[
  {
    "path": ".github/workflows/semgrep.yml",
    "content": "on:\n  pull_request: {}\n  workflow_dispatch: {}\n  push: \n    branches:\n      - main\n      - master\n  schedule:\n    - cron: '0 0 * * *'\nname: Semgrep config\njobs:\n  semgrep:\n    name: semgrep/ci\n    runs-on: ubuntu-latest\n    env:\n      SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}\n      SEMGREP_URL: https://cloudflare.semgrep.dev\n      SEMGREP_APP_URL: https://cloudflare.semgrep.dev\n      SEMGREP_VERSION_CHECK_URL: https://cloudflare.semgrep.dev/api/check-version\n    container:\n      image: returntocorp/semgrep\n    steps:\n      - uses: actions/checkout@v4\n      - run: semgrep ci\n"
  },
  {
    "path": ".gitignore",
    "content": "*.lo\n*.o\n*.la\nMakefile\ncjpeg\ndjpeg\njpegtran\nlibtool\nwrjpgcom\nrdjpgcom\nstamp-h1\njconfig.h\nconfig.log\nconfig.status\n"
  },
  {
    "path": "Makefile.am",
    "content": "## Process this file with automake to produce Makefile.in\n#\n#  Automake Makefile for the JPEG library\n#\n#  This file is written by Bob Friesenhahn, Guido Vollbeding\n#\n\n# Sources to build library\nLIBSOURCES = jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \\\n        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \\\n        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \\\n        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \\\n        jquant2.c jutils.c jmemmgr.c jchuff_util_armv8.S @MEMORYMGR@.c\n\n# System dependent sources\nSYSDEPSOURCES = jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c\n\n# Headers which are installed to support the library\nINSTINCLUDES  = jerror.h jmorecfg.h jpeglib.h\n\n# Headers which are not installed\nOTHERINCLUDES = cderror.h cdjpeg.h jdct.h jinclude.h jmemsys.h jpegint.h \\\n        jversion.h transupp.h\n\n# Manual pages (Automake uses 'MANS' for itself)\nDISTMANS= cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1\n\n# Other documentation files\nDOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \\\n        structure.txt coderules.txt filelist.txt change.log\n\n# Makefiles for various systems\nMKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \\\n        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \\\n        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \\\n        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \\\n        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \\\n        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \\\n        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \\\n        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \\\n        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \\\n        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \\\n        makefile.mms makefile.vms makvms.opt\n\n# Configuration files\nCONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \\\n        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \\\n        jconfig.vms\n\n# Support scripts for configure\nCONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \\\n        missing ar-lib\n\n# Miscellaneous support files\nOTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map\n\n# Test support files\nTESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \\\n        testimgp.jpg\n\n# libtool libraries to build\nlib_LTLIBRARIES = libjpeg.la\n\n# Library sources for libjpeg.la\nlibjpeg_la_SOURCES = $(LIBSOURCES)\n\n# LDFLAGS for libjpeg.la\nlibjpeg_la_LDFLAGS = -no-undefined \\\n        -version-info $(JPEG_LIB_VERSION)\n\nif HAVE_LD_VERSION_SCRIPT\n  libjpeg_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libjpeg.map\nendif\n\n# Executables to build\nbin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom\n\n# Executable sources & libs\ncjpeg_SOURCES    = cjpeg.c rdppm.c rdgif.c rdtarga.c rdrle.c rdbmp.c \\\n        rdswitch.c cdjpeg.c\ncjpeg_LDADD      = libjpeg.la\ndjpeg_SOURCES    = djpeg.c wrppm.c wrgif.c wrtarga.c wrrle.c wrbmp.c \\\n        rdcolmap.c cdjpeg.c\ndjpeg_LDADD      = libjpeg.la\njpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c\njpegtran_LDADD   = libjpeg.la\nrdjpgcom_SOURCES = rdjpgcom.c\nwrjpgcom_SOURCES = wrjpgcom.c\n\n# Manual pages to install\nman_MANS = $(DISTMANS)\n\n# Headers to install\ninclude_HEADERS = $(INSTINCLUDES)\n\n# Other distributed headers\nnoinst_HEADERS = $(OTHERINCLUDES)\n\n# Other distributed files\nEXTRA_DIST =  $(DOCS) $(DISTMANS) $(MKFILES) $(CONFIGFILES) $(SYSDEPSOURCES) \\\n        $(OTHERFILES) $(TESTFILES)\n\n# Files to be cleaned\nCLEANFILES = testout.ppm testout.bmp testout.jpg testoutp.ppm testoutp.jpg \\\n        testoutt.jpg\n\n# Install jconfig.h\ninstall-data-local:\n\t$(mkinstalldirs) $(DESTDIR)$(includedir)\n\t$(INSTALL_HEADER) jconfig.h $(DESTDIR)$(includedir)/jconfig.h\n\n# Uninstall jconfig.h\nuninstall-local:\n\trm -f $(DESTDIR)$(includedir)/jconfig.h\n\n# Run tests\ntest: check-local\ncheck-local:\n\trm -f testout*\n\t./djpeg -dct int -ppm -outfile testout.ppm  $(srcdir)/testorig.jpg\n\t./djpeg -dct int -bmp -colors 256 -outfile testout.bmp  $(srcdir)/testorig.jpg\n\t./cjpeg -dct int -outfile testout.jpg  $(srcdir)/testimg.ppm\n\t./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg\n\t./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm\n\t./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg\n\tcmp $(srcdir)/testimg.ppm testout.ppm\n\tcmp $(srcdir)/testimg.bmp testout.bmp\n\tcmp $(srcdir)/testimg.jpg testout.jpg\n\tcmp $(srcdir)/testimg.ppm testoutp.ppm\n\tcmp $(srcdir)/testimgp.jpg testoutp.jpg\n\tcmp $(srcdir)/testorig.jpg testoutt.jpg\n"
  },
  {
    "path": "Makefile.in",
    "content": "# Makefile.in generated by automake 1.15 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2014 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\n#\n#  Automake Makefile for the JPEG library\n#\n#  This file is written by Bob Friesenhahn, Guido Vollbeding\n#\n\n\n\nVPATH = @srcdir@\nam__is_gnu_make = { \\\n  if test -z '$(MAKELEVEL)'; then \\\n    false; \\\n  elif test -n '$(MAKE_HOST)'; then \\\n    true; \\\n  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \\\n    true; \\\n  else \\\n    false; \\\n  fi; \\\n}\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nbuild_triplet = @build@\nhost_triplet = @host@\ntarget_triplet = @target@\n@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = -Wl,--version-script=$(srcdir)/libjpeg.map\nbin_PROGRAMS = cjpeg$(EXEEXT) djpeg$(EXEEXT) jpegtran$(EXEEXT) \\\n\trdjpgcom$(EXEEXT) wrjpgcom$(EXEEXT)\nsubdir = .\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nDIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \\\n\t$(am__configure_deps) $(include_HEADERS) $(noinst_HEADERS)\nam__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \\\n configure.lineno config.status.lineno\nmkinstalldirs = $(install_sh) -d\nCONFIG_HEADER = jconfig.h\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nam__vpath_adj_setup = srcdirstrip=`echo \"$(srcdir)\" | sed 's|.|.|g'`;\nam__vpath_adj = case $$p in \\\n    $(srcdir)/*) f=`echo \"$$p\" | sed \"s|^$$srcdirstrip/||\"`;; \\\n    *) f=$$p;; \\\n  esac;\nam__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;\nam__install_max = 40\nam__nobase_strip_setup = \\\n  srcdirstrip=`echo \"$(srcdir)\" | sed 's/[].[^$$\\\\*|]/\\\\\\\\&/g'`\nam__nobase_strip = \\\n  for p in $$list; do echo \"$$p\"; done | sed -e \"s|$$srcdirstrip/||\"\nam__nobase_list = $(am__nobase_strip_setup); \\\n  for p in $$list; do echo \"$$p $$p\"; done | \\\n  sed \"s| $$srcdirstrip/| |;\"' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,' | \\\n  $(AWK) 'BEGIN { files[\".\"] = \"\" } { files[$$2] = files[$$2] \" \" $$1; \\\n    if (++n[$$2] == $(am__install_max)) \\\n      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = \"\" } } \\\n    END { for (dir in files) print dir, files[dir] }'\nam__base_list = \\\n  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\\n/ /g' | \\\n  sed '$$!N;$$!N;$$!N;$$!N;s/\\n/ /g'\nam__uninstall_files_from_dir = { \\\n  test -z \"$$files\" \\\n    || { test ! -d \"$$dir\" && test ! -f \"$$dir\" && test ! -r \"$$dir\"; } \\\n    || { echo \" ( cd '$$dir' && rm -f\" $$files \")\"; \\\n         $(am__cd) \"$$dir\" && rm -f $$files; }; \\\n  }\nam__installdirs = \"$(DESTDIR)$(libdir)\" \"$(DESTDIR)$(bindir)\" \\\n\t\"$(DESTDIR)$(man1dir)\" \"$(DESTDIR)$(includedir)\"\nLTLIBRARIES = $(lib_LTLIBRARIES)\nlibjpeg_la_LIBADD =\nam__objects_1 = jaricom.lo jcapimin.lo jcapistd.lo jcarith.lo \\\n\tjccoefct.lo jccolor.lo jcdctmgr.lo jchuff.lo jcinit.lo \\\n\tjcmainct.lo jcmarker.lo jcmaster.lo jcomapi.lo jcparam.lo \\\n\tjcprepct.lo jcsample.lo jctrans.lo jdapimin.lo jdapistd.lo \\\n\tjdarith.lo jdatadst.lo jdatasrc.lo jdcoefct.lo jdcolor.lo \\\n\tjddctmgr.lo jdhuff.lo jdinput.lo jdmainct.lo jdmarker.lo \\\n\tjdmaster.lo jdmerge.lo jdpostct.lo jdsample.lo jdtrans.lo \\\n\tjerror.lo jfdctflt.lo jfdctfst.lo jfdctint.lo jidctflt.lo \\\n\tjidctfst.lo jidctint.lo jquant1.lo jquant2.lo jutils.lo \\\n\tjmemmgr.lo jchuff_util_armv8.lo @MEMORYMGR@.lo\nam_libjpeg_la_OBJECTS = $(am__objects_1)\nlibjpeg_la_OBJECTS = $(am_libjpeg_la_OBJECTS)\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nlibjpeg_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n\t$(libjpeg_la_LDFLAGS) $(LDFLAGS) -o $@\nPROGRAMS = $(bin_PROGRAMS)\nam_cjpeg_OBJECTS = cjpeg.$(OBJEXT) rdppm.$(OBJEXT) rdgif.$(OBJEXT) \\\n\trdtarga.$(OBJEXT) rdrle.$(OBJEXT) rdbmp.$(OBJEXT) \\\n\trdswitch.$(OBJEXT) cdjpeg.$(OBJEXT)\ncjpeg_OBJECTS = $(am_cjpeg_OBJECTS)\ncjpeg_DEPENDENCIES = libjpeg.la\nam_djpeg_OBJECTS = djpeg.$(OBJEXT) wrppm.$(OBJEXT) wrgif.$(OBJEXT) \\\n\twrtarga.$(OBJEXT) wrrle.$(OBJEXT) wrbmp.$(OBJEXT) \\\n\trdcolmap.$(OBJEXT) cdjpeg.$(OBJEXT)\ndjpeg_OBJECTS = $(am_djpeg_OBJECTS)\ndjpeg_DEPENDENCIES = libjpeg.la\nam_jpegtran_OBJECTS = jpegtran.$(OBJEXT) rdswitch.$(OBJEXT) \\\n\tcdjpeg.$(OBJEXT) transupp.$(OBJEXT)\njpegtran_OBJECTS = $(am_jpegtran_OBJECTS)\njpegtran_DEPENDENCIES = libjpeg.la\nam_rdjpgcom_OBJECTS = rdjpgcom.$(OBJEXT)\nrdjpgcom_OBJECTS = $(am_rdjpgcom_OBJECTS)\nrdjpgcom_LDADD = $(LDADD)\nam_wrjpgcom_OBJECTS = wrjpgcom.$(OBJEXT)\nwrjpgcom_OBJECTS = $(am_wrjpgcom_OBJECTS)\nwrjpgcom_LDADD = $(LDADD)\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp = $(SHELL) $(top_srcdir)/depcomp\nam__depfiles_maybe = depfiles\nam__mv = mv -f\nCPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)\nLTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \\\n\t$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \\\n\t$(AM_CCASFLAGS) $(CCASFLAGS)\nAM_V_CPPAS = $(am__v_CPPAS_@AM_V@)\nam__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@)\nam__v_CPPAS_0 = @echo \"  CPPAS   \" $@;\nam__v_CPPAS_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nLTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \\\n\t$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \\\n\t$(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n\t$(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libjpeg_la_SOURCES) $(cjpeg_SOURCES) $(djpeg_SOURCES) \\\n\t$(jpegtran_SOURCES) $(rdjpgcom_SOURCES) $(wrjpgcom_SOURCES)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nman1dir = $(mandir)/man1\nNROFF = nroff\nMANS = $(man_MANS)\nHEADERS = $(include_HEADERS) $(noinst_HEADERS)\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \\\n\t$(LISP)jconfig.cfg\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nCSCOPE = cscope\nAM_RECURSIVE_TARGETS = cscope\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAR = @AR@\nAS = @AS@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCCAS = @CCAS@\nCCASDEPMODE = @CCASDEPMODE@\nCCASFLAGS = @CCASFLAGS@\nCCDEPMODE = @CCDEPMODE@\nCFLAGS = @CFLAGS@\nCPP = @CPP@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDEPDIR = @DEPDIR@\nDLLTOOL = @DLLTOOL@\nDSYMUTIL = @DSYMUTIL@\nDUMPBIN = @DUMPBIN@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEGREP = @EGREP@\nEXEEXT = @EXEEXT@\nFGREP = @FGREP@\nGREP = @GREP@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nJPEG_LIB_VERSION = @JPEG_LIB_VERSION@\nLD = @LD@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLIBTOOL = @LIBTOOL@\nLIPO = @LIPO@\nLN_S = @LN_S@\nLTLIBOBJS = @LTLIBOBJS@\nLT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@\nMAINT = @MAINT@\nMAKEINFO = @MAKEINFO@\nMANIFEST_TOOL = @MANIFEST_TOOL@\nMEMORYMGR = @MEMORYMGR@\nMKDIR_P = @MKDIR_P@\nNM = @NM@\nNMEDIT = @NMEDIT@\nOBJDUMP = @OBJDUMP@\nOBJEXT = @OBJEXT@\nOTOOL = @OTOOL@\nOTOOL64 = @OTOOL64@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nVERSION = @VERSION@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_AR = @ac_ct_AR@\nac_ct_CC = @ac_ct_CC@\nac_ct_DUMPBIN = @ac_ct_DUMPBIN@\nam__include = @am__include@\nam__leading_dot = @am__leading_dot@\nam__quote = @am__quote@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild = @build@\nbuild_alias = @build_alias@\nbuild_cpu = @build_cpu@\nbuild_os = @build_os@\nbuild_vendor = @build_vendor@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost = @host@\nhost_alias = @host_alias@\nhost_cpu = @host_cpu@\nhost_os = @host_os@\nhost_vendor = @host_vendor@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget = @target@\ntarget_alias = @target_alias@\ntarget_cpu = @target_cpu@\ntarget_os = @target_os@\ntarget_vendor = @target_vendor@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\n\n# Sources to build library\nLIBSOURCES = jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \\\n        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \\\n        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \\\n        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \\\n        jquant2.c jutils.c jmemmgr.c jchuff_util_armv8.S @MEMORYMGR@.c\n\n\n# System dependent sources\nSYSDEPSOURCES = jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c\n\n# Headers which are installed to support the library\nINSTINCLUDES = jerror.h jmorecfg.h jpeglib.h\n\n# Headers which are not installed\nOTHERINCLUDES = cderror.h cdjpeg.h jdct.h jinclude.h jmemsys.h jpegint.h \\\n        jversion.h transupp.h\n\n\n# Manual pages (Automake uses 'MANS' for itself)\nDISTMANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1\n\n# Other documentation files\nDOCS = README install.txt usage.txt wizard.txt example.c libjpeg.txt \\\n        structure.txt coderules.txt filelist.txt change.log\n\n\n# Makefiles for various systems\nMKFILES = configure Makefile.in makefile.ansi makefile.unix makefile.bcc \\\n        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \\\n        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \\\n        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \\\n        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \\\n        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \\\n        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \\\n        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \\\n        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \\\n        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \\\n        makefile.mms makefile.vms makvms.opt\n\n\n# Configuration files\nCONFIGFILES = jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \\\n        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \\\n        jconfig.vms\n\n\n# Support scripts for configure\nCONFIGUREFILES = config.guess config.sub install-sh ltmain.sh depcomp \\\n        missing ar-lib\n\n\n# Miscellaneous support files\nOTHERFILES = jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map\n\n# Test support files\nTESTFILES = testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \\\n        testimgp.jpg\n\n\n# libtool libraries to build\nlib_LTLIBRARIES = libjpeg.la\n\n# Library sources for libjpeg.la\nlibjpeg_la_SOURCES = $(LIBSOURCES)\n\n# LDFLAGS for libjpeg.la\nlibjpeg_la_LDFLAGS = -no-undefined -version-info $(JPEG_LIB_VERSION) \\\n\t$(am__append_1)\n\n# Executable sources & libs\ncjpeg_SOURCES = cjpeg.c rdppm.c rdgif.c rdtarga.c rdrle.c rdbmp.c \\\n        rdswitch.c cdjpeg.c\n\ncjpeg_LDADD = libjpeg.la\ndjpeg_SOURCES = djpeg.c wrppm.c wrgif.c wrtarga.c wrrle.c wrbmp.c \\\n        rdcolmap.c cdjpeg.c\n\ndjpeg_LDADD = libjpeg.la\njpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c\njpegtran_LDADD = libjpeg.la\nrdjpgcom_SOURCES = rdjpgcom.c\nwrjpgcom_SOURCES = wrjpgcom.c\n\n# Manual pages to install\nman_MANS = $(DISTMANS)\n\n# Headers to install\ninclude_HEADERS = $(INSTINCLUDES)\n\n# Other distributed headers\nnoinst_HEADERS = $(OTHERINCLUDES)\n\n# Other distributed files\nEXTRA_DIST = $(DOCS) $(DISTMANS) $(MKFILES) $(CONFIGFILES) $(SYSDEPSOURCES) \\\n        $(OTHERFILES) $(TESTFILES)\n\n\n# Files to be cleaned\nCLEANFILES = testout.ppm testout.bmp testout.jpg testoutp.ppm testoutp.jpg \\\n        testoutt.jpg\n\nall: jconfig.h\n\t$(MAKE) $(AM_MAKEFLAGS) all-am\n\n.SUFFIXES:\n.SUFFIXES: .S .c .lo .o .obj\nam--refresh: Makefile\n\t@:\n$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \\\n\t      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \\\n\t\t&& exit 0; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    echo ' $(SHELL) ./config.status'; \\\n\t    $(SHELL) ./config.status;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\t$(SHELL) ./config.status --recheck\n\n$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)\n\t$(am__cd) $(srcdir) && $(AUTOCONF)\n$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)\n\t$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)\n$(am__aclocal_m4_deps):\n\njconfig.h: stamp-h1\n\t@test -f $@ || rm -f stamp-h1\n\t@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1\n\nstamp-h1: $(srcdir)/jconfig.cfg $(top_builddir)/config.status\n\t@rm -f stamp-h1\n\tcd $(top_builddir) && $(SHELL) ./config.status jconfig.h\n$(srcdir)/jconfig.cfg: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) \n\t($(am__cd) $(top_srcdir) && $(AUTOHEADER))\n\trm -f stamp-h1\n\ttouch $@\n\ndistclean-hdr:\n\t-rm -f jconfig.h stamp-h1\n\ninstall-libLTLIBRARIES: $(lib_LTLIBRARIES)\n\t@$(NORMAL_INSTALL)\n\t@list='$(lib_LTLIBRARIES)'; test -n \"$(libdir)\" || list=; \\\n\tlist2=; for p in $$list; do \\\n\t  if test -f $$p; then \\\n\t    list2=\"$$list2 $$p\"; \\\n\t  else :; fi; \\\n\tdone; \\\n\ttest -z \"$$list2\" || { \\\n\t  echo \" $(MKDIR_P) '$(DESTDIR)$(libdir)'\"; \\\n\t  $(MKDIR_P) \"$(DESTDIR)$(libdir)\" || exit 1; \\\n\t  echo \" $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'\"; \\\n\t  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 \"$(DESTDIR)$(libdir)\"; \\\n\t}\n\nuninstall-libLTLIBRARIES:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(lib_LTLIBRARIES)'; test -n \"$(libdir)\" || list=; \\\n\tfor p in $$list; do \\\n\t  $(am__strip_dir) \\\n\t  echo \" $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'\"; \\\n\t  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f \"$(DESTDIR)$(libdir)/$$f\"; \\\n\tdone\n\nclean-libLTLIBRARIES:\n\t-test -z \"$(lib_LTLIBRARIES)\" || rm -f $(lib_LTLIBRARIES)\n\t@list='$(lib_LTLIBRARIES)'; \\\n\tlocs=`for p in $$list; do echo $$p; done | \\\n\t      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \\\n\t      sort -u`; \\\n\ttest -z \"$$locs\" || { \\\n\t  echo rm -f $${locs}; \\\n\t  rm -f $${locs}; \\\n\t}\n\nlibjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES) $(EXTRA_libjpeg_la_DEPENDENCIES) \n\t$(AM_V_CCLD)$(libjpeg_la_LINK) -rpath $(libdir) $(libjpeg_la_OBJECTS) $(libjpeg_la_LIBADD) $(LIBS)\ninstall-binPROGRAMS: $(bin_PROGRAMS)\n\t@$(NORMAL_INSTALL)\n\t@list='$(bin_PROGRAMS)'; test -n \"$(bindir)\" || list=; \\\n\tif test -n \"$$list\"; then \\\n\t  echo \" $(MKDIR_P) '$(DESTDIR)$(bindir)'\"; \\\n\t  $(MKDIR_P) \"$(DESTDIR)$(bindir)\" || exit 1; \\\n\tfi; \\\n\tfor p in $$list; do echo \"$$p $$p\"; done | \\\n\tsed 's/$(EXEEXT)$$//' | \\\n\twhile read p p1; do if test -f $$p \\\n\t || test -f $$p1 \\\n\t  ; then echo \"$$p\"; echo \"$$p\"; else :; fi; \\\n\tdone | \\\n\tsed -e 'p;s,.*/,,;n;h' \\\n\t    -e 's|.*|.|' \\\n\t    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \\\n\tsed 'N;N;N;s,\\n, ,g' | \\\n\t$(AWK) 'BEGIN { files[\".\"] = \"\"; dirs[\".\"] = 1 } \\\n\t  { d=$$3; if (dirs[d] != 1) { print \"d\", d; dirs[d] = 1 } \\\n\t    if ($$2 == $$4) files[d] = files[d] \" \" $$1; \\\n\t    else { print \"f\", $$3 \"/\" $$4, $$1; } } \\\n\t  END { for (d in files) print \"f\", d, files[d] }' | \\\n\twhile read type dir files; do \\\n\t    if test \"$$dir\" = .; then dir=; else dir=/$$dir; fi; \\\n\t    test -z \"$$files\" || { \\\n\t    echo \" $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'\"; \\\n\t    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files \"$(DESTDIR)$(bindir)$$dir\" || exit $$?; \\\n\t    } \\\n\t; done\n\nuninstall-binPROGRAMS:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(bin_PROGRAMS)'; test -n \"$(bindir)\" || list=; \\\n\tfiles=`for p in $$list; do echo \"$$p\"; done | \\\n\t  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \\\n\t      -e 's/$$/$(EXEEXT)/' \\\n\t`; \\\n\ttest -n \"$$list\" || exit 0; \\\n\techo \" ( cd '$(DESTDIR)$(bindir)' && rm -f\" $$files \")\"; \\\n\tcd \"$(DESTDIR)$(bindir)\" && rm -f $$files\n\nclean-binPROGRAMS:\n\t@list='$(bin_PROGRAMS)'; test -n \"$$list\" || exit 0; \\\n\techo \" rm -f\" $$list; \\\n\trm -f $$list || exit $$?; \\\n\ttest -n \"$(EXEEXT)\" || exit 0; \\\n\tlist=`for p in $$list; do echo \"$$p\"; done | sed 's/$(EXEEXT)$$//'`; \\\n\techo \" rm -f\" $$list; \\\n\trm -f $$list\n\ncjpeg$(EXEEXT): $(cjpeg_OBJECTS) $(cjpeg_DEPENDENCIES) $(EXTRA_cjpeg_DEPENDENCIES) \n\t@rm -f cjpeg$(EXEEXT)\n\t$(AM_V_CCLD)$(LINK) $(cjpeg_OBJECTS) $(cjpeg_LDADD) $(LIBS)\n\ndjpeg$(EXEEXT): $(djpeg_OBJECTS) $(djpeg_DEPENDENCIES) $(EXTRA_djpeg_DEPENDENCIES) \n\t@rm -f djpeg$(EXEEXT)\n\t$(AM_V_CCLD)$(LINK) $(djpeg_OBJECTS) $(djpeg_LDADD) $(LIBS)\n\njpegtran$(EXEEXT): $(jpegtran_OBJECTS) $(jpegtran_DEPENDENCIES) $(EXTRA_jpegtran_DEPENDENCIES) \n\t@rm -f jpegtran$(EXEEXT)\n\t$(AM_V_CCLD)$(LINK) $(jpegtran_OBJECTS) $(jpegtran_LDADD) $(LIBS)\n\nrdjpgcom$(EXEEXT): $(rdjpgcom_OBJECTS) $(rdjpgcom_DEPENDENCIES) $(EXTRA_rdjpgcom_DEPENDENCIES) \n\t@rm -f rdjpgcom$(EXEEXT)\n\t$(AM_V_CCLD)$(LINK) $(rdjpgcom_OBJECTS) $(rdjpgcom_LDADD) $(LIBS)\n\nwrjpgcom$(EXEEXT): $(wrjpgcom_OBJECTS) $(wrjpgcom_DEPENDENCIES) $(EXTRA_wrjpgcom_DEPENDENCIES) \n\t@rm -f wrjpgcom$(EXEEXT)\n\t$(AM_V_CCLD)$(LINK) $(wrjpgcom_OBJECTS) $(wrjpgcom_LDADD) $(LIBS)\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/@MEMORYMGR@.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdjpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jaricom.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapimin.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapistd.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcarith.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccoefct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccolor.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcdctmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jchuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jchuff_util_armv8.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcinit.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmainct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmarker.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmaster.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcomapi.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcparam.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcprepct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcsample.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jctrans.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapimin.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapistd.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdarith.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatadst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatasrc.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcoefct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcolor.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jddctmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdhuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdinput.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmainct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmarker.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmaster.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmerge.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdpostct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdsample.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdtrans.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jerror.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctflt.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctfst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctint.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctflt.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctfst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctint.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jmemmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpegtran.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant1.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant2.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jutils.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdbmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdcolmap.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdgif.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdjpgcom.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdppm.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdrle.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdswitch.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdtarga.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transupp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrbmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrgif.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrjpgcom.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrppm.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrrle.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrtarga.Po@am__quote@\n\n.S.o:\n@am__fastdepCCAS_TRUE@\t$(AM_V_CPPAS)$(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\n@am__fastdepCCAS_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\n@AMDEP_TRUE@@am__fastdepCCAS_FALSE@\t$(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCCAS_FALSE@\tDEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCCAS_FALSE@\t$(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $<\n\n.S.obj:\n@am__fastdepCCAS_TRUE@\t$(AM_V_CPPAS)$(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`\n@am__fastdepCCAS_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\n@AMDEP_TRUE@@am__fastdepCCAS_FALSE@\t$(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCCAS_FALSE@\tDEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCCAS_FALSE@\t$(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\n.S.lo:\n@am__fastdepCCAS_TRUE@\t$(AM_V_CPPAS)$(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\n@am__fastdepCCAS_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo\n@AMDEP_TRUE@@am__fastdepCCAS_FALSE@\t$(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCCAS_FALSE@\tDEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCCAS_FALSE@\t$(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $<\n\n.c.o:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\n.c.lo:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<\n\nmostlyclean-libtool:\n\t-rm -f *.lo\n\nclean-libtool:\n\t-rm -rf .libs _libs\n\ndistclean-libtool:\n\t-rm -f libtool config.lt\ninstall-man1: $(man_MANS)\n\t@$(NORMAL_INSTALL)\n\t@list1=''; \\\n\tlist2='$(man_MANS)'; \\\n\ttest -n \"$(man1dir)\" \\\n\t  && test -n \"`echo $$list1$$list2`\" \\\n\t  || exit 0; \\\n\techo \" $(MKDIR_P) '$(DESTDIR)$(man1dir)'\"; \\\n\t$(MKDIR_P) \"$(DESTDIR)$(man1dir)\" || exit 1; \\\n\t{ for i in $$list1; do echo \"$$i\"; done;  \\\n\tif test -n \"$$list2\"; then \\\n\t  for i in $$list2; do echo \"$$i\"; done \\\n\t    | sed -n '/\\.1[a-z]*$$/p'; \\\n\tfi; \\\n\t} | while read p; do \\\n\t  if test -f $$p; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  echo \"$$d$$p\"; echo \"$$p\"; \\\n\tdone | \\\n\tsed -e 'n;s,.*/,,;p;h;s,.*\\.,,;s,^[^1][0-9a-z]*$$,1,;x' \\\n\t      -e 's,\\.[0-9a-z]*$$,,;$(transform);G;s,\\n,.,' | \\\n\tsed 'N;N;s,\\n, ,g' | { \\\n\tlist=; while read file base inst; do \\\n\t  if test \"$$base\" = \"$$inst\"; then list=\"$$list $$file\"; else \\\n\t    echo \" $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'\"; \\\n\t    $(INSTALL_DATA) \"$$file\" \"$(DESTDIR)$(man1dir)/$$inst\" || exit $$?; \\\n\t  fi; \\\n\tdone; \\\n\tfor i in $$list; do echo \"$$i\"; done | $(am__base_list) | \\\n\twhile read files; do \\\n\t  test -z \"$$files\" || { \\\n\t    echo \" $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'\"; \\\n\t    $(INSTALL_DATA) $$files \"$(DESTDIR)$(man1dir)\" || exit $$?; }; \\\n\tdone; }\n\nuninstall-man1:\n\t@$(NORMAL_UNINSTALL)\n\t@list=''; test -n \"$(man1dir)\" || exit 0; \\\n\tfiles=`{ for i in $$list; do echo \"$$i\"; done; \\\n\tl2='$(man_MANS)'; for i in $$l2; do echo \"$$i\"; done | \\\n\t  sed -n '/\\.1[a-z]*$$/p'; \\\n\t} | sed -e 's,.*/,,;h;s,.*\\.,,;s,^[^1][0-9a-z]*$$,1,;x' \\\n\t      -e 's,\\.[0-9a-z]*$$,,;$(transform);G;s,\\n,.,'`; \\\n\tdir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)\ninstall-includeHEADERS: $(include_HEADERS)\n\t@$(NORMAL_INSTALL)\n\t@list='$(include_HEADERS)'; test -n \"$(includedir)\" || list=; \\\n\tif test -n \"$$list\"; then \\\n\t  echo \" $(MKDIR_P) '$(DESTDIR)$(includedir)'\"; \\\n\t  $(MKDIR_P) \"$(DESTDIR)$(includedir)\" || exit 1; \\\n\tfi; \\\n\tfor p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  echo \"$$d$$p\"; \\\n\tdone | $(am__base_list) | \\\n\twhile read files; do \\\n\t  echo \" $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'\"; \\\n\t  $(INSTALL_HEADER) $$files \"$(DESTDIR)$(includedir)\" || exit $$?; \\\n\tdone\n\nuninstall-includeHEADERS:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(include_HEADERS)'; test -n \"$(includedir)\" || list=; \\\n\tfiles=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \\\n\tdir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscope: cscope.files\n\ttest ! -s cscope.files \\\n\t  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)\nclean-cscope:\n\t-rm -f cscope.files\ncscope.files: clean-cscope cscopelist\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\n\t-rm -f cscope.out cscope.in.out cscope.po.out cscope.files\ncheck-am: all-am\n\t$(MAKE) $(AM_MAKEFLAGS) check-local\ncheck: check-am\nall-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(HEADERS) \\\n\t\tjconfig.h\ninstall-binPROGRAMS: install-libLTLIBRARIES\n\ninstalldirs:\n\tfor dir in \"$(DESTDIR)$(libdir)\" \"$(DESTDIR)$(bindir)\" \"$(DESTDIR)$(man1dir)\" \"$(DESTDIR)$(includedir)\"; do \\\n\t  test -z \"$$dir\" || $(MKDIR_P) \"$$dir\"; \\\n\tdone\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\t-test -z \"$(CLEANFILES)\" || rm -f $(CLEANFILES)\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \\\n\tclean-libtool mostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f $(am__CONFIG_DISTCLEAN_FILES)\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-hdr distclean-libtool distclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am: install-data-local install-includeHEADERS install-man\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am: install-binPROGRAMS install-libLTLIBRARIES\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man: install-man1\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f $(am__CONFIG_DISTCLEAN_FILES)\n\t-rm -rf $(top_srcdir)/autom4te.cache\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n\tmostlyclean-libtool\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \\\n\tuninstall-libLTLIBRARIES uninstall-local uninstall-man\n\nuninstall-man: uninstall-man1\n\n.MAKE: all check-am install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am \\\n\tcheck-local clean clean-binPROGRAMS clean-cscope clean-generic \\\n\tclean-libLTLIBRARIES clean-libtool cscope cscopelist-am ctags \\\n\tctags-am distclean distclean-compile distclean-generic \\\n\tdistclean-hdr distclean-libtool distclean-tags dvi dvi-am html \\\n\thtml-am info info-am install install-am install-binPROGRAMS \\\n\tinstall-data install-data-am install-data-local install-dvi \\\n\tinstall-dvi-am install-exec install-exec-am install-html \\\n\tinstall-html-am install-includeHEADERS install-info \\\n\tinstall-info-am install-libLTLIBRARIES install-man \\\n\tinstall-man1 install-pdf install-pdf-am install-ps \\\n\tinstall-ps-am install-strip installcheck installcheck-am \\\n\tinstalldirs maintainer-clean maintainer-clean-generic \\\n\tmostlyclean mostlyclean-compile mostlyclean-generic \\\n\tmostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \\\n\tuninstall-am uninstall-binPROGRAMS uninstall-includeHEADERS \\\n\tuninstall-libLTLIBRARIES uninstall-local uninstall-man \\\n\tuninstall-man1\n\n.PRECIOUS: Makefile\n\n\n# Install jconfig.h\ninstall-data-local:\n\t$(mkinstalldirs) $(DESTDIR)$(includedir)\n\t$(INSTALL_HEADER) jconfig.h $(DESTDIR)$(includedir)/jconfig.h\n\n# Uninstall jconfig.h\nuninstall-local:\n\trm -f $(DESTDIR)$(includedir)/jconfig.h\n\n# Run tests\ntest: check-local\ncheck-local:\n\trm -f testout*\n\t./djpeg -dct int -ppm -outfile testout.ppm  $(srcdir)/testorig.jpg\n\t./djpeg -dct int -bmp -colors 256 -outfile testout.bmp  $(srcdir)/testorig.jpg\n\t./cjpeg -dct int -outfile testout.jpg  $(srcdir)/testimg.ppm\n\t./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg\n\t./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm\n\t./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg\n\tcmp $(srcdir)/testimg.ppm testout.ppm\n\tcmp $(srcdir)/testimg.bmp testout.bmp\n\tcmp $(srcdir)/testimg.jpg testout.jpg\n\tcmp $(srcdir)/testimg.ppm testoutp.ppm\n\tcmp $(srcdir)/testimgp.jpg testoutp.jpg\n\tcmp $(srcdir)/testorig.jpg testoutt.jpg\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "README",
    "content": "The Independent JPEG Group's JPEG software\n==========================================\n\nREADME for release 9a of 19-Jan-2014\n====================================\n\nThis distribution contains the ninth public release of the Independent JPEG\nGroup's free JPEG software.  You are welcome to redistribute this software and\nto use it for any purpose, subject to the conditions under LEGAL ISSUES, below.\n\nThis software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,\nBill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,\nJulian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,\nand other members of the Independent JPEG Group.\n\nIJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee\n(previously known as JPEG, together with ITU-T SG16).\n\n\nDOCUMENTATION ROADMAP\n=====================\n\nThis file contains the following sections:\n\nOVERVIEW            General description of JPEG and the IJG software.\nLEGAL ISSUES        Copyright, lack of warranty, terms of distribution.\nREFERENCES          Where to learn more about JPEG.\nARCHIVE LOCATIONS   Where to find newer versions of this software.\nACKNOWLEDGMENTS     Special thanks.\nFILE FORMAT WARS    Software *not* to get.\nTO DO               Plans for future IJG releases.\n\nOther documentation files in the distribution are:\n\nUser documentation:\n  install.txt       How to configure and install the IJG software.\n  usage.txt         Usage instructions for cjpeg, djpeg, jpegtran,\n                    rdjpgcom, and wrjpgcom.\n  *.1               Unix-style man pages for programs (same info as usage.txt).\n  wizard.txt        Advanced usage instructions for JPEG wizards only.\n  change.log        Version-to-version change highlights.\nProgrammer and internal documentation:\n  libjpeg.txt       How to use the JPEG library in your own programs.\n  example.c         Sample code for calling the JPEG library.\n  structure.txt     Overview of the JPEG library's internal structure.\n  filelist.txt      Road map of IJG files.\n  coderules.txt     Coding style rules --- please read if you contribute code.\n\nPlease read at least the files install.txt and usage.txt.  Some information\ncan also be found in the JPEG FAQ (Frequently Asked Questions) article.  See\nARCHIVE LOCATIONS below to find out where to obtain the FAQ article.\n\nIf you want to understand how the JPEG code works, we suggest reading one or\nmore of the REFERENCES, then looking at the documentation files (in roughly\nthe order listed) before diving into the code.\n\n\nOVERVIEW\n========\n\nThis package contains C software to implement JPEG image encoding, decoding,\nand transcoding.  JPEG (pronounced \"jay-peg\") is a standardized compression\nmethod for full-color and gray-scale images.\n\nThis software implements JPEG baseline, extended-sequential, and progressive\ncompression processes.  Provision is made for supporting all variants of these\nprocesses, although some uncommon parameter settings aren't implemented yet.\nWe have made no provision for supporting the hierarchical or lossless\nprocesses defined in the standard.\n\nWe provide a set of library routines for reading and writing JPEG image files,\nplus two sample applications \"cjpeg\" and \"djpeg\", which use the library to\nperform conversion between JPEG and some other popular image file formats.\nThe library is intended to be reused in other applications.\n\nIn order to support file conversion and viewing software, we have included\nconsiderable functionality beyond the bare JPEG coding/decoding capability;\nfor example, the color quantization modules are not strictly part of JPEG\ndecoding, but they are essential for output to colormapped file formats or\ncolormapped displays.  These extra functions can be compiled out of the\nlibrary if not required for a particular application.\n\nWe have also included \"jpegtran\", a utility for lossless transcoding between\ndifferent JPEG processes, and \"rdjpgcom\" and \"wrjpgcom\", two simple\napplications for inserting and extracting textual comments in JFIF files.\n\nThe emphasis in designing this software has been on achieving portability and\nflexibility, while also making it fast enough to be useful.  In particular,\nthe software is not intended to be read as a tutorial on JPEG.  (See the\nREFERENCES section for introductory material.)  Rather, it is intended to\nbe reliable, portable, industrial-strength code.  We do not claim to have\nachieved that goal in every aspect of the software, but we strive for it.\n\nWe welcome the use of this software as a component of commercial products.\nNo royalty is required, but we do ask for an acknowledgement in product\ndocumentation, as described under LEGAL ISSUES.\n\n\nLEGAL ISSUES\n============\n\nIn plain English:\n\n1. We don't promise that this software works.  (But if you find any bugs,\n   please let us know!)\n2. You can use this software for whatever you want.  You don't have to pay us.\n3. You may not pretend that you wrote this software.  If you use it in a\n   program, you must acknowledge somewhere in your documentation that\n   you've used the IJG code.\n\nIn legalese:\n\nThe authors make NO WARRANTY or representation, either express or implied,\nwith respect to this software, its quality, accuracy, merchantability, or\nfitness for a particular purpose.  This software is provided \"AS IS\", and you,\nits user, assume the entire risk as to its quality and accuracy.\n\nThis software is copyright (C) 1991-2014, Thomas G. Lane, Guido Vollbeding.\nAll Rights Reserved except as specified below.\n\nPermission is hereby granted to use, copy, modify, and distribute this\nsoftware (or portions thereof) for any purpose, without fee, subject to these\nconditions:\n(1) If any part of the source code for this software is distributed, then this\nREADME file must be included, with this copyright and no-warranty notice\nunaltered; and any additions, deletions, or changes to the original files\nmust be clearly indicated in accompanying documentation.\n(2) If only executable code is distributed, then the accompanying\ndocumentation must state that \"this software is based in part on the work of\nthe Independent JPEG Group\".\n(3) Permission for use of this software is granted only if the user accepts\nfull responsibility for any undesirable consequences; the authors accept\nNO LIABILITY for damages of any kind.\n\nThese conditions apply to any software derived from or based on the IJG code,\nnot just to the unmodified library.  If you use our work, you ought to\nacknowledge us.\n\nPermission is NOT granted for the use of any IJG author's name or company name\nin advertising or publicity relating to this software or products derived from\nit.  This software may be referred to only as \"the Independent JPEG Group's\nsoftware\".\n\nWe specifically permit and encourage the use of this software as the basis of\ncommercial products, provided that all warranty or liability claims are\nassumed by the product vendor.\n\n\nThe Unix configuration script \"configure\" was produced with GNU Autoconf.\nIt is copyright by the Free Software Foundation but is freely distributable.\nThe same holds for its supporting scripts (config.guess, config.sub,\nltmain.sh).  Another support script, install-sh, is copyright by X Consortium\nbut is also freely distributable.\n\nThe IJG distribution formerly included code to read and write GIF files.\nTo avoid entanglement with the Unisys LZW patent (now expired), GIF reading\nsupport has been removed altogether, and the GIF writer has been simplified\nto produce \"uncompressed GIFs\".  This technique does not use the LZW\nalgorithm; the resulting GIF files are larger than usual, but are readable\nby all standard GIF decoders.\n\nWe are required to state that\n    \"The Graphics Interchange Format(c) is the Copyright property of\n    CompuServe Incorporated.  GIF(sm) is a Service Mark property of\n    CompuServe Incorporated.\"\n\n\nREFERENCES\n==========\n\nWe recommend reading one or more of these references before trying to\nunderstand the innards of the JPEG software.\n\nThe best short technical introduction to the JPEG compression algorithm is\n\tWallace, Gregory K.  \"The JPEG Still Picture Compression Standard\",\n\tCommunications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.\n(Adjacent articles in that issue discuss MPEG motion picture compression,\napplications of JPEG, and related topics.)  If you don't have the CACM issue\nhandy, a PostScript file containing a revised version of Wallace's article is\navailable at http://www.ijg.org/files/wallace.ps.gz.  The file (actually\na preprint for an article that appeared in IEEE Trans. Consumer Electronics)\nomits the sample images that appeared in CACM, but it includes corrections\nand some added material.  Note: the Wallace article is copyright ACM and IEEE,\nand it may not be used for commercial purposes.\n\nA somewhat less technical, more leisurely introduction to JPEG can be found in\n\"The Data Compression Book\" by Mark Nelson and Jean-loup Gailly, published by\nM&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides\ngood explanations and example C code for a multitude of compression methods\nincluding JPEG.  It is an excellent source if you are comfortable reading C\ncode but don't know much about data compression in general.  The book's JPEG\nsample code is far from industrial-strength, but when you are ready to look\nat a full implementation, you've got one here...\n\nThe best currently available description of JPEG is the textbook \"JPEG Still\nImage Data Compression Standard\" by William B. Pennebaker and Joan L.\nMitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.\nPrice US$59.95, 638 pp.  The book includes the complete text of the ISO JPEG\nstandards (DIS 10918-1 and draft DIS 10918-2).\nAlthough this is by far the most detailed and comprehensive exposition of\nJPEG publicly available, we point out that it is still missing an explanation\nof the most essential properties and algorithms of the underlying DCT\ntechnology.\nIf you think that you know about DCT-based JPEG after reading this book,\nthen you are in delusion.  The real fundamentals and corresponding potential\nof DCT-based JPEG are not publicly known so far, and that is the reason for\nall the mistaken developments taking place in the image coding domain.\n\nThe original JPEG standard is divided into two parts, Part 1 being the actual\nspecification, while Part 2 covers compliance testing methods.  Part 1 is\ntitled \"Digital Compression and Coding of Continuous-tone Still Images,\nPart 1: Requirements and guidelines\" and has document numbers ISO/IEC IS\n10918-1, ITU-T T.81.  Part 2 is titled \"Digital Compression and Coding of\nContinuous-tone Still Images, Part 2: Compliance testing\" and has document\nnumbers ISO/IEC IS 10918-2, ITU-T T.83.\nIJG JPEG 8 introduced an implementation of the JPEG SmartScale extension\nwhich is specified in two documents:  A contributed document at ITU and ISO\nwith title \"ITU-T JPEG-Plus Proposal for Extending ITU-T T.81 for Advanced\nImage Coding\", April 2006, Geneva, Switzerland.  The latest version of this\ndocument is Revision 3.  And a contributed document ISO/IEC JTC1/SC29/WG1 N\n5799 with title \"Evolution of JPEG\", June/July 2011, Berlin, Germany.\nIJG JPEG 9 introduces a reversible color transform for improved lossless\ncompression which is described in a contributed document ISO/IEC JTC1/SC29/\nWG1 N 6080 with title \"JPEG 9 Lossless Coding\", June/July 2012, Paris,\nFrance.\n\nThe JPEG standard does not specify all details of an interchangeable file\nformat.  For the omitted details we follow the \"JFIF\" conventions, revision\n1.02.  JFIF 1.02 has been adopted as an Ecma International Technical Report\nand thus received a formal publication status.  It is available as a free\ndownload in PDF format from\nhttp://www.ecma-international.org/publications/techreports/E-TR-098.htm.\nA PostScript version of the JFIF document is available at\nhttp://www.ijg.org/files/jfif.ps.gz.  There is also a plain text version at\nhttp://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.\n\nThe TIFF 6.0 file format specification can be obtained by FTP from\nftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation scheme\nfound in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.\nIJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).\nInstead, we recommend the JPEG design proposed by TIFF Technical Note #2\n(Compression tag 7).  Copies of this Note can be obtained from\nhttp://www.ijg.org/files/.  It is expected that the next revision\nof the TIFF spec will replace the 6.0 JPEG design with the Note's design.\nAlthough IJG's own code does not support TIFF/JPEG, the free libtiff library\nuses our library to implement TIFF/JPEG per the Note.\n\n\nARCHIVE LOCATIONS\n=================\n\nThe \"official\" archive site for this software is www.ijg.org.\nThe most recent released version can always be found there in\ndirectory \"files\".  This particular version will be archived as\nhttp://www.ijg.org/files/jpegsrc.v9a.tar.gz, and in Windows-compatible\n\"zip\" archive format as http://www.ijg.org/files/jpegsr9a.zip.\n\nThe JPEG FAQ (Frequently Asked Questions) article is a source of some\ngeneral information about JPEG.\nIt is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/\nand other news.answers archive sites, including the official news.answers\narchive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.\nIf you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu\nwith body\n\tsend usenet/news.answers/jpeg-faq/part1\n\tsend usenet/news.answers/jpeg-faq/part2\n\n\nACKNOWLEDGMENTS\n===============\n\nThank to Juergen Bruder for providing me with a copy of the common DCT\nalgorithm article, only to find out that I had come to the same result\nin a more direct and comprehensible way with a more generative approach.\n\nThank to Istvan Sebestyen and Joan L. Mitchell for inviting me to the\nITU JPEG (Study Group 16) meeting in Geneva, Switzerland.\n\nThank to Thomas Wiegand and Gary Sullivan for inviting me to the\nJoint Video Team (MPEG & ITU) meeting in Geneva, Switzerland.\n\nThank to Thomas Richter and Daniel Lee for inviting me to the\nISO/IEC JTC1/SC29/WG1 (previously known as JPEG, together with ITU-T SG16)\nmeeting in Berlin, Germany.\n\nThank to John Korejwa and Massimo Ballerini for inviting me to\nfruitful consultations in Boston, MA and Milan, Italy.\n\nThank to Hendrik Elstner, Roland Fassauer, Simone Zuck, Guenther\nMaier-Gerber, Walter Stoeber, Fred Schmitz, and Norbert Braunagel\nfor corresponding business development.\n\nThank to Nico Zschach and Dirk Stelling of the technical support team\nat the Digital Images company in Halle for providing me with extra\nequipment for configuration tests.\n\nThank to Richard F. Lyon (then of Foveon Inc.) for fruitful\ncommunication about JPEG configuration in Sigma Photo Pro software.\n\nThank to Andrew Finkenstadt for hosting the ijg.org site.\n\nLast but not least special thank to Thomas G. Lane for the original\ndesign and development of this singular software package.\n\n\nFILE FORMAT WARS\n================\n\nThe ISO/IEC JTC1/SC29/WG1 standards committee (previously known as JPEG,\ntogether with ITU-T SG16) currently promotes different formats containing\nthe name \"JPEG\" which is misleading because these formats are incompatible\nwith original DCT-based JPEG and are based on faulty technologies.\nIJG therefore does not and will not support such momentary mistakes\n(see REFERENCES).\nThere exist also distributions under the name \"OpenJPEG\" promoting such\nkind of formats which is misleading because they don't support original\nJPEG images.\nWe have no sympathy for the promotion of inferior formats.  Indeed, one of\nthe original reasons for developing this free software was to help force\nconvergence on common, interoperable format standards for JPEG files.\nDon't use an incompatible file format!\n(In any case, our decoder will remain capable of reading existing JPEG\nimage files indefinitely.)\n\nThe ISO committee pretends to be \"responsible for the popular JPEG\" in their\npublic reports which is not true because they don't respond to actual\nrequirements for the maintenance of the original JPEG specification.\nFurthermore, the ISO committee pretends to \"ensure interoperability\" with\ntheir standards which is not true because their \"standards\" support only\napplication-specific and proprietary use cases and contain mathematically\nincorrect code.\n\nThere are currently different distributions in circulation containing the\nname \"libjpeg\" which is misleading because they don't have the features and\nare incompatible with formats supported by actual IJG libjpeg distributions.\nOne of those fakes is released by members of the ISO committee and just uses\nthe name of libjpeg for misdirection of people, similar to the abuse of the\nname JPEG as described above, while having nothing in common with actual IJG\nlibjpeg distributions and containing mathematically incorrect code.\nThe other one claims to be a \"derivative\" or \"fork\" of the original libjpeg,\nbut violates the license conditions as described under LEGAL ISSUES above\nand violates basic C programming properties.\nWe have no sympathy for the release of misleading, incorrect and illegal\ndistributions derived from obsolete code bases.\nDon't use an obsolete code base!\n\nAccording to the UCC (Uniform Commercial Code) law, IJG has the lawful and\nlegal right to foreclose on certain standardization bodies and other\ninstitutions or corporations that knowingly perform substantial and\nsystematic deceptive acts and practices, fraud, theft, and damaging of the\nvalue of the people of this planet without their knowing, willing and\nintentional consent.\nThe titles, ownership, and rights of these institutions and all their assets\nare now duly secured and held in trust for the free people of this planet.\nPeople of the planet, on every country, may have a financial interest in\nthe assets of these former principals, agents, and beneficiaries of the\nforeclosed institutions and corporations.\nIJG asserts what is: that each man, woman, and child has unalienable value\nand rights granted and deposited in them by the Creator and not any one of\nthe people is subordinate to any artificial principality, corporate fiction\nor the special interest of another without their appropriate knowing,\nwilling and intentional consent made by contract or accommodation agreement.\nIJG expresses that which already was.\nThe people have already determined and demanded that public administration\nentities, national governments, and their supporting judicial systems must\nbe fully transparent, accountable, and liable.\nIJG has secured the value for all concerned free people of the planet.\n\nA partial list of foreclosed institutions and corporations (\"Hall of Shame\")\nis currently prepared and will be published later.\n\n\nTO DO\n=====\n\nVersion 9 is the second release of a new generation JPEG standard\nto overcome the limitations of the original JPEG specification,\nand is the first true source reference JPEG codec.\nMore features are being prepared for coming releases...\n\nPlease send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.\n"
  },
  {
    "path": "aclocal.m4",
    "content": "# generated automatically by aclocal 1.15 -*- Autoconf -*-\n\n# Copyright (C) 1996-2014 Free Software Foundation, Inc.\n\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\nm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])\nm4_ifndef([AC_AUTOCONF_VERSION],\n  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl\nm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,\n[m4_warning([this file was generated for autoconf 2.69.\nYou have another version of autoconf.  It may work, but is not guaranteed to.\nIf you have problems, you may need to regenerate the build system entirely.\nTo do so, use the procedure documented by the package, typically 'autoreconf'.])])\n\n# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-\n#\n#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.\n#   Written by Gordon Matzigkeit, 1996\n#\n# This file is free software; the Free Software Foundation gives\n# unlimited permission to copy and/or distribute it, with or without\n# modifications, as long as this notice is preserved.\n\nm4_define([_LT_COPYING], [dnl\n# Copyright (C) 2014 Free Software Foundation, Inc.\n# This is free software; see the source for copying conditions.  There is NO\n# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n# GNU Libtool is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of of the License, or\n# (at your option) any later version.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program or library that is built\n# using GNU Libtool, you may include this file under the  same\n# distribution terms that you use for the rest of that program.\n#\n# GNU Libtool is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n])\n\n# serial 58 LT_INIT\n\n\n# LT_PREREQ(VERSION)\n# ------------------\n# Complain and exit if this libtool version is less that VERSION.\nm4_defun([LT_PREREQ],\n[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,\n       [m4_default([$3],\n\t\t   [m4_fatal([Libtool version $1 or higher is required],\n\t\t             63)])],\n       [$2])])\n\n\n# _LT_CHECK_BUILDDIR\n# ------------------\n# Complain if the absolute build directory name contains unusual characters\nm4_defun([_LT_CHECK_BUILDDIR],\n[case `pwd` in\n  *\\ * | *\\\t*)\n    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;\nesac\n])\n\n\n# LT_INIT([OPTIONS])\n# ------------------\nAC_DEFUN([LT_INIT],\n[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK\nAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl\nAC_BEFORE([$0], [LT_LANG])dnl\nAC_BEFORE([$0], [LT_OUTPUT])dnl\nAC_BEFORE([$0], [LTDL_INIT])dnl\nm4_require([_LT_CHECK_BUILDDIR])dnl\n\ndnl Autoconf doesn't catch unexpanded LT_ macros by default:\nm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl\nm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl\ndnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4\ndnl unless we require an AC_DEFUNed macro:\nAC_REQUIRE([LTOPTIONS_VERSION])dnl\nAC_REQUIRE([LTSUGAR_VERSION])dnl\nAC_REQUIRE([LTVERSION_VERSION])dnl\nAC_REQUIRE([LTOBSOLETE_VERSION])dnl\nm4_require([_LT_PROG_LTMAIN])dnl\n\n_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])\n\ndnl Parse OPTIONS\n_LT_SET_OPTIONS([$0], [$1])\n\n# This can be used to rebuild libtool when needed\nLIBTOOL_DEPS=$ltmain\n\n# Always use our own libtool.\nLIBTOOL='$(SHELL) $(top_builddir)/libtool'\nAC_SUBST(LIBTOOL)dnl\n\n_LT_SETUP\n\n# Only expand once:\nm4_define([LT_INIT])\n])# LT_INIT\n\n# Old names:\nAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])\nAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_PROG_LIBTOOL], [])\ndnl AC_DEFUN([AM_PROG_LIBTOOL], [])\n\n\n# _LT_PREPARE_CC_BASENAME\n# -----------------------\nm4_defun([_LT_PREPARE_CC_BASENAME], [\n# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.\nfunc_cc_basename ()\n{\n    for cc_temp in @S|@*\"\"; do\n      case $cc_temp in\n        compile | *[[\\\\/]]compile | ccache | *[[\\\\/]]ccache ) ;;\n        distcc | *[[\\\\/]]distcc | purify | *[[\\\\/]]purify ) ;;\n        \\-*) ;;\n        *) break;;\n      esac\n    done\n    func_cc_basename_result=`$ECHO \"$cc_temp\" | $SED \"s%.*/%%; s%^$host_alias-%%\"`\n}\n])# _LT_PREPARE_CC_BASENAME\n\n\n# _LT_CC_BASENAME(CC)\n# -------------------\n# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,\n# but that macro is also expanded into generated libtool script, which\n# arranges for $SED and $ECHO to be set by different means.\nm4_defun([_LT_CC_BASENAME],\n[m4_require([_LT_PREPARE_CC_BASENAME])dnl\nAC_REQUIRE([_LT_DECL_SED])dnl\nAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl\nfunc_cc_basename $1\ncc_basename=$func_cc_basename_result\n])\n\n\n# _LT_FILEUTILS_DEFAULTS\n# ----------------------\n# It is okay to use these file commands and assume they have been set\n# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.\nm4_defun([_LT_FILEUTILS_DEFAULTS],\n[: ${CP=\"cp -f\"}\n: ${MV=\"mv -f\"}\n: ${RM=\"rm -f\"}\n])# _LT_FILEUTILS_DEFAULTS\n\n\n# _LT_SETUP\n# ---------\nm4_defun([_LT_SETUP],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\nAC_REQUIRE([AC_CANONICAL_BUILD])dnl\nAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl\nAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl\n\n_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl\ndnl\n_LT_DECL([], [host_alias], [0], [The host system])dnl\n_LT_DECL([], [host], [0])dnl\n_LT_DECL([], [host_os], [0])dnl\ndnl\n_LT_DECL([], [build_alias], [0], [The build system])dnl\n_LT_DECL([], [build], [0])dnl\n_LT_DECL([], [build_os], [0])dnl\ndnl\nAC_REQUIRE([AC_PROG_CC])dnl\nAC_REQUIRE([LT_PATH_LD])dnl\nAC_REQUIRE([LT_PATH_NM])dnl\ndnl\nAC_REQUIRE([AC_PROG_LN_S])dnl\ntest -z \"$LN_S\" && LN_S=\"ln -s\"\n_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl\ndnl\nAC_REQUIRE([LT_CMD_MAX_LEN])dnl\n_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally \"o\")])dnl\n_LT_DECL([], [exeext], [0], [Executable file suffix (normally \"\")])dnl\ndnl\nm4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_CHECK_SHELL_FEATURES])dnl\nm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl\nm4_require([_LT_CMD_RELOAD])dnl\nm4_require([_LT_CHECK_MAGIC_METHOD])dnl\nm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl\nm4_require([_LT_CMD_OLD_ARCHIVE])dnl\nm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl\nm4_require([_LT_WITH_SYSROOT])dnl\nm4_require([_LT_CMD_TRUNCATE])dnl\n\n_LT_CONFIG_LIBTOOL_INIT([\n# See if we are running on zsh, and set the options that allow our\n# commands through without removal of \\ escapes INIT.\nif test -n \"\\${ZSH_VERSION+set}\"; then\n   setopt NO_GLOB_SUBST\nfi\n])\nif test -n \"${ZSH_VERSION+set}\"; then\n   setopt NO_GLOB_SUBST\nfi\n\n_LT_CHECK_OBJDIR\n\nm4_require([_LT_TAG_COMPILER])dnl\n\ncase $host_os in\naix3*)\n  # AIX sometimes has problems with the GCC collect2 program.  For some\n  # reason, if we set the COLLECT_NAMES environment variable, the problems\n  # vanish in a puff of smoke.\n  if test set != \"${COLLECT_NAMES+set}\"; then\n    COLLECT_NAMES=\n    export COLLECT_NAMES\n  fi\n  ;;\nesac\n\n# Global variables:\nofile=libtool\ncan_build_shared=yes\n\n# All known linkers require a '.a' archive for static linking (except MSVC,\n# which needs '.lib').\nlibext=a\n\nwith_gnu_ld=$lt_cv_prog_gnu_ld\n\nold_CC=$CC\nold_CFLAGS=$CFLAGS\n\n# Set sane defaults for various variables\ntest -z \"$CC\" && CC=cc\ntest -z \"$LTCC\" && LTCC=$CC\ntest -z \"$LTCFLAGS\" && LTCFLAGS=$CFLAGS\ntest -z \"$LD\" && LD=ld\ntest -z \"$ac_objext\" && ac_objext=o\n\n_LT_CC_BASENAME([$compiler])\n\n# Only perform the check for file, if the check method requires it\ntest -z \"$MAGIC_CMD\" && MAGIC_CMD=file\ncase $deplibs_check_method in\nfile_magic*)\n  if test \"$file_magic_cmd\" = '$MAGIC_CMD'; then\n    _LT_PATH_MAGIC\n  fi\n  ;;\nesac\n\n# Use C for the default configuration in the libtool script\nLT_SUPPORTED_TAG([CC])\n_LT_LANG_C_CONFIG\n_LT_LANG_DEFAULT_CONFIG\n_LT_CONFIG_COMMANDS\n])# _LT_SETUP\n\n\n# _LT_PREPARE_SED_QUOTE_VARS\n# --------------------------\n# Define a few sed substitution that help us do robust quoting.\nm4_defun([_LT_PREPARE_SED_QUOTE_VARS],\n[# Backslashify metacharacters that are still active within\n# double-quoted strings.\nsed_quote_subst='s/\\([[\"`$\\\\]]\\)/\\\\\\1/g'\n\n# Same as above, but do not quote variable references.\ndouble_quote_subst='s/\\([[\"`\\\\]]\\)/\\\\\\1/g'\n\n# Sed substitution to delay expansion of an escaped shell variable in a\n# double_quote_subst'ed string.\ndelay_variable_subst='s/\\\\\\\\\\\\\\\\\\\\\\$/\\\\\\\\\\\\$/g'\n\n# Sed substitution to delay expansion of an escaped single quote.\ndelay_single_quote_subst='s/'\\''/'\\'\\\\\\\\\\\\\\'\\''/g'\n\n# Sed substitution to avoid accidental globbing in evaled expressions\nno_glob_subst='s/\\*/\\\\\\*/g'\n])\n\n# _LT_PROG_LTMAIN\n# ---------------\n# Note that this code is called both from 'configure', and 'config.status'\n# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,\n# 'config.status' has no value for ac_aux_dir unless we are using Automake,\n# so we pass a copy along to make sure it has a sensible value anyway.\nm4_defun([_LT_PROG_LTMAIN],\n[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl\n_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])\nltmain=$ac_aux_dir/ltmain.sh\n])# _LT_PROG_LTMAIN\n\n\n\n# So that we can recreate a full libtool script including additional\n# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS\n# in macros and then make a single call at the end using the 'libtool'\n# label.\n\n\n# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])\n# ----------------------------------------\n# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.\nm4_define([_LT_CONFIG_LIBTOOL_INIT],\n[m4_ifval([$1],\n          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],\n                     [$1\n])])])\n\n# Initialize.\nm4_define([_LT_OUTPUT_LIBTOOL_INIT])\n\n\n# _LT_CONFIG_LIBTOOL([COMMANDS])\n# ------------------------------\n# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.\nm4_define([_LT_CONFIG_LIBTOOL],\n[m4_ifval([$1],\n          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],\n                     [$1\n])])])\n\n# Initialize.\nm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])\n\n\n# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])\n# -----------------------------------------------------\nm4_defun([_LT_CONFIG_SAVE_COMMANDS],\n[_LT_CONFIG_LIBTOOL([$1])\n_LT_CONFIG_LIBTOOL_INIT([$2])\n])\n\n\n# _LT_FORMAT_COMMENT([COMMENT])\n# -----------------------------\n# Add leading comment marks to the start of each line, and a trailing\n# full-stop to the whole comment if one is not present already.\nm4_define([_LT_FORMAT_COMMENT],\n[m4_ifval([$1], [\nm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],\n              [['`$\\]], [\\\\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])\n)])\n\n\n\n\n\n# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])\n# -------------------------------------------------------------------\n# CONFIGNAME is the name given to the value in the libtool script.\n# VARNAME is the (base) name used in the configure script.\n# VALUE may be 0, 1 or 2 for a computed quote escaped value based on\n# VARNAME.  Any other value will be used directly.\nm4_define([_LT_DECL],\n[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],\n    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],\n\t[m4_ifval([$1], [$1], [$2])])\n    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])\n    m4_ifval([$4],\n\t[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])\n    lt_dict_add_subkey([lt_decl_dict], [$2],\n\t[tagged?], [m4_ifval([$5], [yes], [no])])])\n])\n\n\n# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])\n# --------------------------------------------------------\nm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])\n\n\n# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])\n# ------------------------------------------------\nm4_define([lt_decl_tag_varnames],\n[_lt_decl_filter([tagged?], [yes], $@)])\n\n\n# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])\n# ---------------------------------------------------------\nm4_define([_lt_decl_filter],\n[m4_case([$#],\n  [0], [m4_fatal([$0: too few arguments: $#])],\n  [1], [m4_fatal([$0: too few arguments: $#: $1])],\n  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],\n  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],\n  [lt_dict_filter([lt_decl_dict], $@)])[]dnl\n])\n\n\n# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])\n# --------------------------------------------------\nm4_define([lt_decl_quote_varnames],\n[_lt_decl_filter([value], [1], $@)])\n\n\n# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])\n# ---------------------------------------------------\nm4_define([lt_decl_dquote_varnames],\n[_lt_decl_filter([value], [2], $@)])\n\n\n# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])\n# ---------------------------------------------------\nm4_define([lt_decl_varnames_tagged],\n[m4_assert([$# <= 2])dnl\n_$0(m4_quote(m4_default([$1], [[, ]])),\n    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),\n    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])\nm4_define([_lt_decl_varnames_tagged],\n[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])\n\n\n# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])\n# ------------------------------------------------\nm4_define([lt_decl_all_varnames],\n[_$0(m4_quote(m4_default([$1], [[, ]])),\n     m4_if([$2], [],\n\t   m4_quote(lt_decl_varnames),\n\tm4_quote(m4_shift($@))))[]dnl\n])\nm4_define([_lt_decl_all_varnames],\n[lt_join($@, lt_decl_varnames_tagged([$1],\n\t\t\tlt_decl_tag_varnames([[, ]], m4_shift($@))))dnl\n])\n\n\n# _LT_CONFIG_STATUS_DECLARE([VARNAME])\n# ------------------------------------\n# Quote a variable value, and forward it to 'config.status' so that its\n# declaration there will have the same value as in 'configure'.  VARNAME\n# must have a single quote delimited value for this to work.\nm4_define([_LT_CONFIG_STATUS_DECLARE],\n[$1='`$ECHO \"$][$1\" | $SED \"$delay_single_quote_subst\"`'])\n\n\n# _LT_CONFIG_STATUS_DECLARATIONS\n# ------------------------------\n# We delimit libtool config variables with single quotes, so when\n# we write them to config.status, we have to be sure to quote all\n# embedded single quotes properly.  In configure, this macro expands\n# each variable declared with _LT_DECL (and _LT_TAGDECL) into:\n#\n#    <var>='`$ECHO \"$<var>\" | $SED \"$delay_single_quote_subst\"`'\nm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],\n[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),\n    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])\n\n\n# _LT_LIBTOOL_TAGS\n# ----------------\n# Output comment and list of tags supported by the script\nm4_defun([_LT_LIBTOOL_TAGS],\n[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl\navailable_tags='_LT_TAGS'dnl\n])\n\n\n# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])\n# -----------------------------------\n# Extract the dictionary values for VARNAME (optionally with TAG) and\n# expand to a commented shell variable setting:\n#\n#    # Some comment about what VAR is for.\n#    visible_name=$lt_internal_name\nm4_define([_LT_LIBTOOL_DECLARE],\n[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],\n\t\t\t\t\t   [description])))[]dnl\nm4_pushdef([_libtool_name],\n    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl\nm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),\n    [0], [_libtool_name=[$]$1],\n    [1], [_libtool_name=$lt_[]$1],\n    [2], [_libtool_name=$lt_[]$1],\n    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl\nm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl\n])\n\n\n# _LT_LIBTOOL_CONFIG_VARS\n# -----------------------\n# Produce commented declarations of non-tagged libtool config variables\n# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'\n# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG\n# section) are produced by _LT_LIBTOOL_TAG_VARS.\nm4_defun([_LT_LIBTOOL_CONFIG_VARS],\n[m4_foreach([_lt_var],\n    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),\n    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])\n\n\n# _LT_LIBTOOL_TAG_VARS(TAG)\n# -------------------------\nm4_define([_LT_LIBTOOL_TAG_VARS],\n[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),\n    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])\n\n\n# _LT_TAGVAR(VARNAME, [TAGNAME])\n# ------------------------------\nm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])\n\n\n# _LT_CONFIG_COMMANDS\n# -------------------\n# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of\n# variables for single and double quote escaping we saved from calls\n# to _LT_DECL, we can put quote escaped variables declarations\n# into 'config.status', and then the shell code to quote escape them in\n# for loops in 'config.status'.  Finally, any additional code accumulated\n# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.\nm4_defun([_LT_CONFIG_COMMANDS],\n[AC_PROVIDE_IFELSE([LT_OUTPUT],\n\tdnl If the libtool generation code has been placed in $CONFIG_LT,\n\tdnl instead of duplicating it all over again into config.status,\n\tdnl then we will have config.status run $CONFIG_LT later, so it\n\tdnl needs to know what name is stored there:\n        [AC_CONFIG_COMMANDS([libtool],\n            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],\n    dnl If the libtool generation code is destined for config.status,\n    dnl expand the accumulated commands and init code now:\n    [AC_CONFIG_COMMANDS([libtool],\n        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])\n])#_LT_CONFIG_COMMANDS\n\n\n# Initialize.\nm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],\n[\n\n# The HP-UX ksh and POSIX shell print the target directory to stdout\n# if CDPATH is set.\n(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n\nsed_quote_subst='$sed_quote_subst'\ndouble_quote_subst='$double_quote_subst'\ndelay_variable_subst='$delay_variable_subst'\n_LT_CONFIG_STATUS_DECLARATIONS\nLTCC='$LTCC'\nLTCFLAGS='$LTCFLAGS'\ncompiler='$compiler_DEFAULT'\n\n# A function that is used when there is no print builtin or printf.\nfunc_fallback_echo ()\n{\n  eval 'cat <<_LTECHO_EOF\n\\$[]1\n_LTECHO_EOF'\n}\n\n# Quote evaled strings.\nfor var in lt_decl_all_varnames([[ \\\n]], lt_decl_quote_varnames); do\n    case \\`eval \\\\\\\\\\$ECHO \\\\\\\\\"\"\\\\\\\\\\$\\$var\"\\\\\\\\\"\\` in\n    *[[\\\\\\\\\\\\\\`\\\\\"\\\\\\$]]*)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\`\\\\\\$ECHO \\\\\"\\\\\\$\\$var\\\\\" | \\\\\\$SED \\\\\"\\\\\\$sed_quote_subst\\\\\"\\\\\\`\\\\\\\\\\\\\"\" ## exclude from sc_prohibit_nested_quotes\n      ;;\n    *)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\$\\$var\\\\\\\\\\\\\"\"\n      ;;\n    esac\ndone\n\n# Double-quote double-evaled strings.\nfor var in lt_decl_all_varnames([[ \\\n]], lt_decl_dquote_varnames); do\n    case \\`eval \\\\\\\\\\$ECHO \\\\\\\\\"\"\\\\\\\\\\$\\$var\"\\\\\\\\\"\\` in\n    *[[\\\\\\\\\\\\\\`\\\\\"\\\\\\$]]*)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\`\\\\\\$ECHO \\\\\"\\\\\\$\\$var\\\\\" | \\\\\\$SED -e \\\\\"\\\\\\$double_quote_subst\\\\\" -e \\\\\"\\\\\\$sed_quote_subst\\\\\" -e \\\\\"\\\\\\$delay_variable_subst\\\\\"\\\\\\`\\\\\\\\\\\\\"\" ## exclude from sc_prohibit_nested_quotes\n      ;;\n    *)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\$\\$var\\\\\\\\\\\\\"\"\n      ;;\n    esac\ndone\n\n_LT_OUTPUT_LIBTOOL_INIT\n])\n\n# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])\n# ------------------------------------\n# Generate a child script FILE with all initialization necessary to\n# reuse the environment learned by the parent script, and make the\n# file executable.  If COMMENT is supplied, it is inserted after the\n# '#!' sequence but before initialization text begins.  After this\n# macro, additional text can be appended to FILE to form the body of\n# the child script.  The macro ends with non-zero status if the\n# file could not be fully written (such as if the disk is full).\nm4_ifdef([AS_INIT_GENERATED],\n[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],\n[m4_defun([_LT_GENERATED_FILE_INIT],\n[m4_require([AS_PREPARE])]dnl\n[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl\n[lt_write_fail=0\ncat >$1 <<_ASEOF || lt_write_fail=1\n#! $SHELL\n# Generated by $as_me.\n$2\nSHELL=\\${CONFIG_SHELL-$SHELL}\nexport SHELL\n_ASEOF\ncat >>$1 <<\\_ASEOF || lt_write_fail=1\nAS_SHELL_SANITIZE\n_AS_PREPARE\nexec AS_MESSAGE_FD>&1\n_ASEOF\ntest 0 = \"$lt_write_fail\" && chmod +x $1[]dnl\nm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT\n\n# LT_OUTPUT\n# ---------\n# This macro allows early generation of the libtool script (before\n# AC_OUTPUT is called), incase it is used in configure for compilation\n# tests.\nAC_DEFUN([LT_OUTPUT],\n[: ${CONFIG_LT=./config.lt}\nAC_MSG_NOTICE([creating $CONFIG_LT])\n_LT_GENERATED_FILE_INIT([\"$CONFIG_LT\"],\n[# Run this file to recreate a libtool stub with the current configuration.])\n\ncat >>\"$CONFIG_LT\" <<\\_LTEOF\nlt_cl_silent=false\nexec AS_MESSAGE_LOG_FD>>config.log\n{\n  echo\n  AS_BOX([Running $as_me.])\n} >&AS_MESSAGE_LOG_FD\n\nlt_cl_help=\"\\\n'$as_me' creates a local libtool stub from the current configuration,\nfor use in further configure time tests before the real libtool is\ngenerated.\n\nUsage: $[0] [[OPTIONS]]\n\n  -h, --help      print this help, then exit\n  -V, --version   print version number, then exit\n  -q, --quiet     do not print progress messages\n  -d, --debug     don't remove temporary files\n\nReport bugs to <bug-libtool@gnu.org>.\"\n\nlt_cl_version=\"\\\nm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl\nm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])\nconfigured by $[0], generated by m4_PACKAGE_STRING.\n\nCopyright (C) 2011 Free Software Foundation, Inc.\nThis config.lt script is free software; the Free Software Foundation\ngives unlimited permision to copy, distribute and modify it.\"\n\nwhile test 0 != $[#]\ndo\n  case $[1] in\n    --version | --v* | -V )\n      echo \"$lt_cl_version\"; exit 0 ;;\n    --help | --h* | -h )\n      echo \"$lt_cl_help\"; exit 0 ;;\n    --debug | --d* | -d )\n      debug=: ;;\n    --quiet | --q* | --silent | --s* | -q )\n      lt_cl_silent=: ;;\n\n    -*) AC_MSG_ERROR([unrecognized option: $[1]\nTry '$[0] --help' for more information.]) ;;\n\n    *) AC_MSG_ERROR([unrecognized argument: $[1]\nTry '$[0] --help' for more information.]) ;;\n  esac\n  shift\ndone\n\nif $lt_cl_silent; then\n  exec AS_MESSAGE_FD>/dev/null\nfi\n_LTEOF\n\ncat >>\"$CONFIG_LT\" <<_LTEOF\n_LT_OUTPUT_LIBTOOL_COMMANDS_INIT\n_LTEOF\n\ncat >>\"$CONFIG_LT\" <<\\_LTEOF\nAC_MSG_NOTICE([creating $ofile])\n_LT_OUTPUT_LIBTOOL_COMMANDS\nAS_EXIT(0)\n_LTEOF\nchmod +x \"$CONFIG_LT\"\n\n# configure is writing to config.log, but config.lt does its own redirection,\n# appending to config.log, which fails on DOS, as config.log is still kept\n# open by configure.  Here we exec the FD to /dev/null, effectively closing\n# config.log, so it can be properly (re)opened and appended to by config.lt.\nlt_cl_success=:\ntest yes = \"$silent\" &&\n  lt_config_lt_args=\"$lt_config_lt_args --quiet\"\nexec AS_MESSAGE_LOG_FD>/dev/null\n$SHELL \"$CONFIG_LT\" $lt_config_lt_args || lt_cl_success=false\nexec AS_MESSAGE_LOG_FD>>config.log\n$lt_cl_success || AS_EXIT(1)\n])# LT_OUTPUT\n\n\n# _LT_CONFIG(TAG)\n# ---------------\n# If TAG is the built-in tag, create an initial libtool script with a\n# default configuration from the untagged config vars.  Otherwise add code\n# to config.status for appending the configuration named by TAG from the\n# matching tagged config vars.\nm4_defun([_LT_CONFIG],\n[m4_require([_LT_FILEUTILS_DEFAULTS])dnl\n_LT_CONFIG_SAVE_COMMANDS([\n  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl\n  m4_if(_LT_TAG, [C], [\n    # See if we are running on zsh, and set the options that allow our\n    # commands through without removal of \\ escapes.\n    if test -n \"${ZSH_VERSION+set}\"; then\n      setopt NO_GLOB_SUBST\n    fi\n\n    cfgfile=${ofile}T\n    trap \"$RM \\\"$cfgfile\\\"; exit 1\" 1 2 15\n    $RM \"$cfgfile\"\n\n    cat <<_LT_EOF >> \"$cfgfile\"\n#! $SHELL\n# Generated automatically by $as_me ($PACKAGE) $VERSION\n# NOTE: Changes made to this file will be lost: look at ltmain.sh.\n\n# Provide generalized library-building support services.\n# Written by Gordon Matzigkeit, 1996\n\n_LT_COPYING\n_LT_LIBTOOL_TAGS\n\n# Configured defaults for sys_lib_dlsearch_path munging.\n: \\${LT_SYS_LIBRARY_PATH=\"$configure_time_lt_sys_library_path\"}\n\n# ### BEGIN LIBTOOL CONFIG\n_LT_LIBTOOL_CONFIG_VARS\n_LT_LIBTOOL_TAG_VARS\n# ### END LIBTOOL CONFIG\n\n_LT_EOF\n\n    cat <<'_LT_EOF' >> \"$cfgfile\"\n\n# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE\n\n_LT_PREPARE_MUNGE_PATH_LIST\n_LT_PREPARE_CC_BASENAME\n\n# ### END FUNCTIONS SHARED WITH CONFIGURE\n\n_LT_EOF\n\n  case $host_os in\n  aix3*)\n    cat <<\\_LT_EOF >> \"$cfgfile\"\n# AIX sometimes has problems with the GCC collect2 program.  For some\n# reason, if we set the COLLECT_NAMES environment variable, the problems\n# vanish in a puff of smoke.\nif test set != \"${COLLECT_NAMES+set}\"; then\n  COLLECT_NAMES=\n  export COLLECT_NAMES\nfi\n_LT_EOF\n    ;;\n  esac\n\n  _LT_PROG_LTMAIN\n\n  # We use sed instead of cat because bash on DJGPP gets confused if\n  # if finds mixed CR/LF and LF-only lines.  Since sed operates in\n  # text mode, it properly converts lines to CR/LF.  This bash problem\n  # is reportedly fixed, but why not run on old versions too?\n  sed '$q' \"$ltmain\" >> \"$cfgfile\" \\\n     || (rm -f \"$cfgfile\"; exit 1)\n\n   mv -f \"$cfgfile\" \"$ofile\" ||\n    (rm -f \"$ofile\" && cp \"$cfgfile\" \"$ofile\" && rm -f \"$cfgfile\")\n  chmod +x \"$ofile\"\n],\n[cat <<_LT_EOF >> \"$ofile\"\n\ndnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded\ndnl in a comment (ie after a #).\n# ### BEGIN LIBTOOL TAG CONFIG: $1\n_LT_LIBTOOL_TAG_VARS(_LT_TAG)\n# ### END LIBTOOL TAG CONFIG: $1\n_LT_EOF\n])dnl /m4_if\n],\n[m4_if([$1], [], [\n    PACKAGE='$PACKAGE'\n    VERSION='$VERSION'\n    RM='$RM'\n    ofile='$ofile'], [])\n])dnl /_LT_CONFIG_SAVE_COMMANDS\n])# _LT_CONFIG\n\n\n# LT_SUPPORTED_TAG(TAG)\n# ---------------------\n# Trace this macro to discover what tags are supported by the libtool\n# --tag option, using:\n#    autoconf --trace 'LT_SUPPORTED_TAG:$1'\nAC_DEFUN([LT_SUPPORTED_TAG], [])\n\n\n# C support is built-in for now\nm4_define([_LT_LANG_C_enabled], [])\nm4_define([_LT_TAGS], [])\n\n\n# LT_LANG(LANG)\n# -------------\n# Enable libtool support for the given language if not already enabled.\nAC_DEFUN([LT_LANG],\n[AC_BEFORE([$0], [LT_OUTPUT])dnl\nm4_case([$1],\n  [C],\t\t\t[_LT_LANG(C)],\n  [C++],\t\t[_LT_LANG(CXX)],\n  [Go],\t\t\t[_LT_LANG(GO)],\n  [Java],\t\t[_LT_LANG(GCJ)],\n  [Fortran 77],\t\t[_LT_LANG(F77)],\n  [Fortran],\t\t[_LT_LANG(FC)],\n  [Windows Resource],\t[_LT_LANG(RC)],\n  [m4_ifdef([_LT_LANG_]$1[_CONFIG],\n    [_LT_LANG($1)],\n    [m4_fatal([$0: unsupported language: \"$1\"])])])dnl\n])# LT_LANG\n\n\n# _LT_LANG(LANGNAME)\n# ------------------\nm4_defun([_LT_LANG],\n[m4_ifdef([_LT_LANG_]$1[_enabled], [],\n  [LT_SUPPORTED_TAG([$1])dnl\n  m4_append([_LT_TAGS], [$1 ])dnl\n  m4_define([_LT_LANG_]$1[_enabled], [])dnl\n  _LT_LANG_$1_CONFIG($1)])dnl\n])# _LT_LANG\n\n\nm4_ifndef([AC_PROG_GO], [\n# NOTE: This macro has been submitted for inclusion into   #\n#  GNU Autoconf as AC_PROG_GO.  When it is available in    #\n#  a released version of Autoconf we should remove this    #\n#  macro and use it instead.                               #\nm4_defun([AC_PROG_GO],\n[AC_LANG_PUSH(Go)dnl\nAC_ARG_VAR([GOC],     [Go compiler command])dnl\nAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl\n_AC_ARG_VAR_LDFLAGS()dnl\nAC_CHECK_TOOL(GOC, gccgo)\nif test -z \"$GOC\"; then\n  if test -n \"$ac_tool_prefix\"; then\n    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])\n  fi\nfi\nif test -z \"$GOC\"; then\n  AC_CHECK_PROG(GOC, gccgo, gccgo, false)\nfi\n])#m4_defun\n])#m4_ifndef\n\n\n# _LT_LANG_DEFAULT_CONFIG\n# -----------------------\nm4_defun([_LT_LANG_DEFAULT_CONFIG],\n[AC_PROVIDE_IFELSE([AC_PROG_CXX],\n  [LT_LANG(CXX)],\n  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])\n\nAC_PROVIDE_IFELSE([AC_PROG_F77],\n  [LT_LANG(F77)],\n  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])\n\nAC_PROVIDE_IFELSE([AC_PROG_FC],\n  [LT_LANG(FC)],\n  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])\n\ndnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal\ndnl pulling things in needlessly.\nAC_PROVIDE_IFELSE([AC_PROG_GCJ],\n  [LT_LANG(GCJ)],\n  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],\n    [LT_LANG(GCJ)],\n    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],\n      [LT_LANG(GCJ)],\n      [m4_ifdef([AC_PROG_GCJ],\n\t[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])\n       m4_ifdef([A][M_PROG_GCJ],\n\t[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])\n       m4_ifdef([LT_PROG_GCJ],\n\t[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])\n\nAC_PROVIDE_IFELSE([AC_PROG_GO],\n  [LT_LANG(GO)],\n  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])\n\nAC_PROVIDE_IFELSE([LT_PROG_RC],\n  [LT_LANG(RC)],\n  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])\n])# _LT_LANG_DEFAULT_CONFIG\n\n# Obsolete macros:\nAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])\nAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])\nAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])\nAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])\nAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_CXX], [])\ndnl AC_DEFUN([AC_LIBTOOL_F77], [])\ndnl AC_DEFUN([AC_LIBTOOL_FC], [])\ndnl AC_DEFUN([AC_LIBTOOL_GCJ], [])\ndnl AC_DEFUN([AC_LIBTOOL_RC], [])\n\n\n# _LT_TAG_COMPILER\n# ----------------\nm4_defun([_LT_TAG_COMPILER],\n[AC_REQUIRE([AC_PROG_CC])dnl\n\n_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl\n_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl\n_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl\n_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# If no C compiler flags were specified, use CFLAGS.\nLTCFLAGS=${LTCFLAGS-\"$CFLAGS\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n])# _LT_TAG_COMPILER\n\n\n# _LT_COMPILER_BOILERPLATE\n# ------------------------\n# Check for compiler boilerplate output or warnings with\n# the simple compiler test code.\nm4_defun([_LT_COMPILER_BOILERPLATE],\n[m4_require([_LT_DECL_SED])dnl\nac_outfile=conftest.$ac_objext\necho \"$lt_simple_compile_test_code\" >conftest.$ac_ext\neval \"$ac_compile\" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err\n_lt_compiler_boilerplate=`cat conftest.err`\n$RM conftest*\n])# _LT_COMPILER_BOILERPLATE\n\n\n# _LT_LINKER_BOILERPLATE\n# ----------------------\n# Check for linker boilerplate output or warnings with\n# the simple link test code.\nm4_defun([_LT_LINKER_BOILERPLATE],\n[m4_require([_LT_DECL_SED])dnl\nac_outfile=conftest.$ac_objext\necho \"$lt_simple_link_test_code\" >conftest.$ac_ext\neval \"$ac_link\" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err\n_lt_linker_boilerplate=`cat conftest.err`\n$RM -r conftest*\n])# _LT_LINKER_BOILERPLATE\n\n# _LT_REQUIRED_DARWIN_CHECKS\n# -------------------------\nm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[\n  case $host_os in\n    rhapsody* | darwin*)\n    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])\n    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])\n    AC_CHECK_TOOL([LIPO], [lipo], [:])\n    AC_CHECK_TOOL([OTOOL], [otool], [:])\n    AC_CHECK_TOOL([OTOOL64], [otool64], [:])\n    _LT_DECL([], [DSYMUTIL], [1],\n      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])\n    _LT_DECL([], [NMEDIT], [1],\n      [Tool to change global to local symbols on Mac OS X])\n    _LT_DECL([], [LIPO], [1],\n      [Tool to manipulate fat objects and archives on Mac OS X])\n    _LT_DECL([], [OTOOL], [1],\n      [ldd/readelf like tool for Mach-O binaries on Mac OS X])\n    _LT_DECL([], [OTOOL64], [1],\n      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])\n\n    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],\n      [lt_cv_apple_cc_single_mod=no\n      if test -z \"$LT_MULTI_MODULE\"; then\n\t# By default we will add the -single_module flag. You can override\n\t# by either setting the environment variable LT_MULTI_MODULE\n\t# non-empty at configure time, or by adding -multi_module to the\n\t# link flags.\n\trm -rf libconftest.dylib*\n\techo \"int foo(void){return 1;}\" > conftest.c\n\techo \"$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \\\n-dynamiclib -Wl,-single_module conftest.c\" >&AS_MESSAGE_LOG_FD\n\t$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \\\n\t  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err\n        _lt_result=$?\n\t# If there is a non-empty error log, and \"single_module\"\n\t# appears in it, assume the flag caused a linker warning\n        if test -s conftest.err && $GREP single_module conftest.err; then\n\t  cat conftest.err >&AS_MESSAGE_LOG_FD\n\t# Otherwise, if the output was created with a 0 exit code from\n\t# the compiler, it worked.\n\telif test -f libconftest.dylib && test 0 = \"$_lt_result\"; then\n\t  lt_cv_apple_cc_single_mod=yes\n\telse\n\t  cat conftest.err >&AS_MESSAGE_LOG_FD\n\tfi\n\trm -rf libconftest.dylib*\n\trm -f conftest.*\n      fi])\n\n    AC_CACHE_CHECK([for -exported_symbols_list linker flag],\n      [lt_cv_ld_exported_symbols_list],\n      [lt_cv_ld_exported_symbols_list=no\n      save_LDFLAGS=$LDFLAGS\n      echo \"_main\" > conftest.sym\n      LDFLAGS=\"$LDFLAGS -Wl,-exported_symbols_list,conftest.sym\"\n      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],\n\t[lt_cv_ld_exported_symbols_list=yes],\n\t[lt_cv_ld_exported_symbols_list=no])\n\tLDFLAGS=$save_LDFLAGS\n    ])\n\n    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],\n      [lt_cv_ld_force_load=no\n      cat > conftest.c << _LT_EOF\nint forced_loaded() { return 2;}\n_LT_EOF\n      echo \"$LTCC $LTCFLAGS -c -o conftest.o conftest.c\" >&AS_MESSAGE_LOG_FD\n      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD\n      echo \"$AR cru libconftest.a conftest.o\" >&AS_MESSAGE_LOG_FD\n      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD\n      echo \"$RANLIB libconftest.a\" >&AS_MESSAGE_LOG_FD\n      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD\n      cat > conftest.c << _LT_EOF\nint main() { return 0;}\n_LT_EOF\n      echo \"$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a\" >&AS_MESSAGE_LOG_FD\n      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err\n      _lt_result=$?\n      if test -s conftest.err && $GREP force_load conftest.err; then\n\tcat conftest.err >&AS_MESSAGE_LOG_FD\n      elif test -f conftest && test 0 = \"$_lt_result\" && $GREP forced_load conftest >/dev/null 2>&1; then\n\tlt_cv_ld_force_load=yes\n      else\n\tcat conftest.err >&AS_MESSAGE_LOG_FD\n      fi\n        rm -f conftest.err libconftest.a conftest conftest.c\n        rm -rf conftest.dSYM\n    ])\n    case $host_os in\n    rhapsody* | darwin1.[[012]])\n      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;\n    darwin1.*)\n      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;\n    darwin*) # darwin 5.x on\n      # if running on 10.5 or later, the deployment target defaults\n      # to the OS version, if on x86, and 10.4, the deployment\n      # target defaults to 10.4. Don't you love it?\n      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in\n\t10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)\n\t  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;\n\t10.[[012]][[,.]]*)\n\t  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;\n\t10.*)\n\t  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;\n      esac\n    ;;\n  esac\n    if test yes = \"$lt_cv_apple_cc_single_mod\"; then\n      _lt_dar_single_mod='$single_module'\n    fi\n    if test yes = \"$lt_cv_ld_exported_symbols_list\"; then\n      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'\n    else\n      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'\n    fi\n    if test : != \"$DSYMUTIL\" && test no = \"$lt_cv_ld_force_load\"; then\n      _lt_dsymutil='~$DSYMUTIL $lib || :'\n    else\n      _lt_dsymutil=\n    fi\n    ;;\n  esac\n])\n\n\n# _LT_DARWIN_LINKER_FEATURES([TAG])\n# ---------------------------------\n# Checks for linker and compiler features on darwin\nm4_defun([_LT_DARWIN_LINKER_FEATURES],\n[\n  m4_require([_LT_REQUIRED_DARWIN_CHECKS])\n  _LT_TAGVAR(archive_cmds_need_lc, $1)=no\n  _LT_TAGVAR(hardcode_direct, $1)=no\n  _LT_TAGVAR(hardcode_automatic, $1)=yes\n  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported\n  if test yes = \"$lt_cv_ld_force_load\"; then\n    _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\\\"`'\n    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],\n                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])\n  else\n    _LT_TAGVAR(whole_archive_flag_spec, $1)=''\n  fi\n  _LT_TAGVAR(link_all_deplibs, $1)=yes\n  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined\n  case $cc_basename in\n     ifort*|nagfor*) _lt_dar_can_shared=yes ;;\n     *) _lt_dar_can_shared=$GCC ;;\n  esac\n  if test yes = \"$_lt_dar_can_shared\"; then\n    output_verbose_link_cmd=func_echo_all\n    _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\"\n    _LT_TAGVAR(module_cmds, $1)=\"\\$CC \\$allow_undefined_flag -o \\$lib -bundle \\$libobjs \\$deplibs \\$compiler_flags$_lt_dsymutil\"\n    _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\"\n    _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\"\n    m4_if([$1], [CXX],\n[   if test yes != \"$lt_cv_apple_cc_single_mod\"; then\n      _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\"\n      _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\"\n    fi\n],[])\n  else\n  _LT_TAGVAR(ld_shlibs, $1)=no\n  fi\n])\n\n# _LT_SYS_MODULE_PATH_AIX([TAGNAME])\n# ----------------------------------\n# Links a minimal program and checks the executable\n# for the system default hardcoded library path. In most cases,\n# this is /usr/lib:/lib, but when the MPI compilers are used\n# the location of the communication and MPI libs are included too.\n# If we don't find anything, use the default library path according\n# to the aix ld manual.\n# Store the results from the different compilers for each TAGNAME.\n# Allow to override them for all tags through lt_cv_aix_libpath.\nm4_defun([_LT_SYS_MODULE_PATH_AIX],\n[m4_require([_LT_DECL_SED])dnl\nif test set = \"${lt_cv_aix_libpath+set}\"; then\n  aix_libpath=$lt_cv_aix_libpath\nelse\n  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],\n  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[\n  lt_aix_libpath_sed='[\n      /Import File Strings/,/^$/ {\n\t  /^0/ {\n\t      s/^0  *\\([^ ]*\\) *$/\\1/\n\t      p\n\t  }\n      }]'\n  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e \"$lt_aix_libpath_sed\"`\n  # Check for a 64-bit object if we didn't find anything.\n  if test -z \"$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])\"; then\n    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e \"$lt_aix_libpath_sed\"`\n  fi],[])\n  if test -z \"$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])\"; then\n    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib\n  fi\n  ])\n  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])\nfi\n])# _LT_SYS_MODULE_PATH_AIX\n\n\n# _LT_SHELL_INIT(ARG)\n# -------------------\nm4_define([_LT_SHELL_INIT],\n[m4_divert_text([M4SH-INIT], [$1\n])])# _LT_SHELL_INIT\n\n\n\n# _LT_PROG_ECHO_BACKSLASH\n# -----------------------\n# Find how we can fake an echo command that does not interpret backslash.\n# In particular, with Autoconf 2.60 or later we add some code to the start\n# of the generated configure script that will find a shell with a builtin\n# printf (that we can use as an echo command).\nm4_defun([_LT_PROG_ECHO_BACKSLASH],\n[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\nECHO=$ECHO$ECHO$ECHO$ECHO$ECHO\nECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO\n\nAC_MSG_CHECKING([how to print strings])\n# Test print first, because it will be a builtin if present.\nif test \"X`( print -r -- -n ) 2>/dev/null`\" = X-n && \\\n   test \"X`print -r -- $ECHO 2>/dev/null`\" = \"X$ECHO\"; then\n  ECHO='print -r --'\nelif test \"X`printf %s $ECHO 2>/dev/null`\" = \"X$ECHO\"; then\n  ECHO='printf %s\\n'\nelse\n  # Use this function as a fallback that always works.\n  func_fallback_echo ()\n  {\n    eval 'cat <<_LTECHO_EOF\n$[]1\n_LTECHO_EOF'\n  }\n  ECHO='func_fallback_echo'\nfi\n\n# func_echo_all arg...\n# Invoke $ECHO with all args, space-separated.\nfunc_echo_all ()\n{\n    $ECHO \"$*\"\n}\n\ncase $ECHO in\n  printf*) AC_MSG_RESULT([printf]) ;;\n  print*) AC_MSG_RESULT([print -r]) ;;\n  *) AC_MSG_RESULT([cat]) ;;\nesac\n\nm4_ifdef([_AS_DETECT_SUGGESTED],\n[_AS_DETECT_SUGGESTED([\n  test -n \"${ZSH_VERSION+set}${BASH_VERSION+set}\" || (\n    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\n    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO\n    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO\n    PATH=/empty FPATH=/empty; export PATH FPATH\n    test \"X`printf %s $ECHO`\" = \"X$ECHO\" \\\n      || test \"X`print -r -- $ECHO`\" = \"X$ECHO\" )])])\n\n_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])\n_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])\n])# _LT_PROG_ECHO_BACKSLASH\n\n\n# _LT_WITH_SYSROOT\n# ----------------\nAC_DEFUN([_LT_WITH_SYSROOT],\n[AC_MSG_CHECKING([for sysroot])\nAC_ARG_WITH([sysroot],\n[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],\n  [Search for dependent libraries within DIR (or the compiler's sysroot\n   if not specified).])],\n[], [with_sysroot=no])\n\ndnl lt_sysroot will always be passed unquoted.  We quote it here\ndnl in case the user passed a directory name.\nlt_sysroot=\ncase $with_sysroot in #(\n yes)\n   if test yes = \"$GCC\"; then\n     lt_sysroot=`$CC --print-sysroot 2>/dev/null`\n   fi\n   ;; #(\n /*)\n   lt_sysroot=`echo \"$with_sysroot\" | sed -e \"$sed_quote_subst\"`\n   ;; #(\n no|'')\n   ;; #(\n *)\n   AC_MSG_RESULT([$with_sysroot])\n   AC_MSG_ERROR([The sysroot must be an absolute path.])\n   ;;\nesac\n\n AC_MSG_RESULT([${lt_sysroot:-no}])\n_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl\n[dependent libraries, and where our libraries should be installed.])])\n\n# _LT_ENABLE_LOCK\n# ---------------\nm4_defun([_LT_ENABLE_LOCK],\n[AC_ARG_ENABLE([libtool-lock],\n  [AS_HELP_STRING([--disable-libtool-lock],\n    [avoid locking (might break parallel builds)])])\ntest no = \"$enable_libtool_lock\" || enable_libtool_lock=yes\n\n# Some flags need to be propagated to the compiler or linker for good\n# libtool support.\ncase $host in\nia64-*-hpux*)\n  # Find out what ABI is being produced by ac_compile, and set mode\n  # options accordingly.\n  echo 'int i;' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n    case `/usr/bin/file conftest.$ac_objext` in\n      *ELF-32*)\n\tHPUX_IA64_MODE=32\n\t;;\n      *ELF-64*)\n\tHPUX_IA64_MODE=64\n\t;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\n*-*-irix6*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.\n  echo '[#]line '$LINENO' \"configure\"' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n    if test yes = \"$lt_cv_prog_gnu_ld\"; then\n      case `/usr/bin/file conftest.$ac_objext` in\n\t*32-bit*)\n\t  LD=\"${LD-ld} -melf32bsmip\"\n\t  ;;\n\t*N32*)\n\t  LD=\"${LD-ld} -melf32bmipn32\"\n\t  ;;\n\t*64-bit*)\n\t  LD=\"${LD-ld} -melf64bmip\"\n\t;;\n      esac\n    else\n      case `/usr/bin/file conftest.$ac_objext` in\n\t*32-bit*)\n\t  LD=\"${LD-ld} -32\"\n\t  ;;\n\t*N32*)\n\t  LD=\"${LD-ld} -n32\"\n\t  ;;\n\t*64-bit*)\n\t  LD=\"${LD-ld} -64\"\n\t  ;;\n      esac\n    fi\n  fi\n  rm -rf conftest*\n  ;;\n\nmips64*-*linux*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.\n  echo '[#]line '$LINENO' \"configure\"' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n    emul=elf\n    case `/usr/bin/file conftest.$ac_objext` in\n      *32-bit*)\n\temul=\"${emul}32\"\n\t;;\n      *64-bit*)\n\temul=\"${emul}64\"\n\t;;\n    esac\n    case `/usr/bin/file conftest.$ac_objext` in\n      *MSB*)\n\temul=\"${emul}btsmip\"\n\t;;\n      *LSB*)\n\temul=\"${emul}ltsmip\"\n\t;;\n    esac\n    case `/usr/bin/file conftest.$ac_objext` in\n      *N32*)\n\temul=\"${emul}n32\"\n\t;;\n    esac\n    LD=\"${LD-ld} -m $emul\"\n  fi\n  rm -rf conftest*\n  ;;\n\nx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \\\ns390*-*linux*|s390*-*tpf*|sparc*-*linux*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.  Note that the listed cases only cover the\n  # situations where additional linker options are needed (such as when\n  # doing 32-bit compilation for a host where ld defaults to 64-bit, or\n  # vice versa); the common cases where no linker options are needed do\n  # not appear in the list.\n  echo 'int i;' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n    case `/usr/bin/file conftest.o` in\n      *32-bit*)\n\tcase $host in\n\t  x86_64-*kfreebsd*-gnu)\n\t    LD=\"${LD-ld} -m elf_i386_fbsd\"\n\t    ;;\n\t  x86_64-*linux*)\n\t    case `/usr/bin/file conftest.o` in\n\t      *x86-64*)\n\t\tLD=\"${LD-ld} -m elf32_x86_64\"\n\t\t;;\n\t      *)\n\t\tLD=\"${LD-ld} -m elf_i386\"\n\t\t;;\n\t    esac\n\t    ;;\n\t  powerpc64le-*linux*)\n\t    LD=\"${LD-ld} -m elf32lppclinux\"\n\t    ;;\n\t  powerpc64-*linux*)\n\t    LD=\"${LD-ld} -m elf32ppclinux\"\n\t    ;;\n\t  s390x-*linux*)\n\t    LD=\"${LD-ld} -m elf_s390\"\n\t    ;;\n\t  sparc64-*linux*)\n\t    LD=\"${LD-ld} -m elf32_sparc\"\n\t    ;;\n\tesac\n\t;;\n      *64-bit*)\n\tcase $host in\n\t  x86_64-*kfreebsd*-gnu)\n\t    LD=\"${LD-ld} -m elf_x86_64_fbsd\"\n\t    ;;\n\t  x86_64-*linux*)\n\t    LD=\"${LD-ld} -m elf_x86_64\"\n\t    ;;\n\t  powerpcle-*linux*)\n\t    LD=\"${LD-ld} -m elf64lppc\"\n\t    ;;\n\t  powerpc-*linux*)\n\t    LD=\"${LD-ld} -m elf64ppc\"\n\t    ;;\n\t  s390*-*linux*|s390*-*tpf*)\n\t    LD=\"${LD-ld} -m elf64_s390\"\n\t    ;;\n\t  sparc*-*linux*)\n\t    LD=\"${LD-ld} -m elf64_sparc\"\n\t    ;;\n\tesac\n\t;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\n\n*-*-sco3.2v5*)\n  # On SCO OpenServer 5, we need -belf to get full-featured binaries.\n  SAVE_CFLAGS=$CFLAGS\n  CFLAGS=\"$CFLAGS -belf\"\n  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,\n    [AC_LANG_PUSH(C)\n     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])\n     AC_LANG_POP])\n  if test yes != \"$lt_cv_cc_needs_belf\"; then\n    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf\n    CFLAGS=$SAVE_CFLAGS\n  fi\n  ;;\n*-*solaris*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.\n  echo 'int i;' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n    case `/usr/bin/file conftest.o` in\n    *64-bit*)\n      case $lt_cv_prog_gnu_ld in\n      yes*)\n        case $host in\n        i?86-*-solaris*|x86_64-*-solaris*)\n          LD=\"${LD-ld} -m elf_x86_64\"\n          ;;\n        sparc*-*-solaris*)\n          LD=\"${LD-ld} -m elf64_sparc\"\n          ;;\n        esac\n        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.\n        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then\n          LD=${LD-ld}_sol2\n        fi\n        ;;\n      *)\n\tif ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then\n\t  LD=\"${LD-ld} -64\"\n\tfi\n\t;;\n      esac\n      ;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\nesac\n\nneed_locks=$enable_libtool_lock\n])# _LT_ENABLE_LOCK\n\n\n# _LT_PROG_AR\n# -----------\nm4_defun([_LT_PROG_AR],\n[AC_CHECK_TOOLS(AR, [ar], false)\n: ${AR=ar}\n: ${AR_FLAGS=cru}\n_LT_DECL([], [AR], [1], [The archiver])\n_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])\n\nAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],\n  [lt_cv_ar_at_file=no\n   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],\n     [echo conftest.$ac_objext > conftest.lst\n      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'\n      AC_TRY_EVAL([lt_ar_try])\n      if test 0 -eq \"$ac_status\"; then\n\t# Ensure the archiver fails upon bogus file names.\n\trm -f conftest.$ac_objext libconftest.a\n\tAC_TRY_EVAL([lt_ar_try])\n\tif test 0 -ne \"$ac_status\"; then\n          lt_cv_ar_at_file=@\n        fi\n      fi\n      rm -f conftest.* libconftest.a\n     ])\n  ])\n\nif test no = \"$lt_cv_ar_at_file\"; then\n  archiver_list_spec=\nelse\n  archiver_list_spec=$lt_cv_ar_at_file\nfi\n_LT_DECL([], [archiver_list_spec], [1],\n  [How to feed a file listing to the archiver])\n])# _LT_PROG_AR\n\n\n# _LT_CMD_OLD_ARCHIVE\n# -------------------\nm4_defun([_LT_CMD_OLD_ARCHIVE],\n[_LT_PROG_AR\n\nAC_CHECK_TOOL(STRIP, strip, :)\ntest -z \"$STRIP\" && STRIP=:\n_LT_DECL([], [STRIP], [1], [A symbol stripping program])\n\nAC_CHECK_TOOL(RANLIB, ranlib, :)\ntest -z \"$RANLIB\" && RANLIB=:\n_LT_DECL([], [RANLIB], [1],\n    [Commands used to install an old-style archive])\n\n# Determine commands to create old-style static archives.\nold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'\nold_postinstall_cmds='chmod 644 $oldlib'\nold_postuninstall_cmds=\n\nif test -n \"$RANLIB\"; then\n  case $host_os in\n  bitrig* | openbsd*)\n    old_postinstall_cmds=\"$old_postinstall_cmds~\\$RANLIB -t \\$tool_oldlib\"\n    ;;\n  *)\n    old_postinstall_cmds=\"$old_postinstall_cmds~\\$RANLIB \\$tool_oldlib\"\n    ;;\n  esac\n  old_archive_cmds=\"$old_archive_cmds~\\$RANLIB \\$tool_oldlib\"\nfi\n\ncase $host_os in\n  darwin*)\n    lock_old_archive_extraction=yes ;;\n  *)\n    lock_old_archive_extraction=no ;;\nesac\n_LT_DECL([], [old_postinstall_cmds], [2])\n_LT_DECL([], [old_postuninstall_cmds], [2])\n_LT_TAGDECL([], [old_archive_cmds], [2],\n    [Commands used to build an old-style archive])\n_LT_DECL([], [lock_old_archive_extraction], [0],\n    [Whether to use a lock for old archive extraction])\n])# _LT_CMD_OLD_ARCHIVE\n\n\n# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,\n#\t\t[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])\n# ----------------------------------------------------------------\n# Check whether the given compiler option works\nAC_DEFUN([_LT_COMPILER_OPTION],\n[m4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_DECL_SED])dnl\nAC_CACHE_CHECK([$1], [$2],\n  [$2=no\n   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])\n   echo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"$3\"  ## exclude from sc_useless_quotes_in_assignment\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}\\{0,1\\} :&$lt_compiler_flag :; t' \\\n   -e 's: [[^ ]]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:$LINENO: $lt_compile\\\"\" >&AS_MESSAGE_LOG_FD)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&AS_MESSAGE_LOG_FD\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&AS_MESSAGE_LOG_FD\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings other than the usual output.\n     $ECHO \"$_lt_compiler_boilerplate\" | $SED '/^$/d' >conftest.exp\n     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2\n     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then\n       $2=yes\n     fi\n   fi\n   $RM conftest*\n])\n\nif test yes = \"[$]$2\"; then\n    m4_if([$5], , :, [$5])\nelse\n    m4_if([$6], , :, [$6])\nfi\n])# _LT_COMPILER_OPTION\n\n# Old name:\nAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])\n\n\n# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,\n#                  [ACTION-SUCCESS], [ACTION-FAILURE])\n# ----------------------------------------------------\n# Check whether the given linker option works\nAC_DEFUN([_LT_LINKER_OPTION],\n[m4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_DECL_SED])dnl\nAC_CACHE_CHECK([$1], [$2],\n  [$2=no\n   save_LDFLAGS=$LDFLAGS\n   LDFLAGS=\"$LDFLAGS $3\"\n   echo \"$lt_simple_link_test_code\" > conftest.$ac_ext\n   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then\n     # The linker can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test -s conftest.err; then\n       # Append any errors to the config.log.\n       cat conftest.err 1>&AS_MESSAGE_LOG_FD\n       $ECHO \"$_lt_linker_boilerplate\" | $SED '/^$/d' > conftest.exp\n       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2\n       if diff conftest.exp conftest.er2 >/dev/null; then\n         $2=yes\n       fi\n     else\n       $2=yes\n     fi\n   fi\n   $RM -r conftest*\n   LDFLAGS=$save_LDFLAGS\n])\n\nif test yes = \"[$]$2\"; then\n    m4_if([$4], , :, [$4])\nelse\n    m4_if([$5], , :, [$5])\nfi\n])# _LT_LINKER_OPTION\n\n# Old name:\nAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])\n\n\n# LT_CMD_MAX_LEN\n#---------------\nAC_DEFUN([LT_CMD_MAX_LEN],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\n# find the maximum length of command line arguments\nAC_MSG_CHECKING([the maximum length of command line arguments])\nAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl\n  i=0\n  teststring=ABCD\n\n  case $build_os in\n  msdosdjgpp*)\n    # On DJGPP, this test can blow up pretty badly due to problems in libc\n    # (any single argument exceeding 2000 bytes causes a buffer overrun\n    # during glob expansion).  Even if it were fixed, the result of this\n    # check would be larger than it should be.\n    lt_cv_sys_max_cmd_len=12288;    # 12K is about right\n    ;;\n\n  gnu*)\n    # Under GNU Hurd, this test is not required because there is\n    # no limit to the length of command line arguments.\n    # Libtool will interpret -1 as no limit whatsoever\n    lt_cv_sys_max_cmd_len=-1;\n    ;;\n\n  cygwin* | mingw* | cegcc*)\n    # On Win9x/ME, this test blows up -- it succeeds, but takes\n    # about 5 minutes as the teststring grows exponentially.\n    # Worse, since 9x/ME are not pre-emptively multitasking,\n    # you end up with a \"frozen\" computer, even though with patience\n    # the test eventually succeeds (with a max line length of 256k).\n    # Instead, let's just punt: use the minimum linelength reported by\n    # all of the supported platforms: 8192 (on NT/2K/XP).\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  mint*)\n    # On MiNT this can take a long time and run out of memory.\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  amigaos*)\n    # On AmigaOS with pdksh, this test takes hours, literally.\n    # So we just punt and use a minimum line length of 8192.\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)\n    # This has been around since 386BSD, at least.  Likely further.\n    if test -x /sbin/sysctl; then\n      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`\n    elif test -x /usr/sbin/sysctl; then\n      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`\n    else\n      lt_cv_sys_max_cmd_len=65536\t# usable default for all BSDs\n    fi\n    # And add a safety zone\n    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 4`\n    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\* 3`\n    ;;\n\n  interix*)\n    # We know the value 262144 and hardcode it with a safety zone (like BSD)\n    lt_cv_sys_max_cmd_len=196608\n    ;;\n\n  os2*)\n    # The test takes a long time on OS/2.\n    lt_cv_sys_max_cmd_len=8192\n    ;;\n\n  osf*)\n    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure\n    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not\n    # nice to cause kernel panics so lets avoid the loop below.\n    # First set a reasonable default.\n    lt_cv_sys_max_cmd_len=16384\n    #\n    if test -x /sbin/sysconfig; then\n      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in\n        *1*) lt_cv_sys_max_cmd_len=-1 ;;\n      esac\n    fi\n    ;;\n  sco3.2v5*)\n    lt_cv_sys_max_cmd_len=102400\n    ;;\n  sysv5* | sco5v6* | sysv4.2uw2*)\n    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`\n    if test -n \"$kargmax\"; then\n      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[\t ]]//'`\n    else\n      lt_cv_sys_max_cmd_len=32768\n    fi\n    ;;\n  *)\n    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`\n    if test -n \"$lt_cv_sys_max_cmd_len\" && \\\n       test undefined != \"$lt_cv_sys_max_cmd_len\"; then\n      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 4`\n      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\* 3`\n    else\n      # Make teststring a little bigger before we do anything with it.\n      # a 1K string should be a reasonable start.\n      for i in 1 2 3 4 5 6 7 8; do\n        teststring=$teststring$teststring\n      done\n      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}\n      # If test is not a shell built-in, we'll probably end up computing a\n      # maximum length that is only half of the actual maximum length, but\n      # we can't tell.\n      while { test X`env echo \"$teststring$teststring\" 2>/dev/null` \\\n\t         = \"X$teststring$teststring\"; } >/dev/null 2>&1 &&\n\t      test 17 != \"$i\" # 1/2 MB should be enough\n      do\n        i=`expr $i + 1`\n        teststring=$teststring$teststring\n      done\n      # Only check the string length outside the loop.\n      lt_cv_sys_max_cmd_len=`expr \"X$teststring\" : \".*\" 2>&1`\n      teststring=\n      # Add a significant safety factor because C++ compilers can tack on\n      # massive amounts of additional arguments before passing them to the\n      # linker.  It appears as though 1/2 is a usable value.\n      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 2`\n    fi\n    ;;\n  esac\n])\nif test -n \"$lt_cv_sys_max_cmd_len\"; then\n  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)\nelse\n  AC_MSG_RESULT(none)\nfi\nmax_cmd_len=$lt_cv_sys_max_cmd_len\n_LT_DECL([], [max_cmd_len], [0],\n    [What is the maximum length of a command?])\n])# LT_CMD_MAX_LEN\n\n# Old name:\nAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])\n\n\n# _LT_HEADER_DLFCN\n# ----------------\nm4_defun([_LT_HEADER_DLFCN],\n[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl\n])# _LT_HEADER_DLFCN\n\n\n# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,\n#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)\n# ----------------------------------------------------------------\nm4_defun([_LT_TRY_DLOPEN_SELF],\n[m4_require([_LT_HEADER_DLFCN])dnl\nif test yes = \"$cross_compiling\"; then :\n  [$4]\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<_LT_EOF\n[#line $LINENO \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n/* When -fvisibility=hidden is used, assume the code has been annotated\n   correspondingly for the symbols needed.  */\n#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))\nint fnord () __attribute__((visibility(\"default\")));\n#endif\n\nint fnord () { return 42; }\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else\n        {\n\t  if (dlsym( self,\"_fnord\"))  status = $lt_dlneed_uscore;\n          else puts (dlerror ());\n\t}\n      /* dlclose (self); */\n    }\n  else\n    puts (dlerror ());\n\n  return status;\n}]\n_LT_EOF\n  if AC_TRY_EVAL(ac_link) && test -s \"conftest$ac_exeext\" 2>/dev/null; then\n    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) $1 ;;\n      x$lt_dlneed_uscore) $2 ;;\n      x$lt_dlunknown|x*) $3 ;;\n    esac\n  else :\n    # compilation failed\n    $3\n  fi\nfi\nrm -fr conftest*\n])# _LT_TRY_DLOPEN_SELF\n\n\n# LT_SYS_DLOPEN_SELF\n# ------------------\nAC_DEFUN([LT_SYS_DLOPEN_SELF],\n[m4_require([_LT_HEADER_DLFCN])dnl\nif test yes != \"$enable_dlopen\"; then\n  enable_dlopen=unknown\n  enable_dlopen_self=unknown\n  enable_dlopen_self_static=unknown\nelse\n  lt_cv_dlopen=no\n  lt_cv_dlopen_libs=\n\n  case $host_os in\n  beos*)\n    lt_cv_dlopen=load_add_on\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n    ;;\n\n  mingw* | pw32* | cegcc*)\n    lt_cv_dlopen=LoadLibrary\n    lt_cv_dlopen_libs=\n    ;;\n\n  cygwin*)\n    lt_cv_dlopen=dlopen\n    lt_cv_dlopen_libs=\n    ;;\n\n  darwin*)\n    # if libdl is installed we need to link against it\n    AC_CHECK_LIB([dl], [dlopen],\n\t\t[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[\n    lt_cv_dlopen=dyld\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n    ])\n    ;;\n\n  tpf*)\n    # Don't try to run any link tests for TPF.  We know it's impossible\n    # because TPF is a cross-compiler, and we know how we open DSOs.\n    lt_cv_dlopen=dlopen\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=no\n    ;;\n\n  *)\n    AC_CHECK_FUNC([shl_load],\n\t  [lt_cv_dlopen=shl_load],\n      [AC_CHECK_LIB([dld], [shl_load],\n\t    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],\n\t[AC_CHECK_FUNC([dlopen],\n\t      [lt_cv_dlopen=dlopen],\n\t  [AC_CHECK_LIB([dl], [dlopen],\n\t\t[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],\n\t    [AC_CHECK_LIB([svld], [dlopen],\n\t\t  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],\n\t      [AC_CHECK_LIB([dld], [dld_link],\n\t\t    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])\n\t      ])\n\t    ])\n\t  ])\n\t])\n      ])\n    ;;\n  esac\n\n  if test no = \"$lt_cv_dlopen\"; then\n    enable_dlopen=no\n  else\n    enable_dlopen=yes\n  fi\n\n  case $lt_cv_dlopen in\n  dlopen)\n    save_CPPFLAGS=$CPPFLAGS\n    test yes = \"$ac_cv_header_dlfcn_h\" && CPPFLAGS=\"$CPPFLAGS -DHAVE_DLFCN_H\"\n\n    save_LDFLAGS=$LDFLAGS\n    wl=$lt_prog_compiler_wl eval LDFLAGS=\\\"\\$LDFLAGS $export_dynamic_flag_spec\\\"\n\n    save_LIBS=$LIBS\n    LIBS=\"$lt_cv_dlopen_libs $LIBS\"\n\n    AC_CACHE_CHECK([whether a program can dlopen itself],\n\t  lt_cv_dlopen_self, [dnl\n\t  _LT_TRY_DLOPEN_SELF(\n\t    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,\n\t    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)\n    ])\n\n    if test yes = \"$lt_cv_dlopen_self\"; then\n      wl=$lt_prog_compiler_wl eval LDFLAGS=\\\"\\$LDFLAGS $lt_prog_compiler_static\\\"\n      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],\n\t  lt_cv_dlopen_self_static, [dnl\n\t  _LT_TRY_DLOPEN_SELF(\n\t    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,\n\t    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)\n      ])\n    fi\n\n    CPPFLAGS=$save_CPPFLAGS\n    LDFLAGS=$save_LDFLAGS\n    LIBS=$save_LIBS\n    ;;\n  esac\n\n  case $lt_cv_dlopen_self in\n  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;\n  *) enable_dlopen_self=unknown ;;\n  esac\n\n  case $lt_cv_dlopen_self_static in\n  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;\n  *) enable_dlopen_self_static=unknown ;;\n  esac\nfi\n_LT_DECL([dlopen_support], [enable_dlopen], [0],\n\t [Whether dlopen is supported])\n_LT_DECL([dlopen_self], [enable_dlopen_self], [0],\n\t [Whether dlopen of programs is supported])\n_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],\n\t [Whether dlopen of statically linked programs is supported])\n])# LT_SYS_DLOPEN_SELF\n\n# Old name:\nAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])\n\n\n# _LT_COMPILER_C_O([TAGNAME])\n# ---------------------------\n# Check to see if options -c and -o are simultaneously supported by compiler.\n# This macro does not hard code the compiler like AC_PROG_CC_C_O.\nm4_defun([_LT_COMPILER_C_O],\n[m4_require([_LT_DECL_SED])dnl\nm4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_TAG_COMPILER])dnl\nAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],\n  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],\n  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no\n   $RM -r conftest 2>/dev/null\n   mkdir conftest\n   cd conftest\n   mkdir out\n   echo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n   lt_compiler_flag=\"-o out/conftest2.$ac_objext\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}\\{0,1\\} :&$lt_compiler_flag :; t' \\\n   -e 's: [[^ ]]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:$LINENO: $lt_compile\\\"\" >&AS_MESSAGE_LOG_FD)\n   (eval \"$lt_compile\" 2>out/conftest.err)\n   ac_status=$?\n   cat out/conftest.err >&AS_MESSAGE_LOG_FD\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&AS_MESSAGE_LOG_FD\n   if (exit $ac_status) && test -s out/conftest2.$ac_objext\n   then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     $ECHO \"$_lt_compiler_boilerplate\" | $SED '/^$/d' > out/conftest.exp\n     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2\n     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then\n       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes\n     fi\n   fi\n   chmod u+w . 2>&AS_MESSAGE_LOG_FD\n   $RM conftest*\n   # SGI C++ compiler will create directory out/ii_files/ for\n   # template instantiation\n   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files\n   $RM out/* && rmdir out\n   cd ..\n   $RM -r conftest\n   $RM conftest*\n])\n_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],\n\t[Does compiler simultaneously support -c and -o options?])\n])# _LT_COMPILER_C_O\n\n\n# _LT_COMPILER_FILE_LOCKS([TAGNAME])\n# ----------------------------------\n# Check to see if we can do hard links to lock some files if needed\nm4_defun([_LT_COMPILER_FILE_LOCKS],\n[m4_require([_LT_ENABLE_LOCK])dnl\nm4_require([_LT_FILEUTILS_DEFAULTS])dnl\n_LT_COMPILER_C_O([$1])\n\nhard_links=nottested\nif test no = \"$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)\" && test no != \"$need_locks\"; then\n  # do not overwrite the value of need_locks provided by the user\n  AC_MSG_CHECKING([if we can lock with hard links])\n  hard_links=yes\n  $RM conftest*\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  touch conftest.a\n  ln conftest.a conftest.b 2>&5 || hard_links=no\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  AC_MSG_RESULT([$hard_links])\n  if test no = \"$hard_links\"; then\n    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])\n    need_locks=warn\n  fi\nelse\n  need_locks=no\nfi\n_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])\n])# _LT_COMPILER_FILE_LOCKS\n\n\n# _LT_CHECK_OBJDIR\n# ----------------\nm4_defun([_LT_CHECK_OBJDIR],\n[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],\n[rm -f .libs 2>/dev/null\nmkdir .libs 2>/dev/null\nif test -d .libs; then\n  lt_cv_objdir=.libs\nelse\n  # MS-DOS does not allow filenames that begin with a dot.\n  lt_cv_objdir=_libs\nfi\nrmdir .libs 2>/dev/null])\nobjdir=$lt_cv_objdir\n_LT_DECL([], [objdir], [0],\n         [The name of the directory that contains temporary libtool files])dnl\nm4_pattern_allow([LT_OBJDIR])dnl\nAC_DEFINE_UNQUOTED([LT_OBJDIR], \"$lt_cv_objdir/\",\n  [Define to the sub-directory where libtool stores uninstalled libraries.])\n])# _LT_CHECK_OBJDIR\n\n\n# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])\n# --------------------------------------\n# Check hardcoding attributes.\nm4_defun([_LT_LINKER_HARDCODE_LIBPATH],\n[AC_MSG_CHECKING([how to hardcode library paths into programs])\n_LT_TAGVAR(hardcode_action, $1)=\nif test -n \"$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\" ||\n   test -n \"$_LT_TAGVAR(runpath_var, $1)\" ||\n   test yes = \"$_LT_TAGVAR(hardcode_automatic, $1)\"; then\n\n  # We can hardcode non-existent directories.\n  if test no != \"$_LT_TAGVAR(hardcode_direct, $1)\" &&\n     # If the only mechanism to avoid hardcoding is shlibpath_var, we\n     # have to relink, otherwise we might link with an installed library\n     # when we should be linking with a yet-to-be-installed one\n     ## test no != \"$_LT_TAGVAR(hardcode_shlibpath_var, $1)\" &&\n     test no != \"$_LT_TAGVAR(hardcode_minus_L, $1)\"; then\n    # Linking always hardcodes the temporary library directory.\n    _LT_TAGVAR(hardcode_action, $1)=relink\n  else\n    # We can link without hardcoding, and we can hardcode nonexisting dirs.\n    _LT_TAGVAR(hardcode_action, $1)=immediate\n  fi\nelse\n  # We cannot hardcode anything, or else we can only hardcode existing\n  # directories.\n  _LT_TAGVAR(hardcode_action, $1)=unsupported\nfi\nAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])\n\nif test relink = \"$_LT_TAGVAR(hardcode_action, $1)\" ||\n   test yes = \"$_LT_TAGVAR(inherit_rpath, $1)\"; then\n  # Fast installation is not supported\n  enable_fast_install=no\nelif test yes = \"$shlibpath_overrides_runpath\" ||\n     test no = \"$enable_shared\"; then\n  # Fast installation is not necessary\n  enable_fast_install=needless\nfi\n_LT_TAGDECL([], [hardcode_action], [0],\n    [How to hardcode a shared library path into an executable])\n])# _LT_LINKER_HARDCODE_LIBPATH\n\n\n# _LT_CMD_STRIPLIB\n# ----------------\nm4_defun([_LT_CMD_STRIPLIB],\n[m4_require([_LT_DECL_EGREP])\nstriplib=\nold_striplib=\nAC_MSG_CHECKING([whether stripping libraries is possible])\nif test -n \"$STRIP\" && $STRIP -V 2>&1 | $GREP \"GNU strip\" >/dev/null; then\n  test -z \"$old_striplib\" && old_striplib=\"$STRIP --strip-debug\"\n  test -z \"$striplib\" && striplib=\"$STRIP --strip-unneeded\"\n  AC_MSG_RESULT([yes])\nelse\n# FIXME - insert some real tests, host_os isn't really good enough\n  case $host_os in\n  darwin*)\n    if test -n \"$STRIP\"; then\n      striplib=\"$STRIP -x\"\n      old_striplib=\"$STRIP -S\"\n      AC_MSG_RESULT([yes])\n    else\n      AC_MSG_RESULT([no])\n    fi\n    ;;\n  *)\n    AC_MSG_RESULT([no])\n    ;;\n  esac\nfi\n_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])\n_LT_DECL([], [striplib], [1])\n])# _LT_CMD_STRIPLIB\n\n\n# _LT_PREPARE_MUNGE_PATH_LIST\n# ---------------------------\n# Make sure func_munge_path_list() is defined correctly.\nm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],\n[[# func_munge_path_list VARIABLE PATH\n# -----------------------------------\n# VARIABLE is name of variable containing _space_ separated list of\n# directories to be munged by the contents of PATH, which is string\n# having a format:\n# \"DIR[:DIR]:\"\n#       string \"DIR[ DIR]\" will be prepended to VARIABLE\n# \":DIR[:DIR]\"\n#       string \"DIR[ DIR]\" will be appended to VARIABLE\n# \"DIRP[:DIRP]::[DIRA:]DIRA\"\n#       string \"DIRP[ DIRP]\" will be prepended to VARIABLE and string\n#       \"DIRA[ DIRA]\" will be appended to VARIABLE\n# \"DIR[:DIR]\"\n#       VARIABLE will be replaced by \"DIR[ DIR]\"\nfunc_munge_path_list ()\n{\n    case x@S|@2 in\n    x)\n        ;;\n    *:)\n        eval @S|@1=\\\"`$ECHO @S|@2 | $SED 's/:/ /g'` \\@S|@@S|@1\\\"\n        ;;\n    x:*)\n        eval @S|@1=\\\"\\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\\\"\n        ;;\n    *::*)\n        eval @S|@1=\\\"\\@S|@@S|@1\\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\\\"\n        eval @S|@1=\\\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\\ \\@S|@@S|@1\\\"\n        ;;\n    *)\n        eval @S|@1=\\\"`$ECHO @S|@2 | $SED 's/:/ /g'`\\\"\n        ;;\n    esac\n}\n]])# _LT_PREPARE_PATH_LIST\n\n\n# _LT_SYS_DYNAMIC_LINKER([TAG])\n# -----------------------------\n# PORTME Fill in your ld.so characteristics\nm4_defun([_LT_SYS_DYNAMIC_LINKER],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\nm4_require([_LT_DECL_EGREP])dnl\nm4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_DECL_OBJDUMP])dnl\nm4_require([_LT_DECL_SED])dnl\nm4_require([_LT_CHECK_SHELL_FEATURES])dnl\nm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl\nAC_MSG_CHECKING([dynamic linker characteristics])\nm4_if([$1],\n\t[], [\nif test yes = \"$GCC\"; then\n  case $host_os in\n    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;\n    *) lt_awk_arg='/^libraries:/' ;;\n  esac\n  case $host_os in\n    mingw* | cegcc*) lt_sed_strip_eq='s|=\\([[A-Za-z]]:\\)|\\1|g' ;;\n    *) lt_sed_strip_eq='s|=/|/|g' ;;\n  esac\n  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e \"s/^libraries://\" -e $lt_sed_strip_eq`\n  case $lt_search_path_spec in\n  *\\;*)\n    # if the path contains \";\" then we assume it to be the separator\n    # otherwise default to the standard path separator (i.e. \":\") - it is\n    # assumed that no part of a normal pathname contains \";\" but that should\n    # okay in the real world where \";\" in dirpaths is itself problematic.\n    lt_search_path_spec=`$ECHO \"$lt_search_path_spec\" | $SED 's/;/ /g'`\n    ;;\n  *)\n    lt_search_path_spec=`$ECHO \"$lt_search_path_spec\" | $SED \"s/$PATH_SEPARATOR/ /g\"`\n    ;;\n  esac\n  # Ok, now we have the path, separated by spaces, we can step through it\n  # and add multilib dir if necessary...\n  lt_tmp_lt_search_path_spec=\n  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`\n  # ...but if some path component already ends with the multilib dir we assume\n  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).\n  case \"$lt_multi_os_dir; $lt_search_path_spec \" in\n  \"/; \"* | \"/.; \"* | \"/./; \"* | *\"$lt_multi_os_dir \"* | *\"$lt_multi_os_dir/ \"*)\n    lt_multi_os_dir=\n    ;;\n  esac\n  for lt_sys_path in $lt_search_path_spec; do\n    if test -d \"$lt_sys_path$lt_multi_os_dir\"; then\n      lt_tmp_lt_search_path_spec=\"$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir\"\n    elif test -n \"$lt_multi_os_dir\"; then\n      test -d \"$lt_sys_path\" && \\\n\tlt_tmp_lt_search_path_spec=\"$lt_tmp_lt_search_path_spec $lt_sys_path\"\n    fi\n  done\n  lt_search_path_spec=`$ECHO \"$lt_tmp_lt_search_path_spec\" | awk '\nBEGIN {RS = \" \"; FS = \"/|\\n\";} {\n  lt_foo = \"\";\n  lt_count = 0;\n  for (lt_i = NF; lt_i > 0; lt_i--) {\n    if ($lt_i != \"\" && $lt_i != \".\") {\n      if ($lt_i == \"..\") {\n        lt_count++;\n      } else {\n        if (lt_count == 0) {\n          lt_foo = \"/\" $lt_i lt_foo;\n        } else {\n          lt_count--;\n        }\n      }\n    }\n  }\n  if (lt_foo != \"\") { lt_freq[[lt_foo]]++; }\n  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }\n}'`\n  # AWK program above erroneously prepends '/' to C:/dos/paths\n  # for these hosts.\n  case $host_os in\n    mingw* | cegcc*) lt_search_path_spec=`$ECHO \"$lt_search_path_spec\" |\\\n      $SED 's|/\\([[A-Za-z]]:\\)|\\1|g'` ;;\n  esac\n  sys_lib_search_path_spec=`$ECHO \"$lt_search_path_spec\" | $lt_NL2SP`\nelse\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\nfi])\nlibrary_names_spec=\nlibname_spec='lib$name'\nsoname_spec=\nshrext_cmds=.so\npostinstall_cmds=\npostuninstall_cmds=\nfinish_cmds=\nfinish_eval=\nshlibpath_var=\nshlibpath_overrides_runpath=unknown\nversion_type=none\ndynamic_linker=\"$host_os ld.so\"\nsys_lib_dlsearch_path_spec=\"/lib /usr/lib\"\nneed_lib_prefix=unknown\nhardcode_into_libs=no\n\n# when you set need_version to no, make sure it does not cause -set_version\n# flags to be left without arguments\nneed_version=unknown\n\nAC_ARG_VAR([LT_SYS_LIBRARY_PATH],\n[User-defined run-time library search path.])\n\ncase $host_os in\naix3*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'\n  shlibpath_var=LIBPATH\n\n  # AIX 3 has no versioning support, so we append a major version to the name.\n  soname_spec='$libname$release$shared_ext$major'\n  ;;\n\naix[[4-9]]*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  hardcode_into_libs=yes\n  if test ia64 = \"$host_cpu\"; then\n    # AIX 5 supports IA64\n    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'\n    shlibpath_var=LD_LIBRARY_PATH\n  else\n    # With GCC up to 2.95.x, collect2 would create an import file\n    # for dependence libraries.  The import file would start with\n    # the line '#! .'.  This would cause the generated library to\n    # depend on '.', always an invalid library.  This was fixed in\n    # development snapshots of GCC prior to 3.0.\n    case $host_os in\n      aix4 | aix4.[[01]] | aix4.[[01]].*)\n      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'\n\t   echo ' yes '\n\t   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then\n\t:\n      else\n\tcan_build_shared=no\n      fi\n      ;;\n    esac\n    # Using Import Files as archive members, it is possible to support\n    # filename-based versioning of shared library archives on AIX. While\n    # this would work for both with and without runtime linking, it will\n    # prevent static linking of such archives. So we do filename-based\n    # shared library versioning with .so extension only, which is used\n    # when both runtime linking and shared linking is enabled.\n    # Unfortunately, runtime linking may impact performance, so we do\n    # not want this to be the default eventually. Also, we use the\n    # versioned .so libs for executables only if there is the -brtl\n    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.\n    # To allow for filename-based versioning support, we need to create\n    # libNAME.so.V as an archive file, containing:\n    # *) an Import File, referring to the versioned filename of the\n    #    archive as well as the shared archive member, telling the\n    #    bitwidth (32 or 64) of that shared object, and providing the\n    #    list of exported symbols of that shared object, eventually\n    #    decorated with the 'weak' keyword\n    # *) the shared object with the F_LOADONLY flag set, to really avoid\n    #    it being seen by the linker.\n    # At run time we better use the real file rather than another symlink,\n    # but for link time we create the symlink libNAME.so -> libNAME.so.V\n\n    case $with_aix_soname,$aix_use_runtimelinking in\n    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct\n    # soname into executable. Probably we can add versioning support to\n    # collect2, so additional links can be useful in future.\n    aix,yes) # traditional libtool\n      dynamic_linker='AIX unversionable lib.so'\n      # If using run time linking (on AIX 4.2 or later) use lib<name>.so\n      # instead of lib<name>.a to let people know that these are not\n      # typical AIX shared libraries.\n      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n      ;;\n    aix,no) # traditional AIX only\n      dynamic_linker='AIX lib.a[(]lib.so.V[)]'\n      # We preserve .a as extension for shared libraries through AIX4.2\n      # and later when we are not doing run time linking.\n      library_names_spec='$libname$release.a $libname.a'\n      soname_spec='$libname$release$shared_ext$major'\n      ;;\n    svr4,*) # full svr4 only\n      dynamic_linker=\"AIX lib.so.V[(]$shared_archive_member_spec.o[)]\"\n      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'\n      # We do not specify a path in Import Files, so LIBPATH fires.\n      shlibpath_overrides_runpath=yes\n      ;;\n    *,yes) # both, prefer svr4\n      dynamic_linker=\"AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]\"\n      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'\n      # unpreferred sharedlib libNAME.a needs extra handling\n      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\"'\n      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\"'\n      # We do not specify a path in Import Files, so LIBPATH fires.\n      shlibpath_overrides_runpath=yes\n      ;;\n    *,no) # both, prefer aix\n      dynamic_linker=\"AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]\"\n      library_names_spec='$libname$release.a $libname.a'\n      soname_spec='$libname$release$shared_ext$major'\n      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling\n      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)'\n      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\"'\n      ;;\n    esac\n    shlibpath_var=LIBPATH\n  fi\n  ;;\n\namigaos*)\n  case $host_cpu in\n  powerpc)\n    # Since July 2007 AmigaOS4 officially supports .so libraries.\n    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    ;;\n  m68k)\n    library_names_spec='$libname.ixlibrary $libname.a'\n    # Create ${libname}_ixlibrary.a entries in /sys/libs.\n    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'\n    ;;\n  esac\n  ;;\n\nbeos*)\n  library_names_spec='$libname$shared_ext'\n  dynamic_linker=\"$host_os ld.so\"\n  shlibpath_var=LIBRARY_PATH\n  ;;\n\nbsdi[[45]]*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=\"/shlib /usr/lib /usr/local/lib\"\n  # the default ld.so.conf also contains /usr/contrib/lib and\n  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow\n  # libtool to hard-code these into programs\n  ;;\n\ncygwin* | mingw* | pw32* | cegcc*)\n  version_type=windows\n  shrext_cmds=.dll\n  need_version=no\n  need_lib_prefix=no\n\n  case $GCC,$cc_basename in\n  yes,*)\n    # gcc\n    library_names_spec='$libname.dll.a'\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\$file`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\$base_file'\\''i; echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname~\n      chmod a+x \\$dldir/$dlname~\n      if test -n '\\''$stripme'\\'' && test -n '\\''$striplib'\\''; then\n        eval '\\''$striplib \\$dldir/$dlname'\\'' || exit \\$?;\n      fi'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $RM \\$dlpath'\n    shlibpath_overrides_runpath=yes\n\n    case $host_os in\n    cygwin*)\n      # Cygwin DLLs use 'cyg' prefix rather than 'lib'\n      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'\nm4_if([$1], [],[\n      sys_lib_search_path_spec=\"$sys_lib_search_path_spec /usr/lib/w32api\"])\n      ;;\n    mingw* | cegcc*)\n      # MinGW DLLs use traditional 'lib' prefix\n      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'\n      ;;\n    pw32*)\n      # pw32 DLLs use 'pw' prefix rather than 'lib'\n      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'\n      ;;\n    esac\n    dynamic_linker='Win32 ld.exe'\n    ;;\n\n  *,cl*)\n    # Native MSVC\n    libname_spec='$name'\n    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'\n    library_names_spec='$libname.dll.lib'\n\n    case $build_os in\n    mingw*)\n      sys_lib_search_path_spec=\n      lt_save_ifs=$IFS\n      IFS=';'\n      for lt_path in $LIB\n      do\n        IFS=$lt_save_ifs\n        # Let DOS variable expansion print the short 8.3 style file name.\n        lt_path=`cd \"$lt_path\" 2>/dev/null && cmd //C \"for %i in (\".\") do @echo %~si\"`\n        sys_lib_search_path_spec=\"$sys_lib_search_path_spec $lt_path\"\n      done\n      IFS=$lt_save_ifs\n      # Convert to MSYS style.\n      sys_lib_search_path_spec=`$ECHO \"$sys_lib_search_path_spec\" | sed -e 's|\\\\\\\\|/|g' -e 's| \\\\([[a-zA-Z]]\\\\):| /\\\\1|g' -e 's|^ ||'`\n      ;;\n    cygwin*)\n      # Convert to unix form, then to dos form, then back to unix form\n      # but this time dos style (no spaces!) so that the unix form looks\n      # like /cygdrive/c/PROGRA~1:/cygdr...\n      sys_lib_search_path_spec=`cygpath --path --unix \"$LIB\"`\n      sys_lib_search_path_spec=`cygpath --path --dos \"$sys_lib_search_path_spec\" 2>/dev/null`\n      sys_lib_search_path_spec=`cygpath --path --unix \"$sys_lib_search_path_spec\" | $SED -e \"s/$PATH_SEPARATOR/ /g\"`\n      ;;\n    *)\n      sys_lib_search_path_spec=$LIB\n      if $ECHO \"$sys_lib_search_path_spec\" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then\n        # It is most probably a Windows format PATH.\n        sys_lib_search_path_spec=`$ECHO \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n      else\n        sys_lib_search_path_spec=`$ECHO \"$sys_lib_search_path_spec\" | $SED -e \"s/$PATH_SEPARATOR/ /g\"`\n      fi\n      # FIXME: find the short name or the path components, as spaces are\n      # common. (e.g. \"Program Files\" -> \"PROGRA~1\")\n      ;;\n    esac\n\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\$file`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\$base_file'\\''i; echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $RM \\$dlpath'\n    shlibpath_overrides_runpath=yes\n    dynamic_linker='Win32 link.exe'\n    ;;\n\n  *)\n    # Assume MSVC wrapper\n    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'\n    dynamic_linker='Win32 ld.exe'\n    ;;\n  esac\n  # FIXME: first we should search . and the directory the executable is in\n  shlibpath_var=PATH\n  ;;\n\ndarwin* | rhapsody*)\n  dynamic_linker=\"$host_os dyld\"\n  version_type=darwin\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'\n  soname_spec='$libname$release$major$shared_ext'\n  shlibpath_overrides_runpath=yes\n  shlibpath_var=DYLD_LIBRARY_PATH\n  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'\nm4_if([$1], [],[\n  sys_lib_search_path_spec=\"$sys_lib_search_path_spec /usr/local/lib\"])\n  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'\n  ;;\n\ndgux*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nfreebsd* | dragonfly*)\n  # DragonFly does not have aout.  When/if they implement a new\n  # versioning mechanism, adjust this.\n  if test -x /usr/bin/objformat; then\n    objformat=`/usr/bin/objformat`\n  else\n    case $host_os in\n    freebsd[[23]].*) objformat=aout ;;\n    *) objformat=elf ;;\n    esac\n  fi\n  version_type=freebsd-$objformat\n  case $version_type in\n    freebsd-elf*)\n      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n      soname_spec='$libname$release$shared_ext$major'\n      need_version=no\n      need_lib_prefix=no\n      ;;\n    freebsd-*)\n      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n      need_version=yes\n      ;;\n  esac\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_os in\n  freebsd2.*)\n    shlibpath_overrides_runpath=yes\n    ;;\n  freebsd3.[[01]]* | freebsdelf3.[[01]]*)\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \\\n  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)\n    shlibpath_overrides_runpath=no\n    hardcode_into_libs=yes\n    ;;\n  *) # from 4.6 on, and DragonFly\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  esac\n  ;;\n\nhaiku*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  dynamic_linker=\"$host_os runtime_loader\"\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'\n  hardcode_into_libs=yes\n  ;;\n\nhpux9* | hpux10* | hpux11*)\n  # Give a soname corresponding to the major version so that dld.sl refuses to\n  # link against other versions.\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  case $host_cpu in\n  ia64*)\n    shrext_cmds='.so'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.so\"\n    shlibpath_var=LD_LIBRARY_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    if test 32 = \"$HPUX_IA64_MODE\"; then\n      sys_lib_search_path_spec=\"/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib\"\n      sys_lib_dlsearch_path_spec=/usr/lib/hpux32\n    else\n      sys_lib_search_path_spec=\"/usr/lib/hpux64 /usr/local/lib/hpux64\"\n      sys_lib_dlsearch_path_spec=/usr/lib/hpux64\n    fi\n    ;;\n  hppa*64*)\n    shrext_cmds='.sl'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    sys_lib_search_path_spec=\"/usr/lib/pa20_64 /usr/ccs/lib/pa20_64\"\n    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n    ;;\n  *)\n    shrext_cmds='.sl'\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=SHLIB_PATH\n    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    ;;\n  esac\n  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...\n  postinstall_cmds='chmod 555 $lib'\n  # or fails outright, so override atomically:\n  install_override_mode=555\n  ;;\n\ninterix[[3-9]]*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $host_os in\n    nonstopux*) version_type=nonstopux ;;\n    *)\n\tif test yes = \"$lt_cv_prog_gnu_ld\"; then\n\t\tversion_type=linux # correct to gnu/linux during the next big refactor\n\telse\n\t\tversion_type=irix\n\tfi ;;\n  esac\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='$libname$release$shared_ext$major'\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'\n  case $host_os in\n  irix5* | nonstopux*)\n    libsuff= shlibsuff=\n    ;;\n  *)\n    case $LD in # libtool.m4 will add one of these switches to LD\n    *-32|*\"-32 \"|*-melf32bsmip|*\"-melf32bsmip \")\n      libsuff= shlibsuff= libmagic=32-bit;;\n    *-n32|*\"-n32 \"|*-melf32bmipn32|*\"-melf32bmipn32 \")\n      libsuff=32 shlibsuff=N32 libmagic=N32;;\n    *-64|*\"-64 \"|*-melf64bmip|*\"-melf64bmip \")\n      libsuff=64 shlibsuff=64 libmagic=64-bit;;\n    *) libsuff= shlibsuff= libmagic=never-match;;\n    esac\n    ;;\n  esac\n  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_search_path_spec=\"/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff\"\n  sys_lib_dlsearch_path_spec=\"/usr/lib$libsuff /lib$libsuff\"\n  hardcode_into_libs=yes\n  ;;\n\n# No shared lib support for Linux oldld, aout, or coff.\nlinux*oldld* | linux*aout* | linux*coff*)\n  dynamic_linker=no\n  ;;\n\nlinux*android*)\n  version_type=none # Android doesn't support versioned libraries.\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext'\n  soname_spec='$libname$release$shared_ext'\n  finish_cmds=\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  dynamic_linker='Android linker'\n  # Don't embed -rpath directories since the linker doesn't support them.\n  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n  ;;\n\n# This must be glibc/ELF.\nlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -n $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n\n  # Some binutils ld are patched to set DT_RUNPATH\n  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],\n    [lt_cv_shlibpath_overrides_runpath=no\n    save_LDFLAGS=$LDFLAGS\n    save_libdir=$libdir\n    eval \"libdir=/foo; wl=\\\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\\\"; \\\n\t LDFLAGS=\\\"\\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\\\"\"\n    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],\n      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep \"RUNPATH.*$libdir\" >/dev/null],\n\t [lt_cv_shlibpath_overrides_runpath=yes])])\n    LDFLAGS=$save_LDFLAGS\n    libdir=$save_libdir\n    ])\n  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath\n\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  # Ideally, we could use ldconfig to report *all* directores which are\n  # searched for libraries, however this is still not possible.  Aside from not\n  # being certain /sbin/ldconfig is available, command\n  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,\n  # even though it is searched at run-time.  Try to do the best guess by\n  # appending ld.so.conf contents (and includes) to the search path.\n  if test -f /etc/ld.so.conf; then\n    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/#.*//;/^[\t ]*hwcap[\t ]/d;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/\"//g;/^$/d' | tr '\\n' ' '`\n    sys_lib_dlsearch_path_spec=\"/lib /usr/lib $lt_ld_extra\"\n  fi\n\n  # We used to test for /lib/ld.so.1 and disable shared libraries on\n  # powerpc, because MkLinux only supported shared libraries with the\n  # GNU dynamic linker.  Since this was broken with cross compilers,\n  # most powerpc-linux boxes support dynamic linking these days and\n  # people can always --disable-shared, the test was removed, and we\n  # assume the GNU/Linux dynamic linker is in use.\n  dynamic_linker='GNU/Linux ld.so'\n  ;;\n\nnetbsdelf*-gnu)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='NetBSD ld.elf_so'\n  ;;\n\nnetbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n    finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n    dynamic_linker='NetBSD (a.out) ld.so'\n  else\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    dynamic_linker='NetBSD ld.elf_so'\n  fi\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  ;;\n\nnewsos6)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\n*nto* | *qnx*)\n  version_type=qnx\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='ldqnx.so'\n  ;;\n\nopenbsd* | bitrig*)\n  version_type=sunos\n  sys_lib_dlsearch_path_spec=/usr/lib\n  need_lib_prefix=no\n  if test -z \"`echo __ELF__ | $CC -E - | $GREP __ELF__`\"; then\n    need_version=no\n  else\n    need_version=yes\n  fi\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nos2*)\n  libname_spec='$name'\n  version_type=windows\n  shrext_cmds=.dll\n  need_version=no\n  need_lib_prefix=no\n  # OS/2 can only load a DLL with a base name of 8 characters or less.\n  soname_spec='`test -n \"$os2dllname\" && libname=\"$os2dllname\";\n    v=$($ECHO $release$versuffix | tr -d .-);\n    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);\n    $ECHO $n$v`$shared_ext'\n  library_names_spec='${libname}_dll.$libext'\n  dynamic_linker='OS/2 ld.exe'\n  shlibpath_var=BEGINLIBPATH\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n  postinstall_cmds='base_file=`basename \\$file`~\n    dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\$base_file'\\''i; $ECHO \\$dlname'\\''`~\n    dldir=$destdir/`dirname \\$dlpath`~\n    test -d \\$dldir || mkdir -p \\$dldir~\n    $install_prog $dir/$dlname \\$dldir/$dlname~\n    chmod a+x \\$dldir/$dlname~\n    if test -n '\\''$stripme'\\'' && test -n '\\''$striplib'\\''; then\n      eval '\\''$striplib \\$dldir/$dlname'\\'' || exit \\$?;\n    fi'\n  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; $ECHO \\$dlname'\\''`~\n    dlpath=$dir/\\$dldll~\n    $RM \\$dlpath'\n  ;;\n\nosf3* | osf4* | osf5*)\n  version_type=osf\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='$libname$release$shared_ext$major'\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib\"\n  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n  ;;\n\nrdos*)\n  dynamic_linker=no\n  ;;\n\nsolaris*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  # ldd complains unless libraries are executable\n  postinstall_cmds='chmod +x $lib'\n  ;;\n\nsunos4*)\n  version_type=sunos\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/usr/etc\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  if test yes = \"$with_gnu_ld\"; then\n    need_lib_prefix=no\n  fi\n  need_version=yes\n  ;;\n\nsysv4 | sysv4.3*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_vendor in\n    sni)\n      shlibpath_overrides_runpath=no\n      need_lib_prefix=no\n      runpath_var=LD_RUN_PATH\n      ;;\n    siemens)\n      need_lib_prefix=no\n      ;;\n    motorola)\n      need_lib_prefix=no\n      need_version=no\n      shlibpath_overrides_runpath=no\n      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'\n      ;;\n  esac\n  ;;\n\nsysv4*MP*)\n  if test -d /usr/nec; then\n    version_type=linux # correct to gnu/linux during the next big refactor\n    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'\n    soname_spec='$libname$shared_ext.$major'\n    shlibpath_var=LD_LIBRARY_PATH\n  fi\n  ;;\n\nsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)\n  version_type=sco\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  if test yes = \"$with_gnu_ld\"; then\n    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'\n  else\n    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'\n    case $host_os in\n      sco3.2v5*)\n        sys_lib_search_path_spec=\"$sys_lib_search_path_spec /lib\"\n\t;;\n    esac\n  fi\n  sys_lib_dlsearch_path_spec='/usr/lib'\n  ;;\n\ntpf*)\n  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  ;;\n\nuts4*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\n*)\n  dynamic_linker=no\n  ;;\nesac\nAC_MSG_RESULT([$dynamic_linker])\ntest no = \"$dynamic_linker\" && can_build_shared=no\n\nvariables_saved_for_relink=\"PATH $shlibpath_var $runpath_var\"\nif test yes = \"$GCC\"; then\n  variables_saved_for_relink=\"$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH\"\nfi\n\nif test set = \"${lt_cv_sys_lib_search_path_spec+set}\"; then\n  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec\nfi\n\nif test set = \"${lt_cv_sys_lib_dlsearch_path_spec+set}\"; then\n  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec\nfi\n\n# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...\nconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec\n\n# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code\nfunc_munge_path_list sys_lib_dlsearch_path_spec \"$LT_SYS_LIBRARY_PATH\"\n\n# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool\nconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH\n\n_LT_DECL([], [variables_saved_for_relink], [1],\n    [Variables whose values should be saved in libtool wrapper scripts and\n    restored at link time])\n_LT_DECL([], [need_lib_prefix], [0],\n    [Do we need the \"lib\" prefix for modules?])\n_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])\n_LT_DECL([], [version_type], [0], [Library versioning type])\n_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])\n_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])\n_LT_DECL([], [shlibpath_overrides_runpath], [0],\n    [Is shlibpath searched before the hard-coded library search path?])\n_LT_DECL([], [libname_spec], [1], [Format of library name prefix])\n_LT_DECL([], [library_names_spec], [1],\n    [[List of archive names.  First name is the real one, the rest are links.\n    The last name is the one that the linker finds with -lNAME]])\n_LT_DECL([], [soname_spec], [1],\n    [[The coded name of the library, if different from the real name]])\n_LT_DECL([], [install_override_mode], [1],\n    [Permission mode override for installation of shared libraries])\n_LT_DECL([], [postinstall_cmds], [2],\n    [Command to use after installation of a shared archive])\n_LT_DECL([], [postuninstall_cmds], [2],\n    [Command to use after uninstallation of a shared archive])\n_LT_DECL([], [finish_cmds], [2],\n    [Commands used to finish a libtool library installation in a directory])\n_LT_DECL([], [finish_eval], [1],\n    [[As \"finish_cmds\", except a single script fragment to be evaled but\n    not shown]])\n_LT_DECL([], [hardcode_into_libs], [0],\n    [Whether we should hardcode library paths into libraries])\n_LT_DECL([], [sys_lib_search_path_spec], [2],\n    [Compile-time system search path for libraries])\n_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],\n    [Detected run-time system search path for libraries])\n_LT_DECL([], [configure_time_lt_sys_library_path], [2],\n    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])\n])# _LT_SYS_DYNAMIC_LINKER\n\n\n# _LT_PATH_TOOL_PREFIX(TOOL)\n# --------------------------\n# find a file program that can recognize shared library\nAC_DEFUN([_LT_PATH_TOOL_PREFIX],\n[m4_require([_LT_DECL_EGREP])dnl\nAC_MSG_CHECKING([for $1])\nAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,\n[case $MAGIC_CMD in\n[[\\\\/*] |  ?:[\\\\/]*])\n  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.\n  ;;\n*)\n  lt_save_MAGIC_CMD=$MAGIC_CMD\n  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\ndnl $ac_dummy forces splitting on constant user-supplied paths.\ndnl POSIX.2 word splitting is done only on the output of word expansions,\ndnl not every word.  This closes a longstanding sh security hole.\n  ac_dummy=\"m4_if([$2], , $PATH, [$2])\"\n  for ac_dir in $ac_dummy; do\n    IFS=$lt_save_ifs\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/$1\"; then\n      lt_cv_path_MAGIC_CMD=$ac_dir/\"$1\"\n      if test -n \"$file_magic_test_file\"; then\n\tcase $deplibs_check_method in\n\t\"file_magic \"*)\n\t  file_magic_regex=`expr \"$deplibs_check_method\" : \"file_magic \\(.*\\)\"`\n\t  MAGIC_CMD=$lt_cv_path_MAGIC_CMD\n\t  if eval $file_magic_cmd \\$file_magic_test_file 2> /dev/null |\n\t    $EGREP \"$file_magic_regex\" > /dev/null; then\n\t    :\n\t  else\n\t    cat <<_LT_EOF 1>&2\n\n*** Warning: the command libtool uses to detect shared libraries,\n*** $file_magic_cmd, produces output that libtool cannot recognize.\n*** The result is that libtool may fail to recognize shared libraries\n*** as such.  This will affect the creation of libtool libraries that\n*** depend on shared libraries, but programs linked with such libtool\n*** libraries will work regardless of this problem.  Nevertheless, you\n*** may want to report the problem to your system manager and/or to\n*** bug-libtool@gnu.org\n\n_LT_EOF\n\t  fi ;;\n\tesac\n      fi\n      break\n    fi\n  done\n  IFS=$lt_save_ifs\n  MAGIC_CMD=$lt_save_MAGIC_CMD\n  ;;\nesac])\nMAGIC_CMD=$lt_cv_path_MAGIC_CMD\nif test -n \"$MAGIC_CMD\"; then\n  AC_MSG_RESULT($MAGIC_CMD)\nelse\n  AC_MSG_RESULT(no)\nfi\n_LT_DECL([], [MAGIC_CMD], [0],\n\t [Used to examine libraries when file_magic_cmd begins with \"file\"])dnl\n])# _LT_PATH_TOOL_PREFIX\n\n# Old name:\nAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])\n\n\n# _LT_PATH_MAGIC\n# --------------\n# find a file program that can recognize a shared library\nm4_defun([_LT_PATH_MAGIC],\n[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)\nif test -z \"$lt_cv_path_MAGIC_CMD\"; then\n  if test -n \"$ac_tool_prefix\"; then\n    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)\n  else\n    MAGIC_CMD=:\n  fi\nfi\n])# _LT_PATH_MAGIC\n\n\n# LT_PATH_LD\n# ----------\n# find the pathname to the GNU or non-GNU linker\nAC_DEFUN([LT_PATH_LD],\n[AC_REQUIRE([AC_PROG_CC])dnl\nAC_REQUIRE([AC_CANONICAL_HOST])dnl\nAC_REQUIRE([AC_CANONICAL_BUILD])dnl\nm4_require([_LT_DECL_SED])dnl\nm4_require([_LT_DECL_EGREP])dnl\nm4_require([_LT_PROG_ECHO_BACKSLASH])dnl\n\nAC_ARG_WITH([gnu-ld],\n    [AS_HELP_STRING([--with-gnu-ld],\n\t[assume the C compiler uses GNU ld @<:@default=no@:>@])],\n    [test no = \"$withval\" || with_gnu_ld=yes],\n    [with_gnu_ld=no])dnl\n\nac_prog=ld\nif test yes = \"$GCC\"; then\n  # Check if gcc -print-prog-name=ld gives a path.\n  AC_MSG_CHECKING([for ld used by $CC])\n  case $host in\n  *-*-mingw*)\n    # gcc leaves a trailing carriage return, which upsets mingw\n    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\\015'` ;;\n  *)\n    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;\n  esac\n  case $ac_prog in\n    # Accept absolute paths.\n    [[\\\\/]]* | ?:[[\\\\/]]*)\n      re_direlt='/[[^/]][[^/]]*/\\.\\./'\n      # Canonicalize the pathname of ld\n      ac_prog=`$ECHO \"$ac_prog\"| $SED 's%\\\\\\\\%/%g'`\n      while $ECHO \"$ac_prog\" | $GREP \"$re_direlt\" > /dev/null 2>&1; do\n\tac_prog=`$ECHO $ac_prog| $SED \"s%$re_direlt%/%\"`\n      done\n      test -z \"$LD\" && LD=$ac_prog\n      ;;\n  \"\")\n    # If it fails, then pretend we aren't using GCC.\n    ac_prog=ld\n    ;;\n  *)\n    # If it is relative, then search for the first ld in PATH.\n    with_gnu_ld=unknown\n    ;;\n  esac\nelif test yes = \"$with_gnu_ld\"; then\n  AC_MSG_CHECKING([for GNU ld])\nelse\n  AC_MSG_CHECKING([for non-GNU ld])\nfi\nAC_CACHE_VAL(lt_cv_path_LD,\n[if test -z \"$LD\"; then\n  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\n  for ac_dir in $PATH; do\n    IFS=$lt_save_ifs\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/$ac_prog\" || test -f \"$ac_dir/$ac_prog$ac_exeext\"; then\n      lt_cv_path_LD=$ac_dir/$ac_prog\n      # Check to see if the program is GNU ld.  I'd rather use --version,\n      # but apparently some variants of GNU ld only accept -v.\n      # Break only if it was the GNU/non-GNU ld that we prefer.\n      case `\"$lt_cv_path_LD\" -v 2>&1 </dev/null` in\n      *GNU* | *'with BFD'*)\n\ttest no != \"$with_gnu_ld\" && break\n\t;;\n      *)\n\ttest yes != \"$with_gnu_ld\" && break\n\t;;\n      esac\n    fi\n  done\n  IFS=$lt_save_ifs\nelse\n  lt_cv_path_LD=$LD # Let the user override the test with a path.\nfi])\nLD=$lt_cv_path_LD\nif test -n \"$LD\"; then\n  AC_MSG_RESULT($LD)\nelse\n  AC_MSG_RESULT(no)\nfi\ntest -z \"$LD\" && AC_MSG_ERROR([no acceptable ld found in \\$PATH])\n_LT_PATH_LD_GNU\nAC_SUBST([LD])\n\n_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])\n])# LT_PATH_LD\n\n# Old names:\nAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])\nAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AM_PROG_LD], [])\ndnl AC_DEFUN([AC_PROG_LD], [])\n\n\n# _LT_PATH_LD_GNU\n#- --------------\nm4_defun([_LT_PATH_LD_GNU],\n[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,\n[# I'd rather use --version here, but apparently some GNU lds only accept -v.\ncase `$LD -v 2>&1 </dev/null` in\n*GNU* | *'with BFD'*)\n  lt_cv_prog_gnu_ld=yes\n  ;;\n*)\n  lt_cv_prog_gnu_ld=no\n  ;;\nesac])\nwith_gnu_ld=$lt_cv_prog_gnu_ld\n])# _LT_PATH_LD_GNU\n\n\n# _LT_CMD_RELOAD\n# --------------\n# find reload flag for linker\n#   -- PORTME Some linkers may need a different reload flag.\nm4_defun([_LT_CMD_RELOAD],\n[AC_CACHE_CHECK([for $LD option to reload object files],\n  lt_cv_ld_reload_flag,\n  [lt_cv_ld_reload_flag='-r'])\nreload_flag=$lt_cv_ld_reload_flag\ncase $reload_flag in\n\"\" | \" \"*) ;;\n*) reload_flag=\" $reload_flag\" ;;\nesac\nreload_cmds='$LD$reload_flag -o $output$reload_objs'\ncase $host_os in\n  cygwin* | mingw* | pw32* | cegcc*)\n    if test yes != \"$GCC\"; then\n      reload_cmds=false\n    fi\n    ;;\n  darwin*)\n    if test yes = \"$GCC\"; then\n      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'\n    else\n      reload_cmds='$LD$reload_flag -o $output$reload_objs'\n    fi\n    ;;\nesac\n_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl\n_LT_TAGDECL([], [reload_cmds], [2])dnl\n])# _LT_CMD_RELOAD\n\n\n# _LT_PATH_DD\n# -----------\n# find a working dd\nm4_defun([_LT_PATH_DD],\n[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],\n[printf 0123456789abcdef0123456789abcdef >conftest.i\ncat conftest.i conftest.i >conftest2.i\n: ${lt_DD:=$DD}\nAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],\n[if \"$ac_path_lt_DD\" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then\n  cmp -s conftest.i conftest.out \\\n  && ac_cv_path_lt_DD=\"$ac_path_lt_DD\" ac_path_lt_DD_found=:\nfi])\nrm -f conftest.i conftest2.i conftest.out])\n])# _LT_PATH_DD\n\n\n# _LT_CMD_TRUNCATE\n# ----------------\n# find command to truncate a binary pipe\nm4_defun([_LT_CMD_TRUNCATE],\n[m4_require([_LT_PATH_DD])\nAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],\n[printf 0123456789abcdef0123456789abcdef >conftest.i\ncat conftest.i conftest.i >conftest2.i\nlt_cv_truncate_bin=\nif \"$ac_cv_path_lt_DD\" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then\n  cmp -s conftest.i conftest.out \\\n  && lt_cv_truncate_bin=\"$ac_cv_path_lt_DD bs=4096 count=1\"\nfi\nrm -f conftest.i conftest2.i conftest.out\ntest -z \"$lt_cv_truncate_bin\" && lt_cv_truncate_bin=\"$SED -e 4q\"])\n_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],\n  [Command to truncate a binary pipe])\n])# _LT_CMD_TRUNCATE\n\n\n# _LT_CHECK_MAGIC_METHOD\n# ----------------------\n# how to check for library dependencies\n#  -- PORTME fill in with the dynamic library characteristics\nm4_defun([_LT_CHECK_MAGIC_METHOD],\n[m4_require([_LT_DECL_EGREP])\nm4_require([_LT_DECL_OBJDUMP])\nAC_CACHE_CHECK([how to recognize dependent libraries],\nlt_cv_deplibs_check_method,\n[lt_cv_file_magic_cmd='$MAGIC_CMD'\nlt_cv_file_magic_test_file=\nlt_cv_deplibs_check_method='unknown'\n# Need to set the preceding variable on all platforms that support\n# interlibrary dependencies.\n# 'none' -- dependencies not supported.\n# 'unknown' -- same as none, but documents that we really don't know.\n# 'pass_all' -- all dependencies passed with no checks.\n# 'test_compile' -- check by making test program.\n# 'file_magic [[regex]]' -- check by looking for files in library path\n# that responds to the $file_magic_cmd with a given extended regex.\n# If you have 'file' or equivalent on your system and you're not sure\n# whether 'pass_all' will *always* work, you probably want this one.\n\ncase $host_os in\naix[[4-9]]*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nbeos*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nbsdi[[45]]*)\n  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'\n  lt_cv_file_magic_cmd='/usr/bin/file -L'\n  lt_cv_file_magic_test_file=/shlib/libc.so\n  ;;\n\ncygwin*)\n  # func_win32_libid is a shell function defined in ltmain.sh\n  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'\n  lt_cv_file_magic_cmd='func_win32_libid'\n  ;;\n\nmingw* | pw32*)\n  # Base MSYS/MinGW do not provide the 'file' command needed by\n  # func_win32_libid shell function, so use a weaker test based on 'objdump',\n  # unless we find 'file', for example because we are cross-compiling.\n  if ( file / ) >/dev/null 2>&1; then\n    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'\n    lt_cv_file_magic_cmd='func_win32_libid'\n  else\n    # Keep this pattern in sync with the one in func_win32_libid.\n    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'\n    lt_cv_file_magic_cmd='$OBJDUMP -f'\n  fi\n  ;;\n\ncegcc*)\n  # use the weaker test based on 'objdump'. See mingw*.\n  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'\n  lt_cv_file_magic_cmd='$OBJDUMP -f'\n  ;;\n\ndarwin* | rhapsody*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nfreebsd* | dragonfly*)\n  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then\n    case $host_cpu in\n    i*86 )\n      # Not sure whether the presence of OpenBSD here was a mistake.\n      # Let's accept both of them until this is cleared up.\n      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'\n      lt_cv_file_magic_cmd=/usr/bin/file\n      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`\n      ;;\n    esac\n  else\n    lt_cv_deplibs_check_method=pass_all\n  fi\n  ;;\n\nhaiku*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nhpux10.20* | hpux11*)\n  lt_cv_file_magic_cmd=/usr/bin/file\n  case $host_cpu in\n  ia64*)\n    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'\n    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so\n    ;;\n  hppa*64*)\n    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\\.[0-9]']\n    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl\n    ;;\n  *)\n    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\\.[[0-9]]) shared library'\n    lt_cv_file_magic_test_file=/usr/lib/libc.sl\n    ;;\n  esac\n  ;;\n\ninterix[[3-9]]*)\n  # PIC code is broken on Interix 3.x, that's why |\\.a not |_pic\\.a here\n  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\\.so|\\.a)$'\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $LD in\n  *-32|*\"-32 \") libmagic=32-bit;;\n  *-n32|*\"-n32 \") libmagic=N32;;\n  *-64|*\"-64 \") libmagic=64-bit;;\n  *) libmagic=never-match;;\n  esac\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\n# This must be glibc/ELF.\nlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nnetbsd* | netbsdelf*-gnu)\n  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then\n    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\\.so\\.[[0-9]]+\\.[[0-9]]+|_pic\\.a)$'\n  else\n    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\\.so|_pic\\.a)$'\n  fi\n  ;;\n\nnewos6*)\n  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'\n  lt_cv_file_magic_cmd=/usr/bin/file\n  lt_cv_file_magic_test_file=/usr/lib/libnls.so\n  ;;\n\n*nto* | *qnx*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nopenbsd* | bitrig*)\n  if test -z \"`echo __ELF__ | $CC -E - | $GREP __ELF__`\"; then\n    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\\.so\\.[[0-9]]+\\.[[0-9]]+|\\.so|_pic\\.a)$'\n  else\n    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\\.so\\.[[0-9]]+\\.[[0-9]]+|_pic\\.a)$'\n  fi\n  ;;\n\nosf3* | osf4* | osf5*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nrdos*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsolaris*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsysv4 | sysv4.3*)\n  case $host_vendor in\n  motorola)\n    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'\n    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`\n    ;;\n  ncr)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  sequent)\n    lt_cv_file_magic_cmd='/bin/file'\n    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'\n    ;;\n  sni)\n    lt_cv_file_magic_cmd='/bin/file'\n    lt_cv_deplibs_check_method=\"file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib\"\n    lt_cv_file_magic_test_file=/lib/libc.so\n    ;;\n  siemens)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  pc)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  esac\n  ;;\n\ntpf*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\nos2*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\nesac\n])\n\nfile_magic_glob=\nwant_nocaseglob=no\nif test \"$build\" = \"$host\"; then\n  case $host_os in\n  mingw* | pw32*)\n    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then\n      want_nocaseglob=yes\n    else\n      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e \"s/\\(..\\)/s\\/[[\\1]]\\/[[\\1]]\\/g;/g\"`\n    fi\n    ;;\n  esac\nfi\n\nfile_magic_cmd=$lt_cv_file_magic_cmd\ndeplibs_check_method=$lt_cv_deplibs_check_method\ntest -z \"$deplibs_check_method\" && deplibs_check_method=unknown\n\n_LT_DECL([], [deplibs_check_method], [1],\n    [Method to check whether dependent libraries are shared objects])\n_LT_DECL([], [file_magic_cmd], [1],\n    [Command to use when deplibs_check_method = \"file_magic\"])\n_LT_DECL([], [file_magic_glob], [1],\n    [How to find potential files when deplibs_check_method = \"file_magic\"])\n_LT_DECL([], [want_nocaseglob], [1],\n    [Find potential files using nocaseglob when deplibs_check_method = \"file_magic\"])\n])# _LT_CHECK_MAGIC_METHOD\n\n\n# LT_PATH_NM\n# ----------\n# find the pathname to a BSD- or MS-compatible name lister\nAC_DEFUN([LT_PATH_NM],\n[AC_REQUIRE([AC_PROG_CC])dnl\nAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,\n[if test -n \"$NM\"; then\n  # Let the user override the test.\n  lt_cv_path_NM=$NM\nelse\n  lt_nm_to_check=${ac_tool_prefix}nm\n  if test -n \"$ac_tool_prefix\" && test \"$build\" = \"$host\"; then\n    lt_nm_to_check=\"$lt_nm_to_check nm\"\n  fi\n  for lt_tmp_nm in $lt_nm_to_check; do\n    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\n    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do\n      IFS=$lt_save_ifs\n      test -z \"$ac_dir\" && ac_dir=.\n      tmp_nm=$ac_dir/$lt_tmp_nm\n      if test -f \"$tmp_nm\" || test -f \"$tmp_nm$ac_exeext\"; then\n\t# Check to see if the nm accepts a BSD-compat flag.\n\t# Adding the 'sed 1q' prevents false positives on HP-UX, which says:\n\t#   nm: unknown option \"B\" ignored\n\t# Tru64's nm complains that /dev/null is an invalid object file\n\t# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty\n\tcase $build_os in\n\tmingw*) lt_bad_file=conftest.nm/nofile ;;\n\t*) lt_bad_file=/dev/null ;;\n\tesac\n\tcase `\"$tmp_nm\" -B $lt_bad_file 2>&1 | sed '1q'` in\n\t*$lt_bad_file* | *'Invalid file or object type'*)\n\t  lt_cv_path_NM=\"$tmp_nm -B\"\n\t  break 2\n\t  ;;\n\t*)\n\t  case `\"$tmp_nm\" -p /dev/null 2>&1 | sed '1q'` in\n\t  */dev/null*)\n\t    lt_cv_path_NM=\"$tmp_nm -p\"\n\t    break 2\n\t    ;;\n\t  *)\n\t    lt_cv_path_NM=${lt_cv_path_NM=\"$tmp_nm\"} # keep the first match, but\n\t    continue # so that we can try to find one that supports BSD flags\n\t    ;;\n\t  esac\n\t  ;;\n\tesac\n      fi\n    done\n    IFS=$lt_save_ifs\n  done\n  : ${lt_cv_path_NM=no}\nfi])\nif test no != \"$lt_cv_path_NM\"; then\n  NM=$lt_cv_path_NM\nelse\n  # Didn't find any BSD compatible name lister, look for dumpbin.\n  if test -n \"$DUMPBIN\"; then :\n    # Let the user override the test.\n  else\n    AC_CHECK_TOOLS(DUMPBIN, [dumpbin \"link -dump\"], :)\n    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in\n    *COFF*)\n      DUMPBIN=\"$DUMPBIN -symbols -headers\"\n      ;;\n    *)\n      DUMPBIN=:\n      ;;\n    esac\n  fi\n  AC_SUBST([DUMPBIN])\n  if test : != \"$DUMPBIN\"; then\n    NM=$DUMPBIN\n  fi\nfi\ntest -z \"$NM\" && NM=nm\nAC_SUBST([NM])\n_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl\n\nAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],\n  [lt_cv_nm_interface=\"BSD nm\"\n  echo \"int some_variable = 0;\" > conftest.$ac_ext\n  (eval echo \"\\\"\\$as_me:$LINENO: $ac_compile\\\"\" >&AS_MESSAGE_LOG_FD)\n  (eval \"$ac_compile\" 2>conftest.err)\n  cat conftest.err >&AS_MESSAGE_LOG_FD\n  (eval echo \"\\\"\\$as_me:$LINENO: $NM \\\\\\\"conftest.$ac_objext\\\\\\\"\\\"\" >&AS_MESSAGE_LOG_FD)\n  (eval \"$NM \\\"conftest.$ac_objext\\\"\" 2>conftest.err > conftest.out)\n  cat conftest.err >&AS_MESSAGE_LOG_FD\n  (eval echo \"\\\"\\$as_me:$LINENO: output\\\"\" >&AS_MESSAGE_LOG_FD)\n  cat conftest.out >&AS_MESSAGE_LOG_FD\n  if $GREP 'External.*some_variable' conftest.out > /dev/null; then\n    lt_cv_nm_interface=\"MS dumpbin\"\n  fi\n  rm -f conftest*])\n])# LT_PATH_NM\n\n# Old names:\nAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])\nAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AM_PROG_NM], [])\ndnl AC_DEFUN([AC_PROG_NM], [])\n\n# _LT_CHECK_SHAREDLIB_FROM_LINKLIB\n# --------------------------------\n# how to determine the name of the shared library\n# associated with a specific link library.\n#  -- PORTME fill in with the dynamic library characteristics\nm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],\n[m4_require([_LT_DECL_EGREP])\nm4_require([_LT_DECL_OBJDUMP])\nm4_require([_LT_DECL_DLLTOOL])\nAC_CACHE_CHECK([how to associate runtime and link libraries],\nlt_cv_sharedlib_from_linklib_cmd,\n[lt_cv_sharedlib_from_linklib_cmd='unknown'\n\ncase $host_os in\ncygwin* | mingw* | pw32* | cegcc*)\n  # two different shell functions defined in ltmain.sh;\n  # decide which one to use based on capabilities of $DLLTOOL\n  case `$DLLTOOL --help 2>&1` in\n  *--identify-strict*)\n    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib\n    ;;\n  *)\n    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback\n    ;;\n  esac\n  ;;\n*)\n  # fallback: assume linklib IS sharedlib\n  lt_cv_sharedlib_from_linklib_cmd=$ECHO\n  ;;\nesac\n])\nsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd\ntest -z \"$sharedlib_from_linklib_cmd\" && sharedlib_from_linklib_cmd=$ECHO\n\n_LT_DECL([], [sharedlib_from_linklib_cmd], [1],\n    [Command to associate shared and link libraries])\n])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB\n\n\n# _LT_PATH_MANIFEST_TOOL\n# ----------------------\n# locate the manifest tool\nm4_defun([_LT_PATH_MANIFEST_TOOL],\n[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)\ntest -z \"$MANIFEST_TOOL\" && MANIFEST_TOOL=mt\nAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],\n  [lt_cv_path_mainfest_tool=no\n  echo \"$as_me:$LINENO: $MANIFEST_TOOL '-?'\" >&AS_MESSAGE_LOG_FD\n  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out\n  cat conftest.err >&AS_MESSAGE_LOG_FD\n  if $GREP 'Manifest Tool' conftest.out > /dev/null; then\n    lt_cv_path_mainfest_tool=yes\n  fi\n  rm -f conftest*])\nif test yes != \"$lt_cv_path_mainfest_tool\"; then\n  MANIFEST_TOOL=:\nfi\n_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl\n])# _LT_PATH_MANIFEST_TOOL\n\n\n# _LT_DLL_DEF_P([FILE])\n# ---------------------\n# True iff FILE is a Windows DLL '.def' file.\n# Keep in sync with func_dll_def_p in the libtool script\nAC_DEFUN([_LT_DLL_DEF_P],\n[dnl\n  test DEF = \"`$SED -n dnl\n    -e '\\''s/^[[\t ]]*//'\\'' dnl Strip leading whitespace\n    -e '\\''/^\\(;.*\\)*$/d'\\'' dnl      Delete empty lines and comments\n    -e '\\''s/^\\(EXPORTS\\|LIBRARY\\)\\([[\t ]].*\\)*$/DEF/p'\\'' dnl\n    -e q dnl                          Only consider the first \"real\" line\n    $1`\" dnl\n])# _LT_DLL_DEF_P\n\n\n# LT_LIB_M\n# --------\n# check for math library\nAC_DEFUN([LT_LIB_M],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\nLIBM=\ncase $host in\n*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)\n  # These system don't have libm, or don't need it\n  ;;\n*-ncr-sysv4.3*)\n  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)\n  AC_CHECK_LIB(m, cos, LIBM=\"$LIBM -lm\")\n  ;;\n*)\n  AC_CHECK_LIB(m, cos, LIBM=-lm)\n  ;;\nesac\nAC_SUBST([LIBM])\n])# LT_LIB_M\n\n# Old name:\nAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_CHECK_LIBM], [])\n\n\n# _LT_COMPILER_NO_RTTI([TAGNAME])\n# -------------------------------\nm4_defun([_LT_COMPILER_NO_RTTI],\n[m4_require([_LT_TAG_COMPILER])dnl\n\n_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=\n\nif test yes = \"$GCC\"; then\n  case $cc_basename in\n  nvcc*)\n    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;\n  *)\n    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;\n  esac\n\n  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],\n    lt_cv_prog_compiler_rtti_exceptions,\n    [-fno-rtti -fno-exceptions], [],\n    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=\"$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions\"])\nfi\n_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],\n\t[Compiler flag to turn off builtin functions])\n])# _LT_COMPILER_NO_RTTI\n\n\n# _LT_CMD_GLOBAL_SYMBOLS\n# ----------------------\nm4_defun([_LT_CMD_GLOBAL_SYMBOLS],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\nAC_REQUIRE([AC_PROG_CC])dnl\nAC_REQUIRE([AC_PROG_AWK])dnl\nAC_REQUIRE([LT_PATH_NM])dnl\nAC_REQUIRE([LT_PATH_LD])dnl\nm4_require([_LT_DECL_SED])dnl\nm4_require([_LT_DECL_EGREP])dnl\nm4_require([_LT_TAG_COMPILER])dnl\n\n# Check for command to grab the raw symbol name followed by C symbol from nm.\nAC_MSG_CHECKING([command to parse $NM output from $compiler object])\nAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],\n[\n# These are sane defaults that work on at least a few old systems.\n# [They come from Ultrix.  What could be older than Ultrix?!! ;)]\n\n# Character class describing NM global symbol codes.\nsymcode='[[BCDEGRST]]'\n\n# Regexp to match symbols that can be accessed directly from C.\nsympat='\\([[_A-Za-z]][[_A-Za-z0-9]]*\\)'\n\n# Define system-specific variables.\ncase $host_os in\naix*)\n  symcode='[[BCDT]]'\n  ;;\ncygwin* | mingw* | pw32* | cegcc*)\n  symcode='[[ABCDGISTW]]'\n  ;;\nhpux*)\n  if test ia64 = \"$host_cpu\"; then\n    symcode='[[ABCDEGRST]]'\n  fi\n  ;;\nirix* | nonstopux*)\n  symcode='[[BCDEGRST]]'\n  ;;\nosf*)\n  symcode='[[BCDEGQRST]]'\n  ;;\nsolaris*)\n  symcode='[[BDRT]]'\n  ;;\nsco3.2v5*)\n  symcode='[[DT]]'\n  ;;\nsysv4.2uw2*)\n  symcode='[[DT]]'\n  ;;\nsysv5* | sco5v6* | unixware* | OpenUNIX*)\n  symcode='[[ABDT]]'\n  ;;\nsysv4)\n  symcode='[[DFNSTU]]'\n  ;;\nesac\n\n# If we're using GNU nm, then use its standard symbol codes.\ncase `$NM -V 2>&1` in\n*GNU* | *'with BFD'*)\n  symcode='[[ABCDGIRSTW]]' ;;\nesac\n\nif test \"$lt_cv_nm_interface\" = \"MS dumpbin\"; then\n  # Gets list of data symbols to import.\n  lt_cv_sys_global_symbol_to_import=\"sed -n -e 's/^I .* \\(.*\\)$/\\1/p'\"\n  # Adjust the below global symbol transforms to fixup imported variables.\n  lt_cdecl_hook=\" -e 's/^I .* \\(.*\\)$/extern __declspec(dllimport) char \\1;/p'\"\n  lt_c_name_hook=\" -e 's/^I .* \\(.*\\)$/  {\\\"\\1\\\", (void *) 0},/p'\"\n  lt_c_name_lib_hook=\"\\\n  -e 's/^I .* \\(lib.*\\)$/  {\\\"\\1\\\", (void *) 0},/p'\\\n  -e 's/^I .* \\(.*\\)$/  {\\\"lib\\1\\\", (void *) 0},/p'\"\nelse\n  # Disable hooks by default.\n  lt_cv_sys_global_symbol_to_import=\n  lt_cdecl_hook=\n  lt_c_name_hook=\n  lt_c_name_lib_hook=\nfi\n\n# Transform an extracted symbol line into a proper C declaration.\n# Some systems (esp. on ia64) link data and code symbols differently,\n# so use this general approach.\nlt_cv_sys_global_symbol_to_cdecl=\"sed -n\"\\\n$lt_cdecl_hook\\\n\" -e 's/^T .* \\(.*\\)$/extern int \\1();/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(.*\\)$/extern char \\1;/p'\"\n\n# Transform an extracted symbol line into symbol name and symbol address\nlt_cv_sys_global_symbol_to_c_name_address=\"sed -n\"\\\n$lt_c_name_hook\\\n\" -e 's/^: \\(.*\\) .*$/  {\\\"\\1\\\", (void *) 0},/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(.*\\)$/  {\\\"\\1\\\", (void *) \\&\\1},/p'\"\n\n# Transform an extracted symbol line into symbol name with lib prefix and\n# symbol address.\nlt_cv_sys_global_symbol_to_c_name_address_lib_prefix=\"sed -n\"\\\n$lt_c_name_lib_hook\\\n\" -e 's/^: \\(.*\\) .*$/  {\\\"\\1\\\", (void *) 0},/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(lib.*\\)$/  {\\\"\\1\\\", (void *) \\&\\1},/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(.*\\)$/  {\\\"lib\\1\\\", (void *) \\&\\1},/p'\"\n\n# Handle CRLF in mingw tool chain\nopt_cr=\ncase $build_os in\nmingw*)\n  opt_cr=`$ECHO 'x\\{0,1\\}' | tr x '\\015'` # option cr in regexp\n  ;;\nesac\n\n# Try without a prefix underscore, then with it.\nfor ac_symprfx in \"\" \"_\"; do\n\n  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.\n  symxfrm=\"\\\\1 $ac_symprfx\\\\2 \\\\2\"\n\n  # Write the raw and C identifiers.\n  if test \"$lt_cv_nm_interface\" = \"MS dumpbin\"; then\n    # Fake it for dumpbin and say T for any non-static function,\n    # D for any global variable and I for any imported variable.\n    # Also find C++ and __fastcall symbols from MSVC++,\n    # which start with @ or ?.\n    lt_cv_sys_global_symbol_pipe=\"$AWK ['\"\\\n\"     {last_section=section; section=\\$ 3};\"\\\n\"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};\"\\\n\"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};\"\\\n\"     /^ *Symbol name *: /{split(\\$ 0,sn,\\\":\\\"); si=substr(sn[2],2)};\"\\\n\"     /^ *Type *: code/{print \\\"T\\\",si,substr(si,length(prfx))};\"\\\n\"     /^ *Type *: data/{print \\\"I\\\",si,substr(si,length(prfx))};\"\\\n\"     \\$ 0!~/External *\\|/{next};\"\\\n\"     / 0+ UNDEF /{next}; / UNDEF \\([^|]\\)*()/{next};\"\\\n\"     {if(hide[section]) next};\"\\\n\"     {f=\\\"D\\\"}; \\$ 0~/\\(\\).*\\|/{f=\\\"T\\\"};\"\\\n\"     {split(\\$ 0,a,/\\||\\r/); split(a[2],s)};\"\\\n\"     s[1]~/^[@?]/{print f,s[1],s[1]; next};\"\\\n\"     s[1]~prfx {split(s[1],t,\\\"@\\\"); print f,t[1],substr(t[1],length(prfx))}\"\\\n\"     ' prfx=^$ac_symprfx]\"\n  else\n    lt_cv_sys_global_symbol_pipe=\"sed -n -e 's/^.*[[\t ]]\\($symcode$symcode*\\)[[\t ]][[\t ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'\"\n  fi\n  lt_cv_sys_global_symbol_pipe=\"$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'\"\n\n  # Check to see that the pipe works correctly.\n  pipe_works=no\n\n  rm -f conftest*\n  cat > conftest.$ac_ext <<_LT_EOF\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nchar nm_test_var;\nvoid nm_test_func(void);\nvoid nm_test_func(void){}\n#ifdef __cplusplus\n}\n#endif\nint main(){nm_test_var='a';nm_test_func();return(0);}\n_LT_EOF\n\n  if AC_TRY_EVAL(ac_compile); then\n    # Now try to grab the symbols.\n    nlist=conftest.nm\n    if AC_TRY_EVAL(NM conftest.$ac_objext \\| \"$lt_cv_sys_global_symbol_pipe\" \\> $nlist) && test -s \"$nlist\"; then\n      # Try sorting and uniquifying the output.\n      if sort \"$nlist\" | uniq > \"$nlist\"T; then\n\tmv -f \"$nlist\"T \"$nlist\"\n      else\n\trm -f \"$nlist\"T\n      fi\n\n      # Make sure that we snagged all the symbols we need.\n      if $GREP ' nm_test_var$' \"$nlist\" >/dev/null; then\n\tif $GREP ' nm_test_func$' \"$nlist\" >/dev/null; then\n\t  cat <<_LT_EOF > conftest.$ac_ext\n/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */\n#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE\n/* DATA imports from DLLs on WIN32 can't be const, because runtime\n   relocations are performed -- see ld's documentation on pseudo-relocs.  */\n# define LT@&t@_DLSYM_CONST\n#elif defined __osf__\n/* This system does not cope well with relocations in const data.  */\n# define LT@&t@_DLSYM_CONST\n#else\n# define LT@&t@_DLSYM_CONST const\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n_LT_EOF\n\t  # Now generate the symbol file.\n\t  eval \"$lt_cv_sys_global_symbol_to_cdecl\"' < \"$nlist\" | $GREP -v main >> conftest.$ac_ext'\n\n\t  cat <<_LT_EOF >> conftest.$ac_ext\n\n/* The mapping between symbol names and symbols.  */\nLT@&t@_DLSYM_CONST struct {\n  const char *name;\n  void       *address;\n}\nlt__PROGRAM__LTX_preloaded_symbols[[]] =\n{\n  { \"@PROGRAM@\", (void *) 0 },\n_LT_EOF\n\t  $SED \"s/^$symcode$symcode* .* \\(.*\\)$/  {\\\"\\1\\\", (void *) \\&\\1},/\" < \"$nlist\" | $GREP -v main >> conftest.$ac_ext\n\t  cat <<\\_LT_EOF >> conftest.$ac_ext\n  {0, (void *) 0}\n};\n\n/* This works around a problem in FreeBSD linker */\n#ifdef FREEBSD_WORKAROUND\nstatic const void *lt_preloaded_setup() {\n  return lt__PROGRAM__LTX_preloaded_symbols;\n}\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n_LT_EOF\n\t  # Now try linking the two files.\n\t  mv conftest.$ac_objext conftstm.$ac_objext\n\t  lt_globsym_save_LIBS=$LIBS\n\t  lt_globsym_save_CFLAGS=$CFLAGS\n\t  LIBS=conftstm.$ac_objext\n\t  CFLAGS=\"$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)\"\n\t  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then\n\t    pipe_works=yes\n\t  fi\n\t  LIBS=$lt_globsym_save_LIBS\n\t  CFLAGS=$lt_globsym_save_CFLAGS\n\telse\n\t  echo \"cannot find nm_test_func in $nlist\" >&AS_MESSAGE_LOG_FD\n\tfi\n      else\n\techo \"cannot find nm_test_var in $nlist\" >&AS_MESSAGE_LOG_FD\n      fi\n    else\n      echo \"cannot run $lt_cv_sys_global_symbol_pipe\" >&AS_MESSAGE_LOG_FD\n    fi\n  else\n    echo \"$progname: failed program was:\" >&AS_MESSAGE_LOG_FD\n    cat conftest.$ac_ext >&5\n  fi\n  rm -rf conftest* conftst*\n\n  # Do not use the global_symbol_pipe unless it works.\n  if test yes = \"$pipe_works\"; then\n    break\n  else\n    lt_cv_sys_global_symbol_pipe=\n  fi\ndone\n])\nif test -z \"$lt_cv_sys_global_symbol_pipe\"; then\n  lt_cv_sys_global_symbol_to_cdecl=\nfi\nif test -z \"$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl\"; then\n  AC_MSG_RESULT(failed)\nelse\n  AC_MSG_RESULT(ok)\nfi\n\n# Response file support.\nif test \"$lt_cv_nm_interface\" = \"MS dumpbin\"; then\n  nm_file_list_spec='@'\nelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then\n  nm_file_list_spec='@'\nfi\n\n_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],\n    [Take the output of nm and produce a listing of raw symbols and C names])\n_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],\n    [Transform the output of nm in a proper C declaration])\n_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],\n    [Transform the output of nm into a list of symbols to manually relocate])\n_LT_DECL([global_symbol_to_c_name_address],\n    [lt_cv_sys_global_symbol_to_c_name_address], [1],\n    [Transform the output of nm in a C name address pair])\n_LT_DECL([global_symbol_to_c_name_address_lib_prefix],\n    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],\n    [Transform the output of nm in a C name address pair when lib prefix is needed])\n_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],\n    [The name lister interface])\n_LT_DECL([], [nm_file_list_spec], [1],\n    [Specify filename containing input files for $NM])\n]) # _LT_CMD_GLOBAL_SYMBOLS\n\n\n# _LT_COMPILER_PIC([TAGNAME])\n# ---------------------------\nm4_defun([_LT_COMPILER_PIC],\n[m4_require([_LT_TAG_COMPILER])dnl\n_LT_TAGVAR(lt_prog_compiler_wl, $1)=\n_LT_TAGVAR(lt_prog_compiler_pic, $1)=\n_LT_TAGVAR(lt_prog_compiler_static, $1)=\n\nm4_if([$1], [CXX], [\n  # C++ specific cases for pic, static, wl, etc.\n  if test yes = \"$GXX\"; then\n    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\n    case $host_os in\n    aix*)\n      # All AIX code is PIC.\n      if test ia64 = \"$host_cpu\"; then\n\t# AIX 5 now supports IA64 processor\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      fi\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n        ;;\n      m68k)\n            # FIXME: we need at least 68020 code to build shared libraries, but\n            # adding the '-m68020' flag to GCC prevents building anything better,\n            # like '-m68040'.\n            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'\n        ;;\n      esac\n      ;;\n\n    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)\n      # PIC is the default for these OSes.\n      ;;\n    mingw* | cygwin* | os2* | pw32* | cegcc*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      # Although the cygwin gcc ignores -fPIC, still need this for old-style\n      # (--disable-auto-import) libraries\n      m4_if([$1], [GCJ], [],\n\t[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])\n      case $host_os in\n      os2*)\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'\n\t;;\n      esac\n      ;;\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'\n      ;;\n    *djgpp*)\n      # DJGPP does not support shared libraries at all\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)=\n      ;;\n    haiku*)\n      # PIC is the default for Haiku.\n      # The \"-static\" flag exists, but is broken.\n      _LT_TAGVAR(lt_prog_compiler_static, $1)=\n      ;;\n    interix[[3-9]]*)\n      # Interix 3.x gcc -fpic/-fPIC options generate broken code.\n      # Instead, we relocate shared libraries at runtime.\n      ;;\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic\n      fi\n      ;;\n    hpux*)\n      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit\n      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag\n      # sets the default TLS model and affects inlining.\n      case $host_cpu in\n      hppa*64*)\n\t;;\n      *)\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t;;\n      esac\n      ;;\n    *qnx* | *nto*)\n      # QNX uses GNU C++, but need to define -shared option too, otherwise\n      # it will coredump.\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'\n      ;;\n    *)\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n      ;;\n    esac\n  else\n    case $host_os in\n      aix[[4-9]]*)\n\t# All AIX code is PIC.\n\tif test ia64 = \"$host_cpu\"; then\n\t  # AIX 5 now supports IA64 processor\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\telse\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'\n\tfi\n\t;;\n      chorus*)\n\tcase $cc_basename in\n\tcxch68*)\n\t  # Green Hills C++ Compiler\n\t  # _LT_TAGVAR(lt_prog_compiler_static, $1)=\"--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a\"\n\t  ;;\n\tesac\n\t;;\n      mingw* | cygwin* | os2* | pw32* | cegcc*)\n\t# This hack is so that the source file can tell whether it is being\n\t# built for inclusion in a dll (and should export symbols for example).\n\tm4_if([$1], [GCJ], [],\n\t  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])\n\t;;\n      dgux*)\n\tcase $cc_basename in\n\t  ec++*)\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    ;;\n\t  ghcx*)\n\t    # Green Hills C++ Compiler\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      freebsd* | dragonfly*)\n\t# FreeBSD uses GNU C++\n\t;;\n      hpux9* | hpux10* | hpux11*)\n\tcase $cc_basename in\n\t  CC*)\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'\n\t    if test ia64 != \"$host_cpu\"; then\n\t      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'\n\t    fi\n\t    ;;\n\t  aCC*)\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'\n\t    case $host_cpu in\n\t    hppa*64*|ia64*)\n\t      # +Z the default\n\t      ;;\n\t    *)\n\t      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'\n\t      ;;\n\t    esac\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      interix*)\n\t# This is c89, which is MS Visual C++ (no shared libs)\n\t# Anyone wants to do a port?\n\t;;\n      irix5* | irix6* | nonstopux*)\n\tcase $cc_basename in\n\t  CC*)\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n\t    # CC pic flag -KPIC is the default.\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n\tcase $cc_basename in\n\t  KCC*)\n\t    # KAI C++ Compiler\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t    ;;\n\t  ecpc* )\n\t    # old Intel C++ for x86_64, which still supported -KPIC.\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\t    ;;\n\t  icpc* )\n\t    # Intel C++, used to be incompatible with GCC.\n\t    # ICC 10 doesn't accept -KPIC any more.\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\t    ;;\n\t  pgCC* | pgcpp*)\n\t    # Portland Group C++ compiler\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t    ;;\n\t  cxx*)\n\t    # Compaq C++\n\t    # Make sure the PIC flag is empty.  It appears that all Alpha\n\t    # Linux and Compaq Tru64 Unix objects are PIC.\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)=\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n\t    ;;\n\t  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)\n\t    # IBM XL 8.0, 9.0 on PPC and BlueGene\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'\n\t    ;;\n\t  *)\n\t    case `$CC -V 2>&1 | sed 5q` in\n\t    *Sun\\ C*)\n\t      # Sun C++ 5.9\n\t      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '\n\t      ;;\n\t    esac\n\t    ;;\n\tesac\n\t;;\n      lynxos*)\n\t;;\n      m88k*)\n\t;;\n      mvs*)\n\tcase $cc_basename in\n\t  cxx*)\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      netbsd* | netbsdelf*-gnu)\n\t;;\n      *qnx* | *nto*)\n        # QNX uses GNU C++, but need to define -shared option too, otherwise\n        # it will coredump.\n        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'\n        ;;\n      osf3* | osf4* | osf5*)\n\tcase $cc_basename in\n\t  KCC*)\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'\n\t    ;;\n\t  RCC*)\n\t    # Rational C++ 2.4.1\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n\t    ;;\n\t  cxx*)\n\t    # Digital/Compaq C++\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    # Make sure the PIC flag is empty.  It appears that all Alpha\n\t    # Linux and Compaq Tru64 Unix objects are PIC.\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)=\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      psos*)\n\t;;\n      solaris*)\n\tcase $cc_basename in\n\t  CC* | sunCC*)\n\t    # Sun C++ 4.2, 5.x and Centerline C++\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '\n\t    ;;\n\t  gcx*)\n\t    # Green Hills C++ Compiler\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      sunos4*)\n\tcase $cc_basename in\n\t  CC*)\n\t    # Sun C++ 4.x\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t    ;;\n\t  lcc*)\n\t    # Lucid\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)\n\tcase $cc_basename in\n\t  CC*)\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t    ;;\n\tesac\n\t;;\n      tandem*)\n\tcase $cc_basename in\n\t  NCC*)\n\t    # NonStop-UX NCC 3.20\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      vxworks*)\n\t;;\n      *)\n\t_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no\n\t;;\n    esac\n  fi\n],\n[\n  if test yes = \"$GCC\"; then\n    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\n    case $host_os in\n      aix*)\n      # All AIX code is PIC.\n      if test ia64 = \"$host_cpu\"; then\n\t# AIX 5 now supports IA64 processor\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      fi\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n        ;;\n      m68k)\n            # FIXME: we need at least 68020 code to build shared libraries, but\n            # adding the '-m68020' flag to GCC prevents building anything better,\n            # like '-m68040'.\n            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'\n        ;;\n      esac\n      ;;\n\n    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)\n      # PIC is the default for these OSes.\n      ;;\n\n    mingw* | cygwin* | pw32* | os2* | cegcc*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      # Although the cygwin gcc ignores -fPIC, still need this for old-style\n      # (--disable-auto-import) libraries\n      m4_if([$1], [GCJ], [],\n\t[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])\n      case $host_os in\n      os2*)\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'\n\t;;\n      esac\n      ;;\n\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'\n      ;;\n\n    haiku*)\n      # PIC is the default for Haiku.\n      # The \"-static\" flag exists, but is broken.\n      _LT_TAGVAR(lt_prog_compiler_static, $1)=\n      ;;\n\n    hpux*)\n      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit\n      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag\n      # sets the default TLS model and affects inlining.\n      case $host_cpu in\n      hppa*64*)\n\t# +Z the default\n\t;;\n      *)\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t;;\n      esac\n      ;;\n\n    interix[[3-9]]*)\n      # Interix 3.x gcc -fpic/-fPIC options generate broken code.\n      # Instead, we relocate shared libraries at runtime.\n      ;;\n\n    msdosdjgpp*)\n      # Just because we use GCC doesn't mean we suddenly get shared libraries\n      # on systems that don't support them.\n      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no\n      enable_shared=no\n      ;;\n\n    *nto* | *qnx*)\n      # QNX uses GNU C++, but need to define -shared option too, otherwise\n      # it will coredump.\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic\n      fi\n      ;;\n\n    *)\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n      ;;\n    esac\n\n    case $cc_basename in\n    nvcc*) # Cuda Compiler Driver 2.2\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '\n      if test -n \"$_LT_TAGVAR(lt_prog_compiler_pic, $1)\"; then\n        _LT_TAGVAR(lt_prog_compiler_pic, $1)=\"-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)\"\n      fi\n      ;;\n    esac\n  else\n    # PORTME Check for flag to pass linker flags through the system compiler.\n    case $host_os in\n    aix*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      if test ia64 = \"$host_cpu\"; then\n\t# AIX 5 now supports IA64 processor\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      else\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'\n      fi\n      ;;\n\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'\n      case $cc_basename in\n      nagfor*)\n        # NAG Fortran compiler\n        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'\n        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'\n        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n        ;;\n      esac\n      ;;\n\n    mingw* | cygwin* | pw32* | os2* | cegcc*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      m4_if([$1], [GCJ], [],\n\t[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])\n      case $host_os in\n      os2*)\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'\n\t;;\n      esac\n      ;;\n\n    hpux9* | hpux10* | hpux11*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case $host_cpu in\n      hppa*64*|ia64*)\n\t# +Z the default\n\t;;\n      *)\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'\n\t;;\n      esac\n      # Is there a better lt_prog_compiler_static that works with the bundled CC?\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      # PIC (with -KPIC) is the default.\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n      ;;\n\n    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n      case $cc_basename in\n      # old Intel for x86_64, which still supported -KPIC.\n      ecc*)\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n        ;;\n      # icc used to be incompatible with GCC.\n      # ICC 10 doesn't accept -KPIC any more.\n      icc* | ifort*)\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n        ;;\n      # Lahey Fortran 8.1.\n      lf95*)\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'\n\t;;\n      nagfor*)\n\t# NAG Fortran compiler\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t;;\n      tcc*)\n\t# Fabrice Bellard et al's Tiny C Compiler\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\t;;\n      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)\n        # Portland Group compilers (*not* the Pentium gcc compiler,\n\t# which looks to be a dead project)\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n        ;;\n      ccc*)\n        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n        # All Alpha code is PIC.\n        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n        ;;\n      xl* | bgxl* | bgf* | mpixl*)\n\t# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'\n\t;;\n      *)\n\tcase `$CC -V 2>&1 | sed 5q` in\n\t*Sun\\ Ceres\\ Fortran* | *Sun*Fortran*\\ [[1-7]].* | *Sun*Fortran*\\ 8.[[0-3]]*)\n\t  # Sun Fortran 8.3 passes all unrecognized flags to the linker\n\t  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''\n\t  ;;\n\t*Sun\\ F* | *Sun*Fortran*)\n\t  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '\n\t  ;;\n\t*Sun\\ C*)\n\t  # Sun C 5.9\n\t  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t  ;;\n        *Intel*\\ [[CF]]*Compiler*)\n\t  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\t  ;;\n\t*Portland\\ Group*)\n\t  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t  ;;\n\tesac\n\t;;\n      esac\n      ;;\n\n    newsos6)\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    *nto* | *qnx*)\n      # QNX uses GNU C++, but need to define -shared option too, otherwise\n      # it will coredump.\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'\n      ;;\n\n    osf3* | osf4* | osf5*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      # All OSF/1 code is PIC.\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n      ;;\n\n    rdos*)\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n      ;;\n\n    solaris*)\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      case $cc_basename in\n      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;\n      *)\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;\n      esac\n      ;;\n\n    sunos4*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    sysv4 | sysv4.2uw2* | sysv4.3*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      fi\n      ;;\n\n    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    unicos*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no\n      ;;\n\n    uts4*)\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    *)\n      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no\n      ;;\n    esac\n  fi\n])\ncase $host_os in\n  # For platforms that do not support PIC, -DPIC is meaningless:\n  *djgpp*)\n    _LT_TAGVAR(lt_prog_compiler_pic, $1)=\n    ;;\n  *)\n    _LT_TAGVAR(lt_prog_compiler_pic, $1)=\"$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])\"\n    ;;\nesac\n\nAC_CACHE_CHECK([for $compiler option to produce PIC],\n  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],\n  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])\n_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)\n\n#\n# Check to make sure the PIC flag actually works.\n#\nif test -n \"$_LT_TAGVAR(lt_prog_compiler_pic, $1)\"; then\n  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],\n    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],\n    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],\n    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in\n     \"\" | \" \"*) ;;\n     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=\" $_LT_TAGVAR(lt_prog_compiler_pic, $1)\" ;;\n     esac],\n    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=\n     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])\nfi\n_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],\n\t[Additional compiler flags for building library objects])\n\n_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],\n\t[How to pass a linker flag through the compiler])\n#\n# Check to make sure the static flag actually works.\n#\nwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\\\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\\\"\n_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],\n  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),\n  $lt_tmp_static_flag,\n  [],\n  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])\n_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],\n\t[Compiler flag to prevent dynamic linking])\n])# _LT_COMPILER_PIC\n\n\n# _LT_LINKER_SHLIBS([TAGNAME])\n# ----------------------------\n# See if the linker supports building shared libraries.\nm4_defun([_LT_LINKER_SHLIBS],\n[AC_REQUIRE([LT_PATH_LD])dnl\nAC_REQUIRE([LT_PATH_NM])dnl\nm4_require([_LT_PATH_MANIFEST_TOOL])dnl\nm4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_DECL_EGREP])dnl\nm4_require([_LT_DECL_SED])dnl\nm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl\nm4_require([_LT_TAG_COMPILER])dnl\nAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])\nm4_if([$1], [CXX], [\n  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']\n  case $host_os in\n  aix[[4-9]]*)\n    # If we're using GNU nm, then we don't want the \"-C\" option.\n    # -C means demangle to GNU nm, but means don't demangle to AIX nm.\n    # Without the \"-l\" option, or with the \"-B\" option, AIX nm treats\n    # weak defined symbols like other global defined symbols, whereas\n    # GNU nm marks them as \"W\".\n    # While the 'weak' keyword is ignored in the Export File, we need\n    # it in the Import File for the 'aix-soname' feature, so we have\n    # to replace the \"-B\" option with \"-P\" for AIX nm.\n    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then\n      _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'\n    else\n      _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'\n    fi\n    ;;\n  pw32*)\n    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds\n    ;;\n  cygwin* | mingw* | cegcc*)\n    case $cc_basename in\n    cl*)\n      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'\n      ;;\n    *)\n      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\\([[^ ]]*\\)/\\1 DATA/;s/^.*[[ ]]__nm__\\([[^ ]]*\\)[[ ]][[^ ]]*/\\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\\'' | sort | uniq > $export_symbols'\n      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']\n      ;;\n    esac\n    ;;\n  linux* | k*bsd*-gnu | gnu*)\n    _LT_TAGVAR(link_all_deplibs, $1)=no\n    ;;\n  *)\n    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n    ;;\n  esac\n], [\n  runpath_var=\n  _LT_TAGVAR(allow_undefined_flag, $1)=\n  _LT_TAGVAR(always_export_symbols, $1)=no\n  _LT_TAGVAR(archive_cmds, $1)=\n  _LT_TAGVAR(archive_expsym_cmds, $1)=\n  _LT_TAGVAR(compiler_needs_object, $1)=no\n  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no\n  _LT_TAGVAR(export_dynamic_flag_spec, $1)=\n  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  _LT_TAGVAR(hardcode_automatic, $1)=no\n  _LT_TAGVAR(hardcode_direct, $1)=no\n  _LT_TAGVAR(hardcode_direct_absolute, $1)=no\n  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=\n  _LT_TAGVAR(hardcode_libdir_separator, $1)=\n  _LT_TAGVAR(hardcode_minus_L, $1)=no\n  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported\n  _LT_TAGVAR(inherit_rpath, $1)=no\n  _LT_TAGVAR(link_all_deplibs, $1)=unknown\n  _LT_TAGVAR(module_cmds, $1)=\n  _LT_TAGVAR(module_expsym_cmds, $1)=\n  _LT_TAGVAR(old_archive_from_new_cmds, $1)=\n  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=\n  _LT_TAGVAR(thread_safe_flag_spec, $1)=\n  _LT_TAGVAR(whole_archive_flag_spec, $1)=\n  # include_expsyms should be a list of space-separated symbols to be *always*\n  # included in the symbol list\n  _LT_TAGVAR(include_expsyms, $1)=\n  # exclude_expsyms can be an extended regexp of symbols to exclude\n  # it will be wrapped by ' (' and ')$', so one must not match beginning or\n  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',\n  # as well as any symbol that contains 'd'.\n  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']\n  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out\n  # platforms (ab)use it in PIC code, but their linkers get confused if\n  # the symbol is explicitly referenced.  Since portable code cannot\n  # rely on this symbol name, it's probably fine to never include it in\n  # preloaded symbol tables.\n  # Exclude shared library initialization/finalization symbols.\ndnl Note also adjust exclude_expsyms for C++ above.\n  extract_expsyms_cmds=\n\n  case $host_os in\n  cygwin* | mingw* | pw32* | cegcc*)\n    # FIXME: the MSVC++ port hasn't been tested in a loooong time\n    # When not using gcc, we currently assume that we are using\n    # Microsoft Visual C++.\n    if test yes != \"$GCC\"; then\n      with_gnu_ld=no\n    fi\n    ;;\n  interix*)\n    # we just hope/assume this is gcc and not c89 (= MSVC++)\n    with_gnu_ld=yes\n    ;;\n  openbsd* | bitrig*)\n    with_gnu_ld=no\n    ;;\n  linux* | k*bsd*-gnu | gnu*)\n    _LT_TAGVAR(link_all_deplibs, $1)=no\n    ;;\n  esac\n\n  _LT_TAGVAR(ld_shlibs, $1)=yes\n\n  # On some targets, GNU ld is compatible enough with the native linker\n  # that we're better off using the native interface for both.\n  lt_use_gnu_ld_interface=no\n  if test yes = \"$with_gnu_ld\"; then\n    case $host_os in\n      aix*)\n\t# The AIX port of GNU ld has always aspired to compatibility\n\t# with the native linker.  However, as the warning in the GNU ld\n\t# block says, versions before 2.19.5* couldn't really create working\n\t# shared libraries, regardless of the interface used.\n\tcase `$LD -v 2>&1` in\n\t  *\\ \\(GNU\\ Binutils\\)\\ 2.19.5*) ;;\n\t  *\\ \\(GNU\\ Binutils\\)\\ 2.[[2-9]]*) ;;\n\t  *\\ \\(GNU\\ Binutils\\)\\ [[3-9]]*) ;;\n\t  *)\n\t    lt_use_gnu_ld_interface=yes\n\t    ;;\n\tesac\n\t;;\n      *)\n\tlt_use_gnu_ld_interface=yes\n\t;;\n    esac\n  fi\n\n  if test yes = \"$lt_use_gnu_ld_interface\"; then\n    # If archive_cmds runs LD, not CC, wlarc should be empty\n    wlarc='$wl'\n\n    # Set some defaults for GNU ld with shared library support. These\n    # are reset later if shared libraries are not supported. Putting them\n    # here allows them to be overridden if necessary.\n    runpath_var=LD_RUN_PATH\n    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'\n    # ancient GNU ld didn't support --whole-archive et. al.\n    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then\n      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'\n    else\n      _LT_TAGVAR(whole_archive_flag_spec, $1)=\n    fi\n    supports_anon_versioning=no\n    case `$LD -v | $SED -e 's/([^)]\\+)\\s\\+//' 2>&1` in\n      *GNU\\ gold*) supports_anon_versioning=yes ;;\n      *\\ [[01]].* | *\\ 2.[[0-9]].* | *\\ 2.10.*) ;; # catch versions < 2.11\n      *\\ 2.11.93.0.2\\ *) supports_anon_versioning=yes ;; # RH7.3 ...\n      *\\ 2.11.92.0.12\\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...\n      *\\ 2.11.*) ;; # other 2.11 versions\n      *) supports_anon_versioning=yes ;;\n    esac\n\n    # See if GNU ld supports shared libraries.\n    case $host_os in\n    aix[[3-9]]*)\n      # On AIX/PPC, the GNU linker is very broken\n      if test ia64 != \"$host_cpu\"; then\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n\tcat <<_LT_EOF 1>&2\n\n*** Warning: the GNU linker, at least up to release 2.19, is reported\n*** to be unable to reliably create shared libraries on AIX.\n*** Therefore, libtool is disabling shared libraries support.  If you\n*** really care for shared libraries, you may want to install binutils\n*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.\n*** You will then need to restart the configuration process.\n\n_LT_EOF\n      fi\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n            _LT_TAGVAR(archive_expsym_cmds, $1)=''\n        ;;\n      m68k)\n            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO \"#define NAME $libname\" > $output_objdir/a2ixlibrary.data~$ECHO \"#define LIBRARY_ID 1\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define VERSION $major\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define REVISION $revision\" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'\n            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n            _LT_TAGVAR(hardcode_minus_L, $1)=yes\n        ;;\n      esac\n      ;;\n\n    beos*)\n      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\t_LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t# Joseph Beckenbach <jrb3@best.com> says some releases of gcc\n\t# support --undefined.  This deserves some investigation.  FIXME\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n      else\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n\n    cygwin* | mingw* | pw32* | cegcc*)\n      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,\n      # as there is no search path for DLLs.\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'\n      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n      _LT_TAGVAR(always_export_symbols, $1)=no\n      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\\([[^ ]]*\\)/\\1 DATA/;s/^.*[[ ]]__nm__\\([[^ ]]*\\)[[ ]][[^ ]]*/\\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\\'' | sort | uniq > $export_symbols'\n      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']\n\n      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then\n        _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'\n\t# If the export-symbols file already is a .def file, use it as\n\t# is; otherwise, prepend EXPORTS...\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then\n          cp $export_symbols $output_objdir/$soname.def;\n        else\n          echo EXPORTS > $output_objdir/$soname.def;\n          cat $export_symbols >> $output_objdir/$soname.def;\n        fi~\n        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'\n      else\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n\n    haiku*)\n      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n      _LT_TAGVAR(link_all_deplibs, $1)=yes\n      ;;\n\n    os2*)\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n      shrext_cmds=.dll\n      _LT_TAGVAR(archive_cmds, $1)='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\temxexp $libobjs | $SED /\"_DLL_InitTerm\"/d >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\tprefix_cmds=\"$SED\"~\n\tif test EXPORTS = \"`$SED 1q $export_symbols`\"; then\n\t  prefix_cmds=\"$prefix_cmds -e 1d\";\n\tfi~\n\tprefix_cmds=\"$prefix_cmds -e \\\"s/^\\(.*\\)$/_\\1/g\\\"\"~\n\tcat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'\n      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n      ;;\n\n    interix[[3-9]]*)\n      _LT_TAGVAR(hardcode_direct, $1)=no\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.\n      # Instead, shared libraries are loaded at an image base (0x10000000 by\n      # default) and relocated if they conflict, which is a slow very memory\n      # consuming and fragmenting process.  To avoid this, we pick a random,\n      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link\n      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.\n      _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'\n      _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'\n      ;;\n\n    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)\n      tmp_diet=no\n      if test linux-dietlibc = \"$host_os\"; then\n\tcase $cc_basename in\n\t  diet\\ *) tmp_diet=yes;;\t# linux-dietlibc with static linking (!diet-dyn)\n\tesac\n      fi\n      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \\\n\t && test no = \"$tmp_diet\"\n      then\n\ttmp_addflag=' $pic_flag'\n\ttmp_sharedflag='-shared'\n\tcase $cc_basename,$host_cpu in\n        pgcc*)\t\t\t\t# Portland Group C compiler\n\t  _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'\n\t  tmp_addflag=' $pic_flag'\n\t  ;;\n\tpgf77* | pgf90* | pgf95* | pgfortran*)\n\t\t\t\t\t# Portland Group f77 and f90 compilers\n\t  _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'\n\t  tmp_addflag=' $pic_flag -Mnomain' ;;\n\tecc*,ia64* | icc*,ia64*)\t# Intel C compiler on ia64\n\t  tmp_addflag=' -i_dynamic' ;;\n\tefc*,ia64* | ifort*,ia64*)\t# Intel Fortran compiler on ia64\n\t  tmp_addflag=' -i_dynamic -nofor_main' ;;\n\tifc* | ifort*)\t\t\t# Intel Fortran compiler\n\t  tmp_addflag=' -nofor_main' ;;\n\tlf95*)\t\t\t\t# Lahey Fortran 8.1\n\t  _LT_TAGVAR(whole_archive_flag_spec, $1)=\n\t  tmp_sharedflag='--shared' ;;\n        nagfor*)                        # NAGFOR 5.3\n          tmp_sharedflag='-Wl,-shared' ;;\n\txl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)\n\t  tmp_sharedflag='-qmkshrobj'\n\t  tmp_addflag= ;;\n\tnvcc*)\t# Cuda Compiler Driver 2.2\n\t  _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'\n\t  _LT_TAGVAR(compiler_needs_object, $1)=yes\n\t  ;;\n\tesac\n\tcase `$CC -V 2>&1 | sed 5q` in\n\t*Sun\\ C*)\t\t\t# Sun C 5.9\n\t  _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'\n\t  _LT_TAGVAR(compiler_needs_object, $1)=yes\n\t  tmp_sharedflag='-G' ;;\n\t*Sun\\ F*)\t\t\t# Sun Fortran 8.3\n\t  tmp_sharedflag='-G' ;;\n\tesac\n\t_LT_TAGVAR(archive_cmds, $1)='$CC '\"$tmp_sharedflag\"\"$tmp_addflag\"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\n        if test yes = \"$supports_anon_versioning\"; then\n          _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $output_objdir/$libname.ver~\n            cat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n            echo \"local: *; };\" >> $output_objdir/$libname.ver~\n            $CC '\"$tmp_sharedflag\"\"$tmp_addflag\"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'\n        fi\n\n\tcase $cc_basename in\n\ttcc*)\n\t  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'\n\t  ;;\n\txlf* | bgf* | bgxlf* | mpixlf*)\n\t  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself\n\t  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n\t  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'\n\t  if test yes = \"$supports_anon_versioning\"; then\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $output_objdir/$libname.ver~\n              cat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n              echo \"local: *; };\" >> $output_objdir/$libname.ver~\n              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'\n\t  fi\n\t  ;;\n\tesac\n      else\n        _LT_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n\n    netbsd* | netbsdelf*-gnu)\n      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n\t_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'\n\twlarc=\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t_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'\n      fi\n      ;;\n\n    solaris*)\n      if $LD -v 2>&1 | $GREP 'BFD 2\\.8' > /dev/null; then\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n\tcat <<_LT_EOF 1>&2\n\n*** Warning: The releases 2.8.* of the GNU linker cannot reliably\n*** create shared libraries on Solaris systems.  Therefore, libtool\n*** is disabling shared libraries support.  We urge you to upgrade GNU\n*** binutils to release 2.9.1 or newer.  Another option is to modify\n*** your PATH or compiler configuration so that the native linker is\n*** used, and then restart.\n\n_LT_EOF\n      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t_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'\n      else\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n\n    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)\n      case `$LD -v 2>&1` in\n        *\\ [[01]].* | *\\ 2.[[0-9]].* | *\\ 2.1[[0-5]].*)\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n\tcat <<_LT_EOF 1>&2\n\n*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot\n*** reliably create shared libraries on SCO systems.  Therefore, libtool\n*** is disabling shared libraries support.  We urge you to upgrade GNU\n*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify\n*** your PATH or compiler configuration so that the native linker is\n*** used, and then restart.\n\n_LT_EOF\n\t;;\n\t*)\n\t  # For security reasons, it is highly recommended that you always\n\t  # use absolute paths for naming shared libraries, and exclude the\n\t  # DT_RUNPATH tag from executables and libraries.  But doing so\n\t  # requires that you compile everything twice, which is a pain.\n\t  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t    _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'\n\t  else\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t  fi\n\t;;\n      esac\n      ;;\n\n    sunos4*)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      wlarc=\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    *)\n      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t_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'\n      else\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n    esac\n\n    if test no = \"$_LT_TAGVAR(ld_shlibs, $1)\"; then\n      runpath_var=\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)=\n      _LT_TAGVAR(whole_archive_flag_spec, $1)=\n    fi\n  else\n    # PORTME fill in a description of your system's linker (not GNU ld)\n    case $host_os in\n    aix3*)\n      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n      _LT_TAGVAR(always_export_symbols, $1)=yes\n      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'\n      # Note: this linker hardcodes the directories in LIBPATH if there\n      # are no directories specified by -L.\n      _LT_TAGVAR(hardcode_minus_L, $1)=yes\n      if test yes = \"$GCC\" && test -z \"$lt_prog_compiler_static\"; then\n\t# Neither direct hardcoding nor static linking is supported with a\n\t# broken collect2.\n\t_LT_TAGVAR(hardcode_direct, $1)=unsupported\n      fi\n      ;;\n\n    aix[[4-9]]*)\n      if test ia64 = \"$host_cpu\"; then\n\t# On IA64, the linker does run time linking by default, so we don't\n\t# have to do anything special.\n\taix_use_runtimelinking=no\n\texp_sym_flag='-Bexport'\n\tno_entry_flag=\n      else\n\t# If we're using GNU nm, then we don't want the \"-C\" option.\n\t# -C means demangle to GNU nm, but means don't demangle to AIX nm.\n\t# Without the \"-l\" option, or with the \"-B\" option, AIX nm treats\n\t# weak defined symbols like other global defined symbols, whereas\n\t# GNU nm marks them as \"W\".\n\t# While the 'weak' keyword is ignored in the Export File, we need\n\t# it in the Import File for the 'aix-soname' feature, so we have\n\t# to replace the \"-B\" option with \"-P\" for AIX nm.\n\tif $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then\n\t  _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'\n\telse\n\t  _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'\n\tfi\n\taix_use_runtimelinking=no\n\n\t# Test if we are trying to use run time linking or normal\n\t# AIX style linking. If -brtl is somewhere in LDFLAGS, we\n\t# have runtime linking enabled, and use it for executables.\n\t# For shared libraries, we enable/disable runtime linking\n\t# depending on the kind of the shared library created -\n\t# when \"with_aix_soname,aix_use_runtimelinking\" is:\n\t# \"aix,no\"   lib.a(lib.so.V) shared, rtl:no,  for executables\n\t# \"aix,yes\"  lib.so          shared, rtl:yes, for executables\n\t#            lib.a           static archive\n\t# \"both,no\"  lib.so.V(shr.o) shared, rtl:yes\n\t#            lib.a(lib.so.V) shared, rtl:no,  for executables\n\t# \"both,yes\" lib.so.V(shr.o) shared, rtl:yes, for executables\n\t#            lib.a(lib.so.V) shared, rtl:no\n\t# \"svr4,*\"   lib.so.V(shr.o) shared, rtl:yes, for executables\n\t#            lib.a           static archive\n\tcase $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)\n\t  for ld_flag in $LDFLAGS; do\n\t  if (test x-brtl = \"x$ld_flag\" || test x-Wl,-brtl = \"x$ld_flag\"); then\n\t    aix_use_runtimelinking=yes\n\t    break\n\t  fi\n\t  done\n\t  if test svr4,no = \"$with_aix_soname,$aix_use_runtimelinking\"; then\n\t    # With aix-soname=svr4, we create the lib.so.V shared archives only,\n\t    # so we don't have lib.a shared libs to link our executables.\n\t    # We have to force runtime linking in this case.\n\t    aix_use_runtimelinking=yes\n\t    LDFLAGS=\"$LDFLAGS -Wl,-brtl\"\n\t  fi\n\t  ;;\n\tesac\n\n\texp_sym_flag='-bexport'\n\tno_entry_flag='-bnoentry'\n      fi\n\n      # When large executables or shared objects are built, AIX ld can\n      # have problems creating the table of contents.  If linking a library\n      # or program results in \"error TOC overflow\" add -mminimal-toc to\n      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not\n      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.\n\n      _LT_TAGVAR(archive_cmds, $1)=''\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'\n      _LT_TAGVAR(link_all_deplibs, $1)=yes\n      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'\n      case $with_aix_soname,$aix_use_runtimelinking in\n      aix,*) ;; # traditional, no import file\n      svr4,* | *,yes) # use import file\n\t# The Import File defines what to hardcode.\n\t_LT_TAGVAR(hardcode_direct, $1)=no\n\t_LT_TAGVAR(hardcode_direct_absolute, $1)=no\n\t;;\n      esac\n\n      if test yes = \"$GCC\"; then\n\tcase $host_os in aix4.[[012]]|aix4.[[012]].*)\n\t# We only want to do this on AIX 4.2 and lower, the check\n\t# below for broken collect2 doesn't work under 4.3+\n\t  collect2name=`$CC -print-prog-name=collect2`\n\t  if test -f \"$collect2name\" &&\n\t   strings \"$collect2name\" | $GREP resolve_lib_name >/dev/null\n\t  then\n\t  # We have reworked collect2\n\t  :\n\t  else\n\t  # We have old collect2\n\t  _LT_TAGVAR(hardcode_direct, $1)=unsupported\n\t  # It fails to find uninstalled libraries when the uninstalled\n\t  # path is not listed in the libpath.  Setting hardcode_minus_L\n\t  # to unsupported forces relinking\n\t  _LT_TAGVAR(hardcode_minus_L, $1)=yes\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n\t  _LT_TAGVAR(hardcode_libdir_separator, $1)=\n\t  fi\n\t  ;;\n\tesac\n\tshared_flag='-shared'\n\tif test yes = \"$aix_use_runtimelinking\"; then\n\t  shared_flag=\"$shared_flag \"'$wl-G'\n\tfi\n\t# Need to ensure runtime linking is disabled for the traditional\n\t# shared library, or the linker may eventually find shared libraries\n\t# /with/ Import File - we do not want to mix them.\n\tshared_flag_aix='-shared'\n\tshared_flag_svr4='-shared $wl-G'\n      else\n\t# not using gcc\n\tif test ia64 = \"$host_cpu\"; then\n\t# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release\n\t# chokes on -Wl,-G. The following line is correct:\n\t  shared_flag='-G'\n\telse\n\t  if test yes = \"$aix_use_runtimelinking\"; then\n\t    shared_flag='$wl-G'\n\t  else\n\t    shared_flag='$wl-bM:SRE'\n\t  fi\n\t  shared_flag_aix='$wl-bM:SRE'\n\t  shared_flag_svr4='$wl-G'\n\tfi\n      fi\n\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'\n      # It seems that -bexpall does not export symbols beginning with\n      # underscore (_), so it is better to generate a list of symbols to export.\n      _LT_TAGVAR(always_export_symbols, $1)=yes\n      if test aix,yes = \"$with_aix_soname,$aix_use_runtimelinking\"; then\n\t# Warning - without using the other runtime loading flags (-brtl),\n\t# -berok will link without error, but may produce a broken library.\n\t_LT_TAGVAR(allow_undefined_flag, $1)='-berok'\n        # Determine the default libpath from the value encoded in an\n        # empty executable.\n        _LT_SYS_MODULE_PATH_AIX([$1])\n        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'\"$aix_libpath\"\n        _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\n      else\n\tif test ia64 = \"$host_cpu\"; then\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=\"-z nodefs\"\n\t  _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\"\n\telse\n\t # Determine the default libpath from the value encoded in an\n\t # empty executable.\n\t _LT_SYS_MODULE_PATH_AIX([$1])\n\t _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'\"$aix_libpath\"\n\t  # Warning - without using the other run time loading flags,\n\t  # -berok will link without error, but may produce a broken library.\n\t  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'\n\t  if test yes = \"$with_gnu_ld\"; then\n\t    # We only use this code for GNU lds that support --whole-archive.\n\t    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'\n\t  else\n\t    # Exported symbols can be pulled into shared objects from archives\n\t    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'\n\t  fi\n\t  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'\n\t  # -brtl affects multiple linker settings, -berok does not and is overridden later\n\t  compiler_flags_filtered='`func_echo_all \"$compiler_flags \" | $SED -e \"s%-brtl\\\\([[, ]]\\\\)%-berok\\\\1%g\"`'\n\t  if test svr4 != \"$with_aix_soname\"; then\n\t    # This is similar to how AIX traditionally builds its shared libraries.\n\t    _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'\n\t  fi\n\t  if test aix != \"$with_aix_soname\"; then\n\t    _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'\n\t  else\n\t    # used by -dlpreopen to get the symbols\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)=\"$_LT_TAGVAR(archive_expsym_cmds, $1)\"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'\n\t  fi\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)=\"$_LT_TAGVAR(archive_expsym_cmds, $1)\"'~$RM -r $output_objdir/$realname.d'\n\tfi\n      fi\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n            _LT_TAGVAR(archive_expsym_cmds, $1)=''\n        ;;\n      m68k)\n            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO \"#define NAME $libname\" > $output_objdir/a2ixlibrary.data~$ECHO \"#define LIBRARY_ID 1\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define VERSION $major\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define REVISION $revision\" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'\n            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n            _LT_TAGVAR(hardcode_minus_L, $1)=yes\n        ;;\n      esac\n      ;;\n\n    bsdi[[45]]*)\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic\n      ;;\n\n    cygwin* | mingw* | pw32* | cegcc*)\n      # When not using gcc, we currently assume that we are using\n      # Microsoft Visual C++.\n      # hardcode_libdir_flag_spec is actually meaningless, as there is\n      # no search path for DLLs.\n      case $cc_basename in\n      cl*)\n\t# Native MSVC\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '\n\t_LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t_LT_TAGVAR(always_export_symbols, $1)=yes\n\t_LT_TAGVAR(file_list_spec, $1)='@'\n\t# Tell ltmain to make .lib files, not .a files.\n\tlibext=lib\n\t# Tell ltmain to make .dll files, not .so files.\n\tshrext_cmds=.dll\n\t# FIXME: Setting linknames here is a bad hack.\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:\"$tool_output_objdir$libname.dll.lib\"~linknames='\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then\n            cp \"$export_symbols\" \"$output_objdir/$soname.def\";\n            echo \"$tool_output_objdir$soname.def\" > \"$output_objdir/$soname.exp\";\n          else\n            $SED -e '\\''s/^/-link -EXPORT:/'\\'' < $export_symbols > $output_objdir/$soname.exp;\n          fi~\n          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs \"@$tool_output_objdir$soname.exp\" -Wl,-DLL,-IMPLIB:\"$tool_output_objdir$libname.dll.lib\"~\n          linknames='\n\t# The linker will not automatically build a static lib if we build a DLL.\n\t# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'\n\t_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n\t_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'\n\t_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\\([[^ ]]*\\)/\\1,DATA/'\\'' | $SED -e '\\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\\'' | sort | uniq > $export_symbols'\n\t# Don't use ranlib\n\t_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'\n\t_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile=\"@OUTPUT@\"~\n          lt_tool_outputfile=\"@TOOL_OUTPUT@\"~\n          case $lt_outputfile in\n            *.exe|*.EXE) ;;\n            *)\n              lt_outputfile=$lt_outputfile.exe\n              lt_tool_outputfile=$lt_tool_outputfile.exe\n              ;;\n          esac~\n          if test : != \"$MANIFEST_TOOL\" && test -f \"$lt_outputfile.manifest\"; then\n            $MANIFEST_TOOL -manifest \"$lt_tool_outputfile.manifest\" -outputresource:\"$lt_tool_outputfile\" || exit 1;\n            $RM \"$lt_outputfile.manifest\";\n          fi'\n\t;;\n      *)\n\t# Assume MSVC wrapper\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '\n\t_LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t# Tell ltmain to make .lib files, not .a files.\n\tlibext=lib\n\t# Tell ltmain to make .dll files, not .so files.\n\tshrext_cmds=.dll\n\t# FIXME: Setting linknames here is a bad hack.\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all \"$deplibs\" | $SED '\\''s/ -lc$//'\\''` -link -dll~linknames='\n\t# The linker will automatically build a .lib file if we build a DLL.\n\t_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'\n\t# FIXME: Should let the user specify the lib program.\n\t_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'\n\t_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n\t;;\n      esac\n      ;;\n\n    darwin* | rhapsody*)\n      _LT_DARWIN_LINKER_FEATURES($1)\n      ;;\n\n    dgux*)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor\n    # support.  Future versions do this automatically, but an explicit c++rt0.o\n    # does not break anything, and helps significantly (at the cost of a little\n    # extra space).\n    freebsd2.2*)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    # Unfortunately, older versions of FreeBSD 2 do not have this feature.\n    freebsd2.*)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.\n    freebsd* | dragonfly*)\n      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    hpux9*)\n      if test yes = \"$GCC\"; then\n\t_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'\n      else\n\t_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'\n      fi\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n\n      # hardcode_minus_L: Not really in the search PATH,\n      # but as the default location of the library.\n      _LT_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n      ;;\n\n    hpux10*)\n      if test yes,no = \"$GCC,$with_gnu_ld\"; then\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'\n      fi\n      if test no = \"$with_gnu_ld\"; then\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'\n\t_LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\t_LT_TAGVAR(hardcode_direct, $1)=yes\n\t_LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n\t_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n\t# hardcode_minus_L: Not really in the search PATH,\n\t# but as the default location of the library.\n\t_LT_TAGVAR(hardcode_minus_L, $1)=yes\n      fi\n      ;;\n\n    hpux11*)\n      if test yes,no = \"$GCC,$with_gnu_ld\"; then\n\tcase $host_cpu in\n\thppa*64*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tia64*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tesac\n      else\n\tcase $host_cpu in\n\thppa*64*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tia64*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\tm4_if($1, [], [\n\t  # Older versions of the 11.00 compiler do not understand -b yet\n\t  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)\n\t  _LT_LINKER_OPTION([if $CC understands -b],\n\t    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],\n\t    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],\n\t    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],\n\t  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])\n\t  ;;\n\tesac\n      fi\n      if test no = \"$with_gnu_ld\"; then\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'\n\t_LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\tcase $host_cpu in\n\thppa*64*|ia64*)\n\t  _LT_TAGVAR(hardcode_direct, $1)=no\n\t  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t  ;;\n\t*)\n\t  _LT_TAGVAR(hardcode_direct, $1)=yes\n\t  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n\t  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n\n\t  # hardcode_minus_L: Not really in the search PATH,\n\t  # but as the default location of the library.\n\t  _LT_TAGVAR(hardcode_minus_L, $1)=yes\n\t  ;;\n\tesac\n      fi\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      if test yes = \"$GCC\"; then\n\t_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'\n\t# Try to use the -exported_symbol ld option, if it does not\n\t# work, assume that -exports_file does not work either and\n\t# implicitly export all symbols.\n\t# This should be the same for all languages, so no per-tag cache variable.\n\tAC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],\n\t  [lt_cv_irix_exported_symbol],\n\t  [save_LDFLAGS=$LDFLAGS\n\t   LDFLAGS=\"$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null\"\n\t   AC_LINK_IFELSE(\n\t     [AC_LANG_SOURCE(\n\t        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],\n\t\t\t      [C++], [[int foo (void) { return 0; }]],\n\t\t\t      [Fortran 77], [[\n      subroutine foo\n      end]],\n\t\t\t      [Fortran], [[\n      subroutine foo\n      end]])])],\n\t      [lt_cv_irix_exported_symbol=yes],\n\t      [lt_cv_irix_exported_symbol=no])\n           LDFLAGS=$save_LDFLAGS])\n\tif test yes = \"$lt_cv_irix_exported_symbol\"; then\n          _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'\n\tfi\n\t_LT_TAGVAR(link_all_deplibs, $1)=no\n      else\n\t_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'\n\t_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'\n      fi\n      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n      _LT_TAGVAR(inherit_rpath, $1)=yes\n      _LT_TAGVAR(link_all_deplibs, $1)=yes\n      ;;\n\n    linux*)\n      case $cc_basename in\n      tcc*)\n\t# Fabrice Bellard et al's Tiny C Compiler\n\t_LT_TAGVAR(ld_shlibs, $1)=yes\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t;;\n      esac\n      ;;\n\n    netbsd* | netbsdelf*-gnu)\n      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n\t_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF\n      fi\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    newsos6)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    *nto* | *qnx*)\n      ;;\n\n    openbsd* | bitrig*)\n      if test -f /usr/libexec/ld.so; then\n\t_LT_TAGVAR(hardcode_direct, $1)=yes\n\t_LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t_LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n\tif test -z \"`echo __ELF__ | $CC -E - | $GREP __ELF__`\"; then\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\t  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n\telse\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\tfi\n      else\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n\n    os2*)\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n      shrext_cmds=.dll\n      _LT_TAGVAR(archive_cmds, $1)='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\temxexp $libobjs | $SED /\"_DLL_InitTerm\"/d >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\tprefix_cmds=\"$SED\"~\n\tif test EXPORTS = \"`$SED 1q $export_symbols`\"; then\n\t  prefix_cmds=\"$prefix_cmds -e 1d\";\n\tfi~\n\tprefix_cmds=\"$prefix_cmds -e \\\"s/^\\(.*\\)$/_\\1/g\\\"\"~\n\tcat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'\n      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n      ;;\n\n    osf3*)\n      if test yes = \"$GCC\"; then\n\t_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\\*'\n\t_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'\n      else\n\t_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \\*'\n\t_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'\n      fi\n      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n      ;;\n\n    osf4* | osf5*)\t# as osf3* with the addition of -msym flag\n      if test yes = \"$GCC\"; then\n\t_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\\*'\n\t_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'\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n      else\n\t_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \\*'\n\t_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'\n\t_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~\n          $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'\n\n\t# Both c and cxx compiler support -rpath directly\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'\n      fi\n      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n      ;;\n\n    solaris*)\n      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'\n      if test yes = \"$GCC\"; then\n\twlarc='$wl'\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n          $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'\n      else\n\tcase `$CC -V 2>&1` in\n\t*\"Compilers 5.0\"*)\n\t  wlarc=''\n\t  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'\n\t  ;;\n\t*)\n\t  wlarc='$wl'\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'\n\t  ;;\n\tesac\n      fi\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      case $host_os in\n      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;\n      *)\n\t# The compiler driver will combine and reorder linker options,\n\t# but understands '-z linker_flag'.  GCC discards it without '$wl',\n\t# but is careful enough not to reorder.\n\t# Supported since Solaris 2.6 (maybe 2.5.1?)\n\tif test yes = \"$GCC\"; then\n\t  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'\n\telse\n\t  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'\n\tfi\n\t;;\n      esac\n      _LT_TAGVAR(link_all_deplibs, $1)=yes\n      ;;\n\n    sunos4*)\n      if test sequent = \"$host_vendor\"; then\n\t# Use $CC to link under sequent, because it throws in some extra .o\n\t# files that make .init and .fini sections work.\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'\n      fi\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    sysv4)\n      case $host_vendor in\n\tsni)\n\t  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???\n\t;;\n\tsiemens)\n\t  ## LD is ld it makes a PLAMLIB\n\t  ## CC just makes a GrossModule.\n\t  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'\n\t  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'\n\t  _LT_TAGVAR(hardcode_direct, $1)=no\n        ;;\n\tmotorola)\n\t  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie\n\t;;\n      esac\n      runpath_var='LD_RUN_PATH'\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    sysv4.3*)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\t_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t_LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\trunpath_var=LD_RUN_PATH\n\thardcode_runpath_var=yes\n\t_LT_TAGVAR(ld_shlibs, $1)=yes\n      fi\n      ;;\n\n    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)\n      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'\n      _LT_TAGVAR(archive_cmds_need_lc, $1)=no\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      runpath_var='LD_RUN_PATH'\n\n      if test yes = \"$GCC\"; then\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      fi\n      ;;\n\n    sysv5* | sco3.2v5* | sco5v6*)\n      # Note: We CANNOT use -z defs as we might desire, because we do not\n      # link with -lc, and that would cause any symbols used from libc to\n      # always be unresolved, which means just about no library would\n      # ever link correctly.  If we're not using GNU ld we use -z text\n      # though, which does catch some bad symbols but isn't as heavy-handed\n      # as -z defs.\n      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'\n      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'\n      _LT_TAGVAR(archive_cmds_need_lc, $1)=no\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'\n      _LT_TAGVAR(link_all_deplibs, $1)=yes\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'\n      runpath_var='LD_RUN_PATH'\n\n      if test yes = \"$GCC\"; then\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      fi\n      ;;\n\n    uts4*)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    *)\n      _LT_TAGVAR(ld_shlibs, $1)=no\n      ;;\n    esac\n\n    if test sni = \"$host_vendor\"; then\n      case $host in\n      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n\t_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'\n\t;;\n      esac\n    fi\n  fi\n])\nAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])\ntest no = \"$_LT_TAGVAR(ld_shlibs, $1)\" && can_build_shared=no\n\n_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld\n\n_LT_DECL([], [libext], [0], [Old archive suffix (normally \"a\")])dnl\n_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally \".so\")])dnl\n_LT_DECL([], [extract_expsyms_cmds], [2],\n    [The commands to extract the exported symbol list from a shared archive])\n\n#\n# Do we need to explicitly link libc?\n#\ncase \"x$_LT_TAGVAR(archive_cmds_need_lc, $1)\" in\nx|xyes)\n  # Assume -lc should be added\n  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes\n\n  if test yes,yes = \"$GCC,$enable_shared\"; then\n    case $_LT_TAGVAR(archive_cmds, $1) in\n    *'~'*)\n      # FIXME: we may have to deal with multi-command sequences.\n      ;;\n    '$CC '*)\n      # Test whether the compiler implicitly links with -lc since on some\n      # systems, -lgcc has to come before -lc. If gcc already passes -lc\n      # to ld, don't add -lc before -lgcc.\n      AC_CACHE_CHECK([whether -lc should be explicitly linked in],\n\t[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),\n\t[$RM conftest*\n\techo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n\tif AC_TRY_EVAL(ac_compile) 2>conftest.err; then\n\t  soname=conftest\n\t  lib=conftest\n\t  libobjs=conftest.$ac_objext\n\t  deplibs=\n\t  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)\n\t  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)\n\t  compiler_flags=-v\n\t  linker_flags=-v\n\t  verstring=\n\t  output_objdir=.\n\t  libname=conftest\n\t  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=\n\t  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\\>\\&1 \\| $GREP \\\" -lc \\\" \\>/dev/null 2\\>\\&1)\n\t  then\n\t    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n\t  else\n\t    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes\n\t  fi\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag\n\telse\n\t  cat conftest.err 1>&5\n\tfi\n\t$RM conftest*\n\t])\n      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)\n      ;;\n    esac\n  fi\n  ;;\nesac\n\n_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],\n    [Whether or not to add -lc for building shared libraries])\n_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],\n    [enable_shared_with_static_runtimes], [0],\n    [Whether or not to disallow shared libs when runtime libs are static])\n_LT_TAGDECL([], [export_dynamic_flag_spec], [1],\n    [Compiler flag to allow reflexive dlopens])\n_LT_TAGDECL([], [whole_archive_flag_spec], [1],\n    [Compiler flag to generate shared objects directly from archives])\n_LT_TAGDECL([], [compiler_needs_object], [1],\n    [Whether the compiler copes with passing no objects directly])\n_LT_TAGDECL([], [old_archive_from_new_cmds], [2],\n    [Create an old-style archive from a shared archive])\n_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],\n    [Create a temporary old-style archive to link instead of a shared archive])\n_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])\n_LT_TAGDECL([], [archive_expsym_cmds], [2])\n_LT_TAGDECL([], [module_cmds], [2],\n    [Commands used to build a loadable module if different from building\n    a shared archive.])\n_LT_TAGDECL([], [module_expsym_cmds], [2])\n_LT_TAGDECL([], [with_gnu_ld], [1],\n    [Whether we are building with GNU ld or not])\n_LT_TAGDECL([], [allow_undefined_flag], [1],\n    [Flag that allows shared libraries with undefined symbols to be built])\n_LT_TAGDECL([], [no_undefined_flag], [1],\n    [Flag that enforces no undefined symbols])\n_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],\n    [Flag to hardcode $libdir into a binary during linking.\n    This must work even if $libdir does not exist])\n_LT_TAGDECL([], [hardcode_libdir_separator], [1],\n    [Whether we need a single \"-rpath\" flag with a separated argument])\n_LT_TAGDECL([], [hardcode_direct], [0],\n    [Set to \"yes\" if using DIR/libNAME$shared_ext during linking hardcodes\n    DIR into the resulting binary])\n_LT_TAGDECL([], [hardcode_direct_absolute], [0],\n    [Set to \"yes\" if using DIR/libNAME$shared_ext during linking hardcodes\n    DIR into the resulting binary and the resulting library dependency is\n    \"absolute\", i.e impossible to change by setting $shlibpath_var if the\n    library is relocated])\n_LT_TAGDECL([], [hardcode_minus_L], [0],\n    [Set to \"yes\" if using the -LDIR flag during linking hardcodes DIR\n    into the resulting binary])\n_LT_TAGDECL([], [hardcode_shlibpath_var], [0],\n    [Set to \"yes\" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR\n    into the resulting binary])\n_LT_TAGDECL([], [hardcode_automatic], [0],\n    [Set to \"yes\" if building a shared library automatically hardcodes DIR\n    into the library and all subsequent libraries and executables linked\n    against it])\n_LT_TAGDECL([], [inherit_rpath], [0],\n    [Set to yes if linker adds runtime paths of dependent libraries\n    to runtime path list])\n_LT_TAGDECL([], [link_all_deplibs], [0],\n    [Whether libtool must link a program against all its dependency libraries])\n_LT_TAGDECL([], [always_export_symbols], [0],\n    [Set to \"yes\" if exported symbols are required])\n_LT_TAGDECL([], [export_symbols_cmds], [2],\n    [The commands to list exported symbols])\n_LT_TAGDECL([], [exclude_expsyms], [1],\n    [Symbols that should not be listed in the preloaded symbols])\n_LT_TAGDECL([], [include_expsyms], [1],\n    [Symbols that must always be exported])\n_LT_TAGDECL([], [prelink_cmds], [2],\n    [Commands necessary for linking programs (against libraries) with templates])\n_LT_TAGDECL([], [postlink_cmds], [2],\n    [Commands necessary for finishing linking programs])\n_LT_TAGDECL([], [file_list_spec], [1],\n    [Specify filename containing input files])\ndnl FIXME: Not yet implemented\ndnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],\ndnl    [Compiler flag to generate thread safe objects])\n])# _LT_LINKER_SHLIBS\n\n\n# _LT_LANG_C_CONFIG([TAG])\n# ------------------------\n# Ensure that the configuration variables for a C compiler are suitably\n# defined.  These variables are subsequently used by _LT_CONFIG to write\n# the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_C_CONFIG],\n[m4_require([_LT_DECL_EGREP])dnl\nlt_save_CC=$CC\nAC_LANG_PUSH(C)\n\n# Source file extension for C test sources.\nac_ext=c\n\n# Object file extension for compiled C test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"int some_variable = 0;\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='int main(){return(0);}'\n\n_LT_TAG_COMPILER\n# Save the default compiler, since it gets overwritten when the other\n# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.\ncompiler_DEFAULT=$CC\n\n# save warnings/boilerplate of simple test code\n_LT_COMPILER_BOILERPLATE\n_LT_LINKER_BOILERPLATE\n\nif test -n \"$compiler\"; then\n  _LT_COMPILER_NO_RTTI($1)\n  _LT_COMPILER_PIC($1)\n  _LT_COMPILER_C_O($1)\n  _LT_COMPILER_FILE_LOCKS($1)\n  _LT_LINKER_SHLIBS($1)\n  _LT_SYS_DYNAMIC_LINKER($1)\n  _LT_LINKER_HARDCODE_LIBPATH($1)\n  LT_SYS_DLOPEN_SELF\n  _LT_CMD_STRIPLIB\n\n  # Report what library types will actually be built\n  AC_MSG_CHECKING([if libtool supports shared libraries])\n  AC_MSG_RESULT([$can_build_shared])\n\n  AC_MSG_CHECKING([whether to build shared libraries])\n  test no = \"$can_build_shared\" && enable_shared=no\n\n  # On AIX, shared libraries and static libraries use the same namespace, and\n  # are all built from PIC.\n  case $host_os in\n  aix3*)\n    test yes = \"$enable_shared\" && enable_static=no\n    if test -n \"$RANLIB\"; then\n      archive_cmds=\"$archive_cmds~\\$RANLIB \\$lib\"\n      postinstall_cmds='$RANLIB $lib'\n    fi\n    ;;\n\n  aix[[4-9]]*)\n    if test ia64 != \"$host_cpu\"; then\n      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in\n      yes,aix,yes) ;;\t\t\t# shared object as lib.so file only\n      yes,svr4,*) ;;\t\t\t# shared object as lib.so archive member only\n      yes,*) enable_static=no ;;\t# shared object in lib.a archive as well\n      esac\n    fi\n    ;;\n  esac\n  AC_MSG_RESULT([$enable_shared])\n\n  AC_MSG_CHECKING([whether to build static libraries])\n  # Make sure either enable_shared or enable_static is yes.\n  test yes = \"$enable_shared\" || enable_static=yes\n  AC_MSG_RESULT([$enable_static])\n\n  _LT_CONFIG($1)\nfi\nAC_LANG_POP\nCC=$lt_save_CC\n])# _LT_LANG_C_CONFIG\n\n\n# _LT_LANG_CXX_CONFIG([TAG])\n# --------------------------\n# Ensure that the configuration variables for a C++ compiler are suitably\n# defined.  These variables are subsequently used by _LT_CONFIG to write\n# the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_CXX_CONFIG],\n[m4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_DECL_EGREP])dnl\nm4_require([_LT_PATH_MANIFEST_TOOL])dnl\nif test -n \"$CXX\" && ( test no != \"$CXX\" &&\n    ( (test g++ = \"$CXX\" && `g++ -v >/dev/null 2>&1` ) ||\n    (test g++ != \"$CXX\"))); then\n  AC_PROG_CXXCPP\nelse\n  _lt_caught_CXX_error=yes\nfi\n\nAC_LANG_PUSH(C++)\n_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n_LT_TAGVAR(allow_undefined_flag, $1)=\n_LT_TAGVAR(always_export_symbols, $1)=no\n_LT_TAGVAR(archive_expsym_cmds, $1)=\n_LT_TAGVAR(compiler_needs_object, $1)=no\n_LT_TAGVAR(export_dynamic_flag_spec, $1)=\n_LT_TAGVAR(hardcode_direct, $1)=no\n_LT_TAGVAR(hardcode_direct_absolute, $1)=no\n_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=\n_LT_TAGVAR(hardcode_libdir_separator, $1)=\n_LT_TAGVAR(hardcode_minus_L, $1)=no\n_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported\n_LT_TAGVAR(hardcode_automatic, $1)=no\n_LT_TAGVAR(inherit_rpath, $1)=no\n_LT_TAGVAR(module_cmds, $1)=\n_LT_TAGVAR(module_expsym_cmds, $1)=\n_LT_TAGVAR(link_all_deplibs, $1)=unknown\n_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds\n_LT_TAGVAR(reload_flag, $1)=$reload_flag\n_LT_TAGVAR(reload_cmds, $1)=$reload_cmds\n_LT_TAGVAR(no_undefined_flag, $1)=\n_LT_TAGVAR(whole_archive_flag_spec, $1)=\n_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no\n\n# Source file extension for C++ test sources.\nac_ext=cpp\n\n# Object file extension for compiled C++ test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# No sense in running all these tests if we already determined that\n# the CXX compiler isn't working.  Some variables (like enable_shared)\n# are currently assumed to apply to all compilers on this platform,\n# and will be corrupted by setting them based on a non-working compiler.\nif test yes != \"$_lt_caught_CXX_error\"; then\n  # Code to be used in simple compile tests\n  lt_simple_compile_test_code=\"int some_variable = 0;\"\n\n  # Code to be used in simple link tests\n  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'\n\n  # ltmain only uses $CC for tagged configurations so make sure $CC is set.\n  _LT_TAG_COMPILER\n\n  # save warnings/boilerplate of simple test code\n  _LT_COMPILER_BOILERPLATE\n  _LT_LINKER_BOILERPLATE\n\n  # Allow CC to be a program name with arguments.\n  lt_save_CC=$CC\n  lt_save_CFLAGS=$CFLAGS\n  lt_save_LD=$LD\n  lt_save_GCC=$GCC\n  GCC=$GXX\n  lt_save_with_gnu_ld=$with_gnu_ld\n  lt_save_path_LD=$lt_cv_path_LD\n  if test -n \"${lt_cv_prog_gnu_ldcxx+set}\"; then\n    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx\n  else\n    $as_unset lt_cv_prog_gnu_ld\n  fi\n  if test -n \"${lt_cv_path_LDCXX+set}\"; then\n    lt_cv_path_LD=$lt_cv_path_LDCXX\n  else\n    $as_unset lt_cv_path_LD\n  fi\n  test -z \"${LDCXX+set}\" || LD=$LDCXX\n  CC=${CXX-\"c++\"}\n  CFLAGS=$CXXFLAGS\n  compiler=$CC\n  _LT_TAGVAR(compiler, $1)=$CC\n  _LT_CC_BASENAME([$compiler])\n\n  if test -n \"$compiler\"; then\n    # We don't want -fno-exception when compiling C++ code, so set the\n    # no_builtin_flag separately\n    if test yes = \"$GXX\"; then\n      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'\n    else\n      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=\n    fi\n\n    if test yes = \"$GXX\"; then\n      # Set up default GNU C++ configuration\n\n      LT_PATH_LD\n\n      # Check if GNU C++ uses GNU ld as the underlying linker, since the\n      # archiving commands below assume that GNU ld is being used.\n      if test yes = \"$with_gnu_ld\"; then\n        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'\n        _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'\n\n        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'\n\n        # If archive_cmds runs LD, not CC, wlarc should be empty\n        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to\n        #     investigate it a little bit more. (MM)\n        wlarc='$wl'\n\n        # ancient GNU ld didn't support --whole-archive et. al.\n        if eval \"`$CC -print-prog-name=ld` --help 2>&1\" |\n\t  $GREP 'no-whole-archive' > /dev/null; then\n          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'\n        else\n          _LT_TAGVAR(whole_archive_flag_spec, $1)=\n        fi\n      else\n        with_gnu_ld=no\n        wlarc=\n\n        # A generic and very simple default shared library creation\n        # command for GNU C++ for the case where it uses the native\n        # linker, instead of GNU ld.  If possible, this setting should\n        # overridden to take advantage of the native linker features on\n        # the platform it is being used on.\n        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'\n      fi\n\n      # Commands to make compiler produce verbose output that lists\n      # what \"hidden\" libraries, object files and flags are used when\n      # linking a shared library.\n      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v \"^Configured with:\" | $GREP \"\\-L\"'\n\n    else\n      GXX=no\n      with_gnu_ld=no\n      wlarc=\n    fi\n\n    # PORTME: fill in a description of your system's C++ link characteristics\n    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])\n    _LT_TAGVAR(ld_shlibs, $1)=yes\n    case $host_os in\n      aix3*)\n        # FIXME: insert proper C++ library support\n        _LT_TAGVAR(ld_shlibs, $1)=no\n        ;;\n      aix[[4-9]]*)\n        if test ia64 = \"$host_cpu\"; then\n          # On IA64, the linker does run time linking by default, so we don't\n          # have to do anything special.\n          aix_use_runtimelinking=no\n          exp_sym_flag='-Bexport'\n          no_entry_flag=\n        else\n          aix_use_runtimelinking=no\n\n          # Test if we are trying to use run time linking or normal\n          # AIX style linking. If -brtl is somewhere in LDFLAGS, we\n          # have runtime linking enabled, and use it for executables.\n          # For shared libraries, we enable/disable runtime linking\n          # depending on the kind of the shared library created -\n          # when \"with_aix_soname,aix_use_runtimelinking\" is:\n          # \"aix,no\"   lib.a(lib.so.V) shared, rtl:no,  for executables\n          # \"aix,yes\"  lib.so          shared, rtl:yes, for executables\n          #            lib.a           static archive\n          # \"both,no\"  lib.so.V(shr.o) shared, rtl:yes\n          #            lib.a(lib.so.V) shared, rtl:no,  for executables\n          # \"both,yes\" lib.so.V(shr.o) shared, rtl:yes, for executables\n          #            lib.a(lib.so.V) shared, rtl:no\n          # \"svr4,*\"   lib.so.V(shr.o) shared, rtl:yes, for executables\n          #            lib.a           static archive\n          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)\n\t    for ld_flag in $LDFLAGS; do\n\t      case $ld_flag in\n\t      *-brtl*)\n\t        aix_use_runtimelinking=yes\n\t        break\n\t        ;;\n\t      esac\n\t    done\n\t    if test svr4,no = \"$with_aix_soname,$aix_use_runtimelinking\"; then\n\t      # With aix-soname=svr4, we create the lib.so.V shared archives only,\n\t      # so we don't have lib.a shared libs to link our executables.\n\t      # We have to force runtime linking in this case.\n\t      aix_use_runtimelinking=yes\n\t      LDFLAGS=\"$LDFLAGS -Wl,-brtl\"\n\t    fi\n\t    ;;\n          esac\n\n          exp_sym_flag='-bexport'\n          no_entry_flag='-bnoentry'\n        fi\n\n        # When large executables or shared objects are built, AIX ld can\n        # have problems creating the table of contents.  If linking a library\n        # or program results in \"error TOC overflow\" add -mminimal-toc to\n        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not\n        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.\n\n        _LT_TAGVAR(archive_cmds, $1)=''\n        _LT_TAGVAR(hardcode_direct, $1)=yes\n        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'\n        _LT_TAGVAR(link_all_deplibs, $1)=yes\n        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'\n        case $with_aix_soname,$aix_use_runtimelinking in\n        aix,*) ;;\t# no import file\n        svr4,* | *,yes) # use import file\n          # The Import File defines what to hardcode.\n          _LT_TAGVAR(hardcode_direct, $1)=no\n          _LT_TAGVAR(hardcode_direct_absolute, $1)=no\n          ;;\n        esac\n\n        if test yes = \"$GXX\"; then\n          case $host_os in aix4.[[012]]|aix4.[[012]].*)\n          # We only want to do this on AIX 4.2 and lower, the check\n          # below for broken collect2 doesn't work under 4.3+\n\t  collect2name=`$CC -print-prog-name=collect2`\n\t  if test -f \"$collect2name\" &&\n\t     strings \"$collect2name\" | $GREP resolve_lib_name >/dev/null\n\t  then\n\t    # We have reworked collect2\n\t    :\n\t  else\n\t    # We have old collect2\n\t    _LT_TAGVAR(hardcode_direct, $1)=unsupported\n\t    # It fails to find uninstalled libraries when the uninstalled\n\t    # path is not listed in the libpath.  Setting hardcode_minus_L\n\t    # to unsupported forces relinking\n\t    _LT_TAGVAR(hardcode_minus_L, $1)=yes\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n\t    _LT_TAGVAR(hardcode_libdir_separator, $1)=\n\t  fi\n          esac\n          shared_flag='-shared'\n\t  if test yes = \"$aix_use_runtimelinking\"; then\n\t    shared_flag=$shared_flag' $wl-G'\n\t  fi\n\t  # Need to ensure runtime linking is disabled for the traditional\n\t  # shared library, or the linker may eventually find shared libraries\n\t  # /with/ Import File - we do not want to mix them.\n\t  shared_flag_aix='-shared'\n\t  shared_flag_svr4='-shared $wl-G'\n        else\n          # not using gcc\n          if test ia64 = \"$host_cpu\"; then\n\t  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release\n\t  # chokes on -Wl,-G. The following line is correct:\n\t  shared_flag='-G'\n          else\n\t    if test yes = \"$aix_use_runtimelinking\"; then\n\t      shared_flag='$wl-G'\n\t    else\n\t      shared_flag='$wl-bM:SRE'\n\t    fi\n\t    shared_flag_aix='$wl-bM:SRE'\n\t    shared_flag_svr4='$wl-G'\n          fi\n        fi\n\n        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'\n        # It seems that -bexpall does not export symbols beginning with\n        # underscore (_), so it is better to generate a list of symbols to\n\t# export.\n        _LT_TAGVAR(always_export_symbols, $1)=yes\n\tif test aix,yes = \"$with_aix_soname,$aix_use_runtimelinking\"; then\n          # Warning - without using the other runtime loading flags (-brtl),\n          # -berok will link without error, but may produce a broken library.\n          # The \"-G\" linker flag allows undefined symbols.\n          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'\n          # Determine the default libpath from the value encoded in an empty\n          # executable.\n          _LT_SYS_MODULE_PATH_AIX([$1])\n          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'\"$aix_libpath\"\n\n          _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\n        else\n          if test ia64 = \"$host_cpu\"; then\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'\n\t    _LT_TAGVAR(allow_undefined_flag, $1)=\"-z nodefs\"\n\t    _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\"\n          else\n\t    # Determine the default libpath from the value encoded in an\n\t    # empty executable.\n\t    _LT_SYS_MODULE_PATH_AIX([$1])\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'\"$aix_libpath\"\n\t    # Warning - without using the other run time loading flags,\n\t    # -berok will link without error, but may produce a broken library.\n\t    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'\n\t    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'\n\t    if test yes = \"$with_gnu_ld\"; then\n\t      # We only use this code for GNU lds that support --whole-archive.\n\t      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'\n\t    else\n\t      # Exported symbols can be pulled into shared objects from archives\n\t      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'\n\t    fi\n\t    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'\n\t    # -brtl affects multiple linker settings, -berok does not and is overridden later\n\t    compiler_flags_filtered='`func_echo_all \"$compiler_flags \" | $SED -e \"s%-brtl\\\\([[, ]]\\\\)%-berok\\\\1%g\"`'\n\t    if test svr4 != \"$with_aix_soname\"; then\n\t      # This is similar to how AIX traditionally builds its shared\n\t      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.\n\t      _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'\n\t    fi\n\t    if test aix != \"$with_aix_soname\"; then\n\t      _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'\n\t    else\n\t      # used by -dlpreopen to get the symbols\n\t      _LT_TAGVAR(archive_expsym_cmds, $1)=\"$_LT_TAGVAR(archive_expsym_cmds, $1)\"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'\n\t    fi\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)=\"$_LT_TAGVAR(archive_expsym_cmds, $1)\"'~$RM -r $output_objdir/$realname.d'\n          fi\n        fi\n        ;;\n\n      beos*)\n\tif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc\n\t  # support --undefined.  This deserves some investigation.  FIXME\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\telse\n\t  _LT_TAGVAR(ld_shlibs, $1)=no\n\tfi\n\t;;\n\n      chorus*)\n        case $cc_basename in\n          *)\n\t  # FIXME: insert proper C++ library support\n\t  _LT_TAGVAR(ld_shlibs, $1)=no\n\t  ;;\n        esac\n        ;;\n\n      cygwin* | mingw* | pw32* | cegcc*)\n\tcase $GXX,$cc_basename in\n\t,cl* | no,cl*)\n\t  # Native MSVC\n\t  # hardcode_libdir_flag_spec is actually meaningless, as there is\n\t  # no search path for DLLs.\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t  _LT_TAGVAR(always_export_symbols, $1)=yes\n\t  _LT_TAGVAR(file_list_spec, $1)='@'\n\t  # Tell ltmain to make .lib files, not .a files.\n\t  libext=lib\n\t  # Tell ltmain to make .dll files, not .so files.\n\t  shrext_cmds=.dll\n\t  # FIXME: Setting linknames here is a bad hack.\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:\"$tool_output_objdir$libname.dll.lib\"~linknames='\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then\n              cp \"$export_symbols\" \"$output_objdir/$soname.def\";\n              echo \"$tool_output_objdir$soname.def\" > \"$output_objdir/$soname.exp\";\n            else\n              $SED -e '\\''s/^/-link -EXPORT:/'\\'' < $export_symbols > $output_objdir/$soname.exp;\n            fi~\n            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs \"@$tool_output_objdir$soname.exp\" -Wl,-DLL,-IMPLIB:\"$tool_output_objdir$libname.dll.lib\"~\n            linknames='\n\t  # The linker will not automatically build a static lib if we build a DLL.\n\t  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'\n\t  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n\t  # Don't use ranlib\n\t  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'\n\t  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile=\"@OUTPUT@\"~\n            lt_tool_outputfile=\"@TOOL_OUTPUT@\"~\n            case $lt_outputfile in\n              *.exe|*.EXE) ;;\n              *)\n                lt_outputfile=$lt_outputfile.exe\n                lt_tool_outputfile=$lt_tool_outputfile.exe\n                ;;\n            esac~\n            func_to_tool_file \"$lt_outputfile\"~\n            if test : != \"$MANIFEST_TOOL\" && test -f \"$lt_outputfile.manifest\"; then\n              $MANIFEST_TOOL -manifest \"$lt_tool_outputfile.manifest\" -outputresource:\"$lt_tool_outputfile\" || exit 1;\n              $RM \"$lt_outputfile.manifest\";\n            fi'\n\t  ;;\n\t*)\n\t  # g++\n\t  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,\n\t  # as there is no search path for DLLs.\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n\t  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t  _LT_TAGVAR(always_export_symbols, $1)=no\n\t  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n\n\t  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then\n\t    _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'\n\t    # If the export-symbols file already is a .def file, use it as\n\t    # is; otherwise, prepend EXPORTS...\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then\n              cp $export_symbols $output_objdir/$soname.def;\n            else\n              echo EXPORTS > $output_objdir/$soname.def;\n              cat $export_symbols >> $output_objdir/$soname.def;\n            fi~\n            $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'\n\t  else\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t  fi\n\t  ;;\n\tesac\n\t;;\n      darwin* | rhapsody*)\n        _LT_DARWIN_LINKER_FEATURES($1)\n\t;;\n\n      os2*)\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n\t_LT_TAGVAR(hardcode_minus_L, $1)=yes\n\t_LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\tshrext_cmds=.dll\n\t_LT_TAGVAR(archive_cmds, $1)='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t  $ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t  $ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t  $ECHO EXPORTS >> $output_objdir/$libname.def~\n\t  emxexp $libobjs | $SED /\"_DLL_InitTerm\"/d >> $output_objdir/$libname.def~\n\t  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\t  emximp -o $lib $output_objdir/$libname.def'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t  $ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t  $ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t  $ECHO EXPORTS >> $output_objdir/$libname.def~\n\t  prefix_cmds=\"$SED\"~\n\t  if test EXPORTS = \"`$SED 1q $export_symbols`\"; then\n\t    prefix_cmds=\"$prefix_cmds -e 1d\";\n\t  fi~\n\t  prefix_cmds=\"$prefix_cmds -e \\\"s/^\\(.*\\)$/_\\1/g\\\"\"~\n\t  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~\n\t  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\t  emximp -o $lib $output_objdir/$libname.def'\n\t_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'\n\t_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n\t;;\n\n      dgux*)\n        case $cc_basename in\n          ec++*)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          ghcx*)\n\t    # Green Hills C++ Compiler\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          *)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n        esac\n        ;;\n\n      freebsd2.*)\n        # C++ shared libraries reported to be fairly broken before\n\t# switch to ELF\n        _LT_TAGVAR(ld_shlibs, $1)=no\n        ;;\n\n      freebsd-elf*)\n        _LT_TAGVAR(archive_cmds_need_lc, $1)=no\n        ;;\n\n      freebsd* | dragonfly*)\n        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF\n        # conventions\n        _LT_TAGVAR(ld_shlibs, $1)=yes\n        ;;\n\n      haiku*)\n        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n        _LT_TAGVAR(link_all_deplibs, $1)=yes\n        ;;\n\n      hpux9*)\n        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'\n        _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n        _LT_TAGVAR(hardcode_direct, $1)=yes\n        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,\n\t\t\t\t             # but as the default\n\t\t\t\t             # location of the library.\n\n        case $cc_basename in\n          CC*)\n            # FIXME: insert proper C++ library support\n            _LT_TAGVAR(ld_shlibs, $1)=no\n            ;;\n          aCC*)\n            _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'\n            # Commands to make compiler produce verbose output that lists\n            # what \"hidden\" libraries, object files and flags are used when\n            # linking a shared library.\n            #\n            # There doesn't appear to be a way to prevent this compiler from\n            # explicitly linking system object files so we need to strip them\n            # from the output so that they don't get included in the library\n            # dependencies.\n            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\"'\n            ;;\n          *)\n            if test yes = \"$GXX\"; then\n              _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'\n            else\n              # FIXME: insert proper C++ library support\n              _LT_TAGVAR(ld_shlibs, $1)=no\n            fi\n            ;;\n        esac\n        ;;\n\n      hpux10*|hpux11*)\n        if test no = \"$with_gnu_ld\"; then\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'\n\t  _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\n          case $host_cpu in\n            hppa*64*|ia64*)\n              ;;\n            *)\n\t      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n              ;;\n          esac\n        fi\n        case $host_cpu in\n          hppa*64*|ia64*)\n            _LT_TAGVAR(hardcode_direct, $1)=no\n            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n            ;;\n          *)\n            _LT_TAGVAR(hardcode_direct, $1)=yes\n            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,\n\t\t\t\t\t         # but as the default\n\t\t\t\t\t         # location of the library.\n            ;;\n        esac\n\n        case $cc_basename in\n          CC*)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          aCC*)\n\t    case $host_cpu in\n\t      hppa*64*)\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t        ;;\n\t      ia64*)\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t        ;;\n\t      *)\n\t        _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'\n\t        ;;\n\t    esac\n\t    # Commands to make compiler produce verbose output that lists\n\t    # what \"hidden\" libraries, object files and flags are used when\n\t    # linking a shared library.\n\t    #\n\t    # There doesn't appear to be a way to prevent this compiler from\n\t    # explicitly linking system object files so we need to strip them\n\t    # from the output so that they don't get included in the library\n\t    # dependencies.\n\t    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\"'\n\t    ;;\n          *)\n\t    if test yes = \"$GXX\"; then\n\t      if test no = \"$with_gnu_ld\"; then\n\t        case $host_cpu in\n\t          hppa*64*)\n\t            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t            ;;\n\t          ia64*)\n\t            _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'\n\t            ;;\n\t          *)\n\t            _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'\n\t            ;;\n\t        esac\n\t      fi\n\t    else\n\t      # FIXME: insert proper C++ library support\n\t      _LT_TAGVAR(ld_shlibs, $1)=no\n\t    fi\n\t    ;;\n        esac\n        ;;\n\n      interix[[3-9]]*)\n\t_LT_TAGVAR(hardcode_direct, $1)=no\n\t_LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\t_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n\t# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.\n\t# Instead, shared libraries are loaded at an image base (0x10000000 by\n\t# default) and relocated if they conflict, which is a slow very memory\n\t# consuming and fragmenting process.  To avoid this, we pick a random,\n\t# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link\n\t# time.  Moving up from 0x10000000 also allows more sbrk(2) space.\n\t_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'\n\t_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'\n\t;;\n      irix5* | irix6*)\n        case $cc_basename in\n          CC*)\n\t    # SGI C++\n\t    _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'\n\n\t    # Archives containing C++ object files must be created using\n\t    # \"CC -ar\", where \"CC\" is the IRIX C++ compiler.  This is\n\t    # necessary to make sure instantiated templates are included\n\t    # in the archive.\n\t    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'\n\t    ;;\n          *)\n\t    if test yes = \"$GXX\"; then\n\t      if test no = \"$with_gnu_ld\"; then\n\t        _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'\n\t      else\n\t        _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'\n\t      fi\n\t    fi\n\t    _LT_TAGVAR(link_all_deplibs, $1)=yes\n\t    ;;\n        esac\n        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n        _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n        _LT_TAGVAR(inherit_rpath, $1)=yes\n        ;;\n\n      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n        case $cc_basename in\n          KCC*)\n\t    # Kuck and Associates, Inc. (KAI) C++ Compiler\n\n\t    # KCC will only create a shared library if the output file\n\t    # ends with \".so\" (or \".sl\" for HP-UX), so rename the library\n\t    # to its proper name (with version) after linking.\n\t    _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'\n\t    _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'\n\t    # Commands to make compiler produce verbose output that lists\n\t    # what \"hidden\" libraries, object files and flags are used when\n\t    # linking a shared library.\n\t    #\n\t    # There doesn't appear to be a way to prevent this compiler from\n\t    # explicitly linking system object files so we need to strip them\n\t    # from the output so that they don't get included in the library\n\t    # dependencies.\n\t    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\"'\n\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\t    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'\n\n\t    # Archives containing C++ object files must be created using\n\t    # \"CC -Bstatic\", where \"CC\" is the KAI C++ compiler.\n\t    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'\n\t    ;;\n\t  icpc* | ecpc* )\n\t    # Intel C++\n\t    with_gnu_ld=yes\n\t    # version 8.0 and above of icpc choke on multiply defined symbols\n\t    # if we add $predep_objects and $postdep_objects, however 7.1 and\n\t    # earlier do not add the objects themselves.\n\t    case `$CC -V 2>&1` in\n\t      *\"Version 7.\"*)\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'\n\t\t_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'\n\t\t;;\n\t      *)  # Version 8.0 or newer\n\t        tmp_idyn=\n\t        case $host_cpu in\n\t\t  ia64*) tmp_idyn=' -i_dynamic';;\n\t\tesac\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'\"$tmp_idyn\"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t\t_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'\n\t\t;;\n\t    esac\n\t    _LT_TAGVAR(archive_cmds_need_lc, $1)=no\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\t    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'\n\t    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'\n\t    ;;\n          pgCC* | pgcpp*)\n            # Portland Group C++ compiler\n\t    case `$CC -V` in\n\t    *pgCC\\ [[1-5]].* | *pgcpp\\ [[1-5]].*)\n\t      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~\n               rm -rf $tpldir~\n               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~\n               compile_command=\"$compile_command `find $tpldir -name \\*.o | sort | $NL2SP`\"'\n\t      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~\n                rm -rf $tpldir~\n                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~\n                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \\*.o | sort | $NL2SP`~\n                $RANLIB $oldlib'\n\t      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~\n                rm -rf $tpldir~\n                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~\n                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \\*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'\n\t      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~\n                rm -rf $tpldir~\n                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~\n                $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'\n\t      ;;\n\t    *) # Version 6 and above use weak symbols\n\t      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'\n\t      _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'\n\t      ;;\n\t    esac\n\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'\n\t    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'\n\t    _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'\n            ;;\n\t  cxx*)\n\t    # Compaq C++\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'\n\t    _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'\n\n\t    runpath_var=LD_RUN_PATH\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'\n\t    _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t    # Commands to make compiler produce verbose output that lists\n\t    # what \"hidden\" libraries, object files and flags are used when\n\t    # linking a shared library.\n\t    #\n\t    # There doesn't appear to be a way to prevent this compiler from\n\t    # explicitly linking system object files so we need to strip them\n\t    # from the output so that they don't get included in the library\n\t    # dependencies.\n\t    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'\n\t    ;;\n\t  xl* | mpixl* | bgxl*)\n\t    # IBM XL 8.0 on PPC, with GNU ld\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n\t    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t    if test yes = \"$supports_anon_versioning\"; then\n\t      _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $output_objdir/$libname.ver~\n                cat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n                echo \"local: *; };\" >> $output_objdir/$libname.ver~\n                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'\n\t    fi\n\t    ;;\n\t  *)\n\t    case `$CC -V 2>&1 | sed 5q` in\n\t    *Sun\\ C*)\n\t      # Sun C++ 5.9\n\t      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'\n\t      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t      _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'\n\t      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n\t      _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'\n\t      _LT_TAGVAR(compiler_needs_object, $1)=yes\n\n\t      # Not sure whether something based on\n\t      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1\n\t      # would be better.\n\t      output_verbose_link_cmd='func_echo_all'\n\n\t      # Archives containing C++ object files must be created using\n\t      # \"CC -xar\", where \"CC\" is the Sun C++ compiler.  This is\n\t      # necessary to make sure instantiated templates are included\n\t      # in the archive.\n\t      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'\n\t      ;;\n\t    esac\n\t    ;;\n\tesac\n\t;;\n\n      lynxos*)\n        # FIXME: insert proper C++ library support\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n\t;;\n\n      m88k*)\n        # FIXME: insert proper C++ library support\n        _LT_TAGVAR(ld_shlibs, $1)=no\n\t;;\n\n      mvs*)\n        case $cc_basename in\n          cxx*)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n\t  *)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n\tesac\n\t;;\n\n      netbsd*)\n        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n\t  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'\n\t  wlarc=\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n\t  _LT_TAGVAR(hardcode_direct, $1)=yes\n\t  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\tfi\n\t# Workaround some broken pre-1.5 toolchains\n\toutput_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e \"s:-lgcc -lc -lgcc::\"'\n\t;;\n\n      *nto* | *qnx*)\n        _LT_TAGVAR(ld_shlibs, $1)=yes\n\t;;\n\n      openbsd* | bitrig*)\n\tif test -f /usr/libexec/ld.so; then\n\t  _LT_TAGVAR(hardcode_direct, $1)=yes\n\t  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\t  if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\"; then\n\t    _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'\n\t    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n\t    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'\n\t  fi\n\t  output_verbose_link_cmd=func_echo_all\n\telse\n\t  _LT_TAGVAR(ld_shlibs, $1)=no\n\tfi\n\t;;\n\n      osf3* | osf4* | osf5*)\n        case $cc_basename in\n          KCC*)\n\t    # Kuck and Associates, Inc. (KAI) C++ Compiler\n\n\t    # KCC will only create a shared library if the output file\n\t    # ends with \".so\" (or \".sl\" for HP-UX), so rename the library\n\t    # to its proper name (with version) after linking.\n\t    _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'\n\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\t    _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t    # Archives containing C++ object files must be created using\n\t    # the KAI C++ compiler.\n\t    case $host in\n\t      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;\n\t      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;\n\t    esac\n\t    ;;\n          RCC*)\n\t    # Rational C++ 2.4.1\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          cxx*)\n\t    case $host in\n\t      osf3*)\n\t        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\\*'\n\t        _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'\n\t        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n\t\t;;\n\t      *)\n\t        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \\*'\n\t        _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'\n\t        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf \"%s %s\\\\n\" -exported_symbol \"\\$i\" >> $lib.exp; done~\n                  echo \"-hidden\">> $lib.exp~\n                  $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~\n                  $RM $lib.exp'\n\t        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'\n\t\t;;\n\t    esac\n\n\t    _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t    # Commands to make compiler produce verbose output that lists\n\t    # what \"hidden\" libraries, object files and flags are used when\n\t    # linking a shared library.\n\t    #\n\t    # There doesn't appear to be a way to prevent this compiler from\n\t    # explicitly linking system object files so we need to strip them\n\t    # from the output so that they don't get included in the library\n\t    # dependencies.\n\t    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\"'\n\t    ;;\n\t  *)\n\t    if test yes,no = \"$GXX,$with_gnu_ld\"; then\n\t      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\\*'\n\t      case $host in\n\t        osf3*)\n\t          _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'\n\t\t  ;;\n\t        *)\n\t          _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'\n\t\t  ;;\n\t      esac\n\n\t      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n\t      _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t      # Commands to make compiler produce verbose output that lists\n\t      # what \"hidden\" libraries, object files and flags are used when\n\t      # linking a shared library.\n\t      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v \"^Configured with:\" | $GREP \"\\-L\"'\n\n\t    else\n\t      # FIXME: insert proper C++ library support\n\t      _LT_TAGVAR(ld_shlibs, $1)=no\n\t    fi\n\t    ;;\n        esac\n        ;;\n\n      psos*)\n        # FIXME: insert proper C++ library support\n        _LT_TAGVAR(ld_shlibs, $1)=no\n        ;;\n\n      sunos4*)\n        case $cc_basename in\n          CC*)\n\t    # Sun C++ 4.x\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          lcc*)\n\t    # Lucid\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          *)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n        esac\n        ;;\n\n      solaris*)\n        case $cc_basename in\n          CC* | sunCC*)\n\t    # Sun C++ 4.2, 5.x and Centerline C++\n            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes\n\t    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n              $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'\n\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n\t    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t    case $host_os in\n\t      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;\n\t      *)\n\t\t# The compiler driver will combine and reorder linker options,\n\t\t# but understands '-z linker_flag'.\n\t        # Supported since Solaris 2.6 (maybe 2.5.1?)\n\t\t_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'\n\t        ;;\n\t    esac\n\t    _LT_TAGVAR(link_all_deplibs, $1)=yes\n\n\t    output_verbose_link_cmd='func_echo_all'\n\n\t    # Archives containing C++ object files must be created using\n\t    # \"CC -xar\", where \"CC\" is the Sun C++ compiler.  This is\n\t    # necessary to make sure instantiated templates are included\n\t    # in the archive.\n\t    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'\n\t    ;;\n          gcx*)\n\t    # Green Hills C++ Compiler\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'\n\n\t    # The C++ compiler must be used to create the archive.\n\t    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'\n\t    ;;\n          *)\n\t    # GNU C++ compiler with Solaris linker\n\t    if test yes,no = \"$GXX,$with_gnu_ld\"; then\n\t      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'\n\t      if $CC --version | $GREP -v '^2\\.7' > /dev/null; then\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'\n\t        _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n                  $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'\n\n\t        # Commands to make compiler produce verbose output that lists\n\t        # what \"hidden\" libraries, object files and flags are used when\n\t        # linking a shared library.\n\t        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v \"^Configured with:\" | $GREP \"\\-L\"'\n\t      else\n\t        # g++ 2.7 appears to require '-G' NOT '-shared' on this\n\t        # platform.\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'\n\t        _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n                  $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'\n\n\t        # Commands to make compiler produce verbose output that lists\n\t        # what \"hidden\" libraries, object files and flags are used when\n\t        # linking a shared library.\n\t        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v \"^Configured with:\" | $GREP \"\\-L\"'\n\t      fi\n\n\t      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'\n\t      case $host_os in\n\t\tsolaris2.[[0-5]] | solaris2.[[0-5]].*) ;;\n\t\t*)\n\t\t  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'\n\t\t  ;;\n\t      esac\n\t    fi\n\t    ;;\n        esac\n        ;;\n\n    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)\n      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'\n      _LT_TAGVAR(archive_cmds_need_lc, $1)=no\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      runpath_var='LD_RUN_PATH'\n\n      case $cc_basename in\n        CC*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n      esac\n      ;;\n\n      sysv5* | sco3.2v5* | sco5v6*)\n\t# Note: We CANNOT use -z defs as we might desire, because we do not\n\t# link with -lc, and that would cause any symbols used from libc to\n\t# always be unresolved, which means just about no library would\n\t# ever link correctly.  If we're not using GNU ld we use -z text\n\t# though, which does catch some bad symbols but isn't as heavy-handed\n\t# as -z defs.\n\t_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'\n\t_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'\n\t_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n\t_LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'\n\t_LT_TAGVAR(hardcode_libdir_separator, $1)=':'\n\t_LT_TAGVAR(link_all_deplibs, $1)=yes\n\t_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'\n\trunpath_var='LD_RUN_PATH'\n\n\tcase $cc_basename in\n          CC*)\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~\n              '\"$_LT_TAGVAR(old_archive_cmds, $1)\"\n\t    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~\n              '\"$_LT_TAGVAR(reload_cmds, $1)\"\n\t    ;;\n\t  *)\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t    ;;\n\tesac\n      ;;\n\n      tandem*)\n        case $cc_basename in\n          NCC*)\n\t    # NonStop-UX NCC 3.20\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          *)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n        esac\n        ;;\n\n      vxworks*)\n        # FIXME: insert proper C++ library support\n        _LT_TAGVAR(ld_shlibs, $1)=no\n        ;;\n\n      *)\n        # FIXME: insert proper C++ library support\n        _LT_TAGVAR(ld_shlibs, $1)=no\n        ;;\n    esac\n\n    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])\n    test no = \"$_LT_TAGVAR(ld_shlibs, $1)\" && can_build_shared=no\n\n    _LT_TAGVAR(GCC, $1)=$GXX\n    _LT_TAGVAR(LD, $1)=$LD\n\n    ## CAVEAT EMPTOR:\n    ## There is no encapsulation within the following macros, do not change\n    ## the running order or otherwise move them around unless you know exactly\n    ## what you are doing...\n    _LT_SYS_HIDDEN_LIBDEPS($1)\n    _LT_COMPILER_PIC($1)\n    _LT_COMPILER_C_O($1)\n    _LT_COMPILER_FILE_LOCKS($1)\n    _LT_LINKER_SHLIBS($1)\n    _LT_SYS_DYNAMIC_LINKER($1)\n    _LT_LINKER_HARDCODE_LIBPATH($1)\n\n    _LT_CONFIG($1)\n  fi # test -n \"$compiler\"\n\n  CC=$lt_save_CC\n  CFLAGS=$lt_save_CFLAGS\n  LDCXX=$LD\n  LD=$lt_save_LD\n  GCC=$lt_save_GCC\n  with_gnu_ld=$lt_save_with_gnu_ld\n  lt_cv_path_LDCXX=$lt_cv_path_LD\n  lt_cv_path_LD=$lt_save_path_LD\n  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld\n  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld\nfi # test yes != \"$_lt_caught_CXX_error\"\n\nAC_LANG_POP\n])# _LT_LANG_CXX_CONFIG\n\n\n# _LT_FUNC_STRIPNAME_CNF\n# ----------------------\n# func_stripname_cnf prefix suffix name\n# strip PREFIX and SUFFIX off of NAME.\n# PREFIX and SUFFIX must not contain globbing or regex special\n# characters, hashes, percent signs, but SUFFIX may contain a leading\n# dot (in which case that matches only a dot).\n#\n# This function is identical to the (non-XSI) version of func_stripname,\n# except this one can be used by m4 code that may be executed by configure,\n# rather than the libtool script.\nm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl\nAC_REQUIRE([_LT_DECL_SED])\nAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])\nfunc_stripname_cnf ()\n{\n  case @S|@2 in\n  .*) func_stripname_result=`$ECHO \"@S|@3\" | $SED \"s%^@S|@1%%; s%\\\\\\\\@S|@2\\$%%\"`;;\n  *)  func_stripname_result=`$ECHO \"@S|@3\" | $SED \"s%^@S|@1%%; s%@S|@2\\$%%\"`;;\n  esac\n} # func_stripname_cnf\n])# _LT_FUNC_STRIPNAME_CNF\n\n\n# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])\n# ---------------------------------\n# Figure out \"hidden\" library dependencies from verbose\n# compiler output when linking a shared library.\n# Parse the compiler output and extract the necessary\n# objects, libraries and library flags.\nm4_defun([_LT_SYS_HIDDEN_LIBDEPS],\n[m4_require([_LT_FILEUTILS_DEFAULTS])dnl\nAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl\n# Dependencies to place before and after the object being linked:\n_LT_TAGVAR(predep_objects, $1)=\n_LT_TAGVAR(postdep_objects, $1)=\n_LT_TAGVAR(predeps, $1)=\n_LT_TAGVAR(postdeps, $1)=\n_LT_TAGVAR(compiler_lib_search_path, $1)=\n\ndnl we can't use the lt_simple_compile_test_code here,\ndnl because it contains code intended for an executable,\ndnl not a library.  It's possible we should let each\ndnl tag define a new lt_????_link_test_code variable,\ndnl but it's only used here...\nm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF\nint a;\nvoid foo (void) { a = 0; }\n_LT_EOF\n], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF\nclass Foo\n{\npublic:\n  Foo (void) { a = 0; }\nprivate:\n  int a;\n};\n_LT_EOF\n], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF\n      subroutine foo\n      implicit none\n      integer*4 a\n      a=0\n      return\n      end\n_LT_EOF\n], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF\n      subroutine foo\n      implicit none\n      integer a\n      a=0\n      return\n      end\n_LT_EOF\n], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF\npublic class foo {\n  private int a;\n  public void bar (void) {\n    a = 0;\n  }\n};\n_LT_EOF\n], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF\npackage foo\nfunc foo() {\n}\n_LT_EOF\n])\n\n_lt_libdeps_save_CFLAGS=$CFLAGS\ncase \"$CC $CFLAGS \" in #(\n*\\ -flto*\\ *) CFLAGS=\"$CFLAGS -fno-lto\" ;;\n*\\ -fwhopr*\\ *) CFLAGS=\"$CFLAGS -fno-whopr\" ;;\n*\\ -fuse-linker-plugin*\\ *) CFLAGS=\"$CFLAGS -fno-use-linker-plugin\" ;;\nesac\n\ndnl Parse the compiler output and extract the necessary\ndnl objects, libraries and library flags.\nif AC_TRY_EVAL(ac_compile); then\n  # Parse the compiler output and extract the necessary\n  # objects, libraries and library flags.\n\n  # Sentinel used to keep track of whether or not we are before\n  # the conftest object file.\n  pre_test_object_deps_done=no\n\n  for p in `eval \"$output_verbose_link_cmd\"`; do\n    case $prev$p in\n\n    -L* | -R* | -l*)\n       # Some compilers place space between \"-{L,R}\" and the path.\n       # Remove the space.\n       if test x-L = \"$p\" ||\n          test x-R = \"$p\"; then\n\t prev=$p\n\t continue\n       fi\n\n       # Expand the sysroot to ease extracting the directories later.\n       if test -z \"$prev\"; then\n         case $p in\n         -L*) func_stripname_cnf '-L' '' \"$p\"; prev=-L; p=$func_stripname_result ;;\n         -R*) func_stripname_cnf '-R' '' \"$p\"; prev=-R; p=$func_stripname_result ;;\n         -l*) func_stripname_cnf '-l' '' \"$p\"; prev=-l; p=$func_stripname_result ;;\n         esac\n       fi\n       case $p in\n       =*) func_stripname_cnf '=' '' \"$p\"; p=$lt_sysroot$func_stripname_result ;;\n       esac\n       if test no = \"$pre_test_object_deps_done\"; then\n\t case $prev in\n\t -L | -R)\n\t   # Internal compiler library paths should come after those\n\t   # provided the user.  The postdeps already come after the\n\t   # user supplied libs so there is no need to process them.\n\t   if test -z \"$_LT_TAGVAR(compiler_lib_search_path, $1)\"; then\n\t     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p\n\t   else\n\t     _LT_TAGVAR(compiler_lib_search_path, $1)=\"${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p\"\n\t   fi\n\t   ;;\n\t # The \"-l\" case would never come before the object being\n\t # linked, so don't bother handling this case.\n\t esac\n       else\n\t if test -z \"$_LT_TAGVAR(postdeps, $1)\"; then\n\t   _LT_TAGVAR(postdeps, $1)=$prev$p\n\t else\n\t   _LT_TAGVAR(postdeps, $1)=\"${_LT_TAGVAR(postdeps, $1)} $prev$p\"\n\t fi\n       fi\n       prev=\n       ;;\n\n    *.lto.$objext) ;; # Ignore GCC LTO objects\n    *.$objext)\n       # This assumes that the test object file only shows up\n       # once in the compiler output.\n       if test \"$p\" = \"conftest.$objext\"; then\n\t pre_test_object_deps_done=yes\n\t continue\n       fi\n\n       if test no = \"$pre_test_object_deps_done\"; then\n\t if test -z \"$_LT_TAGVAR(predep_objects, $1)\"; then\n\t   _LT_TAGVAR(predep_objects, $1)=$p\n\t else\n\t   _LT_TAGVAR(predep_objects, $1)=\"$_LT_TAGVAR(predep_objects, $1) $p\"\n\t fi\n       else\n\t if test -z \"$_LT_TAGVAR(postdep_objects, $1)\"; then\n\t   _LT_TAGVAR(postdep_objects, $1)=$p\n\t else\n\t   _LT_TAGVAR(postdep_objects, $1)=\"$_LT_TAGVAR(postdep_objects, $1) $p\"\n\t fi\n       fi\n       ;;\n\n    *) ;; # Ignore the rest.\n\n    esac\n  done\n\n  # Clean up.\n  rm -f a.out a.exe\nelse\n  echo \"libtool.m4: error: problem compiling $1 test program\"\nfi\n\n$RM -f confest.$objext\nCFLAGS=$_lt_libdeps_save_CFLAGS\n\n# PORTME: override above test on systems where it is broken\nm4_if([$1], [CXX],\n[case $host_os in\ninterix[[3-9]]*)\n  # Interix 3.5 installs completely hosed .la files for C++, so rather than\n  # hack all around it, let's just trust \"g++\" to DTRT.\n  _LT_TAGVAR(predep_objects,$1)=\n  _LT_TAGVAR(postdep_objects,$1)=\n  _LT_TAGVAR(postdeps,$1)=\n  ;;\nesac\n])\n\ncase \" $_LT_TAGVAR(postdeps, $1) \" in\n*\" -lc \"*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;\nesac\n _LT_TAGVAR(compiler_lib_search_dirs, $1)=\nif test -n \"${_LT_TAGVAR(compiler_lib_search_path, $1)}\"; then\n _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo \" ${_LT_TAGVAR(compiler_lib_search_path, $1)}\" | $SED -e 's! -L! !g' -e 's!^ !!'`\nfi\n_LT_TAGDECL([], [compiler_lib_search_dirs], [1],\n    [The directories searched by this compiler when creating a shared library])\n_LT_TAGDECL([], [predep_objects], [1],\n    [Dependencies to place before and after the objects being linked to\n    create a shared library])\n_LT_TAGDECL([], [postdep_objects], [1])\n_LT_TAGDECL([], [predeps], [1])\n_LT_TAGDECL([], [postdeps], [1])\n_LT_TAGDECL([], [compiler_lib_search_path], [1],\n    [The library search path used internally by the compiler when linking\n    a shared library])\n])# _LT_SYS_HIDDEN_LIBDEPS\n\n\n# _LT_LANG_F77_CONFIG([TAG])\n# --------------------------\n# Ensure that the configuration variables for a Fortran 77 compiler are\n# suitably defined.  These variables are subsequently used by _LT_CONFIG\n# to write the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_F77_CONFIG],\n[AC_LANG_PUSH(Fortran 77)\nif test -z \"$F77\" || test no = \"$F77\"; then\n  _lt_disable_F77=yes\nfi\n\n_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n_LT_TAGVAR(allow_undefined_flag, $1)=\n_LT_TAGVAR(always_export_symbols, $1)=no\n_LT_TAGVAR(archive_expsym_cmds, $1)=\n_LT_TAGVAR(export_dynamic_flag_spec, $1)=\n_LT_TAGVAR(hardcode_direct, $1)=no\n_LT_TAGVAR(hardcode_direct_absolute, $1)=no\n_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=\n_LT_TAGVAR(hardcode_libdir_separator, $1)=\n_LT_TAGVAR(hardcode_minus_L, $1)=no\n_LT_TAGVAR(hardcode_automatic, $1)=no\n_LT_TAGVAR(inherit_rpath, $1)=no\n_LT_TAGVAR(module_cmds, $1)=\n_LT_TAGVAR(module_expsym_cmds, $1)=\n_LT_TAGVAR(link_all_deplibs, $1)=unknown\n_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds\n_LT_TAGVAR(reload_flag, $1)=$reload_flag\n_LT_TAGVAR(reload_cmds, $1)=$reload_cmds\n_LT_TAGVAR(no_undefined_flag, $1)=\n_LT_TAGVAR(whole_archive_flag_spec, $1)=\n_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no\n\n# Source file extension for f77 test sources.\nac_ext=f\n\n# Object file extension for compiled f77 test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# No sense in running all these tests if we already determined that\n# the F77 compiler isn't working.  Some variables (like enable_shared)\n# are currently assumed to apply to all compilers on this platform,\n# and will be corrupted by setting them based on a non-working compiler.\nif test yes != \"$_lt_disable_F77\"; then\n  # Code to be used in simple compile tests\n  lt_simple_compile_test_code=\"\\\n      subroutine t\n      return\n      end\n\"\n\n  # Code to be used in simple link tests\n  lt_simple_link_test_code=\"\\\n      program t\n      end\n\"\n\n  # ltmain only uses $CC for tagged configurations so make sure $CC is set.\n  _LT_TAG_COMPILER\n\n  # save warnings/boilerplate of simple test code\n  _LT_COMPILER_BOILERPLATE\n  _LT_LINKER_BOILERPLATE\n\n  # Allow CC to be a program name with arguments.\n  lt_save_CC=$CC\n  lt_save_GCC=$GCC\n  lt_save_CFLAGS=$CFLAGS\n  CC=${F77-\"f77\"}\n  CFLAGS=$FFLAGS\n  compiler=$CC\n  _LT_TAGVAR(compiler, $1)=$CC\n  _LT_CC_BASENAME([$compiler])\n  GCC=$G77\n  if test -n \"$compiler\"; then\n    AC_MSG_CHECKING([if libtool supports shared libraries])\n    AC_MSG_RESULT([$can_build_shared])\n\n    AC_MSG_CHECKING([whether to build shared libraries])\n    test no = \"$can_build_shared\" && enable_shared=no\n\n    # On AIX, shared libraries and static libraries use the same namespace, and\n    # are all built from PIC.\n    case $host_os in\n      aix3*)\n        test yes = \"$enable_shared\" && enable_static=no\n        if test -n \"$RANLIB\"; then\n          archive_cmds=\"$archive_cmds~\\$RANLIB \\$lib\"\n          postinstall_cmds='$RANLIB $lib'\n        fi\n        ;;\n      aix[[4-9]]*)\n\tif test ia64 != \"$host_cpu\"; then\n\t  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in\n\t  yes,aix,yes) ;;\t\t# shared object as lib.so file only\n\t  yes,svr4,*) ;;\t\t# shared object as lib.so archive member only\n\t  yes,*) enable_static=no ;;\t# shared object in lib.a archive as well\n\t  esac\n\tfi\n        ;;\n    esac\n    AC_MSG_RESULT([$enable_shared])\n\n    AC_MSG_CHECKING([whether to build static libraries])\n    # Make sure either enable_shared or enable_static is yes.\n    test yes = \"$enable_shared\" || enable_static=yes\n    AC_MSG_RESULT([$enable_static])\n\n    _LT_TAGVAR(GCC, $1)=$G77\n    _LT_TAGVAR(LD, $1)=$LD\n\n    ## CAVEAT EMPTOR:\n    ## There is no encapsulation within the following macros, do not change\n    ## the running order or otherwise move them around unless you know exactly\n    ## what you are doing...\n    _LT_COMPILER_PIC($1)\n    _LT_COMPILER_C_O($1)\n    _LT_COMPILER_FILE_LOCKS($1)\n    _LT_LINKER_SHLIBS($1)\n    _LT_SYS_DYNAMIC_LINKER($1)\n    _LT_LINKER_HARDCODE_LIBPATH($1)\n\n    _LT_CONFIG($1)\n  fi # test -n \"$compiler\"\n\n  GCC=$lt_save_GCC\n  CC=$lt_save_CC\n  CFLAGS=$lt_save_CFLAGS\nfi # test yes != \"$_lt_disable_F77\"\n\nAC_LANG_POP\n])# _LT_LANG_F77_CONFIG\n\n\n# _LT_LANG_FC_CONFIG([TAG])\n# -------------------------\n# Ensure that the configuration variables for a Fortran compiler are\n# suitably defined.  These variables are subsequently used by _LT_CONFIG\n# to write the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_FC_CONFIG],\n[AC_LANG_PUSH(Fortran)\n\nif test -z \"$FC\" || test no = \"$FC\"; then\n  _lt_disable_FC=yes\nfi\n\n_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n_LT_TAGVAR(allow_undefined_flag, $1)=\n_LT_TAGVAR(always_export_symbols, $1)=no\n_LT_TAGVAR(archive_expsym_cmds, $1)=\n_LT_TAGVAR(export_dynamic_flag_spec, $1)=\n_LT_TAGVAR(hardcode_direct, $1)=no\n_LT_TAGVAR(hardcode_direct_absolute, $1)=no\n_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=\n_LT_TAGVAR(hardcode_libdir_separator, $1)=\n_LT_TAGVAR(hardcode_minus_L, $1)=no\n_LT_TAGVAR(hardcode_automatic, $1)=no\n_LT_TAGVAR(inherit_rpath, $1)=no\n_LT_TAGVAR(module_cmds, $1)=\n_LT_TAGVAR(module_expsym_cmds, $1)=\n_LT_TAGVAR(link_all_deplibs, $1)=unknown\n_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds\n_LT_TAGVAR(reload_flag, $1)=$reload_flag\n_LT_TAGVAR(reload_cmds, $1)=$reload_cmds\n_LT_TAGVAR(no_undefined_flag, $1)=\n_LT_TAGVAR(whole_archive_flag_spec, $1)=\n_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no\n\n# Source file extension for fc test sources.\nac_ext=${ac_fc_srcext-f}\n\n# Object file extension for compiled fc test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# No sense in running all these tests if we already determined that\n# the FC compiler isn't working.  Some variables (like enable_shared)\n# are currently assumed to apply to all compilers on this platform,\n# and will be corrupted by setting them based on a non-working compiler.\nif test yes != \"$_lt_disable_FC\"; then\n  # Code to be used in simple compile tests\n  lt_simple_compile_test_code=\"\\\n      subroutine t\n      return\n      end\n\"\n\n  # Code to be used in simple link tests\n  lt_simple_link_test_code=\"\\\n      program t\n      end\n\"\n\n  # ltmain only uses $CC for tagged configurations so make sure $CC is set.\n  _LT_TAG_COMPILER\n\n  # save warnings/boilerplate of simple test code\n  _LT_COMPILER_BOILERPLATE\n  _LT_LINKER_BOILERPLATE\n\n  # Allow CC to be a program name with arguments.\n  lt_save_CC=$CC\n  lt_save_GCC=$GCC\n  lt_save_CFLAGS=$CFLAGS\n  CC=${FC-\"f95\"}\n  CFLAGS=$FCFLAGS\n  compiler=$CC\n  GCC=$ac_cv_fc_compiler_gnu\n\n  _LT_TAGVAR(compiler, $1)=$CC\n  _LT_CC_BASENAME([$compiler])\n\n  if test -n \"$compiler\"; then\n    AC_MSG_CHECKING([if libtool supports shared libraries])\n    AC_MSG_RESULT([$can_build_shared])\n\n    AC_MSG_CHECKING([whether to build shared libraries])\n    test no = \"$can_build_shared\" && enable_shared=no\n\n    # On AIX, shared libraries and static libraries use the same namespace, and\n    # are all built from PIC.\n    case $host_os in\n      aix3*)\n        test yes = \"$enable_shared\" && enable_static=no\n        if test -n \"$RANLIB\"; then\n          archive_cmds=\"$archive_cmds~\\$RANLIB \\$lib\"\n          postinstall_cmds='$RANLIB $lib'\n        fi\n        ;;\n      aix[[4-9]]*)\n\tif test ia64 != \"$host_cpu\"; then\n\t  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in\n\t  yes,aix,yes) ;;\t\t# shared object as lib.so file only\n\t  yes,svr4,*) ;;\t\t# shared object as lib.so archive member only\n\t  yes,*) enable_static=no ;;\t# shared object in lib.a archive as well\n\t  esac\n\tfi\n        ;;\n    esac\n    AC_MSG_RESULT([$enable_shared])\n\n    AC_MSG_CHECKING([whether to build static libraries])\n    # Make sure either enable_shared or enable_static is yes.\n    test yes = \"$enable_shared\" || enable_static=yes\n    AC_MSG_RESULT([$enable_static])\n\n    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu\n    _LT_TAGVAR(LD, $1)=$LD\n\n    ## CAVEAT EMPTOR:\n    ## There is no encapsulation within the following macros, do not change\n    ## the running order or otherwise move them around unless you know exactly\n    ## what you are doing...\n    _LT_SYS_HIDDEN_LIBDEPS($1)\n    _LT_COMPILER_PIC($1)\n    _LT_COMPILER_C_O($1)\n    _LT_COMPILER_FILE_LOCKS($1)\n    _LT_LINKER_SHLIBS($1)\n    _LT_SYS_DYNAMIC_LINKER($1)\n    _LT_LINKER_HARDCODE_LIBPATH($1)\n\n    _LT_CONFIG($1)\n  fi # test -n \"$compiler\"\n\n  GCC=$lt_save_GCC\n  CC=$lt_save_CC\n  CFLAGS=$lt_save_CFLAGS\nfi # test yes != \"$_lt_disable_FC\"\n\nAC_LANG_POP\n])# _LT_LANG_FC_CONFIG\n\n\n# _LT_LANG_GCJ_CONFIG([TAG])\n# --------------------------\n# Ensure that the configuration variables for the GNU Java Compiler compiler\n# are suitably defined.  These variables are subsequently used by _LT_CONFIG\n# to write the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_GCJ_CONFIG],\n[AC_REQUIRE([LT_PROG_GCJ])dnl\nAC_LANG_SAVE\n\n# Source file extension for Java test sources.\nac_ext=java\n\n# Object file extension for compiled Java test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"class foo {}\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n_LT_TAG_COMPILER\n\n# save warnings/boilerplate of simple test code\n_LT_COMPILER_BOILERPLATE\n_LT_LINKER_BOILERPLATE\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=$CC\nlt_save_CFLAGS=$CFLAGS\nlt_save_GCC=$GCC\nGCC=yes\nCC=${GCJ-\"gcj\"}\nCFLAGS=$GCJFLAGS\ncompiler=$CC\n_LT_TAGVAR(compiler, $1)=$CC\n_LT_TAGVAR(LD, $1)=$LD\n_LT_CC_BASENAME([$compiler])\n\n# GCJ did not exist at the time GCC didn't implicitly link libc in.\n_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n\n_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds\n_LT_TAGVAR(reload_flag, $1)=$reload_flag\n_LT_TAGVAR(reload_cmds, $1)=$reload_cmds\n\nif test -n \"$compiler\"; then\n  _LT_COMPILER_NO_RTTI($1)\n  _LT_COMPILER_PIC($1)\n  _LT_COMPILER_C_O($1)\n  _LT_COMPILER_FILE_LOCKS($1)\n  _LT_LINKER_SHLIBS($1)\n  _LT_LINKER_HARDCODE_LIBPATH($1)\n\n  _LT_CONFIG($1)\nfi\n\nAC_LANG_RESTORE\n\nGCC=$lt_save_GCC\nCC=$lt_save_CC\nCFLAGS=$lt_save_CFLAGS\n])# _LT_LANG_GCJ_CONFIG\n\n\n# _LT_LANG_GO_CONFIG([TAG])\n# --------------------------\n# Ensure that the configuration variables for the GNU Go compiler\n# are suitably defined.  These variables are subsequently used by _LT_CONFIG\n# to write the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_GO_CONFIG],\n[AC_REQUIRE([LT_PROG_GO])dnl\nAC_LANG_SAVE\n\n# Source file extension for Go test sources.\nac_ext=go\n\n# Object file extension for compiled Go test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"package main; func main() { }\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='package main; func main() { }'\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n_LT_TAG_COMPILER\n\n# save warnings/boilerplate of simple test code\n_LT_COMPILER_BOILERPLATE\n_LT_LINKER_BOILERPLATE\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=$CC\nlt_save_CFLAGS=$CFLAGS\nlt_save_GCC=$GCC\nGCC=yes\nCC=${GOC-\"gccgo\"}\nCFLAGS=$GOFLAGS\ncompiler=$CC\n_LT_TAGVAR(compiler, $1)=$CC\n_LT_TAGVAR(LD, $1)=$LD\n_LT_CC_BASENAME([$compiler])\n\n# Go did not exist at the time GCC didn't implicitly link libc in.\n_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n\n_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds\n_LT_TAGVAR(reload_flag, $1)=$reload_flag\n_LT_TAGVAR(reload_cmds, $1)=$reload_cmds\n\nif test -n \"$compiler\"; then\n  _LT_COMPILER_NO_RTTI($1)\n  _LT_COMPILER_PIC($1)\n  _LT_COMPILER_C_O($1)\n  _LT_COMPILER_FILE_LOCKS($1)\n  _LT_LINKER_SHLIBS($1)\n  _LT_LINKER_HARDCODE_LIBPATH($1)\n\n  _LT_CONFIG($1)\nfi\n\nAC_LANG_RESTORE\n\nGCC=$lt_save_GCC\nCC=$lt_save_CC\nCFLAGS=$lt_save_CFLAGS\n])# _LT_LANG_GO_CONFIG\n\n\n# _LT_LANG_RC_CONFIG([TAG])\n# -------------------------\n# Ensure that the configuration variables for the Windows resource compiler\n# are suitably defined.  These variables are subsequently used by _LT_CONFIG\n# to write the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_RC_CONFIG],\n[AC_REQUIRE([LT_PROG_RC])dnl\nAC_LANG_SAVE\n\n# Source file extension for RC test sources.\nac_ext=rc\n\n# Object file extension for compiled RC test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code='sample MENU { MENUITEM \"&Soup\", 100, CHECKED }'\n\n# Code to be used in simple link tests\nlt_simple_link_test_code=$lt_simple_compile_test_code\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n_LT_TAG_COMPILER\n\n# save warnings/boilerplate of simple test code\n_LT_COMPILER_BOILERPLATE\n_LT_LINKER_BOILERPLATE\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=$CC\nlt_save_CFLAGS=$CFLAGS\nlt_save_GCC=$GCC\nGCC=\nCC=${RC-\"windres\"}\nCFLAGS=\ncompiler=$CC\n_LT_TAGVAR(compiler, $1)=$CC\n_LT_CC_BASENAME([$compiler])\n_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes\n\nif test -n \"$compiler\"; then\n  :\n  _LT_CONFIG($1)\nfi\n\nGCC=$lt_save_GCC\nAC_LANG_RESTORE\nCC=$lt_save_CC\nCFLAGS=$lt_save_CFLAGS\n])# _LT_LANG_RC_CONFIG\n\n\n# LT_PROG_GCJ\n# -----------\nAC_DEFUN([LT_PROG_GCJ],\n[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],\n  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],\n    [AC_CHECK_TOOL(GCJ, gcj,)\n      test set = \"${GCJFLAGS+set}\" || GCJFLAGS=\"-g -O2\"\n      AC_SUBST(GCJFLAGS)])])[]dnl\n])\n\n# Old name:\nAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([LT_AC_PROG_GCJ], [])\n\n\n# LT_PROG_GO\n# ----------\nAC_DEFUN([LT_PROG_GO],\n[AC_CHECK_TOOL(GOC, gccgo,)\n])\n\n\n# LT_PROG_RC\n# ----------\nAC_DEFUN([LT_PROG_RC],\n[AC_CHECK_TOOL(RC, windres,)\n])\n\n# Old name:\nAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([LT_AC_PROG_RC], [])\n\n\n# _LT_DECL_EGREP\n# --------------\n# If we don't have a new enough Autoconf to choose the best grep\n# available, choose the one first in the user's PATH.\nm4_defun([_LT_DECL_EGREP],\n[AC_REQUIRE([AC_PROG_EGREP])dnl\nAC_REQUIRE([AC_PROG_FGREP])dnl\ntest -z \"$GREP\" && GREP=grep\n_LT_DECL([], [GREP], [1], [A grep program that handles long lines])\n_LT_DECL([], [EGREP], [1], [An ERE matcher])\n_LT_DECL([], [FGREP], [1], [A literal string matcher])\ndnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too\nAC_SUBST([GREP])\n])\n\n\n# _LT_DECL_OBJDUMP\n# --------------\n# If we don't have a new enough Autoconf to choose the best objdump\n# available, choose the one first in the user's PATH.\nm4_defun([_LT_DECL_OBJDUMP],\n[AC_CHECK_TOOL(OBJDUMP, objdump, false)\ntest -z \"$OBJDUMP\" && OBJDUMP=objdump\n_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])\nAC_SUBST([OBJDUMP])\n])\n\n# _LT_DECL_DLLTOOL\n# ----------------\n# Ensure DLLTOOL variable is set.\nm4_defun([_LT_DECL_DLLTOOL],\n[AC_CHECK_TOOL(DLLTOOL, dlltool, false)\ntest -z \"$DLLTOOL\" && DLLTOOL=dlltool\n_LT_DECL([], [DLLTOOL], [1], [DLL creation program])\nAC_SUBST([DLLTOOL])\n])\n\n# _LT_DECL_SED\n# ------------\n# Check for a fully-functional sed program, that truncates\n# as few characters as possible.  Prefer GNU sed if found.\nm4_defun([_LT_DECL_SED],\n[AC_PROG_SED\ntest -z \"$SED\" && SED=sed\nXsed=\"$SED -e 1s/^X//\"\n_LT_DECL([], [SED], [1], [A sed program that does not truncate output])\n_LT_DECL([], [Xsed], [\"\\$SED -e 1s/^X//\"],\n    [Sed that helps us avoid accidentally triggering echo(1) options like -n])\n])# _LT_DECL_SED\n\nm4_ifndef([AC_PROG_SED], [\n# NOTE: This macro has been submitted for inclusion into   #\n#  GNU Autoconf as AC_PROG_SED.  When it is available in   #\n#  a released version of Autoconf we should remove this    #\n#  macro and use it instead.                               #\n\nm4_defun([AC_PROG_SED],\n[AC_MSG_CHECKING([for a sed that does not truncate output])\nAC_CACHE_VAL(lt_cv_path_SED,\n[# Loop through the user's path and test for sed and gsed.\n# Then use that list of sed's as ones to test for truncation.\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for lt_ac_prog in sed gsed; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      if $as_executable_p \"$as_dir/$lt_ac_prog$ac_exec_ext\"; then\n        lt_ac_sed_list=\"$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext\"\n      fi\n    done\n  done\ndone\nIFS=$as_save_IFS\nlt_ac_max=0\nlt_ac_count=0\n# Add /usr/xpg4/bin/sed as it is typically found on Solaris\n# along with /bin/sed that truncates output.\nfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do\n  test ! -f \"$lt_ac_sed\" && continue\n  cat /dev/null > conftest.in\n  lt_ac_count=0\n  echo $ECHO_N \"0123456789$ECHO_C\" >conftest.in\n  # Check for GNU sed and select it if it is found.\n  if \"$lt_ac_sed\" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then\n    lt_cv_path_SED=$lt_ac_sed\n    break\n  fi\n  while true; do\n    cat conftest.in conftest.in >conftest.tmp\n    mv conftest.tmp conftest.in\n    cp conftest.in conftest.nl\n    echo >>conftest.nl\n    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break\n    cmp -s conftest.out conftest.nl || break\n    # 10000 chars as input seems more than enough\n    test 10 -lt \"$lt_ac_count\" && break\n    lt_ac_count=`expr $lt_ac_count + 1`\n    if test \"$lt_ac_count\" -gt \"$lt_ac_max\"; then\n      lt_ac_max=$lt_ac_count\n      lt_cv_path_SED=$lt_ac_sed\n    fi\n  done\ndone\n])\nSED=$lt_cv_path_SED\nAC_SUBST([SED])\nAC_MSG_RESULT([$SED])\n])#AC_PROG_SED\n])#m4_ifndef\n\n# Old name:\nAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([LT_AC_PROG_SED], [])\n\n\n# _LT_CHECK_SHELL_FEATURES\n# ------------------------\n# Find out whether the shell is Bourne or XSI compatible,\n# or has some other useful features.\nm4_defun([_LT_CHECK_SHELL_FEATURES],\n[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then\n  lt_unset=unset\nelse\n  lt_unset=false\nfi\n_LT_DECL([], [lt_unset], [0], [whether the shell understands \"unset\"])dnl\n\n# test EBCDIC or ASCII\ncase `echo X|tr X '\\101'` in\n A) # ASCII based system\n    # \\n is not interpreted correctly by Solaris 8 /usr/ucb/tr\n  lt_SP2NL='tr \\040 \\012'\n  lt_NL2SP='tr \\015\\012 \\040\\040'\n  ;;\n *) # EBCDIC based system\n  lt_SP2NL='tr \\100 \\n'\n  lt_NL2SP='tr \\r\\n \\100\\100'\n  ;;\nesac\n_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl\n_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl\n])# _LT_CHECK_SHELL_FEATURES\n\n\n# _LT_PATH_CONVERSION_FUNCTIONS\n# -----------------------------\n# Determine what file name conversion functions should be used by\n# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed\n# for certain cross-compile configurations and native mingw.\nm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\nAC_REQUIRE([AC_CANONICAL_BUILD])dnl\nAC_MSG_CHECKING([how to convert $build file names to $host format])\nAC_CACHE_VAL(lt_cv_to_host_file_cmd,\n[case $host in\n  *-*-mingw* )\n    case $build in\n      *-*-mingw* ) # actually msys\n        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32\n        ;;\n      *-*-cygwin* )\n        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32\n        ;;\n      * ) # otherwise, assume *nix\n        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32\n        ;;\n    esac\n    ;;\n  *-*-cygwin* )\n    case $build in\n      *-*-mingw* ) # actually msys\n        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin\n        ;;\n      *-*-cygwin* )\n        lt_cv_to_host_file_cmd=func_convert_file_noop\n        ;;\n      * ) # otherwise, assume *nix\n        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin\n        ;;\n    esac\n    ;;\n  * ) # unhandled hosts (and \"normal\" native builds)\n    lt_cv_to_host_file_cmd=func_convert_file_noop\n    ;;\nesac\n])\nto_host_file_cmd=$lt_cv_to_host_file_cmd\nAC_MSG_RESULT([$lt_cv_to_host_file_cmd])\n_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],\n         [0], [convert $build file names to $host format])dnl\n\nAC_MSG_CHECKING([how to convert $build file names to toolchain format])\nAC_CACHE_VAL(lt_cv_to_tool_file_cmd,\n[#assume ordinary cross tools, or native build.\nlt_cv_to_tool_file_cmd=func_convert_file_noop\ncase $host in\n  *-*-mingw* )\n    case $build in\n      *-*-mingw* ) # actually msys\n        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32\n        ;;\n    esac\n    ;;\nesac\n])\nto_tool_file_cmd=$lt_cv_to_tool_file_cmd\nAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])\n_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],\n         [0], [convert $build files to toolchain format])dnl\n])# _LT_PATH_CONVERSION_FUNCTIONS\n\n# Helper functions for option handling.                    -*- Autoconf -*-\n#\n#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software\n#   Foundation, Inc.\n#   Written by Gary V. Vaughan, 2004\n#\n# This file is free software; the Free Software Foundation gives\n# unlimited permission to copy and/or distribute it, with or without\n# modifications, as long as this notice is preserved.\n\n# serial 8 ltoptions.m4\n\n# This is to help aclocal find these macros, as it can't see m4_define.\nAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])\n\n\n# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)\n# ------------------------------------------\nm4_define([_LT_MANGLE_OPTION],\n[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])\n\n\n# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)\n# ---------------------------------------\n# Set option OPTION-NAME for macro MACRO-NAME, and if there is a\n# matching handler defined, dispatch to it.  Other OPTION-NAMEs are\n# saved as a flag.\nm4_define([_LT_SET_OPTION],\n[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl\nm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),\n        _LT_MANGLE_DEFUN([$1], [$2]),\n    [m4_warning([Unknown $1 option '$2'])])[]dnl\n])\n\n\n# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])\n# ------------------------------------------------------------\n# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.\nm4_define([_LT_IF_OPTION],\n[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])\n\n\n# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)\n# -------------------------------------------------------\n# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME\n# are set.\nm4_define([_LT_UNLESS_OPTIONS],\n[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),\n\t    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),\n\t\t      [m4_define([$0_found])])])[]dnl\nm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3\n])[]dnl\n])\n\n\n# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)\n# ----------------------------------------\n# OPTION-LIST is a space-separated list of Libtool options associated\n# with MACRO-NAME.  If any OPTION has a matching handler declared with\n# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about\n# the unknown option and exit.\nm4_defun([_LT_SET_OPTIONS],\n[# Set options\nm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),\n    [_LT_SET_OPTION([$1], _LT_Option)])\n\nm4_if([$1],[LT_INIT],[\n  dnl\n  dnl Simply set some default values (i.e off) if boolean options were not\n  dnl specified:\n  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no\n  ])\n  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no\n  ])\n  dnl\n  dnl If no reference was made to various pairs of opposing options, then\n  dnl we run the default mode handler for the pair.  For example, if neither\n  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared\n  dnl archives by default:\n  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])\n  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])\n  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])\n  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],\n\t\t   [_LT_ENABLE_FAST_INSTALL])\n  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],\n\t\t   [_LT_WITH_AIX_SONAME([aix])])\n  ])\n])# _LT_SET_OPTIONS\n\n\n\n# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)\n# -----------------------------------------\nm4_define([_LT_MANGLE_DEFUN],\n[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])\n\n\n# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)\n# -----------------------------------------------\nm4_define([LT_OPTION_DEFINE],\n[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl\n])# LT_OPTION_DEFINE\n\n\n# dlopen\n# ------\nLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes\n])\n\nAU_DEFUN([AC_LIBTOOL_DLOPEN],\n[_LT_SET_OPTION([LT_INIT], [dlopen])\nAC_DIAGNOSE([obsolete],\n[$0: Remove this warning and the call to _LT_SET_OPTION when you\nput the 'dlopen' option into LT_INIT's first parameter.])\n])\n\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])\n\n\n# win32-dll\n# ---------\n# Declare package support for building win32 dll's.\nLT_OPTION_DEFINE([LT_INIT], [win32-dll],\n[enable_win32_dll=yes\n\ncase $host in\n*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)\n  AC_CHECK_TOOL(AS, as, false)\n  AC_CHECK_TOOL(DLLTOOL, dlltool, false)\n  AC_CHECK_TOOL(OBJDUMP, objdump, false)\n  ;;\nesac\n\ntest -z \"$AS\" && AS=as\n_LT_DECL([], [AS],      [1], [Assembler program])dnl\n\ntest -z \"$DLLTOOL\" && DLLTOOL=dlltool\n_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl\n\ntest -z \"$OBJDUMP\" && OBJDUMP=objdump\n_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl\n])# win32-dll\n\nAU_DEFUN([AC_LIBTOOL_WIN32_DLL],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\n_LT_SET_OPTION([LT_INIT], [win32-dll])\nAC_DIAGNOSE([obsolete],\n[$0: Remove this warning and the call to _LT_SET_OPTION when you\nput the 'win32-dll' option into LT_INIT's first parameter.])\n])\n\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])\n\n\n# _LT_ENABLE_SHARED([DEFAULT])\n# ----------------------------\n# implement the --enable-shared flag, and supports the 'shared' and\n# 'disable-shared' LT_INIT options.\n# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.\nm4_define([_LT_ENABLE_SHARED],\n[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl\nAC_ARG_ENABLE([shared],\n    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],\n\t[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],\n    [p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_shared=yes ;;\n    no) enable_shared=no ;;\n    *)\n      enable_shared=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for pkg in $enableval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_shared=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac],\n    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)\n\n    _LT_DECL([build_libtool_libs], [enable_shared], [0],\n\t[Whether or not to build shared libraries])\n])# _LT_ENABLE_SHARED\n\nLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])\nLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])\n\n# Old names:\nAC_DEFUN([AC_ENABLE_SHARED],\n[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])\n])\n\nAC_DEFUN([AC_DISABLE_SHARED],\n[_LT_SET_OPTION([LT_INIT], [disable-shared])\n])\n\nAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])\nAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])\n\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AM_ENABLE_SHARED], [])\ndnl AC_DEFUN([AM_DISABLE_SHARED], [])\n\n\n\n# _LT_ENABLE_STATIC([DEFAULT])\n# ----------------------------\n# implement the --enable-static flag, and support the 'static' and\n# 'disable-static' LT_INIT options.\n# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.\nm4_define([_LT_ENABLE_STATIC],\n[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl\nAC_ARG_ENABLE([static],\n    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],\n\t[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],\n    [p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_static=yes ;;\n    no) enable_static=no ;;\n    *)\n     enable_static=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for pkg in $enableval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_static=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac],\n    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)\n\n    _LT_DECL([build_old_libs], [enable_static], [0],\n\t[Whether or not to build static libraries])\n])# _LT_ENABLE_STATIC\n\nLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])\nLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])\n\n# Old names:\nAC_DEFUN([AC_ENABLE_STATIC],\n[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])\n])\n\nAC_DEFUN([AC_DISABLE_STATIC],\n[_LT_SET_OPTION([LT_INIT], [disable-static])\n])\n\nAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])\nAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])\n\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AM_ENABLE_STATIC], [])\ndnl AC_DEFUN([AM_DISABLE_STATIC], [])\n\n\n\n# _LT_ENABLE_FAST_INSTALL([DEFAULT])\n# ----------------------------------\n# implement the --enable-fast-install flag, and support the 'fast-install'\n# and 'disable-fast-install' LT_INIT options.\n# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.\nm4_define([_LT_ENABLE_FAST_INSTALL],\n[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl\nAC_ARG_ENABLE([fast-install],\n    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],\n    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],\n    [p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_fast_install=yes ;;\n    no) enable_fast_install=no ;;\n    *)\n      enable_fast_install=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for pkg in $enableval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_fast_install=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac],\n    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)\n\n_LT_DECL([fast_install], [enable_fast_install], [0],\n\t [Whether or not to optimize for fast installation])dnl\n])# _LT_ENABLE_FAST_INSTALL\n\nLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])\nLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])\n\n# Old names:\nAU_DEFUN([AC_ENABLE_FAST_INSTALL],\n[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])\nAC_DIAGNOSE([obsolete],\n[$0: Remove this warning and the call to _LT_SET_OPTION when you put\nthe 'fast-install' option into LT_INIT's first parameter.])\n])\n\nAU_DEFUN([AC_DISABLE_FAST_INSTALL],\n[_LT_SET_OPTION([LT_INIT], [disable-fast-install])\nAC_DIAGNOSE([obsolete],\n[$0: Remove this warning and the call to _LT_SET_OPTION when you put\nthe 'disable-fast-install' option into LT_INIT's first parameter.])\n])\n\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])\ndnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])\n\n\n# _LT_WITH_AIX_SONAME([DEFAULT])\n# ----------------------------------\n# implement the --with-aix-soname flag, and support the `aix-soname=aix'\n# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT\n# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.\nm4_define([_LT_WITH_AIX_SONAME],\n[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl\nshared_archive_member_spec=\ncase $host,$enable_shared in\npower*-*-aix[[5-9]]*,yes)\n  AC_MSG_CHECKING([which variant of shared library versioning to provide])\n  AC_ARG_WITH([aix-soname],\n    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],\n      [shared library versioning (aka \"SONAME\") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],\n    [case $withval in\n    aix|svr4|both)\n      ;;\n    *)\n      AC_MSG_ERROR([Unknown argument to --with-aix-soname])\n      ;;\n    esac\n    lt_cv_with_aix_soname=$with_aix_soname],\n    [AC_CACHE_VAL([lt_cv_with_aix_soname],\n      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)\n    with_aix_soname=$lt_cv_with_aix_soname])\n  AC_MSG_RESULT([$with_aix_soname])\n  if test aix != \"$with_aix_soname\"; then\n    # For the AIX way of multilib, we name the shared archive member\n    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',\n    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.\n    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,\n    # the AIX toolchain works better with OBJECT_MODE set (default 32).\n    if test 64 = \"${OBJECT_MODE-32}\"; then\n      shared_archive_member_spec=shr_64\n    else\n      shared_archive_member_spec=shr\n    fi\n  fi\n  ;;\n*)\n  with_aix_soname=aix\n  ;;\nesac\n\n_LT_DECL([], [shared_archive_member_spec], [0],\n    [Shared archive member basename, for filename based shared library versioning on AIX])dnl\n])# _LT_WITH_AIX_SONAME\n\nLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])\nLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])\nLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])\n\n\n# _LT_WITH_PIC([MODE])\n# --------------------\n# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'\n# LT_INIT options.\n# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.\nm4_define([_LT_WITH_PIC],\n[AC_ARG_WITH([pic],\n    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],\n\t[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],\n    [lt_p=${PACKAGE-default}\n    case $withval in\n    yes|no) pic_mode=$withval ;;\n    *)\n      pic_mode=default\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for lt_pkg in $withval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$lt_pkg\" = \"X$lt_p\"; then\n\t  pic_mode=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac],\n    [pic_mode=m4_default([$1], [default])])\n\n_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl\n])# _LT_WITH_PIC\n\nLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])\nLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])\n\n# Old name:\nAU_DEFUN([AC_LIBTOOL_PICMODE],\n[_LT_SET_OPTION([LT_INIT], [pic-only])\nAC_DIAGNOSE([obsolete],\n[$0: Remove this warning and the call to _LT_SET_OPTION when you\nput the 'pic-only' option into LT_INIT's first parameter.])\n])\n\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])\n\n\nm4_define([_LTDL_MODE], [])\nLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],\n\t\t [m4_define([_LTDL_MODE], [nonrecursive])])\nLT_OPTION_DEFINE([LTDL_INIT], [recursive],\n\t\t [m4_define([_LTDL_MODE], [recursive])])\nLT_OPTION_DEFINE([LTDL_INIT], [subproject],\n\t\t [m4_define([_LTDL_MODE], [subproject])])\n\nm4_define([_LTDL_TYPE], [])\nLT_OPTION_DEFINE([LTDL_INIT], [installable],\n\t\t [m4_define([_LTDL_TYPE], [installable])])\nLT_OPTION_DEFINE([LTDL_INIT], [convenience],\n\t\t [m4_define([_LTDL_TYPE], [convenience])])\n\n# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-\n#\n# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software\n# Foundation, Inc.\n# Written by Gary V. Vaughan, 2004\n#\n# This file is free software; the Free Software Foundation gives\n# unlimited permission to copy and/or distribute it, with or without\n# modifications, as long as this notice is preserved.\n\n# serial 6 ltsugar.m4\n\n# This is to help aclocal find these macros, as it can't see m4_define.\nAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])\n\n\n# lt_join(SEP, ARG1, [ARG2...])\n# -----------------------------\n# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their\n# associated separator.\n# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier\n# versions in m4sugar had bugs.\nm4_define([lt_join],\n[m4_if([$#], [1], [],\n       [$#], [2], [[$2]],\n       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])\nm4_define([_lt_join],\n[m4_if([$#$2], [2], [],\n       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])\n\n\n# lt_car(LIST)\n# lt_cdr(LIST)\n# ------------\n# Manipulate m4 lists.\n# These macros are necessary as long as will still need to support\n# Autoconf-2.59, which quotes differently.\nm4_define([lt_car], [[$1]])\nm4_define([lt_cdr],\n[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],\n       [$#], 1, [],\n       [m4_dquote(m4_shift($@))])])\nm4_define([lt_unquote], $1)\n\n\n# lt_append(MACRO-NAME, STRING, [SEPARATOR])\n# ------------------------------------------\n# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.\n# Note that neither SEPARATOR nor STRING are expanded; they are appended\n# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).\n# No SEPARATOR is output if MACRO-NAME was previously undefined (different\n# than defined and empty).\n#\n# This macro is needed until we can rely on Autoconf 2.62, since earlier\n# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.\nm4_define([lt_append],\n[m4_define([$1],\n\t   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])\n\n\n\n# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])\n# ----------------------------------------------------------\n# Produce a SEP delimited list of all paired combinations of elements of\n# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list\n# has the form PREFIXmINFIXSUFFIXn.\n# Needed until we can rely on m4_combine added in Autoconf 2.62.\nm4_define([lt_combine],\n[m4_if(m4_eval([$# > 3]), [1],\n       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl\n[[m4_foreach([_Lt_prefix], [$2],\n\t     [m4_foreach([_Lt_suffix],\n\t\t]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,\n\t[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])\n\n\n# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])\n# -----------------------------------------------------------------------\n# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited\n# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.\nm4_define([lt_if_append_uniq],\n[m4_ifdef([$1],\n\t  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],\n\t\t [lt_append([$1], [$2], [$3])$4],\n\t\t [$5])],\n\t  [lt_append([$1], [$2], [$3])$4])])\n\n\n# lt_dict_add(DICT, KEY, VALUE)\n# -----------------------------\nm4_define([lt_dict_add],\n[m4_define([$1($2)], [$3])])\n\n\n# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)\n# --------------------------------------------\nm4_define([lt_dict_add_subkey],\n[m4_define([$1($2:$3)], [$4])])\n\n\n# lt_dict_fetch(DICT, KEY, [SUBKEY])\n# ----------------------------------\nm4_define([lt_dict_fetch],\n[m4_ifval([$3],\n\tm4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),\n    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])\n\n\n# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])\n# -----------------------------------------------------------------\nm4_define([lt_if_dict_fetch],\n[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],\n\t[$5],\n    [$6])])\n\n\n# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])\n# --------------------------------------------------------------\nm4_define([lt_dict_filter],\n[m4_if([$5], [], [],\n  [lt_join(m4_quote(m4_default([$4], [[, ]])),\n           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),\n\t\t      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl\n])\n\n# ltversion.m4 -- version numbers\t\t\t-*- Autoconf -*-\n#\n#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.\n#   Written by Scott James Remnant, 2004\n#\n# This file is free software; the Free Software Foundation gives\n# unlimited permission to copy and/or distribute it, with or without\n# modifications, as long as this notice is preserved.\n\n# @configure_input@\n\n# serial 4179 ltversion.m4\n# This file is part of GNU Libtool\n\nm4_define([LT_PACKAGE_VERSION], [2.4.6])\nm4_define([LT_PACKAGE_REVISION], [2.4.6])\n\nAC_DEFUN([LTVERSION_VERSION],\n[macro_version='2.4.6'\nmacro_revision='2.4.6'\n_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])\n_LT_DECL(, macro_revision, 0)\n])\n\n# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-\n#\n#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software\n#   Foundation, Inc.\n#   Written by Scott James Remnant, 2004.\n#\n# This file is free software; the Free Software Foundation gives\n# unlimited permission to copy and/or distribute it, with or without\n# modifications, as long as this notice is preserved.\n\n# serial 5 lt~obsolete.m4\n\n# These exist entirely to fool aclocal when bootstrapping libtool.\n#\n# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),\n# which have later been changed to m4_define as they aren't part of the\n# exported API, or moved to Autoconf or Automake where they belong.\n#\n# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN\n# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us\n# using a macro with the same name in our local m4/libtool.m4 it'll\n# pull the old libtool.m4 in (it doesn't see our shiny new m4_define\n# and doesn't know about Autoconf macros at all.)\n#\n# So we provide this file, which has a silly filename so it's always\n# included after everything else.  This provides aclocal with the\n# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything\n# because those macros already exist, or will be overwritten later.\n# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.\n#\n# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.\n# Yes, that means every name once taken will need to remain here until\n# we give up compatibility with versions before 1.7, at which point\n# we need to keep only those names which we still refer to.\n\n# This is to help aclocal find these macros, as it can't see m4_define.\nAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])\n\nm4_ifndef([AC_LIBTOOL_LINKER_OPTION],\t[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])\nm4_ifndef([AC_PROG_EGREP],\t\t[AC_DEFUN([AC_PROG_EGREP])])\nm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],\t[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])\nm4_ifndef([_LT_AC_SHELL_INIT],\t\t[AC_DEFUN([_LT_AC_SHELL_INIT])])\nm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],\t[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])\nm4_ifndef([_LT_PROG_LTMAIN],\t\t[AC_DEFUN([_LT_PROG_LTMAIN])])\nm4_ifndef([_LT_AC_TAGVAR],\t\t[AC_DEFUN([_LT_AC_TAGVAR])])\nm4_ifndef([AC_LTDL_ENABLE_INSTALL],\t[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])\nm4_ifndef([AC_LTDL_PREOPEN],\t\t[AC_DEFUN([AC_LTDL_PREOPEN])])\nm4_ifndef([_LT_AC_SYS_COMPILER],\t[AC_DEFUN([_LT_AC_SYS_COMPILER])])\nm4_ifndef([_LT_AC_LOCK],\t\t[AC_DEFUN([_LT_AC_LOCK])])\nm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],\t[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])\nm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],\t[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])\nm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],\t[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])\nm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])\nm4_ifndef([AC_LIBTOOL_OBJDIR],\t\t[AC_DEFUN([AC_LIBTOOL_OBJDIR])])\nm4_ifndef([AC_LTDL_OBJDIR],\t\t[AC_DEFUN([AC_LTDL_OBJDIR])])\nm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])\nm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],\t[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])\nm4_ifndef([AC_PATH_MAGIC],\t\t[AC_DEFUN([AC_PATH_MAGIC])])\nm4_ifndef([AC_PROG_LD_GNU],\t\t[AC_DEFUN([AC_PROG_LD_GNU])])\nm4_ifndef([AC_PROG_LD_RELOAD_FLAG],\t[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])\nm4_ifndef([AC_DEPLIBS_CHECK_METHOD],\t[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])\nm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])\nm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])\nm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])\nm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],\t[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])\nm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],\t[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])\nm4_ifndef([LT_AC_PROG_EGREP],\t\t[AC_DEFUN([LT_AC_PROG_EGREP])])\nm4_ifndef([LT_AC_PROG_SED],\t\t[AC_DEFUN([LT_AC_PROG_SED])])\nm4_ifndef([_LT_CC_BASENAME],\t\t[AC_DEFUN([_LT_CC_BASENAME])])\nm4_ifndef([_LT_COMPILER_BOILERPLATE],\t[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])\nm4_ifndef([_LT_LINKER_BOILERPLATE],\t[AC_DEFUN([_LT_LINKER_BOILERPLATE])])\nm4_ifndef([_AC_PROG_LIBTOOL],\t\t[AC_DEFUN([_AC_PROG_LIBTOOL])])\nm4_ifndef([AC_LIBTOOL_SETUP],\t\t[AC_DEFUN([AC_LIBTOOL_SETUP])])\nm4_ifndef([_LT_AC_CHECK_DLFCN],\t\t[AC_DEFUN([_LT_AC_CHECK_DLFCN])])\nm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],\t[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])\nm4_ifndef([_LT_AC_TAGCONFIG],\t\t[AC_DEFUN([_LT_AC_TAGCONFIG])])\nm4_ifndef([AC_DISABLE_FAST_INSTALL],\t[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])\nm4_ifndef([_LT_AC_LANG_CXX],\t\t[AC_DEFUN([_LT_AC_LANG_CXX])])\nm4_ifndef([_LT_AC_LANG_F77],\t\t[AC_DEFUN([_LT_AC_LANG_F77])])\nm4_ifndef([_LT_AC_LANG_GCJ],\t\t[AC_DEFUN([_LT_AC_LANG_GCJ])])\nm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],\t[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])\nm4_ifndef([_LT_AC_LANG_C_CONFIG],\t[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])\nm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],\t[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])\nm4_ifndef([_LT_AC_LANG_CXX_CONFIG],\t[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])\nm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],\t[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])\nm4_ifndef([_LT_AC_LANG_F77_CONFIG],\t[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])\nm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],\t[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])\nm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],\t[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])\nm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],\t[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])\nm4_ifndef([_LT_AC_LANG_RC_CONFIG],\t[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])\nm4_ifndef([AC_LIBTOOL_CONFIG],\t\t[AC_DEFUN([AC_LIBTOOL_CONFIG])])\nm4_ifndef([_LT_AC_FILE_LTDLL_C],\t[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])\nm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],\t[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])\nm4_ifndef([_LT_AC_PROG_CXXCPP],\t\t[AC_DEFUN([_LT_AC_PROG_CXXCPP])])\nm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],\t[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])\nm4_ifndef([_LT_PROG_ECHO_BACKSLASH],\t[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])\nm4_ifndef([_LT_PROG_F77],\t\t[AC_DEFUN([_LT_PROG_F77])])\nm4_ifndef([_LT_PROG_FC],\t\t[AC_DEFUN([_LT_PROG_FC])])\nm4_ifndef([_LT_PROG_CXX],\t\t[AC_DEFUN([_LT_PROG_CXX])])\n\n# Copyright (C) 2002-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_AUTOMAKE_VERSION(VERSION)\n# ----------------------------\n# Automake X.Y traces this macro to ensure aclocal.m4 has been\n# generated from the m4 files accompanying Automake X.Y.\n# (This private macro should not be called outside this file.)\nAC_DEFUN([AM_AUTOMAKE_VERSION],\n[am__api_version='1.15'\ndnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to\ndnl require some minimum version.  Point them to the right macro.\nm4_if([$1], [1.15], [],\n      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl\n])\n\n# _AM_AUTOCONF_VERSION(VERSION)\n# -----------------------------\n# aclocal traces this macro to find the Autoconf version.\n# This is a private macro too.  Using m4_define simplifies\n# the logic in aclocal, which can simply ignore this definition.\nm4_define([_AM_AUTOCONF_VERSION], [])\n\n# AM_SET_CURRENT_AUTOMAKE_VERSION\n# -------------------------------\n# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.\n# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.\nAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],\n[AM_AUTOMAKE_VERSION([1.15])dnl\nm4_ifndef([AC_AUTOCONF_VERSION],\n  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl\n_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])\n\n# Copyright (C) 2011-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_PROG_AR([ACT-IF-FAIL])\n# -------------------------\n# Try to determine the archiver interface, and trigger the ar-lib wrapper\n# if it is needed.  If the detection of archiver interface fails, run\n# ACT-IF-FAIL (default is to abort configure with a proper error message).\nAC_DEFUN([AM_PROG_AR],\n[AC_BEFORE([$0], [LT_INIT])dnl\nAC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl\nAC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\nAC_REQUIRE_AUX_FILE([ar-lib])dnl\nAC_CHECK_TOOLS([AR], [ar lib \"link -lib\"], [false])\n: ${AR=ar}\n\nAC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],\n  [AC_LANG_PUSH([C])\n   am_cv_ar_interface=ar\n   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],\n     [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'\n      AC_TRY_EVAL([am_ar_try])\n      if test \"$ac_status\" -eq 0; then\n        am_cv_ar_interface=ar\n      else\n        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'\n        AC_TRY_EVAL([am_ar_try])\n        if test \"$ac_status\" -eq 0; then\n          am_cv_ar_interface=lib\n        else\n          am_cv_ar_interface=unknown\n        fi\n      fi\n      rm -f conftest.lib libconftest.a\n     ])\n   AC_LANG_POP([C])])\n\ncase $am_cv_ar_interface in\nar)\n  ;;\nlib)\n  # Microsoft lib, so override with the ar-lib wrapper script.\n  # FIXME: It is wrong to rewrite AR.\n  # But if we don't then we get into trouble of one sort or another.\n  # A longer-term fix would be to have automake use am__AR in this case,\n  # and then we could set am__AR=\"$am_aux_dir/ar-lib \\$(AR)\" or something\n  # similar.\n  AR=\"$am_aux_dir/ar-lib $AR\"\n  ;;\nunknown)\n  m4_default([$1],\n             [AC_MSG_ERROR([could not determine $AR interface])])\n  ;;\nesac\nAC_SUBST([AR])dnl\n])\n\n# Figure out how to run the assembler.                      -*- Autoconf -*-\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_PROG_AS\n# ----------\nAC_DEFUN([AM_PROG_AS],\n[# By default we simply use the C compiler to build assembly code.\nAC_REQUIRE([AC_PROG_CC])\ntest \"${CCAS+set}\" = set || CCAS=$CC\ntest \"${CCASFLAGS+set}\" = set || CCASFLAGS=$CFLAGS\nAC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])\nAC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])\n_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl\n])\n\n# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets\n# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to\n# '$srcdir', '$srcdir/..', or '$srcdir/../..'.\n#\n# Of course, Automake must honor this variable whenever it calls a\n# tool from the auxiliary directory.  The problem is that $srcdir (and\n# therefore $ac_aux_dir as well) can be either absolute or relative,\n# depending on how configure is run.  This is pretty annoying, since\n# it makes $ac_aux_dir quite unusable in subdirectories: in the top\n# source directory, any form will work fine, but in subdirectories a\n# relative path needs to be adjusted first.\n#\n# $ac_aux_dir/missing\n#    fails when called from a subdirectory if $ac_aux_dir is relative\n# $top_srcdir/$ac_aux_dir/missing\n#    fails if $ac_aux_dir is absolute,\n#    fails when called from a subdirectory in a VPATH build with\n#          a relative $ac_aux_dir\n#\n# The reason of the latter failure is that $top_srcdir and $ac_aux_dir\n# are both prefixed by $srcdir.  In an in-source build this is usually\n# harmless because $srcdir is '.', but things will broke when you\n# start a VPATH build or use an absolute $srcdir.\n#\n# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,\n# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:\n#   am_aux_dir='\\$(top_srcdir)/'`expr \"$ac_aux_dir\" : \"$srcdir//*\\(.*\\)\"`\n# and then we would define $MISSING as\n#   MISSING=\"\\${SHELL} $am_aux_dir/missing\"\n# This will work as long as MISSING is not called from configure, because\n# unfortunately $(top_srcdir) has no meaning in configure.\n# However there are other variables, like CC, which are often used in\n# configure, and could therefore not use this \"fixed\" $ac_aux_dir.\n#\n# Another solution, used here, is to always expand $ac_aux_dir to an\n# absolute PATH.  The drawback is that using absolute paths prevent a\n# configured tree to be moved without reconfiguration.\n\nAC_DEFUN([AM_AUX_DIR_EXPAND],\n[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl\n# Expand $ac_aux_dir to an absolute path.\nam_aux_dir=`cd \"$ac_aux_dir\" && pwd`\n])\n\n# AM_CONDITIONAL                                            -*- Autoconf -*-\n\n# Copyright (C) 1997-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_CONDITIONAL(NAME, SHELL-CONDITION)\n# -------------------------------------\n# Define a conditional.\nAC_DEFUN([AM_CONDITIONAL],\n[AC_PREREQ([2.52])dnl\n m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],\n       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl\nAC_SUBST([$1_TRUE])dnl\nAC_SUBST([$1_FALSE])dnl\n_AM_SUBST_NOTMAKE([$1_TRUE])dnl\n_AM_SUBST_NOTMAKE([$1_FALSE])dnl\nm4_define([_AM_COND_VALUE_$1], [$2])dnl\nif $2; then\n  $1_TRUE=\n  $1_FALSE='#'\nelse\n  $1_TRUE='#'\n  $1_FALSE=\nfi\nAC_CONFIG_COMMANDS_PRE(\n[if test -z \"${$1_TRUE}\" && test -z \"${$1_FALSE}\"; then\n  AC_MSG_ERROR([[conditional \"$1\" was never defined.\nUsually this means the macro was only invoked conditionally.]])\nfi])])\n\n# Copyright (C) 1999-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n\n# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be\n# written in clear, in which case automake, when reading aclocal.m4,\n# will think it sees a *use*, and therefore will trigger all it's\n# C support machinery.  Also note that it means that autoscan, seeing\n# CC etc. in the Makefile, will ask for an AC_PROG_CC use...\n\n\n# _AM_DEPENDENCIES(NAME)\n# ----------------------\n# See how the compiler implements dependency checking.\n# NAME is \"CC\", \"CXX\", \"OBJC\", \"OBJCXX\", \"UPC\", or \"GJC\".\n# We try a few techniques and use that to set a single cache variable.\n#\n# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was\n# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular\n# dependency, and given that the user is not expected to run this macro,\n# just rely on AC_PROG_CC.\nAC_DEFUN([_AM_DEPENDENCIES],\n[AC_REQUIRE([AM_SET_DEPDIR])dnl\nAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl\nAC_REQUIRE([AM_MAKE_INCLUDE])dnl\nAC_REQUIRE([AM_DEP_TRACK])dnl\n\nm4_if([$1], [CC],   [depcc=\"$CC\"   am_compiler_list=],\n      [$1], [CXX],  [depcc=\"$CXX\"  am_compiler_list=],\n      [$1], [OBJC], [depcc=\"$OBJC\" am_compiler_list='gcc3 gcc'],\n      [$1], [OBJCXX], [depcc=\"$OBJCXX\" am_compiler_list='gcc3 gcc'],\n      [$1], [UPC],  [depcc=\"$UPC\"  am_compiler_list=],\n      [$1], [GCJ],  [depcc=\"$GCJ\"  am_compiler_list='gcc3 gcc'],\n                    [depcc=\"$$1\"   am_compiler_list=])\n\nAC_CACHE_CHECK([dependency style of $depcc],\n               [am_cv_$1_dependencies_compiler_type],\n[if test -z \"$AMDEP_TRUE\" && test -f \"$am_depcomp\"; then\n  # We make a subdir and do the tests there.  Otherwise we can end up\n  # making bogus files that we don't know about and never remove.  For\n  # instance it was reported that on HP-UX the gcc test will end up\n  # making a dummy file named 'D' -- because '-MD' means \"put the output\n  # in D\".\n  rm -rf conftest.dir\n  mkdir conftest.dir\n  # Copy depcomp to subdir because otherwise we won't find it if we're\n  # using a relative directory.\n  cp \"$am_depcomp\" conftest.dir\n  cd conftest.dir\n  # We will build objects and dependencies in a subdirectory because\n  # it helps to detect inapplicable dependency modes.  For instance\n  # both Tru64's cc and ICC support -MD to output dependencies as a\n  # side effect of compilation, but ICC will put the dependencies in\n  # the current directory while Tru64 will put them in the object\n  # directory.\n  mkdir sub\n\n  am_cv_$1_dependencies_compiler_type=none\n  if test \"$am_compiler_list\" = \"\"; then\n     am_compiler_list=`sed -n ['s/^#*\\([a-zA-Z0-9]*\\))$/\\1/p'] < ./depcomp`\n  fi\n  am__universal=false\n  m4_case([$1], [CC],\n    [case \" $depcc \" in #(\n     *\\ -arch\\ *\\ -arch\\ *) am__universal=true ;;\n     esac],\n    [CXX],\n    [case \" $depcc \" in #(\n     *\\ -arch\\ *\\ -arch\\ *) am__universal=true ;;\n     esac])\n\n  for depmode in $am_compiler_list; do\n    # Setup a source with many dependencies, because some compilers\n    # like to wrap large dependency lists on column 80 (with \\), and\n    # we should not choose a depcomp mode which is confused by this.\n    #\n    # We need to recreate these files for each test, as the compiler may\n    # overwrite some of them when testing with obscure command lines.\n    # This happens at least with the AIX C compiler.\n    : > sub/conftest.c\n    for i in 1 2 3 4 5 6; do\n      echo '#include \"conftst'$i'.h\"' >> sub/conftest.c\n      # Using \": > sub/conftst$i.h\" creates only sub/conftst1.h with\n      # Solaris 10 /bin/sh.\n      echo '/* dummy */' > sub/conftst$i.h\n    done\n    echo \"${am__include} ${am__quote}sub/conftest.Po${am__quote}\" > confmf\n\n    # We check with '-c' and '-o' for the sake of the \"dashmstdout\"\n    # mode.  It turns out that the SunPro C++ compiler does not properly\n    # handle '-M -o', and we need to detect this.  Also, some Intel\n    # versions had trouble with output in subdirs.\n    am__obj=sub/conftest.${OBJEXT-o}\n    am__minus_obj=\"-o $am__obj\"\n    case $depmode in\n    gcc)\n      # This depmode causes a compiler race in universal mode.\n      test \"$am__universal\" = false || continue\n      ;;\n    nosideeffect)\n      # After this tag, mechanisms are not by side-effect, so they'll\n      # only be used when explicitly requested.\n      if test \"x$enable_dependency_tracking\" = xyes; then\n\tcontinue\n      else\n\tbreak\n      fi\n      ;;\n    msvc7 | msvc7msys | msvisualcpp | msvcmsys)\n      # This compiler won't grok '-c -o', but also, the minuso test has\n      # not run yet.  These depmodes are late enough in the game, and\n      # so weak that their functioning should not be impacted.\n      am__obj=conftest.${OBJEXT-o}\n      am__minus_obj=\n      ;;\n    none) break ;;\n    esac\n    if depmode=$depmode \\\n       source=sub/conftest.c object=$am__obj \\\n       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \\\n       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \\\n         >/dev/null 2>conftest.err &&\n       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&\n       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then\n      # icc doesn't choke on unknown options, it will just issue warnings\n      # or remarks (even with -Werror).  So we grep stderr for any message\n      # that says an option was ignored or not supported.\n      # When given -MP, icc 7.0 and 7.1 complain thusly:\n      #   icc: Command line warning: ignoring option '-M'; no argument required\n      # The diagnosis changed in icc 8.0:\n      #   icc: Command line remark: option '-MP' not supported\n      if (grep 'ignoring option' conftest.err ||\n          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else\n        am_cv_$1_dependencies_compiler_type=$depmode\n        break\n      fi\n    fi\n  done\n\n  cd ..\n  rm -rf conftest.dir\nelse\n  am_cv_$1_dependencies_compiler_type=none\nfi\n])\nAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])\nAM_CONDITIONAL([am__fastdep$1], [\n  test \"x$enable_dependency_tracking\" != xno \\\n  && test \"$am_cv_$1_dependencies_compiler_type\" = gcc3])\n])\n\n\n# AM_SET_DEPDIR\n# -------------\n# Choose a directory name for dependency files.\n# This macro is AC_REQUIREd in _AM_DEPENDENCIES.\nAC_DEFUN([AM_SET_DEPDIR],\n[AC_REQUIRE([AM_SET_LEADING_DOT])dnl\nAC_SUBST([DEPDIR], [\"${am__leading_dot}deps\"])dnl\n])\n\n\n# AM_DEP_TRACK\n# ------------\nAC_DEFUN([AM_DEP_TRACK],\n[AC_ARG_ENABLE([dependency-tracking], [dnl\nAS_HELP_STRING(\n  [--enable-dependency-tracking],\n  [do not reject slow dependency extractors])\nAS_HELP_STRING(\n  [--disable-dependency-tracking],\n  [speeds up one-time build])])\nif test \"x$enable_dependency_tracking\" != xno; then\n  am_depcomp=\"$ac_aux_dir/depcomp\"\n  AMDEPBACKSLASH='\\'\n  am__nodep='_no'\nfi\nAM_CONDITIONAL([AMDEP], [test \"x$enable_dependency_tracking\" != xno])\nAC_SUBST([AMDEPBACKSLASH])dnl\n_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl\nAC_SUBST([am__nodep])dnl\n_AM_SUBST_NOTMAKE([am__nodep])dnl\n])\n\n# Generate code to set up dependency tracking.              -*- Autoconf -*-\n\n# Copyright (C) 1999-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n\n# _AM_OUTPUT_DEPENDENCY_COMMANDS\n# ------------------------------\nAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],\n[{\n  # Older Autoconf quotes --file arguments for eval, but not when files\n  # are listed without --file.  Let's play safe and only enable the eval\n  # if we detect the quoting.\n  case $CONFIG_FILES in\n  *\\'*) eval set x \"$CONFIG_FILES\" ;;\n  *)   set x $CONFIG_FILES ;;\n  esac\n  shift\n  for mf\n  do\n    # Strip MF so we end up with the name of the file.\n    mf=`echo \"$mf\" | sed -e 's/:.*$//'`\n    # Check whether this is an Automake generated Makefile or not.\n    # We used to match only the files named 'Makefile.in', but\n    # some people rename them; so instead we look at the file content.\n    # Grep'ing the first line is not enough: some people post-process\n    # each Makefile.in and add a new line on top of each file to say so.\n    # Grep'ing the whole file is not good either: AIX grep has a line\n    # limit of 2048, but all sed's we know have understand at least 4000.\n    if sed -n 's,^#.*generated by automake.*,X,p' \"$mf\" | grep X >/dev/null 2>&1; then\n      dirpart=`AS_DIRNAME(\"$mf\")`\n    else\n      continue\n    fi\n    # Extract the definition of DEPDIR, am__include, and am__quote\n    # from the Makefile without running 'make'.\n    DEPDIR=`sed -n 's/^DEPDIR = //p' < \"$mf\"`\n    test -z \"$DEPDIR\" && continue\n    am__include=`sed -n 's/^am__include = //p' < \"$mf\"`\n    test -z \"$am__include\" && continue\n    am__quote=`sed -n 's/^am__quote = //p' < \"$mf\"`\n    # Find all dependency output files, they are included files with\n    # $(DEPDIR) in their names.  We invoke sed twice because it is the\n    # simplest approach to changing $(DEPDIR) to its actual value in the\n    # expansion.\n    for file in `sed -n \"\n      s/^$am__include $am__quote\\(.*(DEPDIR).*\\)$am__quote\"'$/\\1/p' <\"$mf\" | \\\n\t sed -e 's/\\$(DEPDIR)/'\"$DEPDIR\"'/g'`; do\n      # Make sure the directory exists.\n      test -f \"$dirpart/$file\" && continue\n      fdir=`AS_DIRNAME([\"$file\"])`\n      AS_MKDIR_P([$dirpart/$fdir])\n      # echo \"creating $dirpart/$file\"\n      echo '# dummy' > \"$dirpart/$file\"\n    done\n  done\n}\n])# _AM_OUTPUT_DEPENDENCY_COMMANDS\n\n\n# AM_OUTPUT_DEPENDENCY_COMMANDS\n# -----------------------------\n# This macro should only be invoked once -- use via AC_REQUIRE.\n#\n# This code is only required when automatic dependency tracking\n# is enabled.  FIXME.  This creates each '.P' file that we will\n# need in order to bootstrap the dependency handling code.\nAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],\n[AC_CONFIG_COMMANDS([depfiles],\n     [test x\"$AMDEP_TRUE\" != x\"\" || _AM_OUTPUT_DEPENDENCY_COMMANDS],\n     [AMDEP_TRUE=\"$AMDEP_TRUE\" ac_aux_dir=\"$ac_aux_dir\"])\n])\n\n# Do all the work for Automake.                             -*- Autoconf -*-\n\n# Copyright (C) 1996-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This macro actually does too much.  Some checks are only needed if\n# your package does certain things.  But this isn't really a big deal.\n\ndnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.\nm4_define([AC_PROG_CC],\nm4_defn([AC_PROG_CC])\n[_AM_PROG_CC_C_O\n])\n\n# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])\n# AM_INIT_AUTOMAKE([OPTIONS])\n# -----------------------------------------------\n# The call with PACKAGE and VERSION arguments is the old style\n# call (pre autoconf-2.50), which is being phased out.  PACKAGE\n# and VERSION should now be passed to AC_INIT and removed from\n# the call to AM_INIT_AUTOMAKE.\n# We support both call styles for the transition.  After\n# the next Automake release, Autoconf can make the AC_INIT\n# arguments mandatory, and then we can depend on a new Autoconf\n# release and drop the old call support.\nAC_DEFUN([AM_INIT_AUTOMAKE],\n[AC_PREREQ([2.65])dnl\ndnl Autoconf wants to disallow AM_ names.  We explicitly allow\ndnl the ones we care about.\nm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl\nAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl\nAC_REQUIRE([AC_PROG_INSTALL])dnl\nif test \"`cd $srcdir && pwd`\" != \"`pwd`\"; then\n  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output\n  # is not polluted with repeated \"-I.\"\n  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl\n  # test to see if srcdir already configured\n  if test -f $srcdir/config.status; then\n    AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])\n  fi\nfi\n\n# test whether we have cygpath\nif test -z \"$CYGPATH_W\"; then\n  if (cygpath --version) >/dev/null 2>/dev/null; then\n    CYGPATH_W='cygpath -w'\n  else\n    CYGPATH_W=echo\n  fi\nfi\nAC_SUBST([CYGPATH_W])\n\n# Define the identity of the package.\ndnl Distinguish between old-style and new-style calls.\nm4_ifval([$2],\n[AC_DIAGNOSE([obsolete],\n             [$0: two- and three-arguments forms are deprecated.])\nm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl\n AC_SUBST([PACKAGE], [$1])dnl\n AC_SUBST([VERSION], [$2])],\n[_AM_SET_OPTIONS([$1])dnl\ndnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.\nm4_if(\n  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),\n  [ok:ok],,\n  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl\n AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl\n AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl\n\n_AM_IF_OPTION([no-define],,\n[AC_DEFINE_UNQUOTED([PACKAGE], [\"$PACKAGE\"], [Name of package])\n AC_DEFINE_UNQUOTED([VERSION], [\"$VERSION\"], [Version number of package])])dnl\n\n# Some tools Automake needs.\nAC_REQUIRE([AM_SANITY_CHECK])dnl\nAC_REQUIRE([AC_ARG_PROGRAM])dnl\nAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])\nAM_MISSING_PROG([AUTOCONF], [autoconf])\nAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])\nAM_MISSING_PROG([AUTOHEADER], [autoheader])\nAM_MISSING_PROG([MAKEINFO], [makeinfo])\nAC_REQUIRE([AM_PROG_INSTALL_SH])dnl\nAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl\nAC_REQUIRE([AC_PROG_MKDIR_P])dnl\n# For better backward compatibility.  To be removed once Automake 1.9.x\n# dies out for good.  For more background, see:\n# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>\n# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>\nAC_SUBST([mkdir_p], ['$(MKDIR_P)'])\n# We need awk for the \"check\" target (and possibly the TAP driver).  The\n# system \"awk\" is bad on some platforms.\nAC_REQUIRE([AC_PROG_AWK])dnl\nAC_REQUIRE([AC_PROG_MAKE_SET])dnl\nAC_REQUIRE([AM_SET_LEADING_DOT])dnl\n_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],\n\t      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],\n\t\t\t     [_AM_PROG_TAR([v7])])])\n_AM_IF_OPTION([no-dependencies],,\n[AC_PROVIDE_IFELSE([AC_PROG_CC],\n\t\t  [_AM_DEPENDENCIES([CC])],\n\t\t  [m4_define([AC_PROG_CC],\n\t\t\t     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl\nAC_PROVIDE_IFELSE([AC_PROG_CXX],\n\t\t  [_AM_DEPENDENCIES([CXX])],\n\t\t  [m4_define([AC_PROG_CXX],\n\t\t\t     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl\nAC_PROVIDE_IFELSE([AC_PROG_OBJC],\n\t\t  [_AM_DEPENDENCIES([OBJC])],\n\t\t  [m4_define([AC_PROG_OBJC],\n\t\t\t     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl\nAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],\n\t\t  [_AM_DEPENDENCIES([OBJCXX])],\n\t\t  [m4_define([AC_PROG_OBJCXX],\n\t\t\t     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl\n])\nAC_REQUIRE([AM_SILENT_RULES])dnl\ndnl The testsuite driver may need to know about EXEEXT, so add the\ndnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This\ndnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.\nAC_CONFIG_COMMANDS_PRE(dnl\n[m4_provide_if([_AM_COMPILER_EXEEXT],\n  [AM_CONDITIONAL([am__EXEEXT], [test -n \"$EXEEXT\"])])])dnl\n\n# POSIX will say in a future version that running \"rm -f\" with no argument\n# is OK; and we want to be able to make that assumption in our Makefile\n# recipes.  So use an aggressive probe to check that the usage we want is\n# actually supported \"in the wild\" to an acceptable degree.\n# See automake bug#10828.\n# To make any issue more visible, cause the running configure to be aborted\n# by default if the 'rm' program in use doesn't match our expectations; the\n# user can still override this though.\nif rm -f && rm -fr && rm -rf; then : OK; else\n  cat >&2 <<'END'\nOops!\n\nYour 'rm' program seems unable to run without file operands specified\non the command line, even when the '-f' option is present.  This is contrary\nto the behaviour of most rm programs out there, and not conforming with\nthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>\n\nPlease tell bug-automake@gnu.org about your system, including the value\nof your $PATH and any error possibly output before this message.  This\ncan help us improve future automake versions.\n\nEND\n  if test x\"$ACCEPT_INFERIOR_RM_PROGRAM\" = x\"yes\"; then\n    echo 'Configuration will proceed anyway, since you have set the' >&2\n    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to \"yes\"' >&2\n    echo >&2\n  else\n    cat >&2 <<'END'\nAborting the configuration process, to ensure you take notice of the issue.\n\nYou can download and install GNU coreutils to get an 'rm' implementation\nthat behaves properly: <http://www.gnu.org/software/coreutils/>.\n\nIf you want to complete the configuration process using your problematic\n'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM\nto \"yes\", and re-run configure.\n\nEND\n    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])\n  fi\nfi\ndnl The trailing newline in this macro's definition is deliberate, for\ndnl backward compatibility and to allow trailing 'dnl'-style comments\ndnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.\n])\n\ndnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not\ndnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further\ndnl mangled by Autoconf and run in a shell conditional statement.\nm4_define([_AC_COMPILER_EXEEXT],\nm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])\n\n# When config.status generates a header, we must update the stamp-h file.\n# This file resides in the same directory as the config header\n# that is generated.  The stamp files are numbered to have different names.\n\n# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the\n# loop where config.status creates the headers, so we can generate\n# our stamp files there.\nAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],\n[# Compute $1's index in $config_headers.\n_am_arg=$1\n_am_stamp_count=1\nfor _am_header in $config_headers :; do\n  case $_am_header in\n    $_am_arg | $_am_arg:* )\n      break ;;\n    * )\n      _am_stamp_count=`expr $_am_stamp_count + 1` ;;\n  esac\ndone\necho \"timestamp for $_am_arg\" >`AS_DIRNAME([\"$_am_arg\"])`/stamp-h[]$_am_stamp_count])\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_PROG_INSTALL_SH\n# ------------------\n# Define $install_sh.\nAC_DEFUN([AM_PROG_INSTALL_SH],\n[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\nif test x\"${install_sh+set}\" != xset; then\n  case $am_aux_dir in\n  *\\ * | *\\\t*)\n    install_sh=\"\\${SHELL} '$am_aux_dir/install-sh'\" ;;\n  *)\n    install_sh=\"\\${SHELL} $am_aux_dir/install-sh\"\n  esac\nfi\nAC_SUBST([install_sh])])\n\n# Copyright (C) 2003-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# Check whether the underlying file-system supports filenames\n# with a leading dot.  For instance MS-DOS doesn't.\nAC_DEFUN([AM_SET_LEADING_DOT],\n[rm -rf .tst 2>/dev/null\nmkdir .tst 2>/dev/null\nif test -d .tst; then\n  am__leading_dot=.\nelse\n  am__leading_dot=_\nfi\nrmdir .tst 2>/dev/null\nAC_SUBST([am__leading_dot])])\n\n# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-\n# From Jim Meyering\n\n# Copyright (C) 1996-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_MAINTAINER_MODE([DEFAULT-MODE])\n# ----------------------------------\n# Control maintainer-specific portions of Makefiles.\n# Default is to disable them, unless 'enable' is passed literally.\n# For symmetry, 'disable' may be passed as well.  Anyway, the user\n# can override the default with the --enable/--disable switch.\nAC_DEFUN([AM_MAINTAINER_MODE],\n[m4_case(m4_default([$1], [disable]),\n       [enable], [m4_define([am_maintainer_other], [disable])],\n       [disable], [m4_define([am_maintainer_other], [enable])],\n       [m4_define([am_maintainer_other], [enable])\n        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])\nAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])\n  dnl maintainer-mode's default is 'disable' unless 'enable' is passed\n  AC_ARG_ENABLE([maintainer-mode],\n    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],\n      am_maintainer_other[ make rules and dependencies not useful\n      (and sometimes confusing) to the casual installer])],\n    [USE_MAINTAINER_MODE=$enableval],\n    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))\n  AC_MSG_RESULT([$USE_MAINTAINER_MODE])\n  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])\n  MAINT=$MAINTAINER_MODE_TRUE\n  AC_SUBST([MAINT])dnl\n]\n)\n\n# Check to see how 'make' treats includes.\t            -*- Autoconf -*-\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_MAKE_INCLUDE()\n# -----------------\n# Check to see how make treats includes.\nAC_DEFUN([AM_MAKE_INCLUDE],\n[am_make=${MAKE-make}\ncat > confinc << 'END'\nam__doit:\n\t@echo this is the am__doit target\n.PHONY: am__doit\nEND\n# If we don't find an include directive, just comment out the code.\nAC_MSG_CHECKING([for style of include used by $am_make])\nam__include=\"#\"\nam__quote=\n_am_result=none\n# First try GNU make style include.\necho \"include confinc\" > confmf\n# Ignore all kinds of additional output from 'make'.\ncase `$am_make -s -f confmf 2> /dev/null` in #(\n*the\\ am__doit\\ target*)\n  am__include=include\n  am__quote=\n  _am_result=GNU\n  ;;\nesac\n# Now try BSD make style include.\nif test \"$am__include\" = \"#\"; then\n   echo '.include \"confinc\"' > confmf\n   case `$am_make -s -f confmf 2> /dev/null` in #(\n   *the\\ am__doit\\ target*)\n     am__include=.include\n     am__quote=\"\\\"\"\n     _am_result=BSD\n     ;;\n   esac\nfi\nAC_SUBST([am__include])\nAC_SUBST([am__quote])\nAC_MSG_RESULT([$_am_result])\nrm -f confinc confmf\n])\n\n# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-\n\n# Copyright (C) 1997-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_MISSING_PROG(NAME, PROGRAM)\n# ------------------------------\nAC_DEFUN([AM_MISSING_PROG],\n[AC_REQUIRE([AM_MISSING_HAS_RUN])\n$1=${$1-\"${am_missing_run}$2\"}\nAC_SUBST($1)])\n\n# AM_MISSING_HAS_RUN\n# ------------------\n# Define MISSING if not defined so far and test if it is modern enough.\n# If it is, set am_missing_run to use it, otherwise, to nothing.\nAC_DEFUN([AM_MISSING_HAS_RUN],\n[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\nAC_REQUIRE_AUX_FILE([missing])dnl\nif test x\"${MISSING+set}\" != xset; then\n  case $am_aux_dir in\n  *\\ * | *\\\t*)\n    MISSING=\"\\${SHELL} \\\"$am_aux_dir/missing\\\"\" ;;\n  *)\n    MISSING=\"\\${SHELL} $am_aux_dir/missing\" ;;\n  esac\nfi\n# Use eval to expand $SHELL\nif eval \"$MISSING --is-lightweight\"; then\n  am_missing_run=\"$MISSING \"\nelse\n  am_missing_run=\n  AC_MSG_WARN(['missing' script is too old or missing])\nfi\n])\n\n# Helper functions for option handling.                     -*- Autoconf -*-\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# _AM_MANGLE_OPTION(NAME)\n# -----------------------\nAC_DEFUN([_AM_MANGLE_OPTION],\n[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])\n\n# _AM_SET_OPTION(NAME)\n# --------------------\n# Set option NAME.  Presently that only means defining a flag for this option.\nAC_DEFUN([_AM_SET_OPTION],\n[m4_define(_AM_MANGLE_OPTION([$1]), [1])])\n\n# _AM_SET_OPTIONS(OPTIONS)\n# ------------------------\n# OPTIONS is a space-separated list of Automake options.\nAC_DEFUN([_AM_SET_OPTIONS],\n[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])\n\n# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])\n# -------------------------------------------\n# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.\nAC_DEFUN([_AM_IF_OPTION],\n[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])\n\n# Copyright (C) 1999-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# _AM_PROG_CC_C_O\n# ---------------\n# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC\n# to automatically call this.\nAC_DEFUN([_AM_PROG_CC_C_O],\n[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\nAC_REQUIRE_AUX_FILE([compile])dnl\nAC_LANG_PUSH([C])dnl\nAC_CACHE_CHECK(\n  [whether $CC understands -c and -o together],\n  [am_cv_prog_cc_c_o],\n  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])\n  # Make sure it works both with $CC and with simple cc.\n  # Following AC_PROG_CC_C_O, we do the test twice because some\n  # compilers refuse to overwrite an existing .o file with -o,\n  # though they will create one.\n  am_cv_prog_cc_c_o=yes\n  for am_i in 1 2; do\n    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \\\n         && test -f conftest2.$ac_objext; then\n      : OK\n    else\n      am_cv_prog_cc_c_o=no\n      break\n    fi\n  done\n  rm -f core conftest*\n  unset am_i])\nif test \"$am_cv_prog_cc_c_o\" != yes; then\n   # Losing compiler, so override with the script.\n   # FIXME: It is wrong to rewrite CC.\n   # But if we don't then we get into trouble of one sort or another.\n   # A longer-term fix would be to have automake use am__CC in this case,\n   # and then we could set am__CC=\"\\$(top_srcdir)/compile \\$(CC)\"\n   CC=\"$am_aux_dir/compile $CC\"\nfi\nAC_LANG_POP([C])])\n\n# For backward compatibility.\nAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_RUN_LOG(COMMAND)\n# -------------------\n# Run COMMAND, save the exit status in ac_status, and log it.\n# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)\nAC_DEFUN([AM_RUN_LOG],\n[{ echo \"$as_me:$LINENO: $1\" >&AS_MESSAGE_LOG_FD\n   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD\n   ac_status=$?\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&AS_MESSAGE_LOG_FD\n   (exit $ac_status); }])\n\n# Check to make sure that the build environment is sane.    -*- Autoconf -*-\n\n# Copyright (C) 1996-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_SANITY_CHECK\n# ---------------\nAC_DEFUN([AM_SANITY_CHECK],\n[AC_MSG_CHECKING([whether build environment is sane])\n# Reject unsafe characters in $srcdir or the absolute working directory\n# name.  Accept space and tab only in the latter.\nam_lf='\n'\ncase `pwd` in\n  *[[\\\\\\\"\\#\\$\\&\\'\\`$am_lf]]*)\n    AC_MSG_ERROR([unsafe absolute working directory name]);;\nesac\ncase $srcdir in\n  *[[\\\\\\\"\\#\\$\\&\\'\\`$am_lf\\ \\\t]]*)\n    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;\nesac\n\n# Do 'set' in a subshell so we don't clobber the current shell's\n# arguments.  Must try -L first in case configure is actually a\n# symlink; some systems play weird games with the mod time of symlinks\n# (eg FreeBSD returns the mod time of the symlink's containing\n# directory).\nif (\n   am_has_slept=no\n   for am_try in 1 2; do\n     echo \"timestamp, slept: $am_has_slept\" > conftest.file\n     set X `ls -Lt \"$srcdir/configure\" conftest.file 2> /dev/null`\n     if test \"$[*]\" = \"X\"; then\n\t# -L didn't work.\n\tset X `ls -t \"$srcdir/configure\" conftest.file`\n     fi\n     if test \"$[*]\" != \"X $srcdir/configure conftest.file\" \\\n\t&& test \"$[*]\" != \"X conftest.file $srcdir/configure\"; then\n\n\t# If neither matched, then we have a broken ls.  This can happen\n\t# if, for instance, CONFIG_SHELL is bash and it inherits a\n\t# broken ls alias from the environment.  This has actually\n\t# happened.  Such a system could not be considered \"sane\".\n\tAC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken\n  alias in your environment])\n     fi\n     if test \"$[2]\" = conftest.file || test $am_try -eq 2; then\n       break\n     fi\n     # Just in case.\n     sleep 1\n     am_has_slept=yes\n   done\n   test \"$[2]\" = conftest.file\n   )\nthen\n   # Ok.\n   :\nelse\n   AC_MSG_ERROR([newly created file is older than distributed files!\nCheck your system clock])\nfi\nAC_MSG_RESULT([yes])\n# If we didn't sleep, we still need to ensure time stamps of config.status and\n# generated files are strictly newer.\nam_sleep_pid=\nif grep 'slept: no' conftest.file >/dev/null 2>&1; then\n  ( sleep 1 ) &\n  am_sleep_pid=$!\nfi\nAC_CONFIG_COMMANDS_PRE(\n  [AC_MSG_CHECKING([that generated files are newer than configure])\n   if test -n \"$am_sleep_pid\"; then\n     # Hide warnings about reused PIDs.\n     wait $am_sleep_pid 2>/dev/null\n   fi\n   AC_MSG_RESULT([done])])\nrm -f conftest.file\n])\n\n# Copyright (C) 2009-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_SILENT_RULES([DEFAULT])\n# --------------------------\n# Enable less verbose build rules; with the default set to DEFAULT\n# (\"yes\" being less verbose, \"no\" or empty being verbose).\nAC_DEFUN([AM_SILENT_RULES],\n[AC_ARG_ENABLE([silent-rules], [dnl\nAS_HELP_STRING(\n  [--enable-silent-rules],\n  [less verbose build output (undo: \"make V=1\")])\nAS_HELP_STRING(\n  [--disable-silent-rules],\n  [verbose build output (undo: \"make V=0\")])dnl\n])\ncase $enable_silent_rules in @%:@ (((\n  yes) AM_DEFAULT_VERBOSITY=0;;\n   no) AM_DEFAULT_VERBOSITY=1;;\n    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;\nesac\ndnl\ndnl A few 'make' implementations (e.g., NonStop OS and NextStep)\ndnl do not support nested variable expansions.\ndnl See automake bug#9928 and bug#10237.\nam_make=${MAKE-make}\nAC_CACHE_CHECK([whether $am_make supports nested variables],\n   [am_cv_make_support_nested_variables],\n   [if AS_ECHO([['TRUE=$(BAR$(V))\nBAR0=false\nBAR1=true\nV=1\nam__doit:\n\t@$(TRUE)\n.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then\n  am_cv_make_support_nested_variables=yes\nelse\n  am_cv_make_support_nested_variables=no\nfi])\nif test $am_cv_make_support_nested_variables = yes; then\n  dnl Using '$V' instead of '$(V)' breaks IRIX make.\n  AM_V='$(V)'\n  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'\nelse\n  AM_V=$AM_DEFAULT_VERBOSITY\n  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY\nfi\nAC_SUBST([AM_V])dnl\nAM_SUBST_NOTMAKE([AM_V])dnl\nAC_SUBST([AM_DEFAULT_V])dnl\nAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl\nAC_SUBST([AM_DEFAULT_VERBOSITY])dnl\nAM_BACKSLASH='\\'\nAC_SUBST([AM_BACKSLASH])dnl\n_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl\n])\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_PROG_INSTALL_STRIP\n# ---------------------\n# One issue with vendor 'install' (even GNU) is that you can't\n# specify the program used to strip binaries.  This is especially\n# annoying in cross-compiling environments, where the build's strip\n# is unlikely to handle the host's binaries.\n# Fortunately install-sh will honor a STRIPPROG variable, so we\n# always use install-sh in \"make install-strip\", and initialize\n# STRIPPROG with the value of the STRIP variable (set by the user).\nAC_DEFUN([AM_PROG_INSTALL_STRIP],\n[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl\n# Installed binaries are usually stripped using 'strip' when the user\n# run \"make install-strip\".  However 'strip' might not be the right\n# tool to use in cross-compilation environments, therefore Automake\n# will honor the 'STRIP' environment variable to overrule this program.\ndnl Don't test for $cross_compiling = yes, because it might be 'maybe'.\nif test \"$cross_compiling\" != no; then\n  AC_CHECK_TOOL([STRIP], [strip], :)\nfi\nINSTALL_STRIP_PROGRAM=\"\\$(install_sh) -c -s\"\nAC_SUBST([INSTALL_STRIP_PROGRAM])])\n\n# Copyright (C) 2006-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# _AM_SUBST_NOTMAKE(VARIABLE)\n# ---------------------------\n# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.\n# This macro is traced by Automake.\nAC_DEFUN([_AM_SUBST_NOTMAKE])\n\n# AM_SUBST_NOTMAKE(VARIABLE)\n# --------------------------\n# Public sister of _AM_SUBST_NOTMAKE.\nAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])\n\n# Check how to create a tarball.                            -*- Autoconf -*-\n\n# Copyright (C) 2004-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# _AM_PROG_TAR(FORMAT)\n# --------------------\n# Check how to create a tarball in format FORMAT.\n# FORMAT should be one of 'v7', 'ustar', or 'pax'.\n#\n# Substitute a variable $(am__tar) that is a command\n# writing to stdout a FORMAT-tarball containing the directory\n# $tardir.\n#     tardir=directory && $(am__tar) > result.tar\n#\n# Substitute a variable $(am__untar) that extract such\n# a tarball read from stdin.\n#     $(am__untar) < result.tar\n#\nAC_DEFUN([_AM_PROG_TAR],\n[# Always define AMTAR for backward compatibility.  Yes, it's still used\n# in the wild :-(  We should find a proper way to deprecate it ...\nAC_SUBST([AMTAR], ['$${TAR-tar}'])\n\n# We'll loop over all known methods to create a tar archive until one works.\n_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'\n\nm4_if([$1], [v7],\n  [am__tar='$${TAR-tar} chof - \"$$tardir\"' am__untar='$${TAR-tar} xf -'],\n\n  [m4_case([$1],\n    [ustar],\n     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.\n      # There is notably a 21 bits limit for the UID and the GID.  In fact,\n      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343\n      # and bug#13588).\n      am_max_uid=2097151 # 2^21 - 1\n      am_max_gid=$am_max_uid\n      # The $UID and $GID variables are not portable, so we need to resort\n      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls\n      # below are definitely unexpected, so allow the users to see them\n      # (that is, avoid stderr redirection).\n      am_uid=`id -u || echo unknown`\n      am_gid=`id -g || echo unknown`\n      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])\n      if test $am_uid -le $am_max_uid; then\n         AC_MSG_RESULT([yes])\n      else\n         AC_MSG_RESULT([no])\n         _am_tools=none\n      fi\n      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])\n      if test $am_gid -le $am_max_gid; then\n         AC_MSG_RESULT([yes])\n      else\n        AC_MSG_RESULT([no])\n        _am_tools=none\n      fi],\n\n  [pax],\n    [],\n\n  [m4_fatal([Unknown tar format])])\n\n  AC_MSG_CHECKING([how to create a $1 tar archive])\n\n  # Go ahead even if we have the value already cached.  We do so because we\n  # need to set the values for the 'am__tar' and 'am__untar' variables.\n  _am_tools=${am_cv_prog_tar_$1-$_am_tools}\n\n  for _am_tool in $_am_tools; do\n    case $_am_tool in\n    gnutar)\n      for _am_tar in tar gnutar gtar; do\n        AM_RUN_LOG([$_am_tar --version]) && break\n      done\n      am__tar=\"$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - \"'\"$$tardir\"'\n      am__tar_=\"$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - \"'\"$tardir\"'\n      am__untar=\"$_am_tar -xf -\"\n      ;;\n    plaintar)\n      # Must skip GNU tar: if it does not support --format= it doesn't create\n      # ustar tarball either.\n      (tar --version) >/dev/null 2>&1 && continue\n      am__tar='tar chf - \"$$tardir\"'\n      am__tar_='tar chf - \"$tardir\"'\n      am__untar='tar xf -'\n      ;;\n    pax)\n      am__tar='pax -L -x $1 -w \"$$tardir\"'\n      am__tar_='pax -L -x $1 -w \"$tardir\"'\n      am__untar='pax -r'\n      ;;\n    cpio)\n      am__tar='find \"$$tardir\" -print | cpio -o -H $1 -L'\n      am__tar_='find \"$tardir\" -print | cpio -o -H $1 -L'\n      am__untar='cpio -i -H $1 -d'\n      ;;\n    none)\n      am__tar=false\n      am__tar_=false\n      am__untar=false\n      ;;\n    esac\n\n    # If the value was cached, stop now.  We just wanted to have am__tar\n    # and am__untar set.\n    test -n \"${am_cv_prog_tar_$1}\" && break\n\n    # tar/untar a dummy directory, and stop if the command works.\n    rm -rf conftest.dir\n    mkdir conftest.dir\n    echo GrepMe > conftest.dir/file\n    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])\n    rm -rf conftest.dir\n    if test -s conftest.tar; then\n      AM_RUN_LOG([$am__untar <conftest.tar])\n      AM_RUN_LOG([cat conftest.dir/file])\n      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break\n    fi\n  done\n  rm -rf conftest.dir\n\n  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])\n  AC_MSG_RESULT([$am_cv_prog_tar_$1])])\n\nAC_SUBST([am__tar])\nAC_SUBST([am__untar])\n]) # _AM_PROG_TAR\n\n"
  },
  {
    "path": "ar-lib",
    "content": "#! /bin/sh\n# Wrapper for Microsoft lib.exe\n\nme=ar-lib\nscriptversion=2012-03-01.08; # UTC\n\n# Copyright (C) 2010-2014 Free Software Foundation, Inc.\n# Written by Peter Rosin <peda@lysator.liu.se>.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# This file is maintained in Automake, please report\n# bugs to <bug-automake@gnu.org> or send patches to\n# <automake-patches@gnu.org>.\n\n\n# func_error message\nfunc_error ()\n{\n  echo \"$me: $1\" 1>&2\n  exit 1\n}\n\nfile_conv=\n\n# func_file_conv build_file\n# Convert a $build file to $host form and store it in $file\n# Currently only supports Windows hosts.\nfunc_file_conv ()\n{\n  file=$1\n  case $file in\n    / | /[!/]*) # absolute file, and not a UNC file\n      if test -z \"$file_conv\"; then\n\t# lazily determine how to convert abs files\n\tcase `uname -s` in\n\t  MINGW*)\n\t    file_conv=mingw\n\t    ;;\n\t  CYGWIN*)\n\t    file_conv=cygwin\n\t    ;;\n\t  *)\n\t    file_conv=wine\n\t    ;;\n\tesac\n      fi\n      case $file_conv in\n\tmingw)\n\t  file=`cmd //C echo \"$file \" | sed -e 's/\"\\(.*\\) \" *$/\\1/'`\n\t  ;;\n\tcygwin)\n\t  file=`cygpath -m \"$file\" || echo \"$file\"`\n\t  ;;\n\twine)\n\t  file=`winepath -w \"$file\" || echo \"$file\"`\n\t  ;;\n      esac\n      ;;\n  esac\n}\n\n# func_at_file at_file operation archive\n# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE\n# for each of them.\n# When interpreting the content of the @FILE, do NOT use func_file_conv,\n# since the user would need to supply preconverted file names to\n# binutils ar, at least for MinGW.\nfunc_at_file ()\n{\n  operation=$2\n  archive=$3\n  at_file_contents=`cat \"$1\"`\n  eval set x \"$at_file_contents\"\n  shift\n\n  for member\n  do\n    $AR -NOLOGO $operation:\"$member\" \"$archive\" || exit $?\n  done\n}\n\ncase $1 in\n  '')\n     func_error \"no command.  Try '$0 --help' for more information.\"\n     ;;\n  -h | --h*)\n    cat <<EOF\nUsage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]\n\nMembers may be specified in a file named with @FILE.\nEOF\n    exit $?\n    ;;\n  -v | --v*)\n    echo \"$me, version $scriptversion\"\n    exit $?\n    ;;\nesac\n\nif test $# -lt 3; then\n  func_error \"you must specify a program, an action and an archive\"\nfi\n\nAR=$1\nshift\nwhile :\ndo\n  if test $# -lt 2; then\n    func_error \"you must specify a program, an action and an archive\"\n  fi\n  case $1 in\n    -lib | -LIB \\\n    | -ltcg | -LTCG \\\n    | -machine* | -MACHINE* \\\n    | -subsystem* | -SUBSYSTEM* \\\n    | -verbose | -VERBOSE \\\n    | -wx* | -WX* )\n      AR=\"$AR $1\"\n      shift\n      ;;\n    *)\n      action=$1\n      shift\n      break\n      ;;\n  esac\ndone\norig_archive=$1\nshift\nfunc_file_conv \"$orig_archive\"\narchive=$file\n\n# strip leading dash in $action\naction=${action#-}\n\ndelete=\nextract=\nlist=\nquick=\nreplace=\nindex=\ncreate=\n\nwhile test -n \"$action\"\ndo\n  case $action in\n    d*) delete=yes  ;;\n    x*) extract=yes ;;\n    t*) list=yes    ;;\n    q*) quick=yes   ;;\n    r*) replace=yes ;;\n    s*) index=yes   ;;\n    S*)             ;; # the index is always updated implicitly\n    c*) create=yes  ;;\n    u*)             ;; # TODO: don't ignore the update modifier\n    v*)             ;; # TODO: don't ignore the verbose modifier\n    *)\n      func_error \"unknown action specified\"\n      ;;\n  esac\n  action=${action#?}\ndone\n\ncase $delete$extract$list$quick$replace,$index in\n  yes,* | ,yes)\n    ;;\n  yesyes*)\n    func_error \"more than one action specified\"\n    ;;\n  *)\n    func_error \"no action specified\"\n    ;;\nesac\n\nif test -n \"$delete\"; then\n  if test ! -f \"$orig_archive\"; then\n    func_error \"archive not found\"\n  fi\n  for member\n  do\n    case $1 in\n      @*)\n        func_at_file \"${1#@}\" -REMOVE \"$archive\"\n        ;;\n      *)\n        func_file_conv \"$1\"\n        $AR -NOLOGO -REMOVE:\"$file\" \"$archive\" || exit $?\n        ;;\n    esac\n  done\n\nelif test -n \"$extract\"; then\n  if test ! -f \"$orig_archive\"; then\n    func_error \"archive not found\"\n  fi\n  if test $# -gt 0; then\n    for member\n    do\n      case $1 in\n        @*)\n          func_at_file \"${1#@}\" -EXTRACT \"$archive\"\n          ;;\n        *)\n          func_file_conv \"$1\"\n          $AR -NOLOGO -EXTRACT:\"$file\" \"$archive\" || exit $?\n          ;;\n      esac\n    done\n  else\n    $AR -NOLOGO -LIST \"$archive\" | sed -e 's/\\\\/\\\\\\\\/g' | while read member\n    do\n      $AR -NOLOGO -EXTRACT:\"$member\" \"$archive\" || exit $?\n    done\n  fi\n\nelif test -n \"$quick$replace\"; then\n  if test ! -f \"$orig_archive\"; then\n    if test -z \"$create\"; then\n      echo \"$me: creating $orig_archive\"\n    fi\n    orig_archive=\n  else\n    orig_archive=$archive\n  fi\n\n  for member\n  do\n    case $1 in\n    @*)\n      func_file_conv \"${1#@}\"\n      set x \"$@\" \"@$file\"\n      ;;\n    *)\n      func_file_conv \"$1\"\n      set x \"$@\" \"$file\"\n      ;;\n    esac\n    shift\n    shift\n  done\n\n  if test -n \"$orig_archive\"; then\n    $AR -NOLOGO -OUT:\"$archive\" \"$orig_archive\" \"$@\" || exit $?\n  else\n    $AR -NOLOGO -OUT:\"$archive\" \"$@\" || exit $?\n  fi\n\nelif test -n \"$list\"; then\n  if test ! -f \"$orig_archive\"; then\n    func_error \"archive not found\"\n  fi\n  $AR -NOLOGO -LIST \"$archive\" || exit $?\nfi\n"
  },
  {
    "path": "cderror.h",
    "content": "/*\n * cderror.h\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * Modified 2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file defines the error and message codes for the cjpeg/djpeg\n * applications.  These strings are not needed as part of the JPEG library\n * proper.\n * Edit this file to add new codes, or to translate the message strings to\n * some other language.\n */\n\n/*\n * To define the enum list of message codes, include this file without\n * defining macro JMESSAGE.  To create a message string table, include it\n * again with a suitable JMESSAGE definition (see jerror.c for an example).\n */\n#ifndef JMESSAGE\n#ifndef CDERROR_H\n#define CDERROR_H\n/* First time through, define the enum list */\n#define JMAKE_ENUM_LIST\n#else\n/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */\n#define JMESSAGE(code,string)\n#endif /* CDERROR_H */\n#endif /* JMESSAGE */\n\n#ifdef JMAKE_ENUM_LIST\n\ntypedef enum {\n\n#define JMESSAGE(code,string)\tcode ,\n\n#endif /* JMAKE_ENUM_LIST */\n\nJMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */\n\n#ifdef BMP_SUPPORTED\nJMESSAGE(JERR_BMP_BADCMAP, \"Unsupported BMP colormap format\")\nJMESSAGE(JERR_BMP_BADDEPTH, \"Only 8- and 24-bit BMP files are supported\")\nJMESSAGE(JERR_BMP_BADHEADER, \"Invalid BMP file: bad header length\")\nJMESSAGE(JERR_BMP_BADPLANES, \"Invalid BMP file: biPlanes not equal to 1\")\nJMESSAGE(JERR_BMP_COLORSPACE, \"BMP output must be grayscale or RGB\")\nJMESSAGE(JERR_BMP_COMPRESSED, \"Sorry, compressed BMPs not yet supported\")\nJMESSAGE(JERR_BMP_EMPTY, \"Empty BMP image\")\nJMESSAGE(JERR_BMP_NOT, \"Not a BMP file - does not start with BM\")\nJMESSAGE(JTRC_BMP, \"%ux%u 24-bit BMP image\")\nJMESSAGE(JTRC_BMP_MAPPED, \"%ux%u 8-bit colormapped BMP image\")\nJMESSAGE(JTRC_BMP_OS2, \"%ux%u 24-bit OS2 BMP image\")\nJMESSAGE(JTRC_BMP_OS2_MAPPED, \"%ux%u 8-bit colormapped OS2 BMP image\")\n#endif /* BMP_SUPPORTED */\n\n#ifdef GIF_SUPPORTED\nJMESSAGE(JERR_GIF_BUG, \"GIF output got confused\")\nJMESSAGE(JERR_GIF_CODESIZE, \"Bogus GIF codesize %d\")\nJMESSAGE(JERR_GIF_COLORSPACE, \"GIF output must be grayscale or RGB\")\nJMESSAGE(JERR_GIF_IMAGENOTFOUND, \"Too few images in GIF file\")\nJMESSAGE(JERR_GIF_NOT, \"Not a GIF file\")\nJMESSAGE(JTRC_GIF, \"%ux%ux%d GIF image\")\nJMESSAGE(JTRC_GIF_BADVERSION,\n\t \"Warning: unexpected GIF version number '%c%c%c'\")\nJMESSAGE(JTRC_GIF_EXTENSION, \"Ignoring GIF extension block of type 0x%02x\")\nJMESSAGE(JTRC_GIF_NONSQUARE, \"Caution: nonsquare pixels in input\")\nJMESSAGE(JWRN_GIF_BADDATA, \"Corrupt data in GIF file\")\nJMESSAGE(JWRN_GIF_CHAR, \"Bogus char 0x%02x in GIF file, ignoring\")\nJMESSAGE(JWRN_GIF_ENDCODE, \"Premature end of GIF image\")\nJMESSAGE(JWRN_GIF_NOMOREDATA, \"Ran out of GIF bits\")\n#endif /* GIF_SUPPORTED */\n\n#ifdef PPM_SUPPORTED\nJMESSAGE(JERR_PPM_COLORSPACE, \"PPM output must be grayscale or RGB\")\nJMESSAGE(JERR_PPM_NONNUMERIC, \"Nonnumeric data in PPM file\")\nJMESSAGE(JERR_PPM_NOT, \"Not a PPM/PGM file\")\nJMESSAGE(JTRC_PGM, \"%ux%u PGM image\")\nJMESSAGE(JTRC_PGM_TEXT, \"%ux%u text PGM image\")\nJMESSAGE(JTRC_PPM, \"%ux%u PPM image\")\nJMESSAGE(JTRC_PPM_TEXT, \"%ux%u text PPM image\")\n#endif /* PPM_SUPPORTED */\n\n#ifdef RLE_SUPPORTED\nJMESSAGE(JERR_RLE_BADERROR, \"Bogus error code from RLE library\")\nJMESSAGE(JERR_RLE_COLORSPACE, \"RLE output must be grayscale or RGB\")\nJMESSAGE(JERR_RLE_DIMENSIONS, \"Image dimensions (%ux%u) too large for RLE\")\nJMESSAGE(JERR_RLE_EMPTY, \"Empty RLE file\")\nJMESSAGE(JERR_RLE_EOF, \"Premature EOF in RLE header\")\nJMESSAGE(JERR_RLE_MEM, \"Insufficient memory for RLE header\")\nJMESSAGE(JERR_RLE_NOT, \"Not an RLE file\")\nJMESSAGE(JERR_RLE_TOOMANYCHANNELS, \"Cannot handle %d output channels for RLE\")\nJMESSAGE(JERR_RLE_UNSUPPORTED, \"Cannot handle this RLE setup\")\nJMESSAGE(JTRC_RLE, \"%ux%u full-color RLE file\")\nJMESSAGE(JTRC_RLE_FULLMAP, \"%ux%u full-color RLE file with map of length %d\")\nJMESSAGE(JTRC_RLE_GRAY, \"%ux%u grayscale RLE file\")\nJMESSAGE(JTRC_RLE_MAPGRAY, \"%ux%u grayscale RLE file with map of length %d\")\nJMESSAGE(JTRC_RLE_MAPPED, \"%ux%u colormapped RLE file with map of length %d\")\n#endif /* RLE_SUPPORTED */\n\n#ifdef TARGA_SUPPORTED\nJMESSAGE(JERR_TGA_BADCMAP, \"Unsupported Targa colormap format\")\nJMESSAGE(JERR_TGA_BADPARMS, \"Invalid or unsupported Targa file\")\nJMESSAGE(JERR_TGA_COLORSPACE, \"Targa output must be grayscale or RGB\")\nJMESSAGE(JTRC_TGA, \"%ux%u RGB Targa image\")\nJMESSAGE(JTRC_TGA_GRAY, \"%ux%u grayscale Targa image\")\nJMESSAGE(JTRC_TGA_MAPPED, \"%ux%u colormapped Targa image\")\n#else\nJMESSAGE(JERR_TGA_NOTCOMP, \"Targa support was not compiled\")\n#endif /* TARGA_SUPPORTED */\n\nJMESSAGE(JERR_BAD_CMAP_FILE,\n\t \"Color map file is invalid or of unsupported format\")\nJMESSAGE(JERR_TOO_MANY_COLORS,\n\t \"Output file format cannot handle %d colormap entries\")\nJMESSAGE(JERR_UNGETC_FAILED, \"ungetc failed\")\n#ifdef TARGA_SUPPORTED\nJMESSAGE(JERR_UNKNOWN_FORMAT,\n\t \"Unrecognized input file format --- perhaps you need -targa\")\n#else\nJMESSAGE(JERR_UNKNOWN_FORMAT, \"Unrecognized input file format\")\n#endif\nJMESSAGE(JERR_UNSUPPORTED_FORMAT, \"Unsupported output file format\")\n\n#ifdef JMAKE_ENUM_LIST\n\n  JMSG_LASTADDONCODE\n} ADDON_MESSAGE_CODE;\n\n#undef JMAKE_ENUM_LIST\n#endif /* JMAKE_ENUM_LIST */\n\n/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */\n#undef JMESSAGE\n"
  },
  {
    "path": "cdjpeg.c",
    "content": "/*\n * cdjpeg.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains common support routines used by the IJG application\n * programs (cjpeg, djpeg, jpegtran).\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n#include <ctype.h>\t\t/* to declare isupper(), tolower() */\n#ifdef NEED_SIGNAL_CATCHER\n#include <signal.h>\t\t/* to declare signal() */\n#endif\n#ifdef USE_SETMODE\n#include <fcntl.h>\t\t/* to declare setmode()'s parameter macros */\n/* If you have setmode() but not <io.h>, just delete this line: */\n#include <io.h>\t\t\t/* to declare setmode() */\n#endif\n\n\n/*\n * Signal catcher to ensure that temporary files are removed before aborting.\n * NB: for Amiga Manx C this is actually a global routine named _abort();\n * we put \"#define signal_catcher _abort\" in jconfig.h.  Talk about bogus...\n */\n\n#ifdef NEED_SIGNAL_CATCHER\n\nstatic j_common_ptr sig_cinfo;\n\nvoid\t\t\t\t/* must be global for Manx C */\nsignal_catcher (int signum)\n{\n  if (sig_cinfo != NULL) {\n    if (sig_cinfo->err != NULL) /* turn off trace output */\n      sig_cinfo->err->trace_level = 0;\n    jpeg_destroy(sig_cinfo);\t/* clean up memory allocation & temp files */\n  }\n  exit(EXIT_FAILURE);\n}\n\n\nGLOBAL(void)\nenable_signal_catcher (j_common_ptr cinfo)\n{\n  sig_cinfo = cinfo;\n#ifdef SIGINT\t\t\t/* not all systems have SIGINT */\n  signal(SIGINT, signal_catcher);\n#endif\n#ifdef SIGTERM\t\t\t/* not all systems have SIGTERM */\n  signal(SIGTERM, signal_catcher);\n#endif\n}\n\n#endif\n\n\n/*\n * Optional progress monitor: display a percent-done figure on stderr.\n */\n\n#ifdef PROGRESS_REPORT\n\nMETHODDEF(void)\nprogress_monitor (j_common_ptr cinfo)\n{\n  cd_progress_ptr prog = (cd_progress_ptr) cinfo->progress;\n  int total_passes = prog->pub.total_passes + prog->total_extra_passes;\n  int percent_done = (int) (prog->pub.pass_counter*100L/prog->pub.pass_limit);\n\n  if (percent_done != prog->percent_done) {\n    prog->percent_done = percent_done;\n    if (total_passes > 1) {\n      fprintf(stderr, \"\\rPass %d/%d: %3d%% \",\n\t      prog->pub.completed_passes + prog->completed_extra_passes + 1,\n\t      total_passes, percent_done);\n    } else {\n      fprintf(stderr, \"\\r %3d%% \", percent_done);\n    }\n    fflush(stderr);\n  }\n}\n\n\nGLOBAL(void)\nstart_progress_monitor (j_common_ptr cinfo, cd_progress_ptr progress)\n{\n  /* Enable progress display, unless trace output is on */\n  if (cinfo->err->trace_level == 0) {\n    progress->pub.progress_monitor = progress_monitor;\n    progress->completed_extra_passes = 0;\n    progress->total_extra_passes = 0;\n    progress->percent_done = -1;\n    cinfo->progress = &progress->pub;\n  }\n}\n\n\nGLOBAL(void)\nend_progress_monitor (j_common_ptr cinfo)\n{\n  /* Clear away progress display */\n  if (cinfo->err->trace_level == 0) {\n    fprintf(stderr, \"\\r                \\r\");\n    fflush(stderr);\n  }\n}\n\n#endif\n\n\n/*\n * Case-insensitive matching of possibly-abbreviated keyword switches.\n * keyword is the constant keyword (must be lower case already),\n * minchars is length of minimum legal abbreviation.\n */\n\nGLOBAL(boolean)\nkeymatch (char * arg, const char * keyword, int minchars)\n{\n  register int ca, ck;\n  register int nmatched = 0;\n\n  while ((ca = *arg++) != '\\0') {\n    if ((ck = *keyword++) == '\\0')\n      return FALSE;\t\t/* arg longer than keyword, no good */\n    if (isupper(ca))\t\t/* force arg to lcase (assume ck is already) */\n      ca = tolower(ca);\n    if (ca != ck)\n      return FALSE;\t\t/* no good */\n    nmatched++;\t\t\t/* count matched characters */\n  }\n  /* reached end of argument; fail if it's too short for unique abbrev */\n  if (nmatched < minchars)\n    return FALSE;\n  return TRUE;\t\t\t/* A-OK */\n}\n\n\n/*\n * Routines to establish binary I/O mode for stdin and stdout.\n * Non-Unix systems often require some hacking to get out of text mode.\n */\n\nGLOBAL(FILE *)\nread_stdin (void)\n{\n  FILE * input_file = stdin;\n\n#ifdef USE_SETMODE\t\t/* need to hack file mode? */\n  setmode(fileno(stdin), O_BINARY);\n#endif\n#ifdef USE_FDOPEN\t\t/* need to re-open in binary mode? */\n  if ((input_file = fdopen(fileno(stdin), READ_BINARY)) == NULL) {\n    fprintf(stderr, \"Cannot reopen stdin\\n\");\n    exit(EXIT_FAILURE);\n  }\n#endif\n  return input_file;\n}\n\n\nGLOBAL(FILE *)\nwrite_stdout (void)\n{\n  FILE * output_file = stdout;\n\n#ifdef USE_SETMODE\t\t/* need to hack file mode? */\n  setmode(fileno(stdout), O_BINARY);\n#endif\n#ifdef USE_FDOPEN\t\t/* need to re-open in binary mode? */\n  if ((output_file = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {\n    fprintf(stderr, \"Cannot reopen stdout\\n\");\n    exit(EXIT_FAILURE);\n  }\n#endif\n  return output_file;\n}\n"
  },
  {
    "path": "cdjpeg.h",
    "content": "/*\n * cdjpeg.h\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains common declarations for the sample applications\n * cjpeg and djpeg.  It is NOT used by the core JPEG library.\n */\n\n#define JPEG_CJPEG_DJPEG\t/* define proper options in jconfig.h */\n#define JPEG_INTERNAL_OPTIONS\t/* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"\t\t/* get library error codes too */\n#include \"cderror.h\"\t\t/* get application-specific error codes */\n\n\n/*\n * Object interface for cjpeg's source file decoding modules\n */\n\ntypedef struct cjpeg_source_struct * cjpeg_source_ptr;\n\nstruct cjpeg_source_struct {\n  JMETHOD(void, start_input, (j_compress_ptr cinfo,\n\t\t\t      cjpeg_source_ptr sinfo));\n  JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,\n\t\t\t\t       cjpeg_source_ptr sinfo));\n  JMETHOD(void, finish_input, (j_compress_ptr cinfo,\n\t\t\t       cjpeg_source_ptr sinfo));\n\n  FILE *input_file;\n\n  JSAMPARRAY buffer;\n  JDIMENSION buffer_height;\n};\n\n\n/*\n * Object interface for djpeg's output file encoding modules\n */\n\ntypedef struct djpeg_dest_struct * djpeg_dest_ptr;\n\nstruct djpeg_dest_struct {\n  /* start_output is called after jpeg_start_decompress finishes.\n   * The color map will be ready at this time, if one is needed.\n   */\n  JMETHOD(void, start_output, (j_decompress_ptr cinfo,\n\t\t\t       djpeg_dest_ptr dinfo));\n  /* Emit the specified number of pixel rows from the buffer. */\n  JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,\n\t\t\t\t djpeg_dest_ptr dinfo,\n\t\t\t\t JDIMENSION rows_supplied));\n  /* Finish up at the end of the image. */\n  JMETHOD(void, finish_output, (j_decompress_ptr cinfo,\n\t\t\t\tdjpeg_dest_ptr dinfo));\n\n  /* Target file spec; filled in by djpeg.c after object is created. */\n  FILE * output_file;\n\n  /* Output pixel-row buffer.  Created by module init or start_output.\n   * Width is cinfo->output_width * cinfo->output_components;\n   * height is buffer_height.\n   */\n  JSAMPARRAY buffer;\n  JDIMENSION buffer_height;\n};\n\n\n/*\n * cjpeg/djpeg may need to perform extra passes to convert to or from\n * the source/destination file format.  The JPEG library does not know\n * about these passes, but we'd like them to be counted by the progress\n * monitor.  We use an expanded progress monitor object to hold the\n * additional pass count.\n */\n\nstruct cdjpeg_progress_mgr {\n  struct jpeg_progress_mgr pub;\t/* fields known to JPEG library */\n  int completed_extra_passes;\t/* extra passes completed */\n  int total_extra_passes;\t/* total extra */\n  /* last printed percentage stored here to avoid multiple printouts */\n  int percent_done;\n};\n\ntypedef struct cdjpeg_progress_mgr * cd_progress_ptr;\n\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jinit_read_bmp\t\tjIRdBMP\n#define jinit_write_bmp\t\tjIWrBMP\n#define jinit_read_gif\t\tjIRdGIF\n#define jinit_write_gif\t\tjIWrGIF\n#define jinit_read_ppm\t\tjIRdPPM\n#define jinit_write_ppm\t\tjIWrPPM\n#define jinit_read_rle\t\tjIRdRLE\n#define jinit_write_rle\t\tjIWrRLE\n#define jinit_read_targa\tjIRdTarga\n#define jinit_write_targa\tjIWrTarga\n#define read_quant_tables\tRdQTables\n#define read_scan_script\tRdScnScript\n#define set_quality_ratings     SetQRates\n#define set_quant_slots\t\tSetQSlots\n#define set_sample_factors\tSetSFacts\n#define read_color_map\t\tRdCMap\n#define enable_signal_catcher\tEnSigCatcher\n#define start_progress_monitor\tStProgMon\n#define end_progress_monitor\tEnProgMon\n#define read_stdin\t\tRdStdin\n#define write_stdout\t\tWrStdout\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n/* Module selection routines for I/O modules. */\n\nEXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));\nEXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    boolean is_os2));\nEXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));\nEXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));\nEXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));\nEXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));\nEXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));\nEXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));\nEXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo));\nEXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo));\n\n/* cjpeg support routines (in rdswitch.c) */\n\nEXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,\n\t\t\t\t       boolean force_baseline));\nEXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));\nEXTERN(boolean) set_quality_ratings JPP((j_compress_ptr cinfo, char *arg,\n\t\t\t\t\t boolean force_baseline));\nEXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));\nEXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));\n\n/* djpeg support routines (in rdcolmap.c) */\n\nEXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile));\n\n/* common support routines (in cdjpeg.c) */\n\nEXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));\nEXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,\n\t\t\t\t\t cd_progress_ptr progress));\nEXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));\nEXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));\nEXTERN(FILE *) read_stdin JPP((void));\nEXTERN(FILE *) write_stdout JPP((void));\n\n/* miscellaneous useful macros */\n\n#ifdef DONT_USE_B_MODE\t\t/* define mode parameters for fopen() */\n#define READ_BINARY\t\"r\"\n#define WRITE_BINARY\t\"w\"\n#else\n#ifdef VMS\t\t\t/* VMS is very nonstandard */\n#define READ_BINARY\t\"rb\", \"ctx=stm\"\n#define WRITE_BINARY\t\"wb\", \"ctx=stm\"\n#else\t\t\t\t/* standard ANSI-compliant case */\n#define READ_BINARY\t\"rb\"\n#define WRITE_BINARY\t\"wb\"\n#endif\n#endif\n\n#ifndef EXIT_FAILURE\t\t/* define exit() codes if not provided */\n#define EXIT_FAILURE  1\n#endif\n#ifndef EXIT_SUCCESS\n#ifdef VMS\n#define EXIT_SUCCESS  1\t\t/* VMS is very nonstandard */\n#else\n#define EXIT_SUCCESS  0\n#endif\n#endif\n#ifndef EXIT_WARNING\n#ifdef VMS\n#define EXIT_WARNING  1\t\t/* VMS is very nonstandard */\n#else\n#define EXIT_WARNING  2\n#endif\n#endif\n"
  },
  {
    "path": "change.log",
    "content": "CHANGE LOG for Independent JPEG Group's JPEG software\n\n\nVersion 9a  19-Jan-2014\n-----------------------\n\nAdd support for wide gamut color spaces (JFIF version 2).\nImprove clarity and accuracy in color conversion modules.\nNote: Requires rebuild of test images.\n\nExtend the bit depth support to all values from 8 to 12\n(BITS_IN_JSAMPLE configuration option in jmorecfg.h).\njpegtran now supports N bits sample data precision with all N from 8 to 12\nin a single instance.  Thank to Roland Fassauer for inspiration.\n\nTry to resolve issues with new boolean type definition.\nThank also to v4hn for suggestion.\n\nEnable option to use default Huffman tables for lossless compression\n(for hardware solution), and in this case improve lossless RGB compression\nwith reversible color transform.  Thank to Benny Alexandar for hint.\n\nExtend the entropy decoding structure, so that extraneous bytes between\ncompressed scan data and following marker can be reported correctly.\nThank to Nigel Tao for hint.\n\nAdd jpegtran -wipe option and extension for -crop.\nThank to Andrew Senior, David Clunie, and Josef Schmid for suggestion.\n\n\nVersion 9  13-Jan-2013\n----------------------\n\nAdd cjpeg -rgb1 option to create an RGB JPEG file, and insert\na simple reversible color transform into the processing which\nsignificantly improves the compression.\nThe recommended command for lossless coding of RGB images is now\ncjpeg -rgb1 -block 1 -arithmetic.\nAs said, this option improves the compression significantly, but\nthe files are not compatible with JPEG decoders prior to IJG v9\ndue to the included color transform.\nThe used color transform and marker signaling is compatible with\nother JPEG standards (e.g., JPEG-LS part 2).\n\nRemove the automatic de-ANSI-fication support (Automake 1.12).\nThank also to Nitin A Kamble for suggestion.\n\nAdd remark for jpeg_mem_dest() in jdatadst.c.\nThank to Elie-Gregoire Khoury for the hint.\n\nSupport files with invalid component identifiers (created\nby Adobe PDF).  Thank to Robin Watts for the suggestion.\n\nAdapt full buffer case in jcmainct.c for use with scaled DCT.\nThank to Sergii Biloshytskyi for the suggestion.\n\nAdd type identifier for declaration of noreturn functions.\nThank to Brett L. Moore for the suggestion.\n\nCorrect argument type in format string, avoid compiler warnings.\nThank to Vincent Torri for hint.\n\nAdd missing #include directives in configuration checks, avoid\nconfiguration errors.  Thank to John Spencer for the hint.\n\n\nVersion 8d  15-Jan-2012\n-----------------------\n\nAdd cjpeg -rgb option to create RGB JPEG files.\nUsing this switch suppresses the conversion from RGB\ncolorspace input to the default YCbCr JPEG colorspace.\nThis feature allows true lossless JPEG coding of RGB color images.\nThe recommended command for this purpose is currently\ncjpeg -rgb -block 1 -arithmetic.\nSmartScale capable decoder (introduced with IJG JPEG 8) required.\nThank to Michael Koch for the initial suggestion.\n\nAdd option to disable the region adjustment in the transupp crop code.\nThank to Jeffrey Friedl for the suggestion.\n\nThank to Richard Jones and Edd Dawson for various minor corrections.\n\nThank to Akim Demaille for configure.ac cleanup.\n\n\nVersion 8c  16-Jan-2011\n-----------------------\n\nAdd option to compression library and cjpeg (-block N) to use\ndifferent DCT block size.\nAll N from 1 to 16 are possible.  Default is 8 (baseline format).\nLarger values produce higher compression,\nsmaller values produce higher quality.\nSmartScale capable decoder (introduced with IJG JPEG 8) required.\n\n\nVersion 8b  16-May-2010\n-----------------------\n\nRepair problem in new memory source manager with corrupt JPEG data.\nThank to Ted Campbell and Samuel Chun for the report.\n\nRepair problem in Makefile.am test target.\nThank to anonymous user for the report.\n\nSupport MinGW installation with automatic configure.\nThank to Volker Grabsch for the suggestion.\n\n\nVersion 8a  28-Feb-2010\n-----------------------\n\nWriting tables-only datastreams via jpeg_write_tables works again.\n\nSupport 32-bit BMPs (RGB image with Alpha channel) for read in cjpeg.\nThank to Brett Blackham for the suggestion.\n\nImprove accuracy in floating point IDCT calculation.\nThank to Robert Hooke for the hint.\n\n\nVersion 8  10-Jan-2010\n----------------------\n\njpegtran now supports the same -scale option as djpeg for \"lossless\" resize.\nAn implementation of the JPEG SmartScale extension is required for this\nfeature.  A (draft) specification of the JPEG SmartScale extension is\navailable as a contributed document at ITU and ISO.  Revision 2 or later\nof the document is required (latest document version is Revision 3).\nThe SmartScale extension will enable more features beside lossless resize\nin future implementations, as described in the document (new compression\noptions).\n\nAdd sanity check in BMP reader module to avoid cjpeg crash for empty input\nimage (thank to Isaev Ildar of ISP RAS, Moscow, RU for reporting this error).\n\nAdd data source and destination managers for read from and write to\nmemory buffers.  New API functions jpeg_mem_src and jpeg_mem_dest.\nThank to Roberto Boni from Italy for the suggestion.\n\n\nVersion 7  27-Jun-2009\n----------------------\n\nNew scaled DCTs implemented.\ndjpeg now supports scalings N/8 with all N from 1 to 16.\ncjpeg now supports scalings 8/N with all N from 1 to 16.\nScaled DCTs with size larger than 8 are now also used for resolving the\ncommon 2x2 chroma subsampling case without additional spatial resampling.\nSeparate spatial resampling for those kind of files is now only necessary\nfor N>8 scaling cases.\nFurthermore, separate scaled DCT functions are provided for direct resolving\nof the common asymmetric subsampling cases (2x1 and 1x2) without additional\nspatial resampling.\n\ncjpeg -quality option has been extended for support of separate quality\nsettings for luminance and chrominance (or in general, for every provided\nquantization table slot).\nNew API function jpeg_default_qtables() and q_scale_factor array in library.\n\nAdded -nosmooth option to cjpeg, complementary to djpeg.\nNew variable \"do_fancy_downsampling\" in library, complement to fancy\nupsampling.  Fancy upsampling now uses direct DCT scaling with sizes\nlarger than 8.  The old method is not reversible and has been removed.\n\nSupport arithmetic entropy encoding and decoding.\nAdded files jaricom.c, jcarith.c, jdarith.c.\n\nStraighten the file structure:\nRemoved files jidctred.c, jcphuff.c, jchuff.h, jdphuff.c, jdhuff.h.\n\njpegtran has a new \"lossless\" cropping feature.\n\nImplement -perfect option in jpegtran, new API function\njtransform_perfect_transform() in transupp. (DP 204_perfect.dpatch)\n\nBetter error messages for jpegtran fopen failure.\n(DP 203_jpegtran_errmsg.dpatch)\n\nFix byte order issue with 16bit PPM/PGM files in rdppm.c/wrppm.c:\naccording to Netpbm, the de facto standard implementation of the PNM formats,\nthe most significant byte is first. (DP 203_rdppm.dpatch)\n\nAdd -raw option to rdjpgcom not to mangle the output.\n(DP 205_rdjpgcom_raw.dpatch)\n\nMake rdjpgcom locale aware. (DP 201_rdjpgcom_locale.dpatch)\n\nAdd extern \"C\" to jpeglib.h.\nThis avoids the need to put extern \"C\" { ... } around #include \"jpeglib.h\"\nin your C++ application.  Defining the symbol DONT_USE_EXTERN_C in the\nconfiguration prevents this. (DP 202_jpeglib.h_c++.dpatch)\n\n\nVersion 6b  27-Mar-1998\n-----------------------\n\njpegtran has new features for lossless image transformations (rotation\nand flipping) as well as \"lossless\" reduction to grayscale.\n\njpegtran now copies comments by default; it has a -copy switch to enable\ncopying all APPn blocks as well, or to suppress comments.  (Formerly it\nalways suppressed comments and APPn blocks.)  jpegtran now also preserves\nJFIF version and resolution information.\n\nNew decompressor library feature: COM and APPn markers found in the input\nfile can be saved in memory for later use by the application.  (Before,\nyou had to code this up yourself with a custom marker processor.)\n\nThere is an unused field \"void * client_data\" now in compress and decompress\nparameter structs; this may be useful in some applications.\n\nJFIF version number information is now saved by the decoder and accepted by\nthe encoder.  jpegtran uses this to copy the source file's version number,\nto ensure \"jpegtran -copy all\" won't create bogus files that contain JFXX\nextensions but claim to be version 1.01.  Applications that generate their\nown JFXX extension markers also (finally) have a supported way to cause the\nencoder to emit JFIF version number 1.02.\n\ndjpeg's trace mode reports JFIF 1.02 thumbnail images as such, rather\nthan as unknown APP0 markers.\n\nIn -verbose mode, djpeg and rdjpgcom will try to print the contents of\nAPP12 markers as text.  Some digital cameras store useful text information\nin APP12 markers.\n\nHandling of truncated data streams is more robust: blocks beyond the one in\nwhich the error occurs will be output as uniform gray, or left unchanged\nif decoding a progressive JPEG.  The appearance no longer depends on the\nHuffman tables being used.\n\nHuffman tables are checked for validity much more carefully than before.\n\nTo avoid the Unisys LZW patent, djpeg's GIF output capability has been\nchanged to produce \"uncompressed GIFs\", and cjpeg's GIF input capability\nhas been removed altogether.  We're not happy about it either, but there\nseems to be no good alternative.\n\nThe configure script now supports building libjpeg as a shared library\non many flavors of Unix (all the ones that GNU libtool knows how to\nbuild shared libraries for).  Use \"./configure --enable-shared\" to\ntry this out.\n\nNew jconfig file and makefiles for Microsoft Visual C++ and Developer Studio.\nAlso, a jconfig file and a build script for Metrowerks CodeWarrior\non Apple Macintosh.  makefile.dj has been updated for DJGPP v2, and there\nare miscellaneous other minor improvements in the makefiles.\n\njmemmac.c now knows how to create temporary files following Mac System 7\nconventions.\n\ndjpeg's -map switch is now able to read raw-format PPM files reliably.\n\ncjpeg -progressive -restart no longer generates any unnecessary DRI markers.\n\nMultiple calls to jpeg_simple_progression for a single JPEG object\nno longer leak memory.\n\n\nVersion 6a  7-Feb-96\n--------------------\n\nLibrary initialization sequence modified to detect version mismatches\nand struct field packing mismatches between library and calling application.\nThis change requires applications to be recompiled, but does not require\nany application source code change.\n\nAll routine declarations changed to the style \"GLOBAL(type) name ...\",\nthat is, GLOBAL, LOCAL, METHODDEF, EXTERN are now macros taking the\nroutine's return type as an argument.  This makes it possible to add\nMicrosoft-style linkage keywords to all the routines by changing just\nthese macros.  Note that any application code that was using these macros\nwill have to be changed.\n\nDCT coefficient quantization tables are now stored in normal array order\nrather than zigzag order.  Application code that calls jpeg_add_quant_table,\nor otherwise manipulates quantization tables directly, will need to be\nchanged.  If you need to make such code work with either older or newer\nversions of the library, a test like \"#if JPEG_LIB_VERSION >= 61\" is\nrecommended.\n\ndjpeg's trace capability now dumps DQT tables in natural order, not zigzag\norder.  This allows the trace output to be made into a \"-qtables\" file\nmore easily.\n\nNew system-dependent memory manager module for use on Apple Macintosh.\n\nFix bug in cjpeg's -smooth option: last one or two scanlines would be\nduplicates of the prior line unless the image height mod 16 was 1 or 2.\n\nRepair minor problems in VMS, BCC, MC6 makefiles.\n\nNew configure script based on latest GNU Autoconf.\n\nCorrect the list of include files needed by MetroWerks C for ccommand().\n\nNumerous small documentation updates.\n\n\nVersion 6  2-Aug-95\n-------------------\n\nProgressive JPEG support: library can read and write full progressive JPEG\nfiles.  A \"buffered image\" mode supports incremental decoding for on-the-fly\ndisplay of progressive images.  Simply recompiling an existing IJG-v5-based\ndecoder with v6 should allow it to read progressive files, though of course\nwithout any special progressive display.\n\nNew \"jpegtran\" application performs lossless transcoding between different\nJPEG formats; primarily, it can be used to convert baseline to progressive\nJPEG and vice versa.  In support of jpegtran, the library now allows lossless\nreading and writing of JPEG files as DCT coefficient arrays.  This ability\nmay be of use in other applications.\n\nNotes for programmers:\n* We changed jpeg_start_decompress() to be able to suspend; this makes all\ndecoding modes available to suspending-input applications.  However,\nexisting applications that use suspending input will need to be changed\nto check the return value from jpeg_start_decompress().  You don't need to\ndo anything if you don't use a suspending data source.\n* We changed the interface to the virtual array routines: access_virt_array\nroutines now take a count of the number of rows to access this time.  The\nlast parameter to request_virt_array routines is now interpreted as the\nmaximum number of rows that may be accessed at once, but not necessarily\nthe height of every access.\n\n\nVersion 5b  15-Mar-95\n---------------------\n\nCorrect bugs with grayscale images having v_samp_factor > 1.\n\njpeg_write_raw_data() now supports output suspension.\n\nCorrect bugs in \"configure\" script for case of compiling in\na directory other than the one containing the source files.\n\nRepair bug in jquant1.c: sometimes didn't use as many colors as it could.\n\nBorland C makefile and jconfig file work under either MS-DOS or OS/2.\n\nMiscellaneous improvements to documentation.\n\n\nVersion 5a  7-Dec-94\n--------------------\n\nChanged color conversion roundoff behavior so that grayscale values are\nrepresented exactly.  (This causes test image files to change.)\n\nMake ordered dither use 16x16 instead of 4x4 pattern for a small quality\nimprovement.\n\nNew configure script based on latest GNU Autoconf.\nFix configure script to handle CFLAGS correctly.\nRename *.auto files to *.cfg, so that configure script still works if\nfile names have been truncated for DOS.\n\nFix bug in rdbmp.c: didn't allow for extra data between header and image.\n\nModify rdppm.c/wrppm.c to handle 2-byte raw PPM/PGM formats for 12-bit data.\n\nFix several bugs in rdrle.c.\n\nNEED_SHORT_EXTERNAL_NAMES option was broken.\n\nRevise jerror.h/jerror.c for more flexibility in message table.\n\nRepair oversight in jmemname.c NO_MKTEMP case: file could be there\nbut unreadable.\n\n\nVersion 5  24-Sep-94\n--------------------\n\nVersion 5 represents a nearly complete redesign and rewrite of the IJG\nsoftware.  Major user-visible changes include:\n  * Automatic configuration simplifies installation for most Unix systems.\n  * A range of speed vs. image quality tradeoffs are supported.\n    This includes resizing of an image during decompression: scaling down\n    by a factor of 1/2, 1/4, or 1/8 is handled very efficiently.\n  * New programs rdjpgcom and wrjpgcom allow insertion and extraction\n    of text comments in a JPEG file.\n\nThe application programmer's interface to the library has changed completely.\nNotable improvements include:\n  * We have eliminated the use of callback routines for handling the\n    uncompressed image data.  The application now sees the library as a\n    set of routines that it calls to read or write image data on a\n    scanline-by-scanline basis.\n  * The application image data is represented in a conventional interleaved-\n    pixel format, rather than as a separate array for each color channel.\n    This can save a copying step in many programs.\n  * The handling of compressed data has been cleaned up: the application can\n    supply routines to source or sink the compressed data.  It is possible to\n    suspend processing on source/sink buffer overrun, although this is not\n    supported in all operating modes.\n  * All static state has been eliminated from the library, so that multiple\n    instances of compression or decompression can be active concurrently.\n  * JPEG abbreviated datastream formats are supported, ie, quantization and\n    Huffman tables can be stored separately from the image data.\n  * And not only that, but the documentation of the library has improved\n    considerably!\n\n\nThe last widely used release before the version 5 rewrite was version 4A of\n18-Feb-93.  Change logs before that point have been discarded, since they\nare not of much interest after the rewrite.\n"
  },
  {
    "path": "cjpeg.1",
    "content": ".TH CJPEG 1 \"23 November 2013\"\n.SH NAME\ncjpeg \\- compress an image file to a JPEG file\n.SH SYNOPSIS\n.B cjpeg\n[\n.I options\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B cjpeg\ncompresses the named image file, or the standard input if no file is\nnamed, and produces a JPEG/JFIF file on the standard output.\nThe currently supported input file formats are: PPM (PBMPLUS color\nformat), PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster\nToolkit format).  (RLE is supported only if the URT library is available.)\n.SH OPTIONS\nAll switch names may be abbreviated; for example,\n.B \\-grayscale\nmay be written\n.B \\-gray\nor\n.BR \\-gr .\nMost of the \"basic\" switches can be abbreviated to as little as one letter.\nUpper and lower case are equivalent (thus\n.B \\-BMP\nis the same as\n.BR \\-bmp ).\nBritish spellings are also accepted (e.g.,\n.BR \\-greyscale ),\nthough for brevity these are not mentioned below.\n.PP\nThe basic switches are:\n.TP\n.BI \\-quality \" N[,...]\"\nScale quantization tables to adjust image quality.  Quality is 0 (worst) to\n100 (best); default is 75.  (See below for more info.)\n.TP\n.B \\-grayscale\nCreate monochrome JPEG file from color input.  Be sure to use this switch when\ncompressing a grayscale BMP file, because\n.B cjpeg\nisn't bright enough to notice whether a BMP file uses only shades of gray.\nBy saying\n.BR \\-grayscale ,\nyou'll get a smaller JPEG file that takes less time to process.\n.TP\n.B \\-rgb\nCreate RGB JPEG file.\nUsing this switch suppresses the conversion from RGB\ncolorspace input to the default YCbCr JPEG colorspace.\nYou can use this switch in combination with the\n.BI \\-block \" N\"\nswitch (see below) for lossless JPEG coding.\nSee also the\n.B \\-rgb1\nswitch below.\n.TP\n.B \\-optimize\nPerform optimization of entropy encoding parameters.  Without this, default\nencoding parameters are used.\n.B \\-optimize\nusually makes the JPEG file a little smaller, but\n.B cjpeg\nruns somewhat slower and needs much more memory.  Image quality and speed of\ndecompression are unaffected by\n.BR \\-optimize .\n.TP\n.B \\-progressive\nCreate progressive JPEG file (see below).\n.TP\n.BI \\-scale \" M/N\"\nScale the output image by a factor M/N.  Currently supported scale factors are\nM/N with all N from 1 to 16, where M is the destination DCT size, which is 8\nby default (see\n.BI \\-block \" N\"\nswitch below).\n.TP\n.B \\-targa\nInput file is Targa format.  Targa files that contain an \"identification\"\nfield will not be automatically recognized by\n.BR cjpeg ;\nfor such files you must specify\n.B \\-targa\nto make\n.B cjpeg\ntreat the input as Targa format.\nFor most Targa files, you won't need this switch.\n.PP\nThe\n.B \\-quality\nswitch lets you trade off compressed file size against quality of the\nreconstructed image: the higher the quality setting, the larger the JPEG file,\nand the closer the output image will be to the original input.  Normally you\nwant to use the lowest quality setting (smallest file) that decompresses into\nsomething visually indistinguishable from the original image.  For this\npurpose the quality setting should be between 50 and 95; the default of 75 is\noften about right.  If you see defects at\n.B \\-quality\n75, then go up 5 or 10 counts at a time until you are happy with the output\nimage.  (The optimal setting will vary from one image to another.)\n.PP\n.B \\-quality\n100 will generate a quantization table of all 1's, minimizing loss in the\nquantization step (but there is still information loss in subsampling, as well\nas roundoff error).  This setting is mainly of interest for experimental\npurposes.  Quality values above about 95 are\n.B not\nrecommended for normal use; the compressed file size goes up dramatically for\nhardly any gain in output image quality.\n.PP\nIn the other direction, quality values below 50 will produce very small files\nof low image quality.  Settings around 5 to 10 might be useful in preparing an\nindex of a large image library, for example.  Try\n.B \\-quality\n2 (or so) for some amusing Cubist effects.  (Note: quality\nvalues below about 25 generate 2-byte quantization tables, which are\nconsidered optional in the JPEG standard.\n.B cjpeg\nemits a warning message when you give such a quality value, because some\nother JPEG programs may be unable to decode the resulting file.  Use\n.B \\-baseline\nif you need to ensure compatibility at low quality values.)\n.PP\nThe\n.B \\-quality\noption has been extended in IJG version 7 for support of separate quality\nsettings for luminance and chrominance (or in general, for every provided\nquantization table slot).  This feature is useful for high-quality\napplications which cannot accept the damage of color data by coarse\nsubsampling settings.  You can now easily reduce the color data amount more\nsmoothly with finer control without separate subsampling.  The resulting file\nis fully compliant with standard JPEG decoders.\nNote that the\n.B \\-quality\nratings refer to the quantization table slots, and that the last value is\nreplicated if there are more q-table slots than parameters.  The default\nq-table slots are 0 for luminance and 1 for chrominance with default tables as\ngiven in the JPEG standard.  This is compatible with the old behaviour in case\nthat only one parameter is given, which is then used for both luminance and\nchrominance (slots 0 and 1).  More or custom quantization tables can be set\nwith\n.B \\-qtables\nand assigned to components with\n.B \\-qslots\nparameter (see the \"wizard\" switches below).\n.B Caution:\nYou must explicitly add\n.BI \\-sample \" 1x1\"\nfor efficient separate color\nquality selection, since the default value used by library is 2x2!\n.PP\nThe\n.B \\-progressive\nswitch creates a \"progressive JPEG\" file.  In this type of JPEG file, the data\nis stored in multiple scans of increasing quality.  If the file is being\ntransmitted over a slow communications link, the decoder can use the first\nscan to display a low-quality image very quickly, and can then improve the\ndisplay with each subsequent scan.  The final image is exactly equivalent to a\nstandard JPEG file of the same quality setting, and the total file size is\nabout the same --- often a little smaller.\n.PP\nSwitches for advanced users:\n.TP\n.B \\-arithmetic\nUse arithmetic coding.\n.B Caution:\narithmetic coded JPEG is not yet widely implemented, so many decoders will\nbe unable to view an arithmetic coded JPEG file at all.\n.TP\n.BI \\-block \" N\"\nSet DCT block size.  All N from 1 to 16 are possible.\nDefault is 8 (baseline format).\nLarger values produce higher compression,\nsmaller values produce higher quality\n(exact DCT stage possible with 1 or 2; with the default quality of 75 and\ndefault Luminance qtable the DCT+Quantization stage is lossless for N=1).\n.B Caution:\nAn implementation of the JPEG SmartScale extension is required for this\nfeature.  SmartScale enabled JPEG is not yet widely implemented, so many\ndecoders will be unable to view a SmartScale extended JPEG file at all.\n.TP\n.B \\-rgb1\nCreate RGB JPEG file with reversible color transform.\nWorks like the\n.B \\-rgb\nswitch (see above) and inserts a simple reversible color transform\ninto the processing which significantly improves the compression.\nUse this switch in combination with the\n.BI \\-block \" N\"\nswitch (see above) for lossless JPEG coding.\n.B Caution:\nA decoder with inverse color transform support is required for\nthis feature.  Reversible color transform support is not yet\nwidely implemented, so many decoders will be unable to view\na reversible color transformed JPEG file at all.\n.TP\n.B \\-bgycc\nCreate big gamut YCC JPEG file.\nIn this type of encoding the color difference components are quantized\nfurther by a factor of 2 compared to the normal Cb/Cr values, thus creating\nspace to allow larger color values with higher saturation than the normal\ngamut limits to be encoded.  In order to compensate for the loss of color\nfidelity compared to a normal YCC encoded file, the color quantization\ntables can be adjusted accordingly.  For example,\n.B cjpeg \\-bgycc \\-quality\n80,90 will give similar results as\n.B cjpeg \\-quality\n80.\n.B Caution:\nFor correct decompression a decoder with big gamut YCC support (JFIF\nversion 2) is required.  An old decoder may or may not display a big\ngamut YCC encoded JPEG file, depending on JFIF version check and\ncorresponding warning/error configuration.  In case of a granted\ndecompression the old decoder will display the image with half\nsaturated colors.\n.TP\n.B \\-dct int\nUse integer DCT method (default).\n.TP\n.B \\-dct fast\nUse fast integer DCT (less accurate).\n.TP\n.B \\-dct float\nUse floating-point DCT method.\nThe float method is very slightly more accurate than the int method, but is\nmuch slower unless your machine has very fast floating-point hardware.  Also\nnote that results of the floating-point method may vary slightly across\nmachines, while the integer methods should give the same results everywhere.\nThe fast integer method is much less accurate than the other two.\n.TP\n.B \\-nosmooth\nDon't use high-quality downsampling.\n.TP\n.BI \\-restart \" N\"\nEmit a JPEG restart marker every N MCU rows, or every N MCU blocks if \"B\" is\nattached to the number.\n.B \\-restart 0\n(the default) means no restart markers.\n.TP\n.BI \\-smooth \" N\"\nSmooth the input image to eliminate dithering noise.  N, ranging from 1 to\n100, indicates the strength of smoothing.  0 (the default) means no smoothing.\n.TP\n.BI \\-maxmemory \" N\"\nSet limit for amount of memory to use in processing large images.  Value is\nin thousands of bytes, or millions of bytes if \"M\" is attached to the\nnumber.  For example,\n.B \\-max 4m\nselects 4000000 bytes.  If more space is needed, temporary files will be used.\n.TP\n.BI \\-outfile \" name\"\nSend output image to the named file, not to standard output.\n.TP\n.B \\-verbose\nEnable debug printout.  More\n.BR \\-v 's\ngive more output.  Also, version information is printed at startup.\n.TP\n.B \\-debug\nSame as\n.BR \\-verbose .\n.PP\nThe\n.B \\-restart\noption inserts extra markers that allow a JPEG decoder to resynchronize after\na transmission error.  Without restart markers, any damage to a compressed\nfile will usually ruin the image from the point of the error to the end of the\nimage; with restart markers, the damage is usually confined to the portion of\nthe image up to the next restart marker.  Of course, the restart markers\noccupy extra space.  We recommend\n.B \\-restart 1\nfor images that will be transmitted across unreliable networks such as Usenet.\n.PP\nThe\n.B \\-smooth\noption filters the input to eliminate fine-scale noise.  This is often useful\nwhen converting dithered images to JPEG: a moderate smoothing factor of 10 to\n50 gets rid of dithering patterns in the input file, resulting in a smaller\nJPEG file and a better-looking image.  Too large a smoothing factor will\nvisibly blur the image, however.\n.PP\nSwitches for wizards:\n.TP\n.B \\-baseline\nForce baseline-compatible quantization tables to be generated.  This clamps\nquantization values to 8 bits even at low quality settings.  (This switch is\npoorly named, since it does not ensure that the output is actually baseline\nJPEG.  For example, you can use\n.B \\-baseline\nand\n.B \\-progressive\ntogether.)\n.TP\n.BI \\-qtables \" file\"\nUse the quantization tables given in the specified text file.\n.TP\n.BI \\-qslots \" N[,...]\"\nSelect which quantization table to use for each color component.\n.TP\n.BI \\-sample \" HxV[,...]\"\nSet JPEG sampling factors for each color component.\n.TP\n.BI \\-scans \" file\"\nUse the scan script given in the specified text file.\n.PP\nThe \"wizard\" switches are intended for experimentation with JPEG.  If you\ndon't know what you are doing, \\fBdon't use them\\fR.  These switches are\ndocumented further in the file wizard.txt.\n.SH EXAMPLES\n.LP\nThis example compresses the PPM file foo.ppm with a quality factor of\n60 and saves the output as foo.jpg:\n.IP\n.B cjpeg \\-quality\n.I 60 foo.ppm\n.B >\n.I foo.jpg\n.SH HINTS\nColor GIF files are not the ideal input for JPEG; JPEG is really intended for\ncompressing full-color (24-bit) images.  In particular, don't try to convert\ncartoons, line drawings, and other images that have only a few distinct\ncolors.  GIF works great on these, JPEG does not.  If you want to convert a\nGIF to JPEG, you should experiment with\n.BR cjpeg 's\n.B \\-quality\nand\n.B \\-smooth\noptions to get a satisfactory conversion.\n.B \\-smooth 10\nor so is often helpful.\n.PP\nAvoid running an image through a series of JPEG compression/decompression\ncycles.  Image quality loss will accumulate; after ten or so cycles the image\nmay be noticeably worse than it was after one cycle.  It's best to use a\nlossless format while manipulating an image, then convert to JPEG format when\nyou are ready to file the image away.\n.PP\nThe\n.B \\-optimize\noption to\n.B cjpeg\nis worth using when you are making a \"final\" version for posting or archiving.\nIt's also a win when you are using low quality settings to make very small\nJPEG files; the percentage improvement is often a lot more than it is on\nlarger files.  (At present,\n.B \\-optimize\nmode is always selected when generating progressive JPEG files.)\n.SH ENVIRONMENT\n.TP\n.B JPEGMEM\nIf this environment variable is set, its value is the default memory limit.\nThe value is specified as described for the\n.B \\-maxmemory\nswitch.\n.B JPEGMEM\noverrides the default value specified when the program was compiled, and\nitself is overridden by an explicit\n.BR \\-maxmemory .\n.SH SEE ALSO\n.BR djpeg (1),\n.BR jpegtran (1),\n.BR rdjpgcom (1),\n.BR wrjpgcom (1)\n.br\n.BR ppm (5),\n.BR pgm (5)\n.br\nWallace, Gregory K.  \"The JPEG Still Picture Compression Standard\",\nCommunications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.\n.SH AUTHOR\nIndependent JPEG Group\n.SH BUGS\nGIF input files are no longer supported, to avoid the Unisys LZW patent\n(now expired).\n(Conversion of GIF files to JPEG is usually a bad idea anyway.)\n.PP\nNot all variants of BMP and Targa file formats are supported.\n.PP\nThe\n.B \\-targa\nswitch is not a bug, it's a feature.  (It would be a bug if the Targa format\ndesigners had not been clueless.)\n"
  },
  {
    "path": "cjpeg.c",
    "content": "/*\n * cjpeg.c\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2003-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a command-line user interface for the JPEG compressor.\n * It should work on any system with Unix- or MS-DOS-style command lines.\n *\n * Two different command line styles are permitted, depending on the\n * compile-time switch TWO_FILE_COMMANDLINE:\n *\tcjpeg [options]  inputfile outputfile\n *\tcjpeg [options]  [inputfile]\n * In the second style, output is always to standard output, which you'd\n * normally redirect to a file or pipe to some other program.  Input is\n * either from a named file or from standard input (typically redirected).\n * The second style is convenient on Unix but is unhelpful on systems that\n * don't support pipes.  Also, you MUST use the first style if your system\n * doesn't do binary I/O to stdin/stdout.\n * To simplify script writing, the \"-outfile\" switch is provided.  The syntax\n *\tcjpeg [options]  -outfile outputfile  inputfile\n * works regardless of which command line style is used.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n#include \"jversion.h\"\t\t/* for version message */\n\n#ifdef USE_CCOMMAND\t\t/* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>\t\t/* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>\t\t/* Think declares it here */\n#endif\n#endif\n\n\n/* Create the add-on message string table. */\n\n#define JMESSAGE(code,string)\tstring ,\n\nstatic const char * const cdjpeg_message_table[] = {\n#include \"cderror.h\"\n  NULL\n};\n\n\n/*\n * This routine determines what format the input file is,\n * and selects the appropriate input-reading module.\n *\n * To determine which family of input formats the file belongs to,\n * we may look only at the first byte of the file, since C does not\n * guarantee that more than one character can be pushed back with ungetc.\n * Looking at additional bytes would require one of these approaches:\n *     1) assume we can fseek() the input file (fails for piped input);\n *     2) assume we can push back more than one character (works in\n *        some C implementations, but unportable);\n *     3) provide our own buffering (breaks input readers that want to use\n *        stdio directly, such as the RLE library);\n * or  4) don't put back the data, and modify the input_init methods to assume\n *        they start reading after the start of file (also breaks RLE library).\n * #1 is attractive for MS-DOS but is untenable on Unix.\n *\n * The most portable solution for file types that can't be identified by their\n * first byte is to make the user tell us what they are.  This is also the\n * only approach for \"raw\" file types that contain only arbitrary values.\n * We presently apply this method for Targa files.  Most of the time Targa\n * files start with 0x00, so we recognize that case.  Potentially, however,\n * a Targa file could start with any byte value (byte 0 is the length of the\n * seldom-used ID field), so we provide a switch to force Targa input mode.\n */\n\nstatic boolean is_targa;\t/* records user -targa switch */\n\n\nLOCAL(cjpeg_source_ptr)\nselect_file_type (j_compress_ptr cinfo, FILE * infile)\n{\n  int c;\n\n  if (is_targa) {\n#ifdef TARGA_SUPPORTED\n    return jinit_read_targa(cinfo);\n#else\n    ERREXIT(cinfo, JERR_TGA_NOTCOMP);\n#endif\n  }\n\n  if ((c = getc(infile)) == EOF)\n    ERREXIT(cinfo, JERR_INPUT_EMPTY);\n  if (ungetc(c, infile) == EOF)\n    ERREXIT(cinfo, JERR_UNGETC_FAILED);\n\n  switch (c) {\n#ifdef BMP_SUPPORTED\n  case 'B':\n    return jinit_read_bmp(cinfo);\n#endif\n#ifdef GIF_SUPPORTED\n  case 'G':\n    return jinit_read_gif(cinfo);\n#endif\n#ifdef PPM_SUPPORTED\n  case 'P':\n    return jinit_read_ppm(cinfo);\n#endif\n#ifdef RLE_SUPPORTED\n  case 'R':\n    return jinit_read_rle(cinfo);\n#endif\n#ifdef TARGA_SUPPORTED\n  case 0x00:\n    return jinit_read_targa(cinfo);\n#endif\n  default:\n    ERREXIT(cinfo, JERR_UNKNOWN_FORMAT);\n    break;\n  }\n\n  return NULL;\t\t\t/* suppress compiler warnings */\n}\n\n\n/*\n * Argument-parsing code.\n * The switch parser is designed to be useful with DOS-style command line\n * syntax, ie, intermixed switches and file names, where only the switches\n * to the left of a given file name affect processing of that file.\n * The main program in this file doesn't actually use this capability...\n */\n\n\nstatic const char * progname;\t/* program name for error messages */\nstatic char * outfilename;\t/* for -outfile switch */\n\n\nLOCAL(void)\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"usage: %s [switches] \", progname);\n#ifdef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"inputfile outputfile\\n\");\n#else\n  fprintf(stderr, \"[inputfile]\\n\");\n#endif\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -quality N[,...]   Compression quality (0..100; 5-95 is useful range)\\n\");\n  fprintf(stderr, \"  -grayscale     Create monochrome JPEG file\\n\");\n  fprintf(stderr, \"  -rgb           Create RGB JPEG file\\n\");\n#ifdef ENTROPY_OPT_SUPPORTED\n  fprintf(stderr, \"  -optimize      Optimize Huffman table (smaller file, but slow compression)\\n\");\n#endif\n#ifdef C_PROGRESSIVE_SUPPORTED\n  fprintf(stderr, \"  -progressive   Create progressive JPEG file\\n\");\n#endif\n#ifdef DCT_SCALING_SUPPORTED\n  fprintf(stderr, \"  -scale M/N     Scale image by fraction M/N, eg, 1/2\\n\");\n#endif\n#ifdef TARGA_SUPPORTED\n  fprintf(stderr, \"  -targa         Input file is Targa format (usually not needed)\\n\");\n#endif\n  fprintf(stderr, \"Switches for advanced users:\\n\");\n#ifdef C_ARITH_CODING_SUPPORTED\n  fprintf(stderr, \"  -arithmetic    Use arithmetic coding\\n\");\n#endif\n#ifdef DCT_SCALING_SUPPORTED\n  fprintf(stderr, \"  -block N       DCT block size (1..16; default is 8)\\n\");\n#endif\n#if JPEG_LIB_VERSION_MAJOR >= 9\n  fprintf(stderr, \"  -rgb1          Create RGB JPEG file with reversible color transform\\n\");\n  fprintf(stderr, \"  -bgycc         Create big gamut YCC JPEG file\\n\");\n#endif\n#ifdef DCT_ISLOW_SUPPORTED\n  fprintf(stderr, \"  -dct int       Use integer DCT method%s\\n\",\n\t  (JDCT_DEFAULT == JDCT_ISLOW ? \" (default)\" : \"\"));\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n  fprintf(stderr, \"  -dct fast      Use fast integer DCT (less accurate)%s\\n\",\n\t  (JDCT_DEFAULT == JDCT_IFAST ? \" (default)\" : \"\"));\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  fprintf(stderr, \"  -dct float     Use floating-point DCT method%s\\n\",\n\t  (JDCT_DEFAULT == JDCT_FLOAT ? \" (default)\" : \"\"));\n#endif\n  fprintf(stderr, \"  -nosmooth      Don't use high-quality downsampling\\n\");\n  fprintf(stderr, \"  -restart N     Set restart interval in rows, or in blocks with B\\n\");\n#ifdef INPUT_SMOOTHING_SUPPORTED\n  fprintf(stderr, \"  -smooth N      Smooth dithered input (N=1..100 is strength)\\n\");\n#endif\n  fprintf(stderr, \"  -maxmemory N   Maximum memory to use (in kbytes)\\n\");\n  fprintf(stderr, \"  -outfile name  Specify name for output file\\n\");\n  fprintf(stderr, \"  -verbose  or  -debug   Emit debug output\\n\");\n  fprintf(stderr, \"Switches for wizards:\\n\");\n  fprintf(stderr, \"  -baseline      Force baseline quantization tables\\n\");\n  fprintf(stderr, \"  -qtables file  Use quantization tables given in file\\n\");\n  fprintf(stderr, \"  -qslots N[,...]    Set component quantization tables\\n\");\n  fprintf(stderr, \"  -sample HxV[,...]  Set component sampling factors\\n\");\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n  fprintf(stderr, \"  -scans file    Create multi-scan JPEG per script file\\n\");\n#endif\n  exit(EXIT_FAILURE);\n}\n\n\nLOCAL(int)\nparse_switches (j_compress_ptr cinfo, int argc, char **argv,\n\t\tint last_file_arg_seen, boolean for_real)\n/* Parse optional switches.\n * Returns argv[] index of first file-name argument (== argc if none).\n * Any file names with indexes <= last_file_arg_seen are ignored;\n * they have presumably been processed in a previous iteration.\n * (Pass 0 for last_file_arg_seen on the first or only iteration.)\n * for_real is FALSE on the first (dummy) pass; we may skip any expensive\n * processing.\n */\n{\n  int argn;\n  char * arg;\n  boolean force_baseline;\n  boolean simple_progressive;\n  char * qualityarg = NULL;\t/* saves -quality parm if any */\n  char * qtablefile = NULL;\t/* saves -qtables filename if any */\n  char * qslotsarg = NULL;\t/* saves -qslots parm if any */\n  char * samplearg = NULL;\t/* saves -sample parm if any */\n  char * scansarg = NULL;\t/* saves -scans parm if any */\n\n  /* Set up default JPEG parameters. */\n\n  force_baseline = FALSE;\t/* by default, allow 16-bit quantizers */\n  simple_progressive = FALSE;\n  is_targa = FALSE;\n  outfilename = NULL;\n  cinfo->err->trace_level = 0;\n\n  /* Scan command line options, adjust parameters */\n\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (*arg != '-') {\n      /* Not a switch, must be a file name argument */\n      if (argn <= last_file_arg_seen) {\n\toutfilename = NULL;\t/* -outfile applies to just one input file */\n\tcontinue;\t\t/* ignore this name if previously processed */\n      }\n      break;\t\t\t/* else done parsing switches */\n    }\n    arg++;\t\t\t/* advance past switch marker character */\n\n    if (keymatch(arg, \"arithmetic\", 1)) {\n      /* Use arithmetic coding. */\n#ifdef C_ARITH_CODING_SUPPORTED\n      cinfo->arith_code = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, arithmetic coding not supported\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"baseline\", 2)) {\n      /* Force baseline-compatible output (8-bit quantizer values). */\n      force_baseline = TRUE;\n\n    } else if (keymatch(arg, \"block\", 2)) {\n      /* Set DCT block size. */\n#if defined DCT_SCALING_SUPPORTED && JPEG_LIB_VERSION_MAJOR >= 8 && \\\n      (JPEG_LIB_VERSION_MAJOR > 8 || JPEG_LIB_VERSION_MINOR >= 3)\n      int val;\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%d\", &val) != 1)\n\tusage();\n      if (val < 1 || val > 16)\n\tusage();\n      cinfo->block_size = val;\n#else\n      fprintf(stderr, \"%s: sorry, block size setting not supported\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"dct\", 2)) {\n      /* Select DCT algorithm. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (keymatch(argv[argn], \"int\", 1)) {\n\tcinfo->dct_method = JDCT_ISLOW;\n      } else if (keymatch(argv[argn], \"fast\", 2)) {\n\tcinfo->dct_method = JDCT_IFAST;\n      } else if (keymatch(argv[argn], \"float\", 2)) {\n\tcinfo->dct_method = JDCT_FLOAT;\n      } else\n\tusage();\n\n    } else if (keymatch(arg, \"debug\", 1) || keymatch(arg, \"verbose\", 1)) {\n      /* Enable debug printouts. */\n      /* On first -d, print version identification */\n      static boolean printed_version = FALSE;\n\n      if (! printed_version) {\n\tfprintf(stderr, \"Independent JPEG Group's CJPEG, version %s\\n%s\\n\",\n\t\tJVERSION, JCOPYRIGHT);\n\tprinted_version = TRUE;\n      }\n      cinfo->err->trace_level++;\n\n    } else if (keymatch(arg, \"grayscale\", 2) || keymatch(arg, \"greyscale\",2)) {\n      /* Force a monochrome JPEG file to be generated. */\n      jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);\n\n    } else if (keymatch(arg, \"rgb\", 3) || keymatch(arg, \"rgb1\", 4)) {\n      /* Force an RGB JPEG file to be generated. */\n#if JPEG_LIB_VERSION_MAJOR >= 9\n      /* Note: Entropy table assignment in jpeg_set_colorspace depends\n       * on color_transform.\n       */\n      cinfo->color_transform = arg[3] ? JCT_SUBTRACT_GREEN : JCT_NONE;\n#endif\n      jpeg_set_colorspace(cinfo, JCS_RGB);\n\n    } else if (keymatch(arg, \"bgycc\", 5)) {\n      /* Force a big gamut YCC JPEG file to be generated. */\n#if JPEG_LIB_VERSION_MAJOR >= 9 && \\\n      (JPEG_LIB_VERSION_MAJOR > 9 || JPEG_LIB_VERSION_MINOR >= 1)\n      jpeg_set_colorspace(cinfo, JCS_BG_YCC);\n#else\n      fprintf(stderr, \"%s: sorry, BG_YCC colorspace not supported\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"maxmemory\", 3)) {\n      /* Maximum memory in Kb (or Mb with 'm'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n\tusage();\n      if (ch == 'm' || ch == 'M')\n\tlval *= 1000L;\n      cinfo->mem->max_memory_to_use = lval * 1000L;\n\n    } else if (keymatch(arg, \"nosmooth\", 3)) {\n      /* Suppress fancy downsampling. */\n      cinfo->do_fancy_downsampling = FALSE;\n\n    } else if (keymatch(arg, \"optimize\", 1) || keymatch(arg, \"optimise\", 1)) {\n      /* Enable entropy parm optimization. */\n#ifdef ENTROPY_OPT_SUPPORTED\n      cinfo->optimize_coding = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, entropy optimization was not compiled\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"outfile\", 4)) {\n      /* Set output file name. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      outfilename = argv[argn];\t/* save it away for later use */\n\n    } else if (keymatch(arg, \"progressive\", 1)) {\n      /* Select simple progressive mode. */\n#ifdef C_PROGRESSIVE_SUPPORTED\n      simple_progressive = TRUE;\n      /* We must postpone execution until num_components is known. */\n#else\n      fprintf(stderr, \"%s: sorry, progressive output was not compiled\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"quality\", 1)) {\n      /* Quality ratings (quantization table scaling factors). */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      qualityarg = argv[argn];\n\n    } else if (keymatch(arg, \"qslots\", 2)) {\n      /* Quantization table slot numbers. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      qslotsarg = argv[argn];\n      /* Must delay setting qslots until after we have processed any\n       * colorspace-determining switches, since jpeg_set_colorspace sets\n       * default quant table numbers.\n       */\n\n    } else if (keymatch(arg, \"qtables\", 2)) {\n      /* Quantization tables fetched from file. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      qtablefile = argv[argn];\n      /* We postpone actually reading the file in case -quality comes later. */\n\n    } else if (keymatch(arg, \"restart\", 1)) {\n      /* Restart interval in MCU rows (or in MCUs with 'b'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n\tusage();\n      if (lval < 0 || lval > 65535L)\n\tusage();\n      if (ch == 'b' || ch == 'B') {\n\tcinfo->restart_interval = (unsigned int) lval;\n\tcinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */\n      } else {\n\tcinfo->restart_in_rows = (int) lval;\n\t/* restart_interval will be computed during startup */\n      }\n\n    } else if (keymatch(arg, \"sample\", 2)) {\n      /* Set sampling factors. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      samplearg = argv[argn];\n      /* Must delay setting sample factors until after we have processed any\n       * colorspace-determining switches, since jpeg_set_colorspace sets\n       * default sampling factors.\n       */\n\n    } else if (keymatch(arg, \"scale\", 4)) {\n      /* Scale the image by a fraction M/N. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%u/%u\",\n\t\t &cinfo->scale_num, &cinfo->scale_denom) != 2)\n\tusage();\n\n    } else if (keymatch(arg, \"scans\", 4)) {\n      /* Set scan script. */\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      scansarg = argv[argn];\n      /* We must postpone reading the file in case -progressive appears. */\n#else\n      fprintf(stderr, \"%s: sorry, multi-scan output was not compiled\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"smooth\", 2)) {\n      /* Set input smoothing factor. */\n      int val;\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%d\", &val) != 1)\n\tusage();\n      if (val < 0 || val > 100)\n\tusage();\n      cinfo->smoothing_factor = val;\n\n    } else if (keymatch(arg, \"targa\", 1)) {\n      /* Input file is Targa format. */\n      is_targa = TRUE;\n\n    } else {\n      usage();\t\t\t/* bogus switch */\n    }\n  }\n\n  /* Post-switch-scanning cleanup */\n\n  if (for_real) {\n\n    /* Set quantization tables for selected quality. */\n    /* Some or all may be overridden if -qtables is present. */\n    if (qualityarg != NULL)\t/* process -quality if it was present */\n      if (! set_quality_ratings(cinfo, qualityarg, force_baseline))\n\tusage();\n\n    if (qtablefile != NULL)\t/* process -qtables if it was present */\n      if (! read_quant_tables(cinfo, qtablefile, force_baseline))\n\tusage();\n\n    if (qslotsarg != NULL)\t/* process -qslots if it was present */\n      if (! set_quant_slots(cinfo, qslotsarg))\n\tusage();\n\n    if (samplearg != NULL)\t/* process -sample if it was present */\n      if (! set_sample_factors(cinfo, samplearg))\n\tusage();\n\n#ifdef C_PROGRESSIVE_SUPPORTED\n    if (simple_progressive)\t/* process -progressive; -scans can override */\n      jpeg_simple_progression(cinfo);\n#endif\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n    if (scansarg != NULL)\t/* process -scans if it was present */\n      if (! read_scan_script(cinfo, scansarg))\n\tusage();\n#endif\n  }\n\n  return argn;\t\t\t/* return index of next arg (file name) */\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  struct jpeg_compress_struct cinfo;\n  struct jpeg_error_mgr jerr;\n#ifdef PROGRESS_REPORT\n  struct cdjpeg_progress_mgr progress;\n#endif\n  int file_index;\n  cjpeg_source_ptr src_mgr;\n  FILE * input_file;\n  FILE * output_file;\n  JDIMENSION num_scanlines;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"cjpeg\";\t\t/* in case C library doesn't provide it */\n\n  /* Initialize the JPEG compression object with default error handling. */\n  cinfo.err = jpeg_std_error(&jerr);\n  jpeg_create_compress(&cinfo);\n  /* Add some application-specific error messages (from cderror.h) */\n  jerr.addon_message_table = cdjpeg_message_table;\n  jerr.first_addon_message = JMSG_FIRSTADDONCODE;\n  jerr.last_addon_message = JMSG_LASTADDONCODE;\n\n  /* Now safe to enable signal catcher. */\n#ifdef NEED_SIGNAL_CATCHER\n  enable_signal_catcher((j_common_ptr) &cinfo);\n#endif\n\n  /* Initialize JPEG parameters.\n   * Much of this may be overridden later.\n   * In particular, we don't yet know the input file's color space,\n   * but we need to provide some value for jpeg_set_defaults() to work.\n   */\n\n  cinfo.in_color_space = JCS_RGB; /* arbitrary guess */\n  jpeg_set_defaults(&cinfo);\n\n  /* Scan command line to find file names.\n   * It is convenient to use just one switch-parsing routine, but the switch\n   * values read here are ignored; we will rescan the switches after opening\n   * the input file.\n   */\n\n  file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);\n\n#ifdef TWO_FILE_COMMANDLINE\n  /* Must have either -outfile switch or explicit output file name */\n  if (outfilename == NULL) {\n    if (file_index != argc-2) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n\t      progname);\n      usage();\n    }\n    outfilename = argv[file_index+1];\n  } else {\n    if (file_index != argc-1) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n\t      progname);\n      usage();\n    }\n  }\n#else\n  /* Unix style: expect zero or one file name */\n  if (file_index < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n#endif /* TWO_FILE_COMMANDLINE */\n\n  /* Open the input file. */\n  if (file_index < argc) {\n    if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[file_index]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n    input_file = read_stdin();\n  }\n\n  /* Open the output file. */\n  if (outfilename != NULL) {\n    if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, outfilename);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default output file is stdout */\n    output_file = write_stdout();\n  }\n\n#ifdef PROGRESS_REPORT\n  start_progress_monitor((j_common_ptr) &cinfo, &progress);\n#endif\n\n  /* Figure out the input file format, and set up to read it. */\n  src_mgr = select_file_type(&cinfo, input_file);\n  src_mgr->input_file = input_file;\n\n  /* Read the input file header to obtain file size & colorspace. */\n  (*src_mgr->start_input) (&cinfo, src_mgr);\n\n  /* Now that we know input colorspace, fix colorspace-dependent defaults */\n  jpeg_default_colorspace(&cinfo);\n\n  /* Adjust default compression parameters by re-parsing the options */\n  file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);\n\n  /* Specify data destination for compression */\n  jpeg_stdio_dest(&cinfo, output_file);\n\n  /* Start compressor */\n  jpeg_start_compress(&cinfo, TRUE);\n\n  /* Process data */\n  while (cinfo.next_scanline < cinfo.image_height) {\n    num_scanlines = (*src_mgr->get_pixel_rows) (&cinfo, src_mgr);\n    (void) jpeg_write_scanlines(&cinfo, src_mgr->buffer, num_scanlines);\n  }\n\n  /* Finish compression and release memory */\n  (*src_mgr->finish_input) (&cinfo, src_mgr);\n  jpeg_finish_compress(&cinfo);\n  jpeg_destroy_compress(&cinfo);\n\n  /* Close files, if we opened them */\n  if (input_file != stdin)\n    fclose(input_file);\n  if (output_file != stdout)\n    fclose(output_file);\n\n#ifdef PROGRESS_REPORT\n  end_progress_monitor((j_common_ptr) &cinfo);\n#endif\n\n  /* All done. */\n  exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);\n  return 0;\t\t\t/* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "ckconfig.c",
    "content": "/*\n * ckconfig.c\n *\n * Copyright (C) 1991-1994, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n */\n\n/*\n * This program is intended to help you determine how to configure the JPEG\n * software for installation on a particular system.  The idea is to try to\n * compile and execute this program.  If your compiler fails to compile the\n * program, make changes as indicated in the comments below.  Once you can\n * compile the program, run it, and it will produce a \"jconfig.h\" file for\n * your system.\n *\n * As a general rule, each time you try to compile this program,\n * pay attention only to the *first* error message you get from the compiler.\n * Many C compilers will issue lots of spurious error messages once they\n * have gotten confused.  Go to the line indicated in the first error message,\n * and read the comments preceding that line to see what to change.\n *\n * Almost all of the edits you may need to make to this program consist of\n * changing a line that reads \"#define SOME_SYMBOL\" to \"#undef SOME_SYMBOL\",\n * or vice versa.  This is called defining or undefining that symbol.\n */\n\n\n/* First we must see if your system has the include files we need.\n * We start out with the assumption that your system has all the ANSI-standard\n * include files.  If you get any error trying to include one of these files,\n * undefine the corresponding HAVE_xxx symbol.\n */\n\n#define HAVE_STDDEF_H\t\t/* replace 'define' by 'undef' if error here */\n#ifdef HAVE_STDDEF_H\t\t/* next line will be skipped if you undef... */\n#include <stddef.h>\n#endif\n\n#define HAVE_STDLIB_H\t\t/* same thing for stdlib.h */\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n\n#include <stdio.h>\t\t/* If you ain't got this, you ain't got C. */\n\n/* We have to see if your string functions are defined by\n * strings.h (old BSD convention) or string.h (everybody else).\n * We try the non-BSD convention first; define NEED_BSD_STRINGS\n * if the compiler says it can't find string.h.\n */\n\n#undef NEED_BSD_STRINGS\n\n#ifdef NEED_BSD_STRINGS\n#include <strings.h>\n#else\n#include <string.h>\n#endif\n\n/* On some systems (especially older Unix machines), type size_t is\n * defined only in the include file <sys/types.h>.  If you get a failure\n * on the size_t test below, try defining NEED_SYS_TYPES_H.\n */\n\n#undef NEED_SYS_TYPES_H\t\t/* start by assuming we don't need it */\n#ifdef NEED_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n\n/* Usually type size_t is defined in one of the include files we've included\n * above.  If not, you'll get an error on the \"typedef size_t my_size_t;\" line.\n * In that case, first try defining NEED_SYS_TYPES_H just above.\n * If that doesn't work, you'll have to search through your system library\n * to figure out which include file defines \"size_t\".  Look for a line that\n * says \"typedef something-or-other size_t;\".  Then, change the line below\n * that says \"#include <someincludefile.h>\" to instead include the file\n * you found size_t in, and define NEED_SPECIAL_INCLUDE.  If you can't find\n * type size_t anywhere, try replacing \"#include <someincludefile.h>\" with\n * \"typedef unsigned int size_t;\".\n */\n\n#undef NEED_SPECIAL_INCLUDE\t/* assume we DON'T need it, for starters */\n\n#ifdef NEED_SPECIAL_INCLUDE\n#include <someincludefile.h>\n#endif\n\ntypedef size_t my_size_t;\t/* The payoff: do we have size_t now? */\n\n\n/* The next question is whether your compiler supports ANSI-style function\n * prototypes.  You need to know this in order to choose between using\n * makefile.ansi and using makefile.unix.\n * The #define line below is set to assume you have ANSI function prototypes.\n * If you get an error in this group of lines, undefine HAVE_PROTOTYPES.\n */\n\n#define HAVE_PROTOTYPES\n\n#ifdef HAVE_PROTOTYPES\nint testfunction (int arg1, int * arg2); /* check prototypes */\n\nstruct methods_struct {\t\t/* check method-pointer declarations */\n  int (*error_exit) (char *msgtext);\n  int (*trace_message) (char *msgtext);\n  int (*another_method) (void);\n};\n\nint testfunction (int arg1, int * arg2) /* check definitions */\n{\n  return arg2[arg1];\n}\n\nint test2function (void)\t/* check void arg list */\n{\n  return 0;\n}\n#endif\n\n\n/* Now we want to find out if your compiler knows what \"unsigned char\" means.\n * If you get an error on the \"unsigned char un_char;\" line,\n * then undefine HAVE_UNSIGNED_CHAR.\n */\n\n#define HAVE_UNSIGNED_CHAR\n\n#ifdef HAVE_UNSIGNED_CHAR\nunsigned char un_char;\n#endif\n\n\n/* Now we want to find out if your compiler knows what \"unsigned short\" means.\n * If you get an error on the \"unsigned short un_short;\" line,\n * then undefine HAVE_UNSIGNED_SHORT.\n */\n\n#define HAVE_UNSIGNED_SHORT\n\n#ifdef HAVE_UNSIGNED_SHORT\nunsigned short un_short;\n#endif\n\n\n/* Now we want to find out if your compiler understands type \"void\".\n * If you get an error anywhere in here, undefine HAVE_VOID.\n */\n\n#define HAVE_VOID\n\n#ifdef HAVE_VOID\n/* Caution: a C++ compiler will insist on complete prototypes */\ntypedef void * void_ptr;\t/* check void * */\n#ifdef HAVE_PROTOTYPES\t\t/* check ptr to function returning void */\ntypedef void (*void_func) (int a, int b);\n#else\ntypedef void (*void_func) ();\n#endif\n\n#ifdef HAVE_PROTOTYPES\t\t/* check void function result */\nvoid test3function (void_ptr arg1, void_func arg2)\n#else\nvoid test3function (arg1, arg2)\n     void_ptr arg1;\n     void_func arg2;\n#endif\n{\n  char * locptr = (char *) arg1; /* check casting to and from void * */\n  arg1 = (void *) locptr;\n  (*arg2) (1, 2);\t\t/* check call of fcn returning void */\n}\n#endif\n\n\n/* Now we want to find out if your compiler knows what \"const\" means.\n * If you get an error here, undefine HAVE_CONST.\n */\n\n#define HAVE_CONST\n\n#ifdef HAVE_CONST\nstatic const int carray[3] = {1, 2, 3};\n\n#ifdef HAVE_PROTOTYPES\nint test4function (const int arg1)\n#else\nint test4function (arg1)\n     const int arg1;\n#endif\n{\n  return carray[arg1];\n}\n#endif\n\n\n/* If you get an error or warning about this structure definition,\n * define INCOMPLETE_TYPES_BROKEN.\n */\n\n#undef INCOMPLETE_TYPES_BROKEN\n\n#ifndef INCOMPLETE_TYPES_BROKEN\ntypedef struct undefined_structure * undef_struct_ptr;\n#endif\n\n\n/* If you get an error about duplicate names,\n * define NEED_SHORT_EXTERNAL_NAMES.\n */\n\n#undef NEED_SHORT_EXTERNAL_NAMES\n\n#ifndef NEED_SHORT_EXTERNAL_NAMES\n\nint possibly_duplicate_function ()\n{\n  return 0;\n}\n\nint possibly_dupli_function ()\n{\n  return 1;\n}\n\n#endif\n\n\n\n/************************************************************************\n *  OK, that's it.  You should not have to change anything beyond this\n *  point in order to compile and execute this program.  (You might get\n *  some warnings, but you can ignore them.)\n *  When you run the program, it will make a couple more tests that it\n *  can do automatically, and then it will create jconfig.h and print out\n *  any additional suggestions it has.\n ************************************************************************\n */\n\n\n#ifdef HAVE_PROTOTYPES\nint is_char_signed (int arg)\n#else\nint is_char_signed (arg)\n     int arg;\n#endif\n{\n  if (arg == 189) {\t\t/* expected result for unsigned char */\n    return 0;\t\t\t/* type char is unsigned */\n  }\n  else if (arg != -67) {\t/* expected result for signed char */\n    printf(\"Hmm, it seems 'char' is not eight bits wide on your machine.\\n\");\n    printf(\"I fear the JPEG software will not work at all.\\n\\n\");\n  }\n  return 1;\t\t\t/* assume char is signed otherwise */\n}\n\n\n#ifdef HAVE_PROTOTYPES\nint is_shifting_signed (long arg)\n#else\nint is_shifting_signed (arg)\n     long arg;\n#endif\n/* See whether right-shift on a long is signed or not. */\n{\n  long res = arg >> 4;\n\n  if (res == -0x7F7E80CL) {\t/* expected result for signed shift */\n    return 1;\t\t\t/* right shift is signed */\n  }\n  /* see if unsigned-shift hack will fix it. */\n  /* we can't just test exact value since it depends on width of long... */\n  res |= (~0L) << (32-4);\n  if (res == -0x7F7E80CL) {\t/* expected result now? */\n    return 0;\t\t\t/* right shift is unsigned */\n  }\n  printf(\"Right shift isn't acting as I expect it to.\\n\");\n  printf(\"I fear the JPEG software will not work at all.\\n\\n\");\n  return 0;\t\t\t/* try it with unsigned anyway */\n}\n\n\n#ifdef HAVE_PROTOTYPES\nint main (int argc, char ** argv)\n#else\nint main (argc, argv)\n     int argc;\n     char ** argv;\n#endif\n{\n  char signed_char_check = (char) (-67);\n  FILE *outfile;\n\n  /* Attempt to write jconfig.h */\n  if ((outfile = fopen(\"jconfig.h\", \"w\")) == NULL) {\n    printf(\"Failed to write jconfig.h\\n\");\n    return 1;\n  }\n\n  /* Write out all the info */\n  fprintf(outfile, \"/* jconfig.h --- generated by ckconfig.c */\\n\");\n  fprintf(outfile, \"/* see jconfig.txt for explanations */\\n\\n\");\n#ifdef HAVE_PROTOTYPES\n  fprintf(outfile, \"#define HAVE_PROTOTYPES\\n\");\n#else\n  fprintf(outfile, \"#undef HAVE_PROTOTYPES\\n\");\n#endif\n#ifdef HAVE_UNSIGNED_CHAR\n  fprintf(outfile, \"#define HAVE_UNSIGNED_CHAR\\n\");\n#else\n  fprintf(outfile, \"#undef HAVE_UNSIGNED_CHAR\\n\");\n#endif\n#ifdef HAVE_UNSIGNED_SHORT\n  fprintf(outfile, \"#define HAVE_UNSIGNED_SHORT\\n\");\n#else\n  fprintf(outfile, \"#undef HAVE_UNSIGNED_SHORT\\n\");\n#endif\n#ifdef HAVE_VOID\n  fprintf(outfile, \"/* #define void char */\\n\");\n#else\n  fprintf(outfile, \"#define void char\\n\");\n#endif\n#ifdef HAVE_CONST\n  fprintf(outfile, \"/* #define const */\\n\");\n#else\n  fprintf(outfile, \"#define const\\n\");\n#endif\n  if (is_char_signed((int) signed_char_check))\n    fprintf(outfile, \"#undef CHAR_IS_UNSIGNED\\n\");\n  else\n    fprintf(outfile, \"#define CHAR_IS_UNSIGNED\\n\");\n#ifdef HAVE_STDDEF_H\n  fprintf(outfile, \"#define HAVE_STDDEF_H\\n\");\n#else\n  fprintf(outfile, \"#undef HAVE_STDDEF_H\\n\");\n#endif\n#ifdef HAVE_STDLIB_H\n  fprintf(outfile, \"#define HAVE_STDLIB_H\\n\");\n#else\n  fprintf(outfile, \"#undef HAVE_STDLIB_H\\n\");\n#endif\n#ifdef NEED_BSD_STRINGS\n  fprintf(outfile, \"#define NEED_BSD_STRINGS\\n\");\n#else\n  fprintf(outfile, \"#undef NEED_BSD_STRINGS\\n\");\n#endif\n#ifdef NEED_SYS_TYPES_H\n  fprintf(outfile, \"#define NEED_SYS_TYPES_H\\n\");\n#else\n  fprintf(outfile, \"#undef NEED_SYS_TYPES_H\\n\");\n#endif\n  fprintf(outfile, \"#undef NEED_FAR_POINTERS\\n\");\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n  fprintf(outfile, \"#define NEED_SHORT_EXTERNAL_NAMES\\n\");\n#else\n  fprintf(outfile, \"#undef NEED_SHORT_EXTERNAL_NAMES\\n\");\n#endif\n#ifdef INCOMPLETE_TYPES_BROKEN\n  fprintf(outfile, \"#define INCOMPLETE_TYPES_BROKEN\\n\");\n#else\n  fprintf(outfile, \"#undef INCOMPLETE_TYPES_BROKEN\\n\");\n#endif\n  fprintf(outfile, \"\\n#ifdef JPEG_INTERNALS\\n\\n\");\n  if (is_shifting_signed(-0x7F7E80B1L))\n    fprintf(outfile, \"#undef RIGHT_SHIFT_IS_UNSIGNED\\n\");\n  else\n    fprintf(outfile, \"#define RIGHT_SHIFT_IS_UNSIGNED\\n\");\n  fprintf(outfile, \"\\n#endif /* JPEG_INTERNALS */\\n\");\n  fprintf(outfile, \"\\n#ifdef JPEG_CJPEG_DJPEG\\n\\n\");\n  fprintf(outfile, \"#define BMP_SUPPORTED\t\t/* BMP image file format */\\n\");\n  fprintf(outfile, \"#define GIF_SUPPORTED\t\t/* GIF image file format */\\n\");\n  fprintf(outfile, \"#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\\n\");\n  fprintf(outfile, \"#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\\n\");\n  fprintf(outfile, \"#define TARGA_SUPPORTED\t\t/* Targa image file format */\\n\\n\");\n  fprintf(outfile, \"#undef TWO_FILE_COMMANDLINE\t/* You may need this on non-Unix systems */\\n\");\n  fprintf(outfile, \"#undef NEED_SIGNAL_CATCHER\t/* Define this if you use jmemname.c */\\n\");\n  fprintf(outfile, \"#undef DONT_USE_B_MODE\\n\");\n  fprintf(outfile, \"/* #define PROGRESS_REPORT */\t/* optional */\\n\");\n  fprintf(outfile, \"\\n#endif /* JPEG_CJPEG_DJPEG */\\n\");\n\n  /* Close the jconfig.h file */\n  fclose(outfile);\n\n  /* User report */\n  printf(\"Configuration check for Independent JPEG Group's software done.\\n\");\n  printf(\"\\nI have written the jconfig.h file for you.\\n\\n\");\n#ifdef HAVE_PROTOTYPES\n  printf(\"You should use makefile.ansi as the starting point for your Makefile.\\n\");\n#else\n  printf(\"You should use makefile.unix as the starting point for your Makefile.\\n\");\n#endif\n\n#ifdef NEED_SPECIAL_INCLUDE\n  printf(\"\\nYou'll need to change jconfig.h to include the system include file\\n\");\n  printf(\"that you found type size_t in, or add a direct definition of type\\n\");\n  printf(\"size_t if that's what you used.  Just add it to the end.\\n\");\n#endif\n\n  return 0;\n}\n"
  },
  {
    "path": "coderules.txt",
    "content": "IJG JPEG LIBRARY:  CODING RULES\n\nCopyright (C) 1991-1996, Thomas G. Lane.\nThis file is part of the Independent JPEG Group's software.\nFor conditions of distribution and use, see the accompanying README file.\n\n\nSince numerous people will be contributing code and bug fixes, it's important\nto establish a common coding style.  The goal of using similar coding styles\nis much more important than the details of just what that style is.\n\nIn general we follow the recommendations of \"Recommended C Style and Coding\nStandards\" revision 6.1 (Cannon et al. as modified by Spencer, Keppel and\nBrader).  This document is available in the IJG FTP archive (see\njpeg/doc/cstyle.ms.tbl.Z, or cstyle.txt.Z for those without nroff/tbl).\n\nBlock comments should be laid out thusly:\n\n/*\n *  Block comments in this style.\n */\n\nWe indent statements in K&R style, e.g.,\n\tif (test) {\n\t  then-part;\n\t} else {\n\t  else-part;\n\t}\nwith two spaces per indentation level.  (This indentation convention is\nhandled automatically by GNU Emacs and many other text editors.)\n\nMulti-word names should be written in lower case with underscores, e.g.,\nmulti_word_name (not multiWordName).  Preprocessor symbols and enum constants\nare similar but upper case (MULTI_WORD_NAME).  Names should be unique within\nthe first fifteen characters.  (On some older systems, global names must be\nunique within six characters.  We accommodate this without cluttering the\nsource code by using macros to substitute shorter names.)\n\nWe use function prototypes everywhere; we rely on automatic source code\ntransformation to feed prototype-less C compilers.  Transformation is done\nby the simple and portable tool 'ansi2knr.c' (courtesy of Ghostscript).\nansi2knr is not very bright, so it imposes a format requirement on function\ndeclarations: the function name MUST BEGIN IN COLUMN 1.  Thus all functions\nshould be written in the following style:\n\nLOCAL(int *)\nfunction_name (int a, char *b)\n{\n    code...\n}\n\nNote that each function definition must begin with GLOBAL(type), LOCAL(type),\nor METHODDEF(type).  These macros expand to \"static type\" or just \"type\" as\nappropriate.  They provide a readable indication of the routine's usage and\ncan readily be changed for special needs.  (For instance, special linkage\nkeywords can be inserted for use in Windows DLLs.)\n\nansi2knr does not transform method declarations (function pointers in\nstructs).  We handle these with a macro JMETHOD, defined as\n\t#ifdef HAVE_PROTOTYPES\n\t#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist\n\t#else\n\t#define JMETHOD(type,methodname,arglist)  type (*methodname) ()\n\t#endif\nwhich is used like this:\n\tstruct function_pointers {\n\t  JMETHOD(void, init_entropy_encoder, (int somearg, jparms *jp));\n\t  JMETHOD(void, term_entropy_encoder, (void));\n\t};\nNote the set of parentheses surrounding the parameter list.\n\nA similar solution is used for forward and external function declarations\n(see the EXTERN and JPP macros).\n\nIf the code is to work on non-ANSI compilers, we cannot rely on a prototype\ndeclaration to coerce actual parameters into the right types.  Therefore, use\nexplicit casts on actual parameters whenever the actual parameter type is not\nidentical to the formal parameter.  Beware of implicit conversions to \"int\".\n\nIt seems there are some non-ANSI compilers in which the sizeof() operator\nis defined to return int, yet size_t is defined as long.  Needless to say,\nthis is brain-damaged.  Always use the SIZEOF() macro in place of sizeof(),\nso that the result is guaranteed to be of type size_t.\n\n\nThe JPEG library is intended to be used within larger programs.  Furthermore,\nwe want it to be reentrant so that it can be used by applications that process\nmultiple images concurrently.  The following rules support these requirements:\n\n1. Avoid direct use of file I/O, \"malloc\", error report printouts, etc;\npass these through the common routines provided.\n\n2. Minimize global namespace pollution.  Functions should be declared static\nwherever possible.  (Note that our method-based calling conventions help this\na lot: in many modules only the initialization function will ever need to be\ncalled directly, so only that function need be externally visible.)  All\nglobal function names should begin with \"jpeg_\", and should have an\nabbreviated name (unique in the first six characters) substituted by macro\nwhen NEED_SHORT_EXTERNAL_NAMES is set.\n\n3. Don't use global variables; anything that must be used in another module\nshould be in the common data structures.\n\n4. Don't use static variables except for read-only constant tables.  Variables\nthat should be private to a module can be placed into private structures (see\nthe system architecture document, structure.txt).\n\n5. Source file names should begin with \"j\" for files that are part of the\nlibrary proper; source files that are not part of the library, such as cjpeg.c\nand djpeg.c, do not begin with \"j\".  Keep source file names to eight\ncharacters (plus \".c\" or \".h\", etc) to make life easy for MS-DOSers.  Keep\ncompression and decompression code in separate source files --- some\napplications may want only one half of the library.\n\nNote: these rules (particularly #4) are not followed religiously in the\nmodules that are used in cjpeg/djpeg but are not part of the JPEG library\nproper.  Those modules are not really intended to be used in other\napplications.\n"
  },
  {
    "path": "compile",
    "content": "#! /bin/sh\n# Wrapper for compilers which do not understand '-c -o'.\n\nscriptversion=2012-10-14.11; # UTC\n\n# Copyright (C) 1999-2014 Free Software Foundation, Inc.\n# Written by Tom Tromey <tromey@cygnus.com>.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# This file is maintained in Automake, please report\n# bugs to <bug-automake@gnu.org> or send patches to\n# <automake-patches@gnu.org>.\n\nnl='\n'\n\n# We need space, tab and new line, in precisely that order.  Quoting is\n# there to prevent tools from complaining about whitespace usage.\nIFS=\" \"\"\t$nl\"\n\nfile_conv=\n\n# func_file_conv build_file lazy\n# Convert a $build file to $host form and store it in $file\n# Currently only supports Windows hosts. If the determined conversion\n# type is listed in (the comma separated) LAZY, no conversion will\n# take place.\nfunc_file_conv ()\n{\n  file=$1\n  case $file in\n    / | /[!/]*) # absolute file, and not a UNC file\n      if test -z \"$file_conv\"; then\n\t# lazily determine how to convert abs files\n\tcase `uname -s` in\n\t  MINGW*)\n\t    file_conv=mingw\n\t    ;;\n\t  CYGWIN*)\n\t    file_conv=cygwin\n\t    ;;\n\t  *)\n\t    file_conv=wine\n\t    ;;\n\tesac\n      fi\n      case $file_conv/,$2, in\n\t*,$file_conv,*)\n\t  ;;\n\tmingw/*)\n\t  file=`cmd //C echo \"$file \" | sed -e 's/\"\\(.*\\) \" *$/\\1/'`\n\t  ;;\n\tcygwin/*)\n\t  file=`cygpath -m \"$file\" || echo \"$file\"`\n\t  ;;\n\twine/*)\n\t  file=`winepath -w \"$file\" || echo \"$file\"`\n\t  ;;\n      esac\n      ;;\n  esac\n}\n\n# func_cl_dashL linkdir\n# Make cl look for libraries in LINKDIR\nfunc_cl_dashL ()\n{\n  func_file_conv \"$1\"\n  if test -z \"$lib_path\"; then\n    lib_path=$file\n  else\n    lib_path=\"$lib_path;$file\"\n  fi\n  linker_opts=\"$linker_opts -LIBPATH:$file\"\n}\n\n# func_cl_dashl library\n# Do a library search-path lookup for cl\nfunc_cl_dashl ()\n{\n  lib=$1\n  found=no\n  save_IFS=$IFS\n  IFS=';'\n  for dir in $lib_path $LIB\n  do\n    IFS=$save_IFS\n    if $shared && test -f \"$dir/$lib.dll.lib\"; then\n      found=yes\n      lib=$dir/$lib.dll.lib\n      break\n    fi\n    if test -f \"$dir/$lib.lib\"; then\n      found=yes\n      lib=$dir/$lib.lib\n      break\n    fi\n    if test -f \"$dir/lib$lib.a\"; then\n      found=yes\n      lib=$dir/lib$lib.a\n      break\n    fi\n  done\n  IFS=$save_IFS\n\n  if test \"$found\" != yes; then\n    lib=$lib.lib\n  fi\n}\n\n# func_cl_wrapper cl arg...\n# Adjust compile command to suit cl\nfunc_cl_wrapper ()\n{\n  # Assume a capable shell\n  lib_path=\n  shared=:\n  linker_opts=\n  for arg\n  do\n    if test -n \"$eat\"; then\n      eat=\n    else\n      case $1 in\n\t-o)\n\t  # configure might choose to run compile as 'compile cc -o foo foo.c'.\n\t  eat=1\n\t  case $2 in\n\t    *.o | *.[oO][bB][jJ])\n\t      func_file_conv \"$2\"\n\t      set x \"$@\" -Fo\"$file\"\n\t      shift\n\t      ;;\n\t    *)\n\t      func_file_conv \"$2\"\n\t      set x \"$@\" -Fe\"$file\"\n\t      shift\n\t      ;;\n\t  esac\n\t  ;;\n\t-I)\n\t  eat=1\n\t  func_file_conv \"$2\" mingw\n\t  set x \"$@\" -I\"$file\"\n\t  shift\n\t  ;;\n\t-I*)\n\t  func_file_conv \"${1#-I}\" mingw\n\t  set x \"$@\" -I\"$file\"\n\t  shift\n\t  ;;\n\t-l)\n\t  eat=1\n\t  func_cl_dashl \"$2\"\n\t  set x \"$@\" \"$lib\"\n\t  shift\n\t  ;;\n\t-l*)\n\t  func_cl_dashl \"${1#-l}\"\n\t  set x \"$@\" \"$lib\"\n\t  shift\n\t  ;;\n\t-L)\n\t  eat=1\n\t  func_cl_dashL \"$2\"\n\t  ;;\n\t-L*)\n\t  func_cl_dashL \"${1#-L}\"\n\t  ;;\n\t-static)\n\t  shared=false\n\t  ;;\n\t-Wl,*)\n\t  arg=${1#-Wl,}\n\t  save_ifs=\"$IFS\"; IFS=','\n\t  for flag in $arg; do\n\t    IFS=\"$save_ifs\"\n\t    linker_opts=\"$linker_opts $flag\"\n\t  done\n\t  IFS=\"$save_ifs\"\n\t  ;;\n\t-Xlinker)\n\t  eat=1\n\t  linker_opts=\"$linker_opts $2\"\n\t  ;;\n\t-*)\n\t  set x \"$@\" \"$1\"\n\t  shift\n\t  ;;\n\t*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)\n\t  func_file_conv \"$1\"\n\t  set x \"$@\" -Tp\"$file\"\n\t  shift\n\t  ;;\n\t*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])\n\t  func_file_conv \"$1\" mingw\n\t  set x \"$@\" \"$file\"\n\t  shift\n\t  ;;\n\t*)\n\t  set x \"$@\" \"$1\"\n\t  shift\n\t  ;;\n      esac\n    fi\n    shift\n  done\n  if test -n \"$linker_opts\"; then\n    linker_opts=\"-link$linker_opts\"\n  fi\n  exec \"$@\" $linker_opts\n  exit 1\n}\n\neat=\n\ncase $1 in\n  '')\n     echo \"$0: No command.  Try '$0 --help' for more information.\" 1>&2\n     exit 1;\n     ;;\n  -h | --h*)\n    cat <<\\EOF\nUsage: compile [--help] [--version] PROGRAM [ARGS]\n\nWrapper for compilers which do not understand '-c -o'.\nRemove '-o dest.o' from ARGS, run PROGRAM with the remaining\narguments, and rename the output as expected.\n\nIf you are trying to build a whole package this is not the\nright script to run: please start by reading the file 'INSTALL'.\n\nReport bugs to <bug-automake@gnu.org>.\nEOF\n    exit $?\n    ;;\n  -v | --v*)\n    echo \"compile $scriptversion\"\n    exit $?\n    ;;\n  cl | *[/\\\\]cl | cl.exe | *[/\\\\]cl.exe )\n    func_cl_wrapper \"$@\"      # Doesn't return...\n    ;;\nesac\n\nofile=\ncfile=\n\nfor arg\ndo\n  if test -n \"$eat\"; then\n    eat=\n  else\n    case $1 in\n      -o)\n\t# configure might choose to run compile as 'compile cc -o foo foo.c'.\n\t# So we strip '-o arg' only if arg is an object.\n\teat=1\n\tcase $2 in\n\t  *.o | *.obj)\n\t    ofile=$2\n\t    ;;\n\t  *)\n\t    set x \"$@\" -o \"$2\"\n\t    shift\n\t    ;;\n\tesac\n\t;;\n      *.c)\n\tcfile=$1\n\tset x \"$@\" \"$1\"\n\tshift\n\t;;\n      *)\n\tset x \"$@\" \"$1\"\n\tshift\n\t;;\n    esac\n  fi\n  shift\ndone\n\nif test -z \"$ofile\" || test -z \"$cfile\"; then\n  # If no '-o' option was seen then we might have been invoked from a\n  # pattern rule where we don't need one.  That is ok -- this is a\n  # normal compilation that the losing compiler can handle.  If no\n  # '.c' file was seen then we are probably linking.  That is also\n  # ok.\n  exec \"$@\"\nfi\n\n# Name of file we expect compiler to create.\ncofile=`echo \"$cfile\" | sed 's|^.*[\\\\/]||; s|^[a-zA-Z]:||; s/\\.c$/.o/'`\n\n# Create the lock directory.\n# Note: use '[/\\\\:.-]' here to ensure that we don't use the same name\n# that we are using for the .o file.  Also, base the name on the expected\n# object file name, since that is what matters with a parallel build.\nlockdir=`echo \"$cofile\" | sed -e 's|[/\\\\:.-]|_|g'`.d\nwhile true; do\n  if mkdir \"$lockdir\" >/dev/null 2>&1; then\n    break\n  fi\n  sleep 1\ndone\n# FIXME: race condition here if user kills between mkdir and trap.\ntrap \"rmdir '$lockdir'; exit 1\" 1 2 15\n\n# Run the compile.\n\"$@\"\nret=$?\n\nif test -f \"$cofile\"; then\n  test \"$cofile\" = \"$ofile\" || mv \"$cofile\" \"$ofile\"\nelif test -f \"${cofile}bj\"; then\n  test \"${cofile}bj\" = \"$ofile\" || mv \"${cofile}bj\" \"$ofile\"\nfi\n\nrmdir \"$lockdir\"\nexit $ret\n\n# Local Variables:\n# mode: shell-script\n# sh-indentation: 2\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"
  },
  {
    "path": "config.guess",
    "content": "#! /bin/sh\n# Attempt to guess a canonical system name.\n#   Copyright 1992-2016 Free Software Foundation, Inc.\n\ntimestamp='2016-10-02'\n\n# This file is free software; you can redistribute it and/or modify it\n# under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, see <http://www.gnu.org/licenses/>.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that\n# program.  This Exception is an additional permission under section 7\n# of the GNU General Public License, version 3 (\"GPLv3\").\n#\n# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.\n#\n# You can get the latest version of this script from:\n# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess\n#\n# Please send patches to <config-patches@gnu.org>.\n\n\nme=`echo \"$0\" | sed -e 's,.*/,,'`\n\nusage=\"\\\nUsage: $0 [OPTION]\n\nOutput the configuration name of the system \\`$me' is run on.\n\nOperation modes:\n  -h, --help         print this help, then exit\n  -t, --time-stamp   print date of last modification, then exit\n  -v, --version      print version number, then exit\n\nReport bugs and patches to <config-patches@gnu.org>.\"\n\nversion=\"\\\nGNU config.guess ($timestamp)\n\nOriginally written by Per Bothner.\nCopyright 1992-2016 Free Software Foundation, Inc.\n\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n\nhelp=\"\nTry \\`$me --help' for more information.\"\n\n# Parse command line\nwhile test $# -gt 0 ; do\n  case $1 in\n    --time-stamp | --time* | -t )\n       echo \"$timestamp\" ; exit ;;\n    --version | -v )\n       echo \"$version\" ; exit ;;\n    --help | --h* | -h )\n       echo \"$usage\"; exit ;;\n    -- )     # Stop option processing\n       shift; break ;;\n    - )\t# Use stdin as input.\n       break ;;\n    -* )\n       echo \"$me: invalid option $1$help\" >&2\n       exit 1 ;;\n    * )\n       break ;;\n  esac\ndone\n\nif test $# != 0; then\n  echo \"$me: too many arguments$help\" >&2\n  exit 1\nfi\n\ntrap 'exit 1' 1 2 15\n\n# CC_FOR_BUILD -- compiler used by this script. Note that the use of a\n# compiler to aid in system detection is discouraged as it requires\n# temporary files to be created and, as you can see below, it is a\n# headache to deal with in a portable fashion.\n\n# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still\n# use `HOST_CC' if defined, but it is deprecated.\n\n# Portable tmp directory creation inspired by the Autoconf team.\n\nset_cc_for_build='\ntrap \"exitcode=\\$?; (rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null) && exit \\$exitcode\" 0 ;\ntrap \"rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null; exit 1\" 1 2 13 15 ;\n: ${TMPDIR=/tmp} ;\n { tmp=`(umask 077 && mktemp -d \"$TMPDIR/cgXXXXXX\") 2>/dev/null` && test -n \"$tmp\" && test -d \"$tmp\" ; } ||\n { test -n \"$RANDOM\" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||\n { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo \"Warning: creating insecure temp directory\" >&2 ; } ||\n { echo \"$me: cannot create a temporary directory in $TMPDIR\" >&2 ; exit 1 ; } ;\ndummy=$tmp/dummy ;\ntmpfiles=\"$dummy.c $dummy.o $dummy.rel $dummy\" ;\ncase $CC_FOR_BUILD,$HOST_CC,$CC in\n ,,)    echo \"int x;\" > $dummy.c ;\n\tfor c in cc gcc c89 c99 ; do\n\t  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then\n\t     CC_FOR_BUILD=\"$c\"; break ;\n\t  fi ;\n\tdone ;\n\tif test x\"$CC_FOR_BUILD\" = x ; then\n\t  CC_FOR_BUILD=no_compiler_found ;\n\tfi\n\t;;\n ,,*)   CC_FOR_BUILD=$CC ;;\n ,*,*)  CC_FOR_BUILD=$HOST_CC ;;\nesac ; set_cc_for_build= ;'\n\n# This is needed to find uname on a Pyramid OSx when run in the BSD universe.\n# (ghazi@noc.rutgers.edu 1994-08-24)\nif (test -f /.attbin/uname) >/dev/null 2>&1 ; then\n\tPATH=$PATH:/.attbin ; export PATH\nfi\n\nUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown\nUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown\nUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown\nUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown\n\ncase \"${UNAME_SYSTEM}\" in\nLinux|GNU|GNU/*)\n\t# If the system lacks a compiler, then just pick glibc.\n\t# We could probably try harder.\n\tLIBC=gnu\n\n\teval $set_cc_for_build\n\tcat <<-EOF > $dummy.c\n\t#include <features.h>\n\t#if defined(__UCLIBC__)\n\tLIBC=uclibc\n\t#elif defined(__dietlibc__)\n\tLIBC=dietlibc\n\t#else\n\tLIBC=gnu\n\t#endif\n\tEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`\n\t;;\nesac\n\n# Note: order is significant - the case branches are not exclusive.\n\ncase \"${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}\" in\n    *:NetBSD:*:*)\n\t# NetBSD (nbsd) targets should (where applicable) match one or\n\t# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,\n\t# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently\n\t# switched to ELF, *-*-netbsd* would select the old\n\t# object file format.  This provides both forward\n\t# compatibility and a consistent mechanism for selecting the\n\t# object file format.\n\t#\n\t# Note: NetBSD doesn't particularly care about the vendor\n\t# portion of the name.  We always set it to \"unknown\".\n\tsysctl=\"sysctl -n hw.machine_arch\"\n\tUNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \\\n\t    /sbin/$sysctl 2>/dev/null || \\\n\t    /usr/sbin/$sysctl 2>/dev/null || \\\n\t    echo unknown)`\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    armeb) machine=armeb-unknown ;;\n\t    arm*) machine=arm-unknown ;;\n\t    sh3el) machine=shl-unknown ;;\n\t    sh3eb) machine=sh-unknown ;;\n\t    sh5el) machine=sh5le-unknown ;;\n\t    earmv*)\n\t\tarch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\\(armv[0-9]\\).*$,\\1,'`\n\t\tendian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\\(eb\\)$,\\1,p'`\n\t\tmachine=${arch}${endian}-unknown\n\t\t;;\n\t    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;\n\tesac\n\t# The Operating System including object format, if it has switched\n\t# to ELF recently (or will in the future) and ABI.\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    earm*)\n\t\tos=netbsdelf\n\t\t;;\n\t    arm*|i386|m68k|ns32k|sh3*|sparc|vax)\n\t\teval $set_cc_for_build\n\t\tif echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t\t\t| grep -q __ELF__\n\t\tthen\n\t\t    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).\n\t\t    # Return netbsd for either.  FIX?\n\t\t    os=netbsd\n\t\telse\n\t\t    os=netbsdelf\n\t\tfi\n\t\t;;\n\t    *)\n\t\tos=netbsd\n\t\t;;\n\tesac\n\t# Determine ABI tags.\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    earm*)\n\t\texpr='s/^earmv[0-9]/-eabi/;s/eb$//'\n\t\tabi=`echo ${UNAME_MACHINE_ARCH} | sed -e \"$expr\"`\n\t\t;;\n\tesac\n\t# The OS release\n\t# Debian GNU/NetBSD machines have a different userland, and\n\t# thus, need a distinct triplet. However, they do not need\n\t# kernel version information, so it can be replaced with a\n\t# suitable tag, in the style of linux-gnu.\n\tcase \"${UNAME_VERSION}\" in\n\t    Debian*)\n\t\trelease='-gnu'\n\t\t;;\n\t    *)\n\t\trelease=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`\n\t\t;;\n\tesac\n\t# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:\n\t# contains redundant information, the shorter form:\n\t# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.\n\techo \"${machine}-${os}${release}${abi}\"\n\texit ;;\n    *:Bitrig:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}\n\texit ;;\n    *:OpenBSD:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}\n\texit ;;\n    *:LibertyBSD:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\\.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}\n\texit ;;\n    *:ekkoBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}\n\texit ;;\n    *:SolidBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}\n\texit ;;\n    macppc:MirBSD:*:*)\n\techo powerpc-unknown-mirbsd${UNAME_RELEASE}\n\texit ;;\n    *:MirBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}\n\texit ;;\n    *:Sortix:*:*)\n\techo ${UNAME_MACHINE}-unknown-sortix\n\texit ;;\n    alpha:OSF1:*:*)\n\tcase $UNAME_RELEASE in\n\t*4.0)\n\t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`\n\t\t;;\n\t*5.*)\n\t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`\n\t\t;;\n\tesac\n\t# According to Compaq, /usr/sbin/psrinfo has been available on\n\t# OSF/1 and Tru64 systems produced since 1995.  I hope that\n\t# covers most systems running today.  This code pipes the CPU\n\t# types through head -n 1, so we only detect the type of CPU 0.\n\tALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \\(.*\\) processor.*$/\\1/p' | head -n 1`\n\tcase \"$ALPHA_CPU_TYPE\" in\n\t    \"EV4 (21064)\")\n\t\tUNAME_MACHINE=alpha ;;\n\t    \"EV4.5 (21064)\")\n\t\tUNAME_MACHINE=alpha ;;\n\t    \"LCA4 (21066/21068)\")\n\t\tUNAME_MACHINE=alpha ;;\n\t    \"EV5 (21164)\")\n\t\tUNAME_MACHINE=alphaev5 ;;\n\t    \"EV5.6 (21164A)\")\n\t\tUNAME_MACHINE=alphaev56 ;;\n\t    \"EV5.6 (21164PC)\")\n\t\tUNAME_MACHINE=alphapca56 ;;\n\t    \"EV5.7 (21164PC)\")\n\t\tUNAME_MACHINE=alphapca57 ;;\n\t    \"EV6 (21264)\")\n\t\tUNAME_MACHINE=alphaev6 ;;\n\t    \"EV6.7 (21264A)\")\n\t\tUNAME_MACHINE=alphaev67 ;;\n\t    \"EV6.8CB (21264C)\")\n\t\tUNAME_MACHINE=alphaev68 ;;\n\t    \"EV6.8AL (21264B)\")\n\t\tUNAME_MACHINE=alphaev68 ;;\n\t    \"EV6.8CX (21264D)\")\n\t\tUNAME_MACHINE=alphaev68 ;;\n\t    \"EV6.9A (21264/EV69A)\")\n\t\tUNAME_MACHINE=alphaev69 ;;\n\t    \"EV7 (21364)\")\n\t\tUNAME_MACHINE=alphaev7 ;;\n\t    \"EV7.9 (21364A)\")\n\t\tUNAME_MACHINE=alphaev79 ;;\n\tesac\n\t# A Pn.n version is a patched version.\n\t# A Vn.n version is a released version.\n\t# A Tn.n version is a released field test version.\n\t# A Xn.n version is an unreleased experimental baselevel.\n\t# 1.2 uses \"1.2\" for uname -r.\n\techo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`\n\t# Reset EXIT trap before exiting to avoid spurious non-zero exit code.\n\texitcode=$?\n\ttrap '' 0\n\texit $exitcode ;;\n    Alpha\\ *:Windows_NT*:*)\n\t# How do we know it's Interix rather than the generic POSIX subsystem?\n\t# Should we change UNAME_MACHINE based on the output of uname instead\n\t# of the specific Alpha model?\n\techo alpha-pc-interix\n\texit ;;\n    21064:Windows_NT:50:3)\n\techo alpha-dec-winnt3.5\n\texit ;;\n    Amiga*:UNIX_System_V:4.0:*)\n\techo m68k-unknown-sysv4\n\texit ;;\n    *:[Aa]miga[Oo][Ss]:*:*)\n\techo ${UNAME_MACHINE}-unknown-amigaos\n\texit ;;\n    *:[Mm]orph[Oo][Ss]:*:*)\n\techo ${UNAME_MACHINE}-unknown-morphos\n\texit ;;\n    *:OS/390:*:*)\n\techo i370-ibm-openedition\n\texit ;;\n    *:z/VM:*:*)\n\techo s390-ibm-zvmoe\n\texit ;;\n    *:OS400:*:*)\n\techo powerpc-ibm-os400\n\texit ;;\n    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)\n\techo arm-acorn-riscix${UNAME_RELEASE}\n\texit ;;\n    arm*:riscos:*:*|arm*:RISCOS:*:*)\n\techo arm-unknown-riscos\n\texit ;;\n    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)\n\techo hppa1.1-hitachi-hiuxmpp\n\texit ;;\n    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)\n\t# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.\n\tif test \"`(/bin/universe) 2>/dev/null`\" = att ; then\n\t\techo pyramid-pyramid-sysv3\n\telse\n\t\techo pyramid-pyramid-bsd\n\tfi\n\texit ;;\n    NILE*:*:*:dcosx)\n\techo pyramid-pyramid-svr4\n\texit ;;\n    DRS?6000:unix:4.0:6*)\n\techo sparc-icl-nx6\n\texit ;;\n    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)\n\tcase `/usr/bin/uname -p` in\n\t    sparc) echo sparc-icl-nx7; exit ;;\n\tesac ;;\n    s390x:SunOS:*:*)\n\techo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4H:SunOS:5.*:*)\n\techo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)\n\techo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)\n\techo i386-pc-auroraux${UNAME_RELEASE}\n\texit ;;\n    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)\n\teval $set_cc_for_build\n\tSUN_ARCH=i386\n\t# If there is a compiler, see if it is configured for 64-bit objects.\n\t# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.\n\t# This test works for both compilers.\n\tif [ \"$CC_FOR_BUILD\" != no_compiler_found ]; then\n\t    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \\\n\t\t(CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) | \\\n\t\tgrep IS_64BIT_ARCH >/dev/null\n\t    then\n\t\tSUN_ARCH=x86_64\n\t    fi\n\tfi\n\techo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:6*:*)\n\t# According to config.sub, this is the proper way to canonicalize\n\t# SunOS6.  Hard to guess exactly what SunOS6 will be like, but\n\t# it's likely to be more like Solaris than SunOS4.\n\techo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:*:*)\n\tcase \"`/usr/bin/arch -k`\" in\n\t    Series*|S4*)\n\t\tUNAME_RELEASE=`uname -v`\n\t\t;;\n\tesac\n\t# Japanese Language versions have a version number like `4.1.3-JL'.\n\techo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`\n\texit ;;\n    sun3*:SunOS:*:*)\n\techo m68k-sun-sunos${UNAME_RELEASE}\n\texit ;;\n    sun*:*:4.2BSD:*)\n\tUNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`\n\ttest \"x${UNAME_RELEASE}\" = x && UNAME_RELEASE=3\n\tcase \"`/bin/arch`\" in\n\t    sun3)\n\t\techo m68k-sun-sunos${UNAME_RELEASE}\n\t\t;;\n\t    sun4)\n\t\techo sparc-sun-sunos${UNAME_RELEASE}\n\t\t;;\n\tesac\n\texit ;;\n    aushp:SunOS:*:*)\n\techo sparc-auspex-sunos${UNAME_RELEASE}\n\texit ;;\n    # The situation for MiNT is a little confusing.  The machine name\n    # can be virtually everything (everything which is not\n    # \"atarist\" or \"atariste\" at least should have a processor\n    # > m68000).  The system name ranges from \"MiNT\" over \"FreeMiNT\"\n    # to the lowercase version \"mint\" (or \"freemint\").  Finally\n    # the system name \"TOS\" denotes a system which is actually not\n    # MiNT.  But MiNT is downward compatible to TOS, so this should\n    # be no problem.\n    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)\n\techo m68k-milan-mint${UNAME_RELEASE}\n\texit ;;\n    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)\n\techo m68k-hades-mint${UNAME_RELEASE}\n\texit ;;\n    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)\n\techo m68k-unknown-mint${UNAME_RELEASE}\n\texit ;;\n    m68k:machten:*:*)\n\techo m68k-apple-machten${UNAME_RELEASE}\n\texit ;;\n    powerpc:machten:*:*)\n\techo powerpc-apple-machten${UNAME_RELEASE}\n\texit ;;\n    RISC*:Mach:*:*)\n\techo mips-dec-mach_bsd4.3\n\texit ;;\n    RISC*:ULTRIX:*:*)\n\techo mips-dec-ultrix${UNAME_RELEASE}\n\texit ;;\n    VAX*:ULTRIX*:*:*)\n\techo vax-dec-ultrix${UNAME_RELEASE}\n\texit ;;\n    2020:CLIX:*:* | 2430:CLIX:*:*)\n\techo clipper-intergraph-clix${UNAME_RELEASE}\n\texit ;;\n    mips:*:*:UMIPS | mips:*:*:RISCos)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n#ifdef __cplusplus\n#include <stdio.h>  /* for printf() prototype */\n\tint main (int argc, char *argv[]) {\n#else\n\tint main (argc, argv) int argc; char *argv[]; {\n#endif\n\t#if defined (host_mips) && defined (MIPSEB)\n\t#if defined (SYSTYPE_SYSV)\n\t  printf (\"mips-mips-riscos%ssysv\\n\", argv[1]); exit (0);\n\t#endif\n\t#if defined (SYSTYPE_SVR4)\n\t  printf (\"mips-mips-riscos%ssvr4\\n\", argv[1]); exit (0);\n\t#endif\n\t#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)\n\t  printf (\"mips-mips-riscos%sbsd\\n\", argv[1]); exit (0);\n\t#endif\n\t#endif\n\t  exit (-1);\n\t}\nEOF\n\t$CC_FOR_BUILD -o $dummy $dummy.c &&\n\t  dummyarg=`echo \"${UNAME_RELEASE}\" | sed -n 's/\\([0-9]*\\).*/\\1/p'` &&\n\t  SYSTEM_NAME=`$dummy $dummyarg` &&\n\t    { echo \"$SYSTEM_NAME\"; exit; }\n\techo mips-mips-riscos${UNAME_RELEASE}\n\texit ;;\n    Motorola:PowerMAX_OS:*:*)\n\techo powerpc-motorola-powermax\n\texit ;;\n    Motorola:*:4.3:PL8-*)\n\techo powerpc-harris-powermax\n\texit ;;\n    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)\n\techo powerpc-harris-powermax\n\texit ;;\n    Night_Hawk:Power_UNIX:*:*)\n\techo powerpc-harris-powerunix\n\texit ;;\n    m88k:CX/UX:7*:*)\n\techo m88k-harris-cxux7\n\texit ;;\n    m88k:*:4*:R4*)\n\techo m88k-motorola-sysv4\n\texit ;;\n    m88k:*:3*:R3*)\n\techo m88k-motorola-sysv3\n\texit ;;\n    AViiON:dgux:*:*)\n\t# DG/UX returns AViiON for all architectures\n\tUNAME_PROCESSOR=`/usr/bin/uname -p`\n\tif [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]\n\tthen\n\t    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \\\n\t       [ ${TARGET_BINARY_INTERFACE}x = x ]\n\t    then\n\t\techo m88k-dg-dgux${UNAME_RELEASE}\n\t    else\n\t\techo m88k-dg-dguxbcs${UNAME_RELEASE}\n\t    fi\n\telse\n\t    echo i586-dg-dgux${UNAME_RELEASE}\n\tfi\n\texit ;;\n    M88*:DolphinOS:*:*)\t# DolphinOS (SVR3)\n\techo m88k-dolphin-sysv3\n\texit ;;\n    M88*:*:R3*:*)\n\t# Delta 88k system running SVR3\n\techo m88k-motorola-sysv3\n\texit ;;\n    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)\n\techo m88k-tektronix-sysv3\n\texit ;;\n    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)\n\techo m68k-tektronix-bsd\n\texit ;;\n    *:IRIX*:*:*)\n\techo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`\n\texit ;;\n    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.\n\techo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id\n\texit ;;               # Note that: echo \"'`uname -s`'\" gives 'AIX '\n    i*86:AIX:*:*)\n\techo i386-ibm-aix\n\texit ;;\n    ia64:AIX:*:*)\n\tif [ -x /usr/bin/oslevel ] ; then\n\t\tIBM_REV=`/usr/bin/oslevel`\n\telse\n\t\tIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}\n\tfi\n\techo ${UNAME_MACHINE}-ibm-aix${IBM_REV}\n\texit ;;\n    *:AIX:2:3)\n\tif grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then\n\t\teval $set_cc_for_build\n\t\tsed 's/^\t\t//' << EOF >$dummy.c\n\t\t#include <sys/systemcfg.h>\n\n\t\tmain()\n\t\t\t{\n\t\t\tif (!__power_pc())\n\t\t\t\texit(1);\n\t\t\tputs(\"powerpc-ibm-aix3.2.5\");\n\t\t\texit(0);\n\t\t\t}\nEOF\n\t\tif $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`\n\t\tthen\n\t\t\techo \"$SYSTEM_NAME\"\n\t\telse\n\t\t\techo rs6000-ibm-aix3.2.5\n\t\tfi\n\telif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then\n\t\techo rs6000-ibm-aix3.2.4\n\telse\n\t\techo rs6000-ibm-aix3.2\n\tfi\n\texit ;;\n    *:AIX:*:[4567])\n\tIBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`\n\tif /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then\n\t\tIBM_ARCH=rs6000\n\telse\n\t\tIBM_ARCH=powerpc\n\tfi\n\tif [ -x /usr/bin/lslpp ] ; then\n\t\tIBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |\n\t\t\t   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`\n\telse\n\t\tIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}\n\tfi\n\techo ${IBM_ARCH}-ibm-aix${IBM_REV}\n\texit ;;\n    *:AIX:*:*)\n\techo rs6000-ibm-aix\n\texit ;;\n    ibmrt:4.4BSD:*|romp-ibm:BSD:*)\n\techo romp-ibm-bsd4.4\n\texit ;;\n    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and\n\techo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to\n\texit ;;                             # report: romp-ibm BSD 4.3\n    *:BOSX:*:*)\n\techo rs6000-bull-bosx\n\texit ;;\n    DPX/2?00:B.O.S.:*:*)\n\techo m68k-bull-sysv3\n\texit ;;\n    9000/[34]??:4.3bsd:1.*:*)\n\techo m68k-hp-bsd\n\texit ;;\n    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)\n\techo m68k-hp-bsd4.4\n\texit ;;\n    9000/[34678]??:HP-UX:*:*)\n\tHPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`\n\tcase \"${UNAME_MACHINE}\" in\n\t    9000/31? )            HP_ARCH=m68000 ;;\n\t    9000/[34]?? )         HP_ARCH=m68k ;;\n\t    9000/[678][0-9][0-9])\n\t\tif [ -x /usr/bin/getconf ]; then\n\t\t    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`\n\t\t    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`\n\t\t    case \"${sc_cpu_version}\" in\n\t\t      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0\n\t\t      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1\n\t\t      532)                      # CPU_PA_RISC2_0\n\t\t\tcase \"${sc_kernel_bits}\" in\n\t\t\t  32) HP_ARCH=hppa2.0n ;;\n\t\t\t  64) HP_ARCH=hppa2.0w ;;\n\t\t\t  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20\n\t\t\tesac ;;\n\t\t    esac\n\t\tfi\n\t\tif [ \"${HP_ARCH}\" = \"\" ]; then\n\t\t    eval $set_cc_for_build\n\t\t    sed 's/^\t\t//' << EOF >$dummy.c\n\n\t\t#define _HPUX_SOURCE\n\t\t#include <stdlib.h>\n\t\t#include <unistd.h>\n\n\t\tint main ()\n\t\t{\n\t\t#if defined(_SC_KERNEL_BITS)\n\t\t    long bits = sysconf(_SC_KERNEL_BITS);\n\t\t#endif\n\t\t    long cpu  = sysconf (_SC_CPU_VERSION);\n\n\t\t    switch (cpu)\n\t\t\t{\n\t\t\tcase CPU_PA_RISC1_0: puts (\"hppa1.0\"); break;\n\t\t\tcase CPU_PA_RISC1_1: puts (\"hppa1.1\"); break;\n\t\t\tcase CPU_PA_RISC2_0:\n\t\t#if defined(_SC_KERNEL_BITS)\n\t\t\t    switch (bits)\n\t\t\t\t{\n\t\t\t\tcase 64: puts (\"hppa2.0w\"); break;\n\t\t\t\tcase 32: puts (\"hppa2.0n\"); break;\n\t\t\t\tdefault: puts (\"hppa2.0\"); break;\n\t\t\t\t} break;\n\t\t#else  /* !defined(_SC_KERNEL_BITS) */\n\t\t\t    puts (\"hppa2.0\"); break;\n\t\t#endif\n\t\t\tdefault: puts (\"hppa1.0\"); break;\n\t\t\t}\n\t\t    exit (0);\n\t\t}\nEOF\n\t\t    (CCOPTS=\"\" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`\n\t\t    test -z \"$HP_ARCH\" && HP_ARCH=hppa\n\t\tfi ;;\n\tesac\n\tif [ ${HP_ARCH} = hppa2.0w ]\n\tthen\n\t    eval $set_cc_for_build\n\n\t    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating\n\t    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler\n\t    # generating 64-bit code.  GNU and HP use different nomenclature:\n\t    #\n\t    # $ CC_FOR_BUILD=cc ./config.guess\n\t    # => hppa2.0w-hp-hpux11.23\n\t    # $ CC_FOR_BUILD=\"cc +DA2.0w\" ./config.guess\n\t    # => hppa64-hp-hpux11.23\n\n\t    if echo __LP64__ | (CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) |\n\t\tgrep -q __LP64__\n\t    then\n\t\tHP_ARCH=hppa2.0w\n\t    else\n\t\tHP_ARCH=hppa64\n\t    fi\n\tfi\n\techo ${HP_ARCH}-hp-hpux${HPUX_REV}\n\texit ;;\n    ia64:HP-UX:*:*)\n\tHPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`\n\techo ia64-hp-hpux${HPUX_REV}\n\texit ;;\n    3050*:HI-UX:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#include <unistd.h>\n\tint\n\tmain ()\n\t{\n\t  long cpu = sysconf (_SC_CPU_VERSION);\n\t  /* The order matters, because CPU_IS_HP_MC68K erroneously returns\n\t     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct\n\t     results, however.  */\n\t  if (CPU_IS_PA_RISC (cpu))\n\t    {\n\t      switch (cpu)\n\t\t{\n\t\t  case CPU_PA_RISC1_0: puts (\"hppa1.0-hitachi-hiuxwe2\"); break;\n\t\t  case CPU_PA_RISC1_1: puts (\"hppa1.1-hitachi-hiuxwe2\"); break;\n\t\t  case CPU_PA_RISC2_0: puts (\"hppa2.0-hitachi-hiuxwe2\"); break;\n\t\t  default: puts (\"hppa-hitachi-hiuxwe2\"); break;\n\t\t}\n\t    }\n\t  else if (CPU_IS_HP_MC68K (cpu))\n\t    puts (\"m68k-hitachi-hiuxwe2\");\n\t  else puts (\"unknown-hitachi-hiuxwe2\");\n\t  exit (0);\n\t}\nEOF\n\t$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&\n\t\t{ echo \"$SYSTEM_NAME\"; exit; }\n\techo unknown-hitachi-hiuxwe2\n\texit ;;\n    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )\n\techo hppa1.1-hp-bsd\n\texit ;;\n    9000/8??:4.3bsd:*:*)\n\techo hppa1.0-hp-bsd\n\texit ;;\n    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)\n\techo hppa1.0-hp-mpeix\n\texit ;;\n    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )\n\techo hppa1.1-hp-osf\n\texit ;;\n    hp8??:OSF1:*:*)\n\techo hppa1.0-hp-osf\n\texit ;;\n    i*86:OSF1:*:*)\n\tif [ -x /usr/sbin/sysversion ] ; then\n\t    echo ${UNAME_MACHINE}-unknown-osf1mk\n\telse\n\t    echo ${UNAME_MACHINE}-unknown-osf1\n\tfi\n\texit ;;\n    parisc*:Lites*:*:*)\n\techo hppa1.1-hp-lites\n\texit ;;\n    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)\n\techo c1-convex-bsd\n\texit ;;\n    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)\n\tif getsysinfo -f scalar_acc\n\tthen echo c32-convex-bsd\n\telse echo c2-convex-bsd\n\tfi\n\texit ;;\n    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)\n\techo c34-convex-bsd\n\texit ;;\n    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)\n\techo c38-convex-bsd\n\texit ;;\n    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)\n\techo c4-convex-bsd\n\texit ;;\n    CRAY*Y-MP:*:*:*)\n\techo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*[A-Z]90:*:*:*)\n\techo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \\\n\t| sed -e 's/CRAY.*\\([A-Z]90\\)/\\1/' \\\n\t      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \\\n\t      -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*TS:*:*:*)\n\techo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*T3E:*:*:*)\n\techo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*SV1:*:*:*)\n\techo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    *:UNICOS/mp:*:*)\n\techo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)\n\tFUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`\n\tFUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\\///'`\n\tFUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`\n\techo \"${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n\texit ;;\n    5000:UNIX_System_V:4.*:*)\n\tFUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\\///'`\n\tFUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`\n\techo \"sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n\texit ;;\n    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\\ Embedded/OS:*:*)\n\techo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}\n\texit ;;\n    sparc*:BSD/OS:*:*)\n\techo sparc-unknown-bsdi${UNAME_RELEASE}\n\texit ;;\n    *:BSD/OS:*:*)\n\techo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}\n\texit ;;\n    *:FreeBSD:*:*)\n\tUNAME_PROCESSOR=`/usr/bin/uname -p`\n\tcase ${UNAME_PROCESSOR} in\n\t    amd64)\n\t\techo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;\n\t    *)\n\t\techo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;\n\tesac\n\texit ;;\n    i*:CYGWIN*:*)\n\techo ${UNAME_MACHINE}-pc-cygwin\n\texit ;;\n    *:MINGW64*:*)\n\techo ${UNAME_MACHINE}-pc-mingw64\n\texit ;;\n    *:MINGW*:*)\n\techo ${UNAME_MACHINE}-pc-mingw32\n\texit ;;\n    *:MSYS*:*)\n\techo ${UNAME_MACHINE}-pc-msys\n\texit ;;\n    i*:windows32*:*)\n\t# uname -m includes \"-pc\" on this system.\n\techo ${UNAME_MACHINE}-mingw32\n\texit ;;\n    i*:PW*:*)\n\techo ${UNAME_MACHINE}-pc-pw32\n\texit ;;\n    *:Interix*:*)\n\tcase ${UNAME_MACHINE} in\n\t    x86)\n\t\techo i586-pc-interix${UNAME_RELEASE}\n\t\texit ;;\n\t    authenticamd | genuineintel | EM64T)\n\t\techo x86_64-unknown-interix${UNAME_RELEASE}\n\t\texit ;;\n\t    IA64)\n\t\techo ia64-unknown-interix${UNAME_RELEASE}\n\t\texit ;;\n\tesac ;;\n    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)\n\techo i${UNAME_MACHINE}-pc-mks\n\texit ;;\n    8664:Windows_NT:*)\n\techo x86_64-pc-mks\n\texit ;;\n    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)\n\t# How do we know it's Interix rather than the generic POSIX subsystem?\n\t# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we\n\t# UNAME_MACHINE based on the output of uname instead of i386?\n\techo i586-pc-interix\n\texit ;;\n    i*:UWIN*:*)\n\techo ${UNAME_MACHINE}-pc-uwin\n\texit ;;\n    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)\n\techo x86_64-unknown-cygwin\n\texit ;;\n    p*:CYGWIN*:*)\n\techo powerpcle-unknown-cygwin\n\texit ;;\n    prep*:SunOS:5.*:*)\n\techo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    *:GNU:*:*)\n\t# the GNU system\n\techo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`\n\texit ;;\n    *:GNU/*:*:*)\n\t# other systems with GNU libc and userland\n\techo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr \"[:upper:]\" \"[:lower:]\"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}\n\texit ;;\n    i*86:Minix:*:*)\n\techo ${UNAME_MACHINE}-pc-minix\n\texit ;;\n    aarch64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    aarch64_be:Linux:*:*)\n\tUNAME_MACHINE=aarch64_be\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    alpha:Linux:*:*)\n\tcase `sed -n '/^cpu model/s/^.*: \\(.*\\)/\\1/p' < /proc/cpuinfo` in\n\t  EV5)   UNAME_MACHINE=alphaev5 ;;\n\t  EV56)  UNAME_MACHINE=alphaev56 ;;\n\t  PCA56) UNAME_MACHINE=alphapca56 ;;\n\t  PCA57) UNAME_MACHINE=alphapca56 ;;\n\t  EV6)   UNAME_MACHINE=alphaev6 ;;\n\t  EV67)  UNAME_MACHINE=alphaev67 ;;\n\t  EV68*) UNAME_MACHINE=alphaev68 ;;\n\tesac\n\tobjdump --private-headers /bin/sh | grep -q ld.so.1\n\tif test \"$?\" = 0 ; then LIBC=gnulibc1 ; fi\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    arc:Linux:*:* | arceb:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    arm*:Linux:*:*)\n\teval $set_cc_for_build\n\tif echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t    | grep -q __ARM_EABI__\n\tthen\n\t    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\telse\n\t    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t\t| grep -q __ARM_PCS_VFP\n\t    then\n\t\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi\n\t    else\n\t\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf\n\t    fi\n\tfi\n\texit ;;\n    avr32*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    cris:Linux:*:*)\n\techo ${UNAME_MACHINE}-axis-linux-${LIBC}\n\texit ;;\n    crisv32:Linux:*:*)\n\techo ${UNAME_MACHINE}-axis-linux-${LIBC}\n\texit ;;\n    e2k:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    frv:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    hexagon:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    i*86:Linux:*:*)\n\techo ${UNAME_MACHINE}-pc-linux-${LIBC}\n\texit ;;\n    ia64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    k1om:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    m32r*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    m68*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    mips:Linux:*:* | mips64:Linux:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#undef CPU\n\t#undef ${UNAME_MACHINE}\n\t#undef ${UNAME_MACHINE}el\n\t#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)\n\tCPU=${UNAME_MACHINE}el\n\t#else\n\t#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)\n\tCPU=${UNAME_MACHINE}\n\t#else\n\tCPU=\n\t#endif\n\t#endif\nEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`\n\ttest x\"${CPU}\" != x && { echo \"${CPU}-unknown-linux-${LIBC}\"; exit; }\n\t;;\n    mips64el:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    openrisc*:Linux:*:*)\n\techo or1k-unknown-linux-${LIBC}\n\texit ;;\n    or32:Linux:*:* | or1k*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    padre:Linux:*:*)\n\techo sparc-unknown-linux-${LIBC}\n\texit ;;\n    parisc64:Linux:*:* | hppa64:Linux:*:*)\n\techo hppa64-unknown-linux-${LIBC}\n\texit ;;\n    parisc:Linux:*:* | hppa:Linux:*:*)\n\t# Look for CPU level\n\tcase `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in\n\t  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;\n\t  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;\n\t  *)    echo hppa-unknown-linux-${LIBC} ;;\n\tesac\n\texit ;;\n    ppc64:Linux:*:*)\n\techo powerpc64-unknown-linux-${LIBC}\n\texit ;;\n    ppc:Linux:*:*)\n\techo powerpc-unknown-linux-${LIBC}\n\texit ;;\n    ppc64le:Linux:*:*)\n\techo powerpc64le-unknown-linux-${LIBC}\n\texit ;;\n    ppcle:Linux:*:*)\n\techo powerpcle-unknown-linux-${LIBC}\n\texit ;;\n    riscv32:Linux:*:* | riscv64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    s390:Linux:*:* | s390x:Linux:*:*)\n\techo ${UNAME_MACHINE}-ibm-linux-${LIBC}\n\texit ;;\n    sh64*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    sh*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    sparc:Linux:*:* | sparc64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    tile*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    vax:Linux:*:*)\n\techo ${UNAME_MACHINE}-dec-linux-${LIBC}\n\texit ;;\n    x86_64:Linux:*:*)\n\techo ${UNAME_MACHINE}-pc-linux-${LIBC}\n\texit ;;\n    xtensa*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    i*86:DYNIX/ptx:4*:*)\n\t# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.\n\t# earlier versions are messed up and put the nodename in both\n\t# sysname and nodename.\n\techo i386-sequent-sysv4\n\texit ;;\n    i*86:UNIX_SV:4.2MP:2.*)\n\t# Unixware is an offshoot of SVR4, but it has its own version\n\t# number series starting with 2...\n\t# I am not positive that other SVR4 systems won't match this,\n\t# I just have to hope.  -- rms.\n\t# Use sysv4.2uw... so that sysv4* matches it.\n\techo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}\n\texit ;;\n    i*86:OS/2:*:*)\n\t# If we were able to find `uname', then EMX Unix compatibility\n\t# is probably installed.\n\techo ${UNAME_MACHINE}-pc-os2-emx\n\texit ;;\n    i*86:XTS-300:*:STOP)\n\techo ${UNAME_MACHINE}-unknown-stop\n\texit ;;\n    i*86:atheos:*:*)\n\techo ${UNAME_MACHINE}-unknown-atheos\n\texit ;;\n    i*86:syllable:*:*)\n\techo ${UNAME_MACHINE}-pc-syllable\n\texit ;;\n    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)\n\techo i386-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    i*86:*DOS:*:*)\n\techo ${UNAME_MACHINE}-pc-msdosdjgpp\n\texit ;;\n    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)\n\tUNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\\/MP$//'`\n\tif grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then\n\t\techo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}\n\telse\n\t\techo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}\n\tfi\n\texit ;;\n    i*86:*:5:[678]*)\n\t# UnixWare 7.x, OpenUNIX and OpenServer 6.\n\tcase `/bin/uname -X | grep \"^Machine\"` in\n\t    *486*)\t     UNAME_MACHINE=i486 ;;\n\t    *Pentium)\t     UNAME_MACHINE=i586 ;;\n\t    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;\n\tesac\n\techo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}\n\texit ;;\n    i*86:*:3.2:*)\n\tif test -f /usr/options/cb.name; then\n\t\tUNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`\n\t\techo ${UNAME_MACHINE}-pc-isc$UNAME_REL\n\telif /bin/uname -X 2>/dev/null >/dev/null ; then\n\t\tUNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`\n\t\t(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486\n\t\t(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i586\n\t\t(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i686\n\t\t(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i686\n\t\techo ${UNAME_MACHINE}-pc-sco$UNAME_REL\n\telse\n\t\techo ${UNAME_MACHINE}-pc-sysv32\n\tfi\n\texit ;;\n    pc:*:*:*)\n\t# Left here for compatibility:\n\t# uname -m prints for DJGPP always 'pc', but it prints nothing about\n\t# the processor, so we play safe by assuming i586.\n\t# Note: whatever this is, it MUST be the same as what config.sub\n\t# prints for the \"djgpp\" host, or else GDB configure will decide that\n\t# this is a cross-build.\n\techo i586-pc-msdosdjgpp\n\texit ;;\n    Intel:Mach:3*:*)\n\techo i386-pc-mach3\n\texit ;;\n    paragon:*:*:*)\n\techo i860-intel-osf1\n\texit ;;\n    i860:*:4.*:*) # i860-SVR4\n\tif grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then\n\t  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4\n\telse # Add other i860-SVR4 vendors below as they are discovered.\n\t  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4\n\tfi\n\texit ;;\n    mini*:CTIX:SYS*5:*)\n\t# \"miniframe\"\n\techo m68010-convergent-sysv\n\texit ;;\n    mc68k:UNIX:SYSTEM5:3.51m)\n\techo m68k-convergent-sysv\n\texit ;;\n    M680?0:D-NIX:5.3:*)\n\techo m68k-diab-dnix\n\texit ;;\n    M68*:*:R3V[5678]*:*)\n\ttest -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;\n    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)\n\tOS_REL=''\n\ttest -r /etc/.relid \\\n\t&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \\([0-9][0-9]\\).*/\\1/p' < /etc/.relid`\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n\t  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;\n    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t  && { echo i486-ncr-sysv4; exit; } ;;\n    NCR*:*:4.2:* | MPRAS*:*:4.2:*)\n\tOS_REL='.3'\n\ttest -r /etc/.relid \\\n\t    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \\([0-9][0-9]\\).*/\\1/p' < /etc/.relid`\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n\t    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \\\n\t    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;\n    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)\n\techo m68k-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    mc68030:UNIX_System_V:4.*:*)\n\techo m68k-atari-sysv4\n\texit ;;\n    TSUNAMI:LynxOS:2.*:*)\n\techo sparc-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    rs6000:LynxOS:2.*:*)\n\techo rs6000-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)\n\techo powerpc-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    SM[BE]S:UNIX_SV:*:*)\n\techo mips-dde-sysv${UNAME_RELEASE}\n\texit ;;\n    RM*:ReliantUNIX-*:*:*)\n\techo mips-sni-sysv4\n\texit ;;\n    RM*:SINIX-*:*:*)\n\techo mips-sni-sysv4\n\texit ;;\n    *:SINIX-*:*:*)\n\tif uname -p 2>/dev/null >/dev/null ; then\n\t\tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n\t\techo ${UNAME_MACHINE}-sni-sysv4\n\telse\n\t\techo ns32k-sni-sysv\n\tfi\n\texit ;;\n    PENTIUM:*:4.0*:*)\t# Unisys `ClearPath HMP IX 4000' SVR4/MP effort\n\t\t\t# says <Richard.M.Bartel@ccMail.Census.GOV>\n\techo i586-unisys-sysv4\n\texit ;;\n    *:UNIX_System_V:4*:FTX*)\n\t# From Gerald Hewes <hewes@openmarket.com>.\n\t# How about differentiating between stratus architectures? -djm\n\techo hppa1.1-stratus-sysv4\n\texit ;;\n    *:*:*:FTX*)\n\t# From seanf@swdc.stratus.com.\n\techo i860-stratus-sysv4\n\texit ;;\n    i*86:VOS:*:*)\n\t# From Paul.Green@stratus.com.\n\techo ${UNAME_MACHINE}-stratus-vos\n\texit ;;\n    *:VOS:*:*)\n\t# From Paul.Green@stratus.com.\n\techo hppa1.1-stratus-vos\n\texit ;;\n    mc68*:A/UX:*:*)\n\techo m68k-apple-aux${UNAME_RELEASE}\n\texit ;;\n    news*:NEWS-OS:6*:*)\n\techo mips-sony-newsos6\n\texit ;;\n    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)\n\tif [ -d /usr/nec ]; then\n\t\techo mips-nec-sysv${UNAME_RELEASE}\n\telse\n\t\techo mips-unknown-sysv${UNAME_RELEASE}\n\tfi\n\texit ;;\n    BeBox:BeOS:*:*)\t# BeOS running on hardware made by Be, PPC only.\n\techo powerpc-be-beos\n\texit ;;\n    BeMac:BeOS:*:*)\t# BeOS running on Mac or Mac clone, PPC only.\n\techo powerpc-apple-beos\n\texit ;;\n    BePC:BeOS:*:*)\t# BeOS running on Intel PC compatible.\n\techo i586-pc-beos\n\texit ;;\n    BePC:Haiku:*:*)\t# Haiku running on Intel PC compatible.\n\techo i586-pc-haiku\n\texit ;;\n    x86_64:Haiku:*:*)\n\techo x86_64-unknown-haiku\n\texit ;;\n    SX-4:SUPER-UX:*:*)\n\techo sx4-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-5:SUPER-UX:*:*)\n\techo sx5-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-6:SUPER-UX:*:*)\n\techo sx6-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-7:SUPER-UX:*:*)\n\techo sx7-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-8:SUPER-UX:*:*)\n\techo sx8-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-8R:SUPER-UX:*:*)\n\techo sx8r-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-ACE:SUPER-UX:*:*)\n\techo sxace-nec-superux${UNAME_RELEASE}\n\texit ;;\n    Power*:Rhapsody:*:*)\n\techo powerpc-apple-rhapsody${UNAME_RELEASE}\n\texit ;;\n    *:Rhapsody:*:*)\n\techo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}\n\texit ;;\n    *:Darwin:*:*)\n\tUNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown\n\teval $set_cc_for_build\n\tif test \"$UNAME_PROCESSOR\" = unknown ; then\n\t    UNAME_PROCESSOR=powerpc\n\tfi\n\tif test `echo \"$UNAME_RELEASE\" | sed -e 's/\\..*//'` -le 10 ; then\n\t    if [ \"$CC_FOR_BUILD\" != no_compiler_found ]; then\n\t\tif (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \\\n\t\t    (CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) | \\\n\t\t    grep IS_64BIT_ARCH >/dev/null\n\t\tthen\n\t\t    case $UNAME_PROCESSOR in\n\t\t\ti386) UNAME_PROCESSOR=x86_64 ;;\n\t\t\tpowerpc) UNAME_PROCESSOR=powerpc64 ;;\n\t\t    esac\n\t\tfi\n\t    fi\n\telif test \"$UNAME_PROCESSOR\" = i386 ; then\n\t    # Avoid executing cc on OS X 10.9, as it ships with a stub\n\t    # that puts up a graphical alert prompting to install\n\t    # developer tools.  Any system running Mac OS X 10.7 or\n\t    # later (Darwin 11 and later) is required to have a 64-bit\n\t    # processor. This is not true of the ARM version of Darwin\n\t    # that Apple uses in portable devices.\n\t    UNAME_PROCESSOR=x86_64\n\tfi\n\techo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}\n\texit ;;\n    *:procnto*:*:* | *:QNX:[0123456789]*:*)\n\tUNAME_PROCESSOR=`uname -p`\n\tif test \"$UNAME_PROCESSOR\" = x86; then\n\t\tUNAME_PROCESSOR=i386\n\t\tUNAME_MACHINE=pc\n\tfi\n\techo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}\n\texit ;;\n    *:QNX:*:4*)\n\techo i386-pc-qnx\n\texit ;;\n    NEO-?:NONSTOP_KERNEL:*:*)\n\techo neo-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    NSE-*:NONSTOP_KERNEL:*:*)\n\techo nse-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    NSR-?:NONSTOP_KERNEL:*:*)\n\techo nsr-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    *:NonStop-UX:*:*)\n\techo mips-compaq-nonstopux\n\texit ;;\n    BS2000:POSIX*:*:*)\n\techo bs2000-siemens-sysv\n\texit ;;\n    DS/*:UNIX_System_V:*:*)\n\techo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}\n\texit ;;\n    *:Plan9:*:*)\n\t# \"uname -m\" is not consistent, so use $cputype instead. 386\n\t# is converted to i386 for consistency with other x86\n\t# operating systems.\n\tif test \"$cputype\" = 386; then\n\t    UNAME_MACHINE=i386\n\telse\n\t    UNAME_MACHINE=\"$cputype\"\n\tfi\n\techo ${UNAME_MACHINE}-unknown-plan9\n\texit ;;\n    *:TOPS-10:*:*)\n\techo pdp10-unknown-tops10\n\texit ;;\n    *:TENEX:*:*)\n\techo pdp10-unknown-tenex\n\texit ;;\n    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)\n\techo pdp10-dec-tops20\n\texit ;;\n    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)\n\techo pdp10-xkl-tops20\n\texit ;;\n    *:TOPS-20:*:*)\n\techo pdp10-unknown-tops20\n\texit ;;\n    *:ITS:*:*)\n\techo pdp10-unknown-its\n\texit ;;\n    SEI:*:*:SEIUX)\n\techo mips-sei-seiux${UNAME_RELEASE}\n\texit ;;\n    *:DragonFly:*:*)\n\techo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`\n\texit ;;\n    *:*VMS:*:*)\n\tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n\tcase \"${UNAME_MACHINE}\" in\n\t    A*) echo alpha-dec-vms ; exit ;;\n\t    I*) echo ia64-dec-vms ; exit ;;\n\t    V*) echo vax-dec-vms ; exit ;;\n\tesac ;;\n    *:XENIX:*:SysV)\n\techo i386-pc-xenix\n\texit ;;\n    i*86:skyos:*:*)\n\techo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`\n\texit ;;\n    i*86:rdos:*:*)\n\techo ${UNAME_MACHINE}-pc-rdos\n\texit ;;\n    i*86:AROS:*:*)\n\techo ${UNAME_MACHINE}-pc-aros\n\texit ;;\n    x86_64:VMkernel:*:*)\n\techo ${UNAME_MACHINE}-unknown-esx\n\texit ;;\n    amd64:Isilon\\ OneFS:*:*)\n\techo x86_64-unknown-onefs\n\texit ;;\nesac\n\ncat >&2 <<EOF\n$0: unable to guess system type\n\nThis script (version $timestamp), has failed to recognize the\noperating system you are using. If your script is old, overwrite\nconfig.guess and config.sub with the latest versions from:\n\n  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess\nand\n  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub\n\nIf $0 has already been updated, send the following data and any\ninformation you think might be pertinent to config-patches@gnu.org to\nprovide the necessary information to handle your system.\n\nconfig.guess timestamp = $timestamp\n\nuname -m = `(uname -m) 2>/dev/null || echo unknown`\nuname -r = `(uname -r) 2>/dev/null || echo unknown`\nuname -s = `(uname -s) 2>/dev/null || echo unknown`\nuname -v = `(uname -v) 2>/dev/null || echo unknown`\n\n/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`\n/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`\n\nhostinfo               = `(hostinfo) 2>/dev/null`\n/bin/universe          = `(/bin/universe) 2>/dev/null`\n/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`\n/bin/arch              = `(/bin/arch) 2>/dev/null`\n/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`\n/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`\n\nUNAME_MACHINE = ${UNAME_MACHINE}\nUNAME_RELEASE = ${UNAME_RELEASE}\nUNAME_SYSTEM  = ${UNAME_SYSTEM}\nUNAME_VERSION = ${UNAME_VERSION}\nEOF\n\nexit 1\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"timestamp='\"\n# time-stamp-format: \"%:y-%02m-%02d\"\n# time-stamp-end: \"'\"\n# End:\n"
  },
  {
    "path": "config.sub",
    "content": "#! /bin/sh\n# Configuration validation subroutine script.\n#   Copyright 1992-2016 Free Software Foundation, Inc.\n\ntimestamp='2016-11-04'\n\n# This file is free software; you can redistribute it and/or modify it\n# under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, see <http://www.gnu.org/licenses/>.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that\n# program.  This Exception is an additional permission under section 7\n# of the GNU General Public License, version 3 (\"GPLv3\").\n\n\n# Please send patches to <config-patches@gnu.org>.\n#\n# Configuration subroutine to validate and canonicalize a configuration type.\n# Supply the specified configuration type as an argument.\n# If it is invalid, we print an error message on stderr and exit with code 1.\n# Otherwise, we print the canonical config type on stdout and succeed.\n\n# You can get the latest version of this script from:\n# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub\n\n# This file is supposed to be the same for all GNU packages\n# and recognize all the CPU types, system types and aliases\n# that are meaningful with *any* GNU software.\n# Each package is responsible for reporting which valid configurations\n# it does not support.  The user should be able to distinguish\n# a failure to support a valid configuration from a meaningless\n# configuration.\n\n# The goal of this file is to map all the various variations of a given\n# machine specification into a single specification in the form:\n#\tCPU_TYPE-MANUFACTURER-OPERATING_SYSTEM\n# or in some cases, the newer four-part form:\n#\tCPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM\n# It is wrong to echo any other type of specification.\n\nme=`echo \"$0\" | sed -e 's,.*/,,'`\n\nusage=\"\\\nUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS\n\nCanonicalize a configuration name.\n\nOperation modes:\n  -h, --help         print this help, then exit\n  -t, --time-stamp   print date of last modification, then exit\n  -v, --version      print version number, then exit\n\nReport bugs and patches to <config-patches@gnu.org>.\"\n\nversion=\"\\\nGNU config.sub ($timestamp)\n\nCopyright 1992-2016 Free Software Foundation, Inc.\n\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n\nhelp=\"\nTry \\`$me --help' for more information.\"\n\n# Parse command line\nwhile test $# -gt 0 ; do\n  case $1 in\n    --time-stamp | --time* | -t )\n       echo \"$timestamp\" ; exit ;;\n    --version | -v )\n       echo \"$version\" ; exit ;;\n    --help | --h* | -h )\n       echo \"$usage\"; exit ;;\n    -- )     # Stop option processing\n       shift; break ;;\n    - )\t# Use stdin as input.\n       break ;;\n    -* )\n       echo \"$me: invalid option $1$help\"\n       exit 1 ;;\n\n    *local*)\n       # First pass through any local machine types.\n       echo $1\n       exit ;;\n\n    * )\n       break ;;\n  esac\ndone\n\ncase $# in\n 0) echo \"$me: missing argument$help\" >&2\n    exit 1;;\n 1) ;;\n *) echo \"$me: too many arguments$help\" >&2\n    exit 1;;\nesac\n\n# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).\n# Here we must recognize all the valid KERNEL-OS combinations.\nmaybe_os=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\2/'`\ncase $maybe_os in\n  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \\\n  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \\\n  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \\\n  kopensolaris*-gnu* | cloudabi*-eabi* | \\\n  storm-chaos* | os2-emx* | rtmk-nova*)\n    os=-$maybe_os\n    basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`\n    ;;\n  android-linux)\n    os=-linux-android\n    basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`-unknown\n    ;;\n  *)\n    basic_machine=`echo $1 | sed 's/-[^-]*$//'`\n    if [ $basic_machine != $1 ]\n    then os=`echo $1 | sed 's/.*-/-/'`\n    else os=; fi\n    ;;\nesac\n\n### Let's recognize common machines as not being operating systems so\n### that things like config.sub decstation-3100 work.  We also\n### recognize some manufacturers as not being operating systems, so we\n### can provide default operating systems below.\ncase $os in\n\t-sun*os*)\n\t\t# Prevent following clause from handling this invalid input.\n\t\t;;\n\t-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \\\n\t-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \\\n\t-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \\\n\t-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\\\n\t-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \\\n\t-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \\\n\t-apple | -axis | -knuth | -cray | -microblaze*)\n\t\tos=\n\t\tbasic_machine=$1\n\t\t;;\n\t-bluegene*)\n\t\tos=-cnk\n\t\t;;\n\t-sim | -cisco | -oki | -wec | -winbond)\n\t\tos=\n\t\tbasic_machine=$1\n\t\t;;\n\t-scout)\n\t\t;;\n\t-wrs)\n\t\tos=-vxworks\n\t\tbasic_machine=$1\n\t\t;;\n\t-chorusos*)\n\t\tos=-chorusos\n\t\tbasic_machine=$1\n\t\t;;\n\t-chorusrdb)\n\t\tos=-chorusrdb\n\t\tbasic_machine=$1\n\t\t;;\n\t-hiux*)\n\t\tos=-hiuxwe2\n\t\t;;\n\t-sco6)\n\t\tos=-sco5v6\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco5)\n\t\tos=-sco3.2v5\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco4)\n\t\tos=-sco3.2v4\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco3.2.[4-9]*)\n\t\tos=`echo $os | sed -e 's/sco3.2./sco3.2v/'`\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco3.2v[4-9]*)\n\t\t# Don't forget version if it is 3.2v4 or newer.\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco5v6*)\n\t\t# Don't forget version if it is 3.2v4 or newer.\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco*)\n\t\tos=-sco3.2v2\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-udk*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-isc)\n\t\tos=-isc2.2\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-clix*)\n\t\tbasic_machine=clipper-intergraph\n\t\t;;\n\t-isc*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-lynx*178)\n\t\tos=-lynxos178\n\t\t;;\n\t-lynx*5)\n\t\tos=-lynxos5\n\t\t;;\n\t-lynx*)\n\t\tos=-lynxos\n\t\t;;\n\t-ptx*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`\n\t\t;;\n\t-windowsnt*)\n\t\tos=`echo $os | sed -e 's/windowsnt/winnt/'`\n\t\t;;\n\t-psos*)\n\t\tos=-psos\n\t\t;;\n\t-mint | -mint[0-9]*)\n\t\tbasic_machine=m68k-atari\n\t\tos=-mint\n\t\t;;\nesac\n\n# Decode aliases for certain CPU-COMPANY combinations.\ncase $basic_machine in\n\t# Recognize the basic CPU types without company name.\n\t# Some are omitted here because they have special meanings below.\n\t1750a | 580 \\\n\t| a29k \\\n\t| aarch64 | aarch64_be \\\n\t| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \\\n\t| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \\\n\t| am33_2.0 \\\n\t| arc | arceb \\\n\t| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \\\n\t| avr | avr32 \\\n\t| ba \\\n\t| be32 | be64 \\\n\t| bfin \\\n\t| c4x | c8051 | clipper \\\n\t| d10v | d30v | dlx | dsp16xx \\\n\t| e2k | epiphany \\\n\t| fido | fr30 | frv | ft32 \\\n\t| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \\\n\t| hexagon \\\n\t| i370 | i860 | i960 | ia64 \\\n\t| ip2k | iq2000 \\\n\t| k1om \\\n\t| le32 | le64 \\\n\t| lm32 \\\n\t| m32c | m32r | m32rle | m68000 | m68k | m88k \\\n\t| maxq | mb | microblaze | microblazeel | mcore | mep | metag \\\n\t| mips | mipsbe | mipseb | mipsel | mipsle \\\n\t| mips16 \\\n\t| mips64 | mips64el \\\n\t| mips64octeon | mips64octeonel \\\n\t| mips64orion | mips64orionel \\\n\t| mips64r5900 | mips64r5900el \\\n\t| mips64vr | mips64vrel \\\n\t| mips64vr4100 | mips64vr4100el \\\n\t| mips64vr4300 | mips64vr4300el \\\n\t| mips64vr5000 | mips64vr5000el \\\n\t| mips64vr5900 | mips64vr5900el \\\n\t| mipsisa32 | mipsisa32el \\\n\t| mipsisa32r2 | mipsisa32r2el \\\n\t| mipsisa32r6 | mipsisa32r6el \\\n\t| mipsisa64 | mipsisa64el \\\n\t| mipsisa64r2 | mipsisa64r2el \\\n\t| mipsisa64r6 | mipsisa64r6el \\\n\t| mipsisa64sb1 | mipsisa64sb1el \\\n\t| mipsisa64sr71k | mipsisa64sr71kel \\\n\t| mipsr5900 | mipsr5900el \\\n\t| mipstx39 | mipstx39el \\\n\t| mn10200 | mn10300 \\\n\t| moxie \\\n\t| mt \\\n\t| msp430 \\\n\t| nds32 | nds32le | nds32be \\\n\t| nios | nios2 | nios2eb | nios2el \\\n\t| ns16k | ns32k \\\n\t| open8 | or1k | or1knd | or32 \\\n\t| pdp10 | pdp11 | pj | pjl \\\n\t| powerpc | powerpc64 | powerpc64le | powerpcle \\\n\t| pru \\\n\t| pyramid \\\n\t| riscv32 | riscv64 \\\n\t| rl78 | rx \\\n\t| score \\\n\t| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \\\n\t| sh64 | sh64le \\\n\t| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \\\n\t| sparcv8 | sparcv9 | sparcv9b | sparcv9v \\\n\t| spu \\\n\t| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \\\n\t| ubicom32 \\\n\t| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \\\n\t| visium \\\n\t| we32k \\\n\t| x86 | xc16x | xstormy16 | xtensa \\\n\t| z8k | z80)\n\t\tbasic_machine=$basic_machine-unknown\n\t\t;;\n\tc54x)\n\t\tbasic_machine=tic54x-unknown\n\t\t;;\n\tc55x)\n\t\tbasic_machine=tic55x-unknown\n\t\t;;\n\tc6x)\n\t\tbasic_machine=tic6x-unknown\n\t\t;;\n\tleon|leon[3-9])\n\t\tbasic_machine=sparc-$basic_machine\n\t\t;;\n\tm6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-none\n\t\t;;\n\tm88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)\n\t\t;;\n\tms1)\n\t\tbasic_machine=mt-unknown\n\t\t;;\n\n\tstrongarm | thumb | xscale)\n\t\tbasic_machine=arm-unknown\n\t\t;;\n\txgate)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-none\n\t\t;;\n\txscaleeb)\n\t\tbasic_machine=armeb-unknown\n\t\t;;\n\n\txscaleel)\n\t\tbasic_machine=armel-unknown\n\t\t;;\n\n\t# We use `pc' rather than `unknown'\n\t# because (1) that's what they normally are, and\n\t# (2) the word \"unknown\" tends to confuse beginning users.\n\ti*86 | x86_64)\n\t  basic_machine=$basic_machine-pc\n\t  ;;\n\t# Object if more than one company name word.\n\t*-*-*)\n\t\techo Invalid configuration \\`$1\\': machine \\`$basic_machine\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\n\t# Recognize the basic CPU types with company name.\n\t580-* \\\n\t| a29k-* \\\n\t| aarch64-* | aarch64_be-* \\\n\t| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \\\n\t| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \\\n\t| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \\\n\t| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \\\n\t| avr-* | avr32-* \\\n\t| ba-* \\\n\t| be32-* | be64-* \\\n\t| bfin-* | bs2000-* \\\n\t| c[123]* | c30-* | [cjt]90-* | c4x-* \\\n\t| c8051-* | clipper-* | craynv-* | cydra-* \\\n\t| d10v-* | d30v-* | dlx-* \\\n\t| e2k-* | elxsi-* \\\n\t| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \\\n\t| h8300-* | h8500-* \\\n\t| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \\\n\t| hexagon-* \\\n\t| i*86-* | i860-* | i960-* | ia64-* \\\n\t| ip2k-* | iq2000-* \\\n\t| k1om-* \\\n\t| le32-* | le64-* \\\n\t| lm32-* \\\n\t| m32c-* | m32r-* | m32rle-* \\\n\t| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \\\n\t| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \\\n\t| microblaze-* | microblazeel-* \\\n\t| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \\\n\t| mips16-* \\\n\t| mips64-* | mips64el-* \\\n\t| mips64octeon-* | mips64octeonel-* \\\n\t| mips64orion-* | mips64orionel-* \\\n\t| mips64r5900-* | mips64r5900el-* \\\n\t| mips64vr-* | mips64vrel-* \\\n\t| mips64vr4100-* | mips64vr4100el-* \\\n\t| mips64vr4300-* | mips64vr4300el-* \\\n\t| mips64vr5000-* | mips64vr5000el-* \\\n\t| mips64vr5900-* | mips64vr5900el-* \\\n\t| mipsisa32-* | mipsisa32el-* \\\n\t| mipsisa32r2-* | mipsisa32r2el-* \\\n\t| mipsisa32r6-* | mipsisa32r6el-* \\\n\t| mipsisa64-* | mipsisa64el-* \\\n\t| mipsisa64r2-* | mipsisa64r2el-* \\\n\t| mipsisa64r6-* | mipsisa64r6el-* \\\n\t| mipsisa64sb1-* | mipsisa64sb1el-* \\\n\t| mipsisa64sr71k-* | mipsisa64sr71kel-* \\\n\t| mipsr5900-* | mipsr5900el-* \\\n\t| mipstx39-* | mipstx39el-* \\\n\t| mmix-* \\\n\t| mt-* \\\n\t| msp430-* \\\n\t| nds32-* | nds32le-* | nds32be-* \\\n\t| nios-* | nios2-* | nios2eb-* | nios2el-* \\\n\t| none-* | np1-* | ns16k-* | ns32k-* \\\n\t| open8-* \\\n\t| or1k*-* \\\n\t| orion-* \\\n\t| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \\\n\t| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \\\n\t| pru-* \\\n\t| pyramid-* \\\n\t| riscv32-* | riscv64-* \\\n\t| rl78-* | romp-* | rs6000-* | rx-* \\\n\t| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \\\n\t| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \\\n\t| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \\\n\t| sparclite-* \\\n\t| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \\\n\t| tahoe-* \\\n\t| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \\\n\t| tile*-* \\\n\t| tron-* \\\n\t| ubicom32-* \\\n\t| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \\\n\t| vax-* \\\n\t| visium-* \\\n\t| we32k-* \\\n\t| x86-* | x86_64-* | xc16x-* | xps100-* \\\n\t| xstormy16-* | xtensa*-* \\\n\t| ymp-* \\\n\t| z8k-* | z80-*)\n\t\t;;\n\t# Recognize the basic CPU types without company name, with glob match.\n\txtensa*)\n\t\tbasic_machine=$basic_machine-unknown\n\t\t;;\n\t# Recognize the various machine names and aliases which stand\n\t# for a CPU type and a company and sometimes even an OS.\n\t386bsd)\n\t\tbasic_machine=i386-unknown\n\t\tos=-bsd\n\t\t;;\n\t3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)\n\t\tbasic_machine=m68000-att\n\t\t;;\n\t3b*)\n\t\tbasic_machine=we32k-att\n\t\t;;\n\ta29khif)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tabacus)\n\t\tbasic_machine=abacus-unknown\n\t\t;;\n\tadobe68k)\n\t\tbasic_machine=m68010-adobe\n\t\tos=-scout\n\t\t;;\n\talliant | fx80)\n\t\tbasic_machine=fx80-alliant\n\t\t;;\n\taltos | altos3068)\n\t\tbasic_machine=m68k-altos\n\t\t;;\n\tam29k)\n\t\tbasic_machine=a29k-none\n\t\tos=-bsd\n\t\t;;\n\tamd64)\n\t\tbasic_machine=x86_64-pc\n\t\t;;\n\tamd64-*)\n\t\tbasic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tamdahl)\n\t\tbasic_machine=580-amdahl\n\t\tos=-sysv\n\t\t;;\n\tamiga | amiga-*)\n\t\tbasic_machine=m68k-unknown\n\t\t;;\n\tamigaos | amigados)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-amigaos\n\t\t;;\n\tamigaunix | amix)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-sysv4\n\t\t;;\n\tapollo68)\n\t\tbasic_machine=m68k-apollo\n\t\tos=-sysv\n\t\t;;\n\tapollo68bsd)\n\t\tbasic_machine=m68k-apollo\n\t\tos=-bsd\n\t\t;;\n\taros)\n\t\tbasic_machine=i386-pc\n\t\tos=-aros\n\t\t;;\n\tasmjs)\n\t\tbasic_machine=asmjs-unknown\n\t\t;;\n\taux)\n\t\tbasic_machine=m68k-apple\n\t\tos=-aux\n\t\t;;\n\tbalance)\n\t\tbasic_machine=ns32k-sequent\n\t\tos=-dynix\n\t\t;;\n\tblackfin)\n\t\tbasic_machine=bfin-unknown\n\t\tos=-linux\n\t\t;;\n\tblackfin-*)\n\t\tbasic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tbluegene*)\n\t\tbasic_machine=powerpc-ibm\n\t\tos=-cnk\n\t\t;;\n\tc54x-*)\n\t\tbasic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc55x-*)\n\t\tbasic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc6x-*)\n\t\tbasic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc90)\n\t\tbasic_machine=c90-cray\n\t\tos=-unicos\n\t\t;;\n\tcegcc)\n\t\tbasic_machine=arm-unknown\n\t\tos=-cegcc\n\t\t;;\n\tconvex-c1)\n\t\tbasic_machine=c1-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c2)\n\t\tbasic_machine=c2-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c32)\n\t\tbasic_machine=c32-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c34)\n\t\tbasic_machine=c34-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c38)\n\t\tbasic_machine=c38-convex\n\t\tos=-bsd\n\t\t;;\n\tcray | j90)\n\t\tbasic_machine=j90-cray\n\t\tos=-unicos\n\t\t;;\n\tcraynv)\n\t\tbasic_machine=craynv-cray\n\t\tos=-unicosmp\n\t\t;;\n\tcr16 | cr16-*)\n\t\tbasic_machine=cr16-unknown\n\t\tos=-elf\n\t\t;;\n\tcrds | unos)\n\t\tbasic_machine=m68k-crds\n\t\t;;\n\tcrisv32 | crisv32-* | etraxfs*)\n\t\tbasic_machine=crisv32-axis\n\t\t;;\n\tcris | cris-* | etrax*)\n\t\tbasic_machine=cris-axis\n\t\t;;\n\tcrx)\n\t\tbasic_machine=crx-unknown\n\t\tos=-elf\n\t\t;;\n\tda30 | da30-*)\n\t\tbasic_machine=m68k-da30\n\t\t;;\n\tdecstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)\n\t\tbasic_machine=mips-dec\n\t\t;;\n\tdecsystem10* | dec10*)\n\t\tbasic_machine=pdp10-dec\n\t\tos=-tops10\n\t\t;;\n\tdecsystem20* | dec20*)\n\t\tbasic_machine=pdp10-dec\n\t\tos=-tops20\n\t\t;;\n\tdelta | 3300 | motorola-3300 | motorola-delta \\\n\t      | 3300-motorola | delta-motorola)\n\t\tbasic_machine=m68k-motorola\n\t\t;;\n\tdelta88)\n\t\tbasic_machine=m88k-motorola\n\t\tos=-sysv3\n\t\t;;\n\tdicos)\n\t\tbasic_machine=i686-pc\n\t\tos=-dicos\n\t\t;;\n\tdjgpp)\n\t\tbasic_machine=i586-pc\n\t\tos=-msdosdjgpp\n\t\t;;\n\tdpx20 | dpx20-*)\n\t\tbasic_machine=rs6000-bull\n\t\tos=-bosx\n\t\t;;\n\tdpx2* | dpx2*-bull)\n\t\tbasic_machine=m68k-bull\n\t\tos=-sysv3\n\t\t;;\n\te500v[12])\n\t\tbasic_machine=powerpc-unknown\n\t\tos=$os\"spe\"\n\t\t;;\n\te500v[12]-*)\n\t\tbasic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=$os\"spe\"\n\t\t;;\n\tebmon29k)\n\t\tbasic_machine=a29k-amd\n\t\tos=-ebmon\n\t\t;;\n\telxsi)\n\t\tbasic_machine=elxsi-elxsi\n\t\tos=-bsd\n\t\t;;\n\tencore | umax | mmax)\n\t\tbasic_machine=ns32k-encore\n\t\t;;\n\tes1800 | OSE68k | ose68k | ose | OSE)\n\t\tbasic_machine=m68k-ericsson\n\t\tos=-ose\n\t\t;;\n\tfx2800)\n\t\tbasic_machine=i860-alliant\n\t\t;;\n\tgenix)\n\t\tbasic_machine=ns32k-ns\n\t\t;;\n\tgmicro)\n\t\tbasic_machine=tron-gmicro\n\t\tos=-sysv\n\t\t;;\n\tgo32)\n\t\tbasic_machine=i386-pc\n\t\tos=-go32\n\t\t;;\n\th3050r* | hiux*)\n\t\tbasic_machine=hppa1.1-hitachi\n\t\tos=-hiuxwe2\n\t\t;;\n\th8300hms)\n\t\tbasic_machine=h8300-hitachi\n\t\tos=-hms\n\t\t;;\n\th8300xray)\n\t\tbasic_machine=h8300-hitachi\n\t\tos=-xray\n\t\t;;\n\th8500hms)\n\t\tbasic_machine=h8500-hitachi\n\t\tos=-hms\n\t\t;;\n\tharris)\n\t\tbasic_machine=m88k-harris\n\t\tos=-sysv3\n\t\t;;\n\thp300-*)\n\t\tbasic_machine=m68k-hp\n\t\t;;\n\thp300bsd)\n\t\tbasic_machine=m68k-hp\n\t\tos=-bsd\n\t\t;;\n\thp300hpux)\n\t\tbasic_machine=m68k-hp\n\t\tos=-hpux\n\t\t;;\n\thp3k9[0-9][0-9] | hp9[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thp9k2[0-9][0-9] | hp9k31[0-9])\n\t\tbasic_machine=m68000-hp\n\t\t;;\n\thp9k3[2-9][0-9])\n\t\tbasic_machine=m68k-hp\n\t\t;;\n\thp9k6[0-9][0-9] | hp6[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thp9k7[0-79][0-9] | hp7[0-79][0-9])\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k78[0-9] | hp78[0-9])\n\t\t# FIXME: really hppa2.0-hp\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)\n\t\t# FIXME: really hppa2.0-hp\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[0-9][13679] | hp8[0-9][13679])\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[0-9][0-9] | hp8[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thppa-next)\n\t\tos=-nextstep3\n\t\t;;\n\thppaosf)\n\t\tbasic_machine=hppa1.1-hp\n\t\tos=-osf\n\t\t;;\n\thppro)\n\t\tbasic_machine=hppa1.1-hp\n\t\tos=-proelf\n\t\t;;\n\ti370-ibm* | ibm*)\n\t\tbasic_machine=i370-ibm\n\t\t;;\n\ti*86v32)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv32\n\t\t;;\n\ti*86v4*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv4\n\t\t;;\n\ti*86v)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv\n\t\t;;\n\ti*86sol2)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-solaris2\n\t\t;;\n\ti386mach)\n\t\tbasic_machine=i386-mach\n\t\tos=-mach\n\t\t;;\n\ti386-vsta | vsta)\n\t\tbasic_machine=i386-unknown\n\t\tos=-vsta\n\t\t;;\n\tiris | iris4d)\n\t\tbasic_machine=mips-sgi\n\t\tcase $os in\n\t\t    -irix*)\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-irix4\n\t\t\t;;\n\t\tesac\n\t\t;;\n\tisi68 | isi)\n\t\tbasic_machine=m68k-isi\n\t\tos=-sysv\n\t\t;;\n\tleon-*|leon[3-9]-*)\n\t\tbasic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`\n\t\t;;\n\tm68knommu)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-linux\n\t\t;;\n\tm68knommu-*)\n\t\tbasic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tm88k-omron*)\n\t\tbasic_machine=m88k-omron\n\t\t;;\n\tmagnum | m3230)\n\t\tbasic_machine=mips-mips\n\t\tos=-sysv\n\t\t;;\n\tmerlin)\n\t\tbasic_machine=ns32k-utek\n\t\tos=-sysv\n\t\t;;\n\tmicroblaze*)\n\t\tbasic_machine=microblaze-xilinx\n\t\t;;\n\tmingw64)\n\t\tbasic_machine=x86_64-pc\n\t\tos=-mingw64\n\t\t;;\n\tmingw32)\n\t\tbasic_machine=i686-pc\n\t\tos=-mingw32\n\t\t;;\n\tmingw32ce)\n\t\tbasic_machine=arm-unknown\n\t\tos=-mingw32ce\n\t\t;;\n\tminiframe)\n\t\tbasic_machine=m68000-convergent\n\t\t;;\n\t*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)\n\t\tbasic_machine=m68k-atari\n\t\tos=-mint\n\t\t;;\n\tmips3*-*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`\n\t\t;;\n\tmips3*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown\n\t\t;;\n\tmonitor)\n\t\tbasic_machine=m68k-rom68k\n\t\tos=-coff\n\t\t;;\n\tmorphos)\n\t\tbasic_machine=powerpc-unknown\n\t\tos=-morphos\n\t\t;;\n\tmoxiebox)\n\t\tbasic_machine=moxie-unknown\n\t\tos=-moxiebox\n\t\t;;\n\tmsdos)\n\t\tbasic_machine=i386-pc\n\t\tos=-msdos\n\t\t;;\n\tms1-*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`\n\t\t;;\n\tmsys)\n\t\tbasic_machine=i686-pc\n\t\tos=-msys\n\t\t;;\n\tmvs)\n\t\tbasic_machine=i370-ibm\n\t\tos=-mvs\n\t\t;;\n\tnacl)\n\t\tbasic_machine=le32-unknown\n\t\tos=-nacl\n\t\t;;\n\tncr3000)\n\t\tbasic_machine=i486-ncr\n\t\tos=-sysv4\n\t\t;;\n\tnetbsd386)\n\t\tbasic_machine=i386-unknown\n\t\tos=-netbsd\n\t\t;;\n\tnetwinder)\n\t\tbasic_machine=armv4l-rebel\n\t\tos=-linux\n\t\t;;\n\tnews | news700 | news800 | news900)\n\t\tbasic_machine=m68k-sony\n\t\tos=-newsos\n\t\t;;\n\tnews1000)\n\t\tbasic_machine=m68030-sony\n\t\tos=-newsos\n\t\t;;\n\tnews-3600 | risc-news)\n\t\tbasic_machine=mips-sony\n\t\tos=-newsos\n\t\t;;\n\tnecv70)\n\t\tbasic_machine=v70-nec\n\t\tos=-sysv\n\t\t;;\n\tnext | m*-next )\n\t\tbasic_machine=m68k-next\n\t\tcase $os in\n\t\t    -nextstep* )\n\t\t\t;;\n\t\t    -ns2*)\n\t\t      os=-nextstep2\n\t\t\t;;\n\t\t    *)\n\t\t      os=-nextstep3\n\t\t\t;;\n\t\tesac\n\t\t;;\n\tnh3000)\n\t\tbasic_machine=m68k-harris\n\t\tos=-cxux\n\t\t;;\n\tnh[45]000)\n\t\tbasic_machine=m88k-harris\n\t\tos=-cxux\n\t\t;;\n\tnindy960)\n\t\tbasic_machine=i960-intel\n\t\tos=-nindy\n\t\t;;\n\tmon960)\n\t\tbasic_machine=i960-intel\n\t\tos=-mon960\n\t\t;;\n\tnonstopux)\n\t\tbasic_machine=mips-compaq\n\t\tos=-nonstopux\n\t\t;;\n\tnp1)\n\t\tbasic_machine=np1-gould\n\t\t;;\n\tneo-tandem)\n\t\tbasic_machine=neo-tandem\n\t\t;;\n\tnse-tandem)\n\t\tbasic_machine=nse-tandem\n\t\t;;\n\tnsr-tandem)\n\t\tbasic_machine=nsr-tandem\n\t\t;;\n\top50n-* | op60c-*)\n\t\tbasic_machine=hppa1.1-oki\n\t\tos=-proelf\n\t\t;;\n\topenrisc | openrisc-*)\n\t\tbasic_machine=or32-unknown\n\t\t;;\n\tos400)\n\t\tbasic_machine=powerpc-ibm\n\t\tos=-os400\n\t\t;;\n\tOSE68000 | ose68000)\n\t\tbasic_machine=m68000-ericsson\n\t\tos=-ose\n\t\t;;\n\tos68k)\n\t\tbasic_machine=m68k-none\n\t\tos=-os68k\n\t\t;;\n\tpa-hitachi)\n\t\tbasic_machine=hppa1.1-hitachi\n\t\tos=-hiuxwe2\n\t\t;;\n\tparagon)\n\t\tbasic_machine=i860-intel\n\t\tos=-osf\n\t\t;;\n\tparisc)\n\t\tbasic_machine=hppa-unknown\n\t\tos=-linux\n\t\t;;\n\tparisc-*)\n\t\tbasic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tpbd)\n\t\tbasic_machine=sparc-tti\n\t\t;;\n\tpbb)\n\t\tbasic_machine=m68k-tti\n\t\t;;\n\tpc532 | pc532-*)\n\t\tbasic_machine=ns32k-pc532\n\t\t;;\n\tpc98)\n\t\tbasic_machine=i386-pc\n\t\t;;\n\tpc98-*)\n\t\tbasic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentium | p5 | k5 | k6 | nexgen | viac3)\n\t\tbasic_machine=i586-pc\n\t\t;;\n\tpentiumpro | p6 | 6x86 | athlon | athlon_*)\n\t\tbasic_machine=i686-pc\n\t\t;;\n\tpentiumii | pentium2 | pentiumiii | pentium3)\n\t\tbasic_machine=i686-pc\n\t\t;;\n\tpentium4)\n\t\tbasic_machine=i786-pc\n\t\t;;\n\tpentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)\n\t\tbasic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentiumpro-* | p6-* | 6x86-* | athlon-*)\n\t\tbasic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)\n\t\tbasic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentium4-*)\n\t\tbasic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpn)\n\t\tbasic_machine=pn-gould\n\t\t;;\n\tpower)\tbasic_machine=power-ibm\n\t\t;;\n\tppc | ppcbe)\tbasic_machine=powerpc-unknown\n\t\t;;\n\tppc-* | ppcbe-*)\n\t\tbasic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppcle | powerpclittle)\n\t\tbasic_machine=powerpcle-unknown\n\t\t;;\n\tppcle-* | powerpclittle-*)\n\t\tbasic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppc64)\tbasic_machine=powerpc64-unknown\n\t\t;;\n\tppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppc64le | powerpc64little)\n\t\tbasic_machine=powerpc64le-unknown\n\t\t;;\n\tppc64le-* | powerpc64little-*)\n\t\tbasic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tps2)\n\t\tbasic_machine=i386-ibm\n\t\t;;\n\tpw32)\n\t\tbasic_machine=i586-unknown\n\t\tos=-pw32\n\t\t;;\n\trdos | rdos64)\n\t\tbasic_machine=x86_64-pc\n\t\tos=-rdos\n\t\t;;\n\trdos32)\n\t\tbasic_machine=i386-pc\n\t\tos=-rdos\n\t\t;;\n\trom68k)\n\t\tbasic_machine=m68k-rom68k\n\t\tos=-coff\n\t\t;;\n\trm[46]00)\n\t\tbasic_machine=mips-siemens\n\t\t;;\n\trtpc | rtpc-*)\n\t\tbasic_machine=romp-ibm\n\t\t;;\n\ts390 | s390-*)\n\t\tbasic_machine=s390-ibm\n\t\t;;\n\ts390x | s390x-*)\n\t\tbasic_machine=s390x-ibm\n\t\t;;\n\tsa29200)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tsb1)\n\t\tbasic_machine=mipsisa64sb1-unknown\n\t\t;;\n\tsb1el)\n\t\tbasic_machine=mipsisa64sb1el-unknown\n\t\t;;\n\tsde)\n\t\tbasic_machine=mipsisa32-sde\n\t\tos=-elf\n\t\t;;\n\tsei)\n\t\tbasic_machine=mips-sei\n\t\tos=-seiux\n\t\t;;\n\tsequent)\n\t\tbasic_machine=i386-sequent\n\t\t;;\n\tsh)\n\t\tbasic_machine=sh-hitachi\n\t\tos=-hms\n\t\t;;\n\tsh5el)\n\t\tbasic_machine=sh5le-unknown\n\t\t;;\n\tsh64)\n\t\tbasic_machine=sh64-unknown\n\t\t;;\n\tsparclite-wrs | simso-wrs)\n\t\tbasic_machine=sparclite-wrs\n\t\tos=-vxworks\n\t\t;;\n\tsps7)\n\t\tbasic_machine=m68k-bull\n\t\tos=-sysv2\n\t\t;;\n\tspur)\n\t\tbasic_machine=spur-unknown\n\t\t;;\n\tst2000)\n\t\tbasic_machine=m68k-tandem\n\t\t;;\n\tstratus)\n\t\tbasic_machine=i860-stratus\n\t\tos=-sysv4\n\t\t;;\n\tstrongarm-* | thumb-*)\n\t\tbasic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tsun2)\n\t\tbasic_machine=m68000-sun\n\t\t;;\n\tsun2os3)\n\t\tbasic_machine=m68000-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun2os4)\n\t\tbasic_machine=m68000-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun3os3)\n\t\tbasic_machine=m68k-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun3os4)\n\t\tbasic_machine=m68k-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun4os3)\n\t\tbasic_machine=sparc-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun4os4)\n\t\tbasic_machine=sparc-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun4sol2)\n\t\tbasic_machine=sparc-sun\n\t\tos=-solaris2\n\t\t;;\n\tsun3 | sun3-*)\n\t\tbasic_machine=m68k-sun\n\t\t;;\n\tsun4)\n\t\tbasic_machine=sparc-sun\n\t\t;;\n\tsun386 | sun386i | roadrunner)\n\t\tbasic_machine=i386-sun\n\t\t;;\n\tsv1)\n\t\tbasic_machine=sv1-cray\n\t\tos=-unicos\n\t\t;;\n\tsymmetry)\n\t\tbasic_machine=i386-sequent\n\t\tos=-dynix\n\t\t;;\n\tt3e)\n\t\tbasic_machine=alphaev5-cray\n\t\tos=-unicos\n\t\t;;\n\tt90)\n\t\tbasic_machine=t90-cray\n\t\tos=-unicos\n\t\t;;\n\ttile*)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-linux-gnu\n\t\t;;\n\ttx39)\n\t\tbasic_machine=mipstx39-unknown\n\t\t;;\n\ttx39el)\n\t\tbasic_machine=mipstx39el-unknown\n\t\t;;\n\ttoad1)\n\t\tbasic_machine=pdp10-xkl\n\t\tos=-tops20\n\t\t;;\n\ttower | tower-32)\n\t\tbasic_machine=m68k-ncr\n\t\t;;\n\ttpf)\n\t\tbasic_machine=s390x-ibm\n\t\tos=-tpf\n\t\t;;\n\tudi29k)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tultra3)\n\t\tbasic_machine=a29k-nyu\n\t\tos=-sym1\n\t\t;;\n\tv810 | necv810)\n\t\tbasic_machine=v810-nec\n\t\tos=-none\n\t\t;;\n\tvaxv)\n\t\tbasic_machine=vax-dec\n\t\tos=-sysv\n\t\t;;\n\tvms)\n\t\tbasic_machine=vax-dec\n\t\tos=-vms\n\t\t;;\n\tvpp*|vx|vx-*)\n\t\tbasic_machine=f301-fujitsu\n\t\t;;\n\tvxworks960)\n\t\tbasic_machine=i960-wrs\n\t\tos=-vxworks\n\t\t;;\n\tvxworks68)\n\t\tbasic_machine=m68k-wrs\n\t\tos=-vxworks\n\t\t;;\n\tvxworks29k)\n\t\tbasic_machine=a29k-wrs\n\t\tos=-vxworks\n\t\t;;\n\tw65*)\n\t\tbasic_machine=w65-wdc\n\t\tos=-none\n\t\t;;\n\tw89k-*)\n\t\tbasic_machine=hppa1.1-winbond\n\t\tos=-proelf\n\t\t;;\n\txbox)\n\t\tbasic_machine=i686-pc\n\t\tos=-mingw32\n\t\t;;\n\txps | xps100)\n\t\tbasic_machine=xps100-honeywell\n\t\t;;\n\txscale-* | xscalee[bl]-*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`\n\t\t;;\n\tymp)\n\t\tbasic_machine=ymp-cray\n\t\tos=-unicos\n\t\t;;\n\tz8k-*-coff)\n\t\tbasic_machine=z8k-unknown\n\t\tos=-sim\n\t\t;;\n\tz80-*-coff)\n\t\tbasic_machine=z80-unknown\n\t\tos=-sim\n\t\t;;\n\tnone)\n\t\tbasic_machine=none-none\n\t\tos=-none\n\t\t;;\n\n# Here we handle the default manufacturer of certain CPU types.  It is in\n# some cases the only manufacturer, in others, it is the most popular.\n\tw89k)\n\t\tbasic_machine=hppa1.1-winbond\n\t\t;;\n\top50n)\n\t\tbasic_machine=hppa1.1-oki\n\t\t;;\n\top60c)\n\t\tbasic_machine=hppa1.1-oki\n\t\t;;\n\tromp)\n\t\tbasic_machine=romp-ibm\n\t\t;;\n\tmmix)\n\t\tbasic_machine=mmix-knuth\n\t\t;;\n\trs6000)\n\t\tbasic_machine=rs6000-ibm\n\t\t;;\n\tvax)\n\t\tbasic_machine=vax-dec\n\t\t;;\n\tpdp10)\n\t\t# there are many clones, so DEC is not a safe bet\n\t\tbasic_machine=pdp10-unknown\n\t\t;;\n\tpdp11)\n\t\tbasic_machine=pdp11-dec\n\t\t;;\n\twe32k)\n\t\tbasic_machine=we32k-att\n\t\t;;\n\tsh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)\n\t\tbasic_machine=sh-unknown\n\t\t;;\n\tsparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)\n\t\tbasic_machine=sparc-sun\n\t\t;;\n\tcydra)\n\t\tbasic_machine=cydra-cydrome\n\t\t;;\n\torion)\n\t\tbasic_machine=orion-highlevel\n\t\t;;\n\torion105)\n\t\tbasic_machine=clipper-highlevel\n\t\t;;\n\tmac | mpw | mac-mpw)\n\t\tbasic_machine=m68k-apple\n\t\t;;\n\tpmac | pmac-mpw)\n\t\tbasic_machine=powerpc-apple\n\t\t;;\n\t*-unknown)\n\t\t# Make sure to match an already-canonicalized machine name.\n\t\t;;\n\t*)\n\t\techo Invalid configuration \\`$1\\': machine \\`$basic_machine\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\nesac\n\n# Here we canonicalize certain aliases for manufacturers.\ncase $basic_machine in\n\t*-digital*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`\n\t\t;;\n\t*-commodore*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`\n\t\t;;\n\t*)\n\t\t;;\nesac\n\n# Decode manufacturer-specific aliases for certain operating systems.\n\nif [ x\"$os\" != x\"\" ]\nthen\ncase $os in\n\t# First match some system type aliases\n\t# that might get confused with valid system types.\n\t# -solaris* is a basic system type, with this one exception.\n\t-auroraux)\n\t\tos=-auroraux\n\t\t;;\n\t-solaris1 | -solaris1.*)\n\t\tos=`echo $os | sed -e 's|solaris1|sunos4|'`\n\t\t;;\n\t-solaris)\n\t\tos=-solaris2\n\t\t;;\n\t-svr4*)\n\t\tos=-sysv4\n\t\t;;\n\t-unixware*)\n\t\tos=-sysv4.2uw\n\t\t;;\n\t-gnu/linux*)\n\t\tos=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`\n\t\t;;\n\t# First accept the basic system types.\n\t# The portable systems comes first.\n\t# Each alternative MUST END IN A *, to match a version number.\n\t# -sysv* is not here because it comes later, after sysvr4.\n\t-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \\\n\t      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\\\n\t      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \\\n\t      | -sym* | -kopensolaris* | -plan9* \\\n\t      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \\\n\t      | -aos* | -aros* | -cloudabi* | -sortix* \\\n\t      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \\\n\t      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \\\n\t      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \\\n\t      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \\\n\t      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \\\n\t      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \\\n\t      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \\\n\t      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \\\n\t      | -chorusos* | -chorusrdb* | -cegcc* \\\n\t      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \\\n\t      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \\\n\t      | -linux-newlib* | -linux-musl* | -linux-uclibc* \\\n\t      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \\\n\t      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \\\n\t      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \\\n\t      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \\\n\t      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \\\n\t      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \\\n\t      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \\\n\t      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \\\n\t      | -onefs* | -tirtos* | -phoenix* | -fuchsia*)\n\t# Remember, each alternative MUST END IN *, to match a version number.\n\t\t;;\n\t-qnx*)\n\t\tcase $basic_machine in\n\t\t    x86-* | i*86-*)\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-nto$os\n\t\t\t;;\n\t\tesac\n\t\t;;\n\t-nto-qnx*)\n\t\t;;\n\t-nto*)\n\t\tos=`echo $os | sed -e 's|nto|nto-qnx|'`\n\t\t;;\n\t-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \\\n\t      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \\\n\t      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)\n\t\t;;\n\t-mac*)\n\t\tos=`echo $os | sed -e 's|mac|macos|'`\n\t\t;;\n\t-linux-dietlibc)\n\t\tos=-linux-dietlibc\n\t\t;;\n\t-linux*)\n\t\tos=`echo $os | sed -e 's|linux|linux-gnu|'`\n\t\t;;\n\t-sunos5*)\n\t\tos=`echo $os | sed -e 's|sunos5|solaris2|'`\n\t\t;;\n\t-sunos6*)\n\t\tos=`echo $os | sed -e 's|sunos6|solaris3|'`\n\t\t;;\n\t-opened*)\n\t\tos=-openedition\n\t\t;;\n\t-os400*)\n\t\tos=-os400\n\t\t;;\n\t-wince*)\n\t\tos=-wince\n\t\t;;\n\t-osfrose*)\n\t\tos=-osfrose\n\t\t;;\n\t-osf*)\n\t\tos=-osf\n\t\t;;\n\t-utek*)\n\t\tos=-bsd\n\t\t;;\n\t-dynix*)\n\t\tos=-bsd\n\t\t;;\n\t-acis*)\n\t\tos=-aos\n\t\t;;\n\t-atheos*)\n\t\tos=-atheos\n\t\t;;\n\t-syllable*)\n\t\tos=-syllable\n\t\t;;\n\t-386bsd)\n\t\tos=-bsd\n\t\t;;\n\t-ctix* | -uts*)\n\t\tos=-sysv\n\t\t;;\n\t-nova*)\n\t\tos=-rtmk-nova\n\t\t;;\n\t-ns2 )\n\t\tos=-nextstep2\n\t\t;;\n\t-nsk*)\n\t\tos=-nsk\n\t\t;;\n\t# Preserve the version number of sinix5.\n\t-sinix5.*)\n\t\tos=`echo $os | sed -e 's|sinix|sysv|'`\n\t\t;;\n\t-sinix*)\n\t\tos=-sysv4\n\t\t;;\n\t-tpf*)\n\t\tos=-tpf\n\t\t;;\n\t-triton*)\n\t\tos=-sysv3\n\t\t;;\n\t-oss*)\n\t\tos=-sysv3\n\t\t;;\n\t-svr4)\n\t\tos=-sysv4\n\t\t;;\n\t-svr3)\n\t\tos=-sysv3\n\t\t;;\n\t-sysvr4)\n\t\tos=-sysv4\n\t\t;;\n\t# This must come after -sysvr4.\n\t-sysv*)\n\t\t;;\n\t-ose*)\n\t\tos=-ose\n\t\t;;\n\t-es1800*)\n\t\tos=-ose\n\t\t;;\n\t-xenix)\n\t\tos=-xenix\n\t\t;;\n\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n\t\tos=-mint\n\t\t;;\n\t-aros*)\n\t\tos=-aros\n\t\t;;\n\t-zvmoe)\n\t\tos=-zvmoe\n\t\t;;\n\t-dicos*)\n\t\tos=-dicos\n\t\t;;\n\t-nacl*)\n\t\t;;\n\t-ios)\n\t\t;;\n\t-none)\n\t\t;;\n\t*)\n\t\t# Get rid of the `-' at the beginning of $os.\n\t\tos=`echo $os | sed 's/[^-]*-//'`\n\t\techo Invalid configuration \\`$1\\': system \\`$os\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\nesac\nelse\n\n# Here we handle the default operating systems that come with various machines.\n# The value should be what the vendor currently ships out the door with their\n# machine or put another way, the most popular os provided with the machine.\n\n# Note that if you're going to try to match \"-MANUFACTURER\" here (say,\n# \"-sun\"), then you have to tell the case statement up towards the top\n# that MANUFACTURER isn't an operating system.  Otherwise, code above\n# will signal an error saying that MANUFACTURER isn't an operating\n# system, and we'll never get to this point.\n\ncase $basic_machine in\n\tscore-*)\n\t\tos=-elf\n\t\t;;\n\tspu-*)\n\t\tos=-elf\n\t\t;;\n\t*-acorn)\n\t\tos=-riscix1.2\n\t\t;;\n\tarm*-rebel)\n\t\tos=-linux\n\t\t;;\n\tarm*-semi)\n\t\tos=-aout\n\t\t;;\n\tc4x-* | tic4x-*)\n\t\tos=-coff\n\t\t;;\n\tc8051-*)\n\t\tos=-elf\n\t\t;;\n\thexagon-*)\n\t\tos=-elf\n\t\t;;\n\ttic54x-*)\n\t\tos=-coff\n\t\t;;\n\ttic55x-*)\n\t\tos=-coff\n\t\t;;\n\ttic6x-*)\n\t\tos=-coff\n\t\t;;\n\t# This must come before the *-dec entry.\n\tpdp10-*)\n\t\tos=-tops20\n\t\t;;\n\tpdp11-*)\n\t\tos=-none\n\t\t;;\n\t*-dec | vax-*)\n\t\tos=-ultrix4.2\n\t\t;;\n\tm68*-apollo)\n\t\tos=-domain\n\t\t;;\n\ti386-sun)\n\t\tos=-sunos4.0.2\n\t\t;;\n\tm68000-sun)\n\t\tos=-sunos3\n\t\t;;\n\tm68*-cisco)\n\t\tos=-aout\n\t\t;;\n\tmep-*)\n\t\tos=-elf\n\t\t;;\n\tmips*-cisco)\n\t\tos=-elf\n\t\t;;\n\tmips*-*)\n\t\tos=-elf\n\t\t;;\n\tor32-*)\n\t\tos=-coff\n\t\t;;\n\t*-tti)\t# must be before sparc entry or we get the wrong os.\n\t\tos=-sysv3\n\t\t;;\n\tsparc-* | *-sun)\n\t\tos=-sunos4.1.1\n\t\t;;\n\t*-be)\n\t\tos=-beos\n\t\t;;\n\t*-haiku)\n\t\tos=-haiku\n\t\t;;\n\t*-ibm)\n\t\tos=-aix\n\t\t;;\n\t*-knuth)\n\t\tos=-mmixware\n\t\t;;\n\t*-wec)\n\t\tos=-proelf\n\t\t;;\n\t*-winbond)\n\t\tos=-proelf\n\t\t;;\n\t*-oki)\n\t\tos=-proelf\n\t\t;;\n\t*-hp)\n\t\tos=-hpux\n\t\t;;\n\t*-hitachi)\n\t\tos=-hiux\n\t\t;;\n\ti860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)\n\t\tos=-sysv\n\t\t;;\n\t*-cbm)\n\t\tos=-amigaos\n\t\t;;\n\t*-dg)\n\t\tos=-dgux\n\t\t;;\n\t*-dolphin)\n\t\tos=-sysv3\n\t\t;;\n\tm68k-ccur)\n\t\tos=-rtu\n\t\t;;\n\tm88k-omron*)\n\t\tos=-luna\n\t\t;;\n\t*-next )\n\t\tos=-nextstep\n\t\t;;\n\t*-sequent)\n\t\tos=-ptx\n\t\t;;\n\t*-crds)\n\t\tos=-unos\n\t\t;;\n\t*-ns)\n\t\tos=-genix\n\t\t;;\n\ti370-*)\n\t\tos=-mvs\n\t\t;;\n\t*-next)\n\t\tos=-nextstep3\n\t\t;;\n\t*-gould)\n\t\tos=-sysv\n\t\t;;\n\t*-highlevel)\n\t\tos=-bsd\n\t\t;;\n\t*-encore)\n\t\tos=-bsd\n\t\t;;\n\t*-sgi)\n\t\tos=-irix\n\t\t;;\n\t*-siemens)\n\t\tos=-sysv4\n\t\t;;\n\t*-masscomp)\n\t\tos=-rtu\n\t\t;;\n\tf30[01]-fujitsu | f700-fujitsu)\n\t\tos=-uxpv\n\t\t;;\n\t*-rom68k)\n\t\tos=-coff\n\t\t;;\n\t*-*bug)\n\t\tos=-coff\n\t\t;;\n\t*-apple)\n\t\tos=-macos\n\t\t;;\n\t*-atari*)\n\t\tos=-mint\n\t\t;;\n\t*)\n\t\tos=-none\n\t\t;;\nesac\nfi\n\n# Here we handle the case where we know the os, and the CPU type, but not the\n# manufacturer.  We pick the logical manufacturer.\nvendor=unknown\ncase $basic_machine in\n\t*-unknown)\n\t\tcase $os in\n\t\t\t-riscix*)\n\t\t\t\tvendor=acorn\n\t\t\t\t;;\n\t\t\t-sunos*)\n\t\t\t\tvendor=sun\n\t\t\t\t;;\n\t\t\t-cnk*|-aix*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-beos*)\n\t\t\t\tvendor=be\n\t\t\t\t;;\n\t\t\t-hpux*)\n\t\t\t\tvendor=hp\n\t\t\t\t;;\n\t\t\t-mpeix*)\n\t\t\t\tvendor=hp\n\t\t\t\t;;\n\t\t\t-hiux*)\n\t\t\t\tvendor=hitachi\n\t\t\t\t;;\n\t\t\t-unos*)\n\t\t\t\tvendor=crds\n\t\t\t\t;;\n\t\t\t-dgux*)\n\t\t\t\tvendor=dg\n\t\t\t\t;;\n\t\t\t-luna*)\n\t\t\t\tvendor=omron\n\t\t\t\t;;\n\t\t\t-genix*)\n\t\t\t\tvendor=ns\n\t\t\t\t;;\n\t\t\t-mvs* | -opened*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-os400*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-ptx*)\n\t\t\t\tvendor=sequent\n\t\t\t\t;;\n\t\t\t-tpf*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-vxsim* | -vxworks* | -windiss*)\n\t\t\t\tvendor=wrs\n\t\t\t\t;;\n\t\t\t-aux*)\n\t\t\t\tvendor=apple\n\t\t\t\t;;\n\t\t\t-hms*)\n\t\t\t\tvendor=hitachi\n\t\t\t\t;;\n\t\t\t-mpw* | -macos*)\n\t\t\t\tvendor=apple\n\t\t\t\t;;\n\t\t\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n\t\t\t\tvendor=atari\n\t\t\t\t;;\n\t\t\t-vos*)\n\t\t\t\tvendor=stratus\n\t\t\t\t;;\n\t\tesac\n\t\tbasic_machine=`echo $basic_machine | sed \"s/unknown/$vendor/\"`\n\t\t;;\nesac\n\necho $basic_machine$os\nexit\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"timestamp='\"\n# time-stamp-format: \"%:y-%02m-%02d\"\n# time-stamp-end: \"'\"\n# End:\n"
  },
  {
    "path": "configure",
    "content": "#! /bin/sh\n# Guess values for system-dependent variables and create Makefiles.\n# Generated by GNU Autoconf 2.69 for libjpeg 9.1.0.\n#\n#\n# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.\n#\n#\n# This configure script is free software; the Free Software Foundation\n# gives unlimited permission to copy, distribute and modify it.\n## -------------------- ##\n## M4sh Initialization. ##\n## -------------------- ##\n\n# Be more Bourne compatible\nDUALCASE=1; export DUALCASE # for MKS sh\nif test -n \"${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on ${1+\"$@\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '${1+\"$@\"}'='\"$@\"'\n  setopt NO_GLOB_SUBST\nelse\n  case `(set -o) 2>/dev/null` in #(\n  *posix*) :\n    set -o posix ;; #(\n  *) :\n     ;;\nesac\nfi\n\n\nas_nl='\n'\nexport as_nl\n# Printing a long string crashes Solaris 7 /usr/bin/printf.\nas_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\nas_echo=$as_echo$as_echo$as_echo$as_echo$as_echo\nas_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo\n# Prefer a ksh shell builtin over an external printf program on Solaris,\n# but without wasting forks for bash or zsh.\nif test -z \"$BASH_VERSION$ZSH_VERSION\" \\\n    && (test \"X`print -r -- $as_echo`\" = \"X$as_echo\") 2>/dev/null; then\n  as_echo='print -r --'\n  as_echo_n='print -rn --'\nelif (test \"X`printf %s $as_echo`\" = \"X$as_echo\") 2>/dev/null; then\n  as_echo='printf %s\\n'\n  as_echo_n='printf %s'\nelse\n  if test \"X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`\" = \"X-n $as_echo\"; then\n    as_echo_body='eval /usr/ucb/echo -n \"$1$as_nl\"'\n    as_echo_n='/usr/ucb/echo -n'\n  else\n    as_echo_body='eval expr \"X$1\" : \"X\\\\(.*\\\\)\"'\n    as_echo_n_body='eval\n      arg=$1;\n      case $arg in #(\n      *\"$as_nl\"*)\n\texpr \"X$arg\" : \"X\\\\(.*\\\\)$as_nl\";\n\targ=`expr \"X$arg\" : \".*$as_nl\\\\(.*\\\\)\"`;;\n      esac;\n      expr \"X$arg\" : \"X\\\\(.*\\\\)\" | tr -d \"$as_nl\"\n    '\n    export as_echo_n_body\n    as_echo_n='sh -c $as_echo_n_body as_echo'\n  fi\n  export as_echo_body\n  as_echo='sh -c $as_echo_body as_echo'\nfi\n\n# The user is always right.\nif test \"${PATH_SEPARATOR+set}\" != set; then\n  PATH_SEPARATOR=:\n  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {\n    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||\n      PATH_SEPARATOR=';'\n  }\nfi\n\n\n# IFS\n# We need space, tab and new line, in precisely that order.  Quoting is\n# there to prevent editors from complaining about space-tab.\n# (If _AS_PATH_WALK were called with IFS unset, it would disable word\n# splitting by setting IFS to empty value.)\nIFS=\" \"\"\t$as_nl\"\n\n# Find who we are.  Look in the path if we contain no directory separator.\nas_myself=\ncase $0 in #((\n  *[\\\\/]* ) as_myself=$0 ;;\n  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    test -r \"$as_dir/$0\" && as_myself=$as_dir/$0 && break\n  done\nIFS=$as_save_IFS\n\n     ;;\nesac\n# We did not find ourselves, most probably we were run as `sh COMMAND'\n# in which case we are not to be found in the path.\nif test \"x$as_myself\" = x; then\n  as_myself=$0\nfi\nif test ! -f \"$as_myself\"; then\n  $as_echo \"$as_myself: error: cannot find myself; rerun with an absolute file name\" >&2\n  exit 1\nfi\n\n# Unset variables that we do not need and which cause bugs (e.g. in\n# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the \"|| exit 1\"\n# suppresses any \"Segmentation fault\" message there.  '((' could\n# trigger a bug in pdksh 5.2.14.\nfor as_var in BASH_ENV ENV MAIL MAILPATH\ndo eval test x\\${$as_var+set} = xset \\\n  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :\ndone\nPS1='$ '\nPS2='> '\nPS4='+ '\n\n# NLS nuisances.\nLC_ALL=C\nexport LC_ALL\nLANGUAGE=C\nexport LANGUAGE\n\n# CDPATH.\n(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n\n# Use a proper internal environment variable to ensure we don't fall\n  # into an infinite loop, continuously re-executing ourselves.\n  if test x\"${_as_can_reexec}\" != xno && test \"x$CONFIG_SHELL\" != x; then\n    _as_can_reexec=no; export _as_can_reexec;\n    # We cannot yet assume a decent shell, so we have to provide a\n# neutralization value for shells without unset; and this also\n# works around shells that cannot unset nonexistent variables.\n# Preserve -v and -x to the replacement shell.\nBASH_ENV=/dev/null\nENV=/dev/null\n(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV\ncase $- in # ((((\n  *v*x* | *x*v* ) as_opts=-vx ;;\n  *v* ) as_opts=-v ;;\n  *x* ) as_opts=-x ;;\n  * ) as_opts= ;;\nesac\nexec $CONFIG_SHELL $as_opts \"$as_myself\" ${1+\"$@\"}\n# Admittedly, this is quite paranoid, since all the known shells bail\n# out after a failed `exec'.\n$as_echo \"$0: could not re-execute with $CONFIG_SHELL\" >&2\nas_fn_exit 255\n  fi\n  # We don't want this to propagate to other subprocesses.\n          { _as_can_reexec=; unset _as_can_reexec;}\nif test \"x$CONFIG_SHELL\" = x; then\n  as_bourne_compatible=\"if test -n \\\"\\${ZSH_VERSION+set}\\\" && (emulate sh) >/dev/null 2>&1; then :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on \\${1+\\\"\\$@\\\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '\\${1+\\\"\\$@\\\"}'='\\\"\\$@\\\"'\n  setopt NO_GLOB_SUBST\nelse\n  case \\`(set -o) 2>/dev/null\\` in #(\n  *posix*) :\n    set -o posix ;; #(\n  *) :\n     ;;\nesac\nfi\n\"\n  as_required=\"as_fn_return () { (exit \\$1); }\nas_fn_success () { as_fn_return 0; }\nas_fn_failure () { as_fn_return 1; }\nas_fn_ret_success () { return 0; }\nas_fn_ret_failure () { return 1; }\n\nexitcode=0\nas_fn_success || { exitcode=1; echo as_fn_success failed.; }\nas_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }\nas_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }\nas_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }\nif ( set x; as_fn_ret_success y && test x = \\\"\\$1\\\" ); then :\n\nelse\n  exitcode=1; echo positional parameters were not saved.\nfi\ntest x\\$exitcode = x0 || exit 1\ntest -x / || exit 1\"\n  as_suggested=\"  as_lineno_1=\";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested\" as_lineno_1a=\\$LINENO\n  as_lineno_2=\";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested\" as_lineno_2a=\\$LINENO\n  eval 'test \\\"x\\$as_lineno_1'\\$as_run'\\\" != \\\"x\\$as_lineno_2'\\$as_run'\\\" &&\n  test \\\"x\\`expr \\$as_lineno_1'\\$as_run' + 1\\`\\\" = \\\"x\\$as_lineno_2'\\$as_run'\\\"' || exit 1\ntest \\$(( 1 + 1 )) = 2 || exit 1\n\n  test -n \\\"\\${ZSH_VERSION+set}\\${BASH_VERSION+set}\\\" || (\n    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\n    ECHO=\\$ECHO\\$ECHO\\$ECHO\\$ECHO\\$ECHO\n    ECHO=\\$ECHO\\$ECHO\\$ECHO\\$ECHO\\$ECHO\\$ECHO\n    PATH=/empty FPATH=/empty; export PATH FPATH\n    test \\\"X\\`printf %s \\$ECHO\\`\\\" = \\\"X\\$ECHO\\\" \\\\\n      || test \\\"X\\`print -r -- \\$ECHO\\`\\\" = \\\"X\\$ECHO\\\" ) || exit 1\"\n  if (eval \"$as_required\") 2>/dev/null; then :\n  as_have_required=yes\nelse\n  as_have_required=no\nfi\n  if test x$as_have_required = xyes && (eval \"$as_suggested\") 2>/dev/null; then :\n\nelse\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nas_found=false\nfor as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  as_found=:\n  case $as_dir in #(\n\t /*)\n\t   for as_base in sh bash ksh sh5; do\n\t     # Try only shells that exist, to save several forks.\n\t     as_shell=$as_dir/$as_base\n\t     if { test -f \"$as_shell\" || test -f \"$as_shell.exe\"; } &&\n\t\t    { $as_echo \"$as_bourne_compatible\"\"$as_required\" | as_run=a \"$as_shell\"; } 2>/dev/null; then :\n  CONFIG_SHELL=$as_shell as_have_required=yes\n\t\t   if { $as_echo \"$as_bourne_compatible\"\"$as_suggested\" | as_run=a \"$as_shell\"; } 2>/dev/null; then :\n  break 2\nfi\nfi\n\t   done;;\n       esac\n  as_found=false\ndone\n$as_found || { if { test -f \"$SHELL\" || test -f \"$SHELL.exe\"; } &&\n\t      { $as_echo \"$as_bourne_compatible\"\"$as_required\" | as_run=a \"$SHELL\"; } 2>/dev/null; then :\n  CONFIG_SHELL=$SHELL as_have_required=yes\nfi; }\nIFS=$as_save_IFS\n\n\n      if test \"x$CONFIG_SHELL\" != x; then :\n  export CONFIG_SHELL\n             # We cannot yet assume a decent shell, so we have to provide a\n# neutralization value for shells without unset; and this also\n# works around shells that cannot unset nonexistent variables.\n# Preserve -v and -x to the replacement shell.\nBASH_ENV=/dev/null\nENV=/dev/null\n(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV\ncase $- in # ((((\n  *v*x* | *x*v* ) as_opts=-vx ;;\n  *v* ) as_opts=-v ;;\n  *x* ) as_opts=-x ;;\n  * ) as_opts= ;;\nesac\nexec $CONFIG_SHELL $as_opts \"$as_myself\" ${1+\"$@\"}\n# Admittedly, this is quite paranoid, since all the known shells bail\n# out after a failed `exec'.\n$as_echo \"$0: could not re-execute with $CONFIG_SHELL\" >&2\nexit 255\nfi\n\n    if test x$as_have_required = xno; then :\n  $as_echo \"$0: This script requires a shell more modern than all\"\n  $as_echo \"$0: the shells that I found on your system.\"\n  if test x${ZSH_VERSION+set} = xset ; then\n    $as_echo \"$0: In particular, zsh $ZSH_VERSION has bugs and should\"\n    $as_echo \"$0: be upgraded to zsh 4.3.4 or later.\"\n  else\n    $as_echo \"$0: Please tell bug-autoconf@gnu.org about your system,\n$0: including any error possibly output before this\n$0: message. Then install a modern shell, or manually run\n$0: the script under such a shell if you do have one.\"\n  fi\n  exit 1\nfi\nfi\nfi\nSHELL=${CONFIG_SHELL-/bin/sh}\nexport SHELL\n# Unset more variables known to interfere with behavior of common tools.\nCLICOLOR_FORCE= GREP_OPTIONS=\nunset CLICOLOR_FORCE GREP_OPTIONS\n\n## --------------------- ##\n## M4sh Shell Functions. ##\n## --------------------- ##\n# as_fn_unset VAR\n# ---------------\n# Portably unset VAR.\nas_fn_unset ()\n{\n  { eval $1=; unset $1;}\n}\nas_unset=as_fn_unset\n\n# as_fn_set_status STATUS\n# -----------------------\n# Set $? to STATUS, without forking.\nas_fn_set_status ()\n{\n  return $1\n} # as_fn_set_status\n\n# as_fn_exit STATUS\n# -----------------\n# Exit the shell with STATUS, even in a \"trap 0\" or \"set -e\" context.\nas_fn_exit ()\n{\n  set +e\n  as_fn_set_status $1\n  exit $1\n} # as_fn_exit\n\n# as_fn_mkdir_p\n# -------------\n# Create \"$as_dir\" as a directory, including parents if necessary.\nas_fn_mkdir_p ()\n{\n\n  case $as_dir in #(\n  -*) as_dir=./$as_dir;;\n  esac\n  test -d \"$as_dir\" || eval $as_mkdir_p || {\n    as_dirs=\n    while :; do\n      case $as_dir in #(\n      *\\'*) as_qdir=`$as_echo \"$as_dir\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;; #'(\n      *) as_qdir=$as_dir;;\n      esac\n      as_dirs=\"'$as_qdir' $as_dirs\"\n      as_dir=`$as_dirname -- \"$as_dir\" ||\n$as_expr X\"$as_dir\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_dir\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$as_dir\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n      test -d \"$as_dir\" && break\n    done\n    test -z \"$as_dirs\" || eval \"mkdir $as_dirs\"\n  } || test -d \"$as_dir\" || as_fn_error $? \"cannot create directory $as_dir\"\n\n\n} # as_fn_mkdir_p\n\n# as_fn_executable_p FILE\n# -----------------------\n# Test if FILE is an executable regular file.\nas_fn_executable_p ()\n{\n  test -f \"$1\" && test -x \"$1\"\n} # as_fn_executable_p\n# as_fn_append VAR VALUE\n# ----------------------\n# Append the text in VALUE to the end of the definition contained in VAR. Take\n# advantage of any shell optimizations that allow amortized linear growth over\n# repeated appends, instead of the typical quadratic growth present in naive\n# implementations.\nif (eval \"as_var=1; as_var+=2; test x\\$as_var = x12\") 2>/dev/null; then :\n  eval 'as_fn_append ()\n  {\n    eval $1+=\\$2\n  }'\nelse\n  as_fn_append ()\n  {\n    eval $1=\\$$1\\$2\n  }\nfi # as_fn_append\n\n# as_fn_arith ARG...\n# ------------------\n# Perform arithmetic evaluation on the ARGs, and store the result in the\n# global $as_val. Take advantage of shells that can avoid forks. The arguments\n# must be portable across $(()) and expr.\nif (eval \"test \\$(( 1 + 1 )) = 2\") 2>/dev/null; then :\n  eval 'as_fn_arith ()\n  {\n    as_val=$(( $* ))\n  }'\nelse\n  as_fn_arith ()\n  {\n    as_val=`expr \"$@\" || test $? -eq 1`\n  }\nfi # as_fn_arith\n\n\n# as_fn_error STATUS ERROR [LINENO LOG_FD]\n# ----------------------------------------\n# Output \"`basename $0`: error: ERROR\" to stderr. If LINENO and LOG_FD are\n# provided, also output the error to LOG_FD, referencing LINENO. Then exit the\n# script with STATUS, using 1 if that was 0.\nas_fn_error ()\n{\n  as_status=$1; test $as_status -eq 0 && as_status=1\n  if test \"$4\"; then\n    as_lineno=${as_lineno-\"$3\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n    $as_echo \"$as_me:${as_lineno-$LINENO}: error: $2\" >&$4\n  fi\n  $as_echo \"$as_me: error: $2\" >&2\n  as_fn_exit $as_status\n} # as_fn_error\n\nif expr a : '\\(a\\)' >/dev/null 2>&1 &&\n   test \"X`expr 00001 : '.*\\(...\\)'`\" = X001; then\n  as_expr=expr\nelse\n  as_expr=false\nfi\n\nif (basename -- /) >/dev/null 2>&1 && test \"X`basename -- / 2>&1`\" = \"X/\"; then\n  as_basename=basename\nelse\n  as_basename=false\nfi\n\nif (as_dir=`dirname -- /` && test \"X$as_dir\" = X/) >/dev/null 2>&1; then\n  as_dirname=dirname\nelse\n  as_dirname=false\nfi\n\nas_me=`$as_basename -- \"$0\" ||\n$as_expr X/\"$0\" : '.*/\\([^/][^/]*\\)/*$' \\| \\\n\t X\"$0\" : 'X\\(//\\)$' \\| \\\n\t X\"$0\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X/\"$0\" |\n    sed '/^.*\\/\\([^/][^/]*\\)\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n\n# Avoid depending upon Character Ranges.\nas_cr_letters='abcdefghijklmnopqrstuvwxyz'\nas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'\nas_cr_Letters=$as_cr_letters$as_cr_LETTERS\nas_cr_digits='0123456789'\nas_cr_alnum=$as_cr_Letters$as_cr_digits\n\n\n  as_lineno_1=$LINENO as_lineno_1a=$LINENO\n  as_lineno_2=$LINENO as_lineno_2a=$LINENO\n  eval 'test \"x$as_lineno_1'$as_run'\" != \"x$as_lineno_2'$as_run'\" &&\n  test \"x`expr $as_lineno_1'$as_run' + 1`\" = \"x$as_lineno_2'$as_run'\"' || {\n  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)\n  sed -n '\n    p\n    /[$]LINENO/=\n  ' <$as_myself |\n    sed '\n      s/[$]LINENO.*/&-/\n      t lineno\n      b\n      :lineno\n      N\n      :loop\n      s/[$]LINENO\\([^'$as_cr_alnum'_].*\\n\\)\\(.*\\)/\\2\\1\\2/\n      t loop\n      s/-\\n.*//\n    ' >$as_me.lineno &&\n  chmod +x \"$as_me.lineno\" ||\n    { $as_echo \"$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell\" >&2; as_fn_exit 1; }\n\n  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have\n  # already done that, so ensure we don't try to do so again and fall\n  # in an infinite loop.  This has already happened in practice.\n  _as_can_reexec=no; export _as_can_reexec\n  # Don't try to exec as it changes $[0], causing all sort of problems\n  # (the dirname of $[0] is not the place where we might find the\n  # original and so on.  Autoconf is especially sensitive to this).\n  . \"./$as_me.lineno\"\n  # Exit status is that of the last command.\n  exit\n}\n\nECHO_C= ECHO_N= ECHO_T=\ncase `echo -n x` in #(((((\n-n*)\n  case `echo 'xy\\c'` in\n  *c*) ECHO_T='\t';;\t# ECHO_T is single tab character.\n  xy)  ECHO_C='\\c';;\n  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null\n       ECHO_T='\t';;\n  esac;;\n*)\n  ECHO_N='-n';;\nesac\n\nrm -f conf$$ conf$$.exe conf$$.file\nif test -d conf$$.dir; then\n  rm -f conf$$.dir/conf$$.file\nelse\n  rm -f conf$$.dir\n  mkdir conf$$.dir 2>/dev/null\nfi\nif (echo >conf$$.file) 2>/dev/null; then\n  if ln -s conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s='ln -s'\n    # ... but there are two gotchas:\n    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.\n    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.\n    # In both cases, we have to default to `cp -pR'.\n    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||\n      as_ln_s='cp -pR'\n  elif ln conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s=ln\n  else\n    as_ln_s='cp -pR'\n  fi\nelse\n  as_ln_s='cp -pR'\nfi\nrm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file\nrmdir conf$$.dir 2>/dev/null\n\nif mkdir -p . 2>/dev/null; then\n  as_mkdir_p='mkdir -p \"$as_dir\"'\nelse\n  test -d ./-p && rmdir ./-p\n  as_mkdir_p=false\nfi\n\nas_test_x='test -x'\nas_executable_p=as_fn_executable_p\n\n# Sed expression to map a string onto a valid CPP name.\nas_tr_cpp=\"eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'\"\n\n# Sed expression to map a string onto a valid variable name.\nas_tr_sh=\"eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'\"\n\nSHELL=${CONFIG_SHELL-/bin/sh}\n\n\ntest -n \"$DJDIR\" || exec 7<&0 </dev/null\nexec 6>&1\n\n# Name of the host.\n# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,\n# so uname gets run too.\nac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`\n\n#\n# Initializations.\n#\nac_default_prefix=/usr/local\nac_clean_files=\nac_config_libobj_dir=.\nLIBOBJS=\ncross_compiling=no\nsubdirs=\nMFLAGS=\nMAKEFLAGS=\n\n# Identity of this package.\nPACKAGE_NAME='libjpeg'\nPACKAGE_TARNAME='libjpeg'\nPACKAGE_VERSION='9.1.0'\nPACKAGE_STRING='libjpeg 9.1.0'\nPACKAGE_BUGREPORT=''\nPACKAGE_URL=''\n\n# Factoring default headers for most tests.\nac_includes_default=\"\\\n#include <stdio.h>\n#ifdef HAVE_SYS_TYPES_H\n# include <sys/types.h>\n#endif\n#ifdef HAVE_SYS_STAT_H\n# include <sys/stat.h>\n#endif\n#ifdef STDC_HEADERS\n# include <stdlib.h>\n# include <stddef.h>\n#else\n# ifdef HAVE_STDLIB_H\n#  include <stdlib.h>\n# endif\n#endif\n#ifdef HAVE_STRING_H\n# if !defined STDC_HEADERS && defined HAVE_MEMORY_H\n#  include <memory.h>\n# endif\n# include <string.h>\n#endif\n#ifdef HAVE_STRINGS_H\n# include <strings.h>\n#endif\n#ifdef HAVE_INTTYPES_H\n# include <inttypes.h>\n#endif\n#ifdef HAVE_STDINT_H\n# include <stdint.h>\n#endif\n#ifdef HAVE_UNISTD_H\n# include <unistd.h>\n#endif\"\n\nac_subst_vars='am__EXEEXT_FALSE\nam__EXEEXT_TRUE\nLTLIBOBJS\nLIBOBJS\nJPEG_LIB_VERSION\nMEMORYMGR\nLT_SYS_LIBRARY_PATH\nOTOOL64\nOTOOL\nLIPO\nNMEDIT\nDSYMUTIL\nMANIFEST_TOOL\nRANLIB\nNM\nac_ct_DUMPBIN\nDUMPBIN\nLD\nFGREP\nSED\nLIBTOOL\nOBJDUMP\nDLLTOOL\nAS\nEGREP\nGREP\nHAVE_LD_VERSION_SCRIPT_FALSE\nHAVE_LD_VERSION_SCRIPT_TRUE\nam__fastdepCCAS_FALSE\nam__fastdepCCAS_TRUE\nCCASDEPMODE\nCCASFLAGS\nCCAS\nac_ct_AR\nAR\nLN_S\nCPP\nam__fastdepCC_FALSE\nam__fastdepCC_TRUE\nCCDEPMODE\nam__nodep\nAMDEPBACKSLASH\nAMDEP_FALSE\nAMDEP_TRUE\nam__quote\nam__include\nDEPDIR\nOBJEXT\nEXEEXT\nac_ct_CC\nCPPFLAGS\nLDFLAGS\nCFLAGS\nCC\nMAINT\nMAINTAINER_MODE_FALSE\nMAINTAINER_MODE_TRUE\nAM_BACKSLASH\nAM_DEFAULT_VERBOSITY\nAM_DEFAULT_V\nAM_V\nam__untar\nam__tar\nAMTAR\nam__leading_dot\nSET_MAKE\nAWK\nmkdir_p\nMKDIR_P\nINSTALL_STRIP_PROGRAM\nSTRIP\ninstall_sh\nMAKEINFO\nAUTOHEADER\nAUTOMAKE\nAUTOCONF\nACLOCAL\nVERSION\nPACKAGE\nCYGPATH_W\nam__isrc\nINSTALL_DATA\nINSTALL_SCRIPT\nINSTALL_PROGRAM\ntarget_os\ntarget_vendor\ntarget_cpu\ntarget\nhost_os\nhost_vendor\nhost_cpu\nhost\nbuild_os\nbuild_vendor\nbuild_cpu\nbuild\ntarget_alias\nhost_alias\nbuild_alias\nLIBS\nECHO_T\nECHO_N\nECHO_C\nDEFS\nmandir\nlocaledir\nlibdir\npsdir\npdfdir\ndvidir\nhtmldir\ninfodir\ndocdir\noldincludedir\nincludedir\nrunstatedir\nlocalstatedir\nsharedstatedir\nsysconfdir\ndatadir\ndatarootdir\nlibexecdir\nsbindir\nbindir\nprogram_transform_name\nprefix\nexec_prefix\nPACKAGE_URL\nPACKAGE_BUGREPORT\nPACKAGE_STRING\nPACKAGE_VERSION\nPACKAGE_TARNAME\nPACKAGE_NAME\nPATH_SEPARATOR\nSHELL'\nac_subst_files=''\nac_user_opts='\nenable_option_checking\nenable_silent_rules\nenable_maintainer_mode\nenable_dependency_tracking\nenable_ld_version_script\nenable_shared\nenable_static\nwith_pic\nenable_fast_install\nwith_aix_soname\nwith_gnu_ld\nwith_sysroot\nenable_libtool_lock\nenable_maxmem\n'\n      ac_precious_vars='build_alias\nhost_alias\ntarget_alias\nCC\nCFLAGS\nLDFLAGS\nLIBS\nCPPFLAGS\nCPP\nCCAS\nCCASFLAGS\nLT_SYS_LIBRARY_PATH'\n\n\n# Initialize some variables set by options.\nac_init_help=\nac_init_version=false\nac_unrecognized_opts=\nac_unrecognized_sep=\n# The variables have the same names as the options, with\n# dashes changed to underlines.\ncache_file=/dev/null\nexec_prefix=NONE\nno_create=\nno_recursion=\nprefix=NONE\nprogram_prefix=NONE\nprogram_suffix=NONE\nprogram_transform_name=s,x,x,\nsilent=\nsite=\nsrcdir=\nverbose=\nx_includes=NONE\nx_libraries=NONE\n\n# Installation directory options.\n# These are left unexpanded so users can \"make install exec_prefix=/foo\"\n# and all the variables that are supposed to be based on exec_prefix\n# by default will actually change.\n# Use braces instead of parens because sh, perl, etc. also accept them.\n# (The list follows the same order as the GNU Coding Standards.)\nbindir='${exec_prefix}/bin'\nsbindir='${exec_prefix}/sbin'\nlibexecdir='${exec_prefix}/libexec'\ndatarootdir='${prefix}/share'\ndatadir='${datarootdir}'\nsysconfdir='${prefix}/etc'\nsharedstatedir='${prefix}/com'\nlocalstatedir='${prefix}/var'\nrunstatedir='${localstatedir}/run'\nincludedir='${prefix}/include'\noldincludedir='/usr/include'\ndocdir='${datarootdir}/doc/${PACKAGE_TARNAME}'\ninfodir='${datarootdir}/info'\nhtmldir='${docdir}'\ndvidir='${docdir}'\npdfdir='${docdir}'\npsdir='${docdir}'\nlibdir='${exec_prefix}/lib'\nlocaledir='${datarootdir}/locale'\nmandir='${datarootdir}/man'\n\nac_prev=\nac_dashdash=\nfor ac_option\ndo\n  # If the previous option needs an argument, assign it.\n  if test -n \"$ac_prev\"; then\n    eval $ac_prev=\\$ac_option\n    ac_prev=\n    continue\n  fi\n\n  case $ac_option in\n  *=?*) ac_optarg=`expr \"X$ac_option\" : '[^=]*=\\(.*\\)'` ;;\n  *=)   ac_optarg= ;;\n  *)    ac_optarg=yes ;;\n  esac\n\n  # Accept the important Cygnus configure options, so we can diagnose typos.\n\n  case $ac_dashdash$ac_option in\n  --)\n    ac_dashdash=yes ;;\n\n  -bindir | --bindir | --bindi | --bind | --bin | --bi)\n    ac_prev=bindir ;;\n  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)\n    bindir=$ac_optarg ;;\n\n  -build | --build | --buil | --bui | --bu)\n    ac_prev=build_alias ;;\n  -build=* | --build=* | --buil=* | --bui=* | --bu=*)\n    build_alias=$ac_optarg ;;\n\n  -cache-file | --cache-file | --cache-fil | --cache-fi \\\n  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)\n    ac_prev=cache_file ;;\n  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \\\n  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)\n    cache_file=$ac_optarg ;;\n\n  --config-cache | -C)\n    cache_file=config.cache ;;\n\n  -datadir | --datadir | --datadi | --datad)\n    ac_prev=datadir ;;\n  -datadir=* | --datadir=* | --datadi=* | --datad=*)\n    datadir=$ac_optarg ;;\n\n  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \\\n  | --dataroo | --dataro | --datar)\n    ac_prev=datarootdir ;;\n  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \\\n  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)\n    datarootdir=$ac_optarg ;;\n\n  -disable-* | --disable-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*disable-\\(.*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid feature name: $ac_useropt\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`$as_echo \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"enable_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval enable_$ac_useropt=no ;;\n\n  -docdir | --docdir | --docdi | --doc | --do)\n    ac_prev=docdir ;;\n  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)\n    docdir=$ac_optarg ;;\n\n  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)\n    ac_prev=dvidir ;;\n  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)\n    dvidir=$ac_optarg ;;\n\n  -enable-* | --enable-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*enable-\\([^=]*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid feature name: $ac_useropt\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`$as_echo \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"enable_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval enable_$ac_useropt=\\$ac_optarg ;;\n\n  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \\\n  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \\\n  | --exec | --exe | --ex)\n    ac_prev=exec_prefix ;;\n  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \\\n  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \\\n  | --exec=* | --exe=* | --ex=*)\n    exec_prefix=$ac_optarg ;;\n\n  -gas | --gas | --ga | --g)\n    # Obsolete; use --with-gas.\n    with_gas=yes ;;\n\n  -help | --help | --hel | --he | -h)\n    ac_init_help=long ;;\n  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)\n    ac_init_help=recursive ;;\n  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)\n    ac_init_help=short ;;\n\n  -host | --host | --hos | --ho)\n    ac_prev=host_alias ;;\n  -host=* | --host=* | --hos=* | --ho=*)\n    host_alias=$ac_optarg ;;\n\n  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)\n    ac_prev=htmldir ;;\n  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \\\n  | --ht=*)\n    htmldir=$ac_optarg ;;\n\n  -includedir | --includedir | --includedi | --included | --include \\\n  | --includ | --inclu | --incl | --inc)\n    ac_prev=includedir ;;\n  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \\\n  | --includ=* | --inclu=* | --incl=* | --inc=*)\n    includedir=$ac_optarg ;;\n\n  -infodir | --infodir | --infodi | --infod | --info | --inf)\n    ac_prev=infodir ;;\n  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)\n    infodir=$ac_optarg ;;\n\n  -libdir | --libdir | --libdi | --libd)\n    ac_prev=libdir ;;\n  -libdir=* | --libdir=* | --libdi=* | --libd=*)\n    libdir=$ac_optarg ;;\n\n  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \\\n  | --libexe | --libex | --libe)\n    ac_prev=libexecdir ;;\n  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \\\n  | --libexe=* | --libex=* | --libe=*)\n    libexecdir=$ac_optarg ;;\n\n  -localedir | --localedir | --localedi | --localed | --locale)\n    ac_prev=localedir ;;\n  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)\n    localedir=$ac_optarg ;;\n\n  -localstatedir | --localstatedir | --localstatedi | --localstated \\\n  | --localstate | --localstat | --localsta | --localst | --locals)\n    ac_prev=localstatedir ;;\n  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \\\n  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)\n    localstatedir=$ac_optarg ;;\n\n  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)\n    ac_prev=mandir ;;\n  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)\n    mandir=$ac_optarg ;;\n\n  -nfp | --nfp | --nf)\n    # Obsolete; use --without-fp.\n    with_fp=no ;;\n\n  -no-create | --no-create | --no-creat | --no-crea | --no-cre \\\n  | --no-cr | --no-c | -n)\n    no_create=yes ;;\n\n  -no-recursion | --no-recursion | --no-recursio | --no-recursi \\\n  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)\n    no_recursion=yes ;;\n\n  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \\\n  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \\\n  | --oldin | --oldi | --old | --ol | --o)\n    ac_prev=oldincludedir ;;\n  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \\\n  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \\\n  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)\n    oldincludedir=$ac_optarg ;;\n\n  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)\n    ac_prev=prefix ;;\n  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)\n    prefix=$ac_optarg ;;\n\n  -program-prefix | --program-prefix | --program-prefi | --program-pref \\\n  | --program-pre | --program-pr | --program-p)\n    ac_prev=program_prefix ;;\n  -program-prefix=* | --program-prefix=* | --program-prefi=* \\\n  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)\n    program_prefix=$ac_optarg ;;\n\n  -program-suffix | --program-suffix | --program-suffi | --program-suff \\\n  | --program-suf | --program-su | --program-s)\n    ac_prev=program_suffix ;;\n  -program-suffix=* | --program-suffix=* | --program-suffi=* \\\n  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)\n    program_suffix=$ac_optarg ;;\n\n  -program-transform-name | --program-transform-name \\\n  | --program-transform-nam | --program-transform-na \\\n  | --program-transform-n | --program-transform- \\\n  | --program-transform | --program-transfor \\\n  | --program-transfo | --program-transf \\\n  | --program-trans | --program-tran \\\n  | --progr-tra | --program-tr | --program-t)\n    ac_prev=program_transform_name ;;\n  -program-transform-name=* | --program-transform-name=* \\\n  | --program-transform-nam=* | --program-transform-na=* \\\n  | --program-transform-n=* | --program-transform-=* \\\n  | --program-transform=* | --program-transfor=* \\\n  | --program-transfo=* | --program-transf=* \\\n  | --program-trans=* | --program-tran=* \\\n  | --progr-tra=* | --program-tr=* | --program-t=*)\n    program_transform_name=$ac_optarg ;;\n\n  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)\n    ac_prev=pdfdir ;;\n  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)\n    pdfdir=$ac_optarg ;;\n\n  -psdir | --psdir | --psdi | --psd | --ps)\n    ac_prev=psdir ;;\n  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)\n    psdir=$ac_optarg ;;\n\n  -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n  | -silent | --silent | --silen | --sile | --sil)\n    silent=yes ;;\n\n  -runstatedir | --runstatedir | --runstatedi | --runstated \\\n  | --runstate | --runstat | --runsta | --runst | --runs \\\n  | --run | --ru | --r)\n    ac_prev=runstatedir ;;\n  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \\\n  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \\\n  | --run=* | --ru=* | --r=*)\n    runstatedir=$ac_optarg ;;\n\n  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)\n    ac_prev=sbindir ;;\n  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \\\n  | --sbi=* | --sb=*)\n    sbindir=$ac_optarg ;;\n\n  -sharedstatedir | --sharedstatedir | --sharedstatedi \\\n  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \\\n  | --sharedst | --shareds | --shared | --share | --shar \\\n  | --sha | --sh)\n    ac_prev=sharedstatedir ;;\n  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \\\n  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \\\n  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \\\n  | --sha=* | --sh=*)\n    sharedstatedir=$ac_optarg ;;\n\n  -site | --site | --sit)\n    ac_prev=site ;;\n  -site=* | --site=* | --sit=*)\n    site=$ac_optarg ;;\n\n  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)\n    ac_prev=srcdir ;;\n  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)\n    srcdir=$ac_optarg ;;\n\n  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \\\n  | --syscon | --sysco | --sysc | --sys | --sy)\n    ac_prev=sysconfdir ;;\n  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \\\n  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)\n    sysconfdir=$ac_optarg ;;\n\n  -target | --target | --targe | --targ | --tar | --ta | --t)\n    ac_prev=target_alias ;;\n  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)\n    target_alias=$ac_optarg ;;\n\n  -v | -verbose | --verbose | --verbos | --verbo | --verb)\n    verbose=yes ;;\n\n  -version | --version | --versio | --versi | --vers | -V)\n    ac_init_version=: ;;\n\n  -with-* | --with-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*with-\\([^=]*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid package name: $ac_useropt\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`$as_echo \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"with_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval with_$ac_useropt=\\$ac_optarg ;;\n\n  -without-* | --without-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*without-\\(.*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid package name: $ac_useropt\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`$as_echo \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"with_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval with_$ac_useropt=no ;;\n\n  --x)\n    # Obsolete; use --with-x.\n    with_x=yes ;;\n\n  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \\\n  | --x-incl | --x-inc | --x-in | --x-i)\n    ac_prev=x_includes ;;\n  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \\\n  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)\n    x_includes=$ac_optarg ;;\n\n  -x-libraries | --x-libraries | --x-librarie | --x-librari \\\n  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)\n    ac_prev=x_libraries ;;\n  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \\\n  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)\n    x_libraries=$ac_optarg ;;\n\n  -*) as_fn_error $? \"unrecognized option: \\`$ac_option'\nTry \\`$0 --help' for more information\"\n    ;;\n\n  *=*)\n    ac_envvar=`expr \"x$ac_option\" : 'x\\([^=]*\\)='`\n    # Reject names that are not valid shell variable names.\n    case $ac_envvar in #(\n      '' | [0-9]* | *[!_$as_cr_alnum]* )\n      as_fn_error $? \"invalid variable name: \\`$ac_envvar'\" ;;\n    esac\n    eval $ac_envvar=\\$ac_optarg\n    export $ac_envvar ;;\n\n  *)\n    # FIXME: should be removed in autoconf 3.0.\n    $as_echo \"$as_me: WARNING: you should use --build, --host, --target\" >&2\n    expr \"x$ac_option\" : \".*[^-._$as_cr_alnum]\" >/dev/null &&\n      $as_echo \"$as_me: WARNING: invalid host type: $ac_option\" >&2\n    : \"${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}\"\n    ;;\n\n  esac\ndone\n\nif test -n \"$ac_prev\"; then\n  ac_option=--`echo $ac_prev | sed 's/_/-/g'`\n  as_fn_error $? \"missing argument to $ac_option\"\nfi\n\nif test -n \"$ac_unrecognized_opts\"; then\n  case $enable_option_checking in\n    no) ;;\n    fatal) as_fn_error $? \"unrecognized options: $ac_unrecognized_opts\" ;;\n    *)     $as_echo \"$as_me: WARNING: unrecognized options: $ac_unrecognized_opts\" >&2 ;;\n  esac\nfi\n\n# Check all directory arguments for consistency.\nfor ac_var in\texec_prefix prefix bindir sbindir libexecdir datarootdir \\\n\t\tdatadir sysconfdir sharedstatedir localstatedir includedir \\\n\t\toldincludedir docdir infodir htmldir dvidir pdfdir psdir \\\n\t\tlibdir localedir mandir runstatedir\ndo\n  eval ac_val=\\$$ac_var\n  # Remove trailing slashes.\n  case $ac_val in\n    */ )\n      ac_val=`expr \"X$ac_val\" : 'X\\(.*[^/]\\)' \\| \"X$ac_val\" : 'X\\(.*\\)'`\n      eval $ac_var=\\$ac_val;;\n  esac\n  # Be sure to have absolute directory names.\n  case $ac_val in\n    [\\\\/$]* | ?:[\\\\/]* )  continue;;\n    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;\n  esac\n  as_fn_error $? \"expected an absolute directory name for --$ac_var: $ac_val\"\ndone\n\n# There might be people who depend on the old broken behavior: `$host'\n# used to hold the argument of --host etc.\n# FIXME: To remove some day.\nbuild=$build_alias\nhost=$host_alias\ntarget=$target_alias\n\n# FIXME: To remove some day.\nif test \"x$host_alias\" != x; then\n  if test \"x$build_alias\" = x; then\n    cross_compiling=maybe\n  elif test \"x$build_alias\" != \"x$host_alias\"; then\n    cross_compiling=yes\n  fi\nfi\n\nac_tool_prefix=\ntest -n \"$host_alias\" && ac_tool_prefix=$host_alias-\n\ntest \"$silent\" = yes && exec 6>/dev/null\n\n\nac_pwd=`pwd` && test -n \"$ac_pwd\" &&\nac_ls_di=`ls -di .` &&\nac_pwd_ls_di=`cd \"$ac_pwd\" && ls -di .` ||\n  as_fn_error $? \"working directory cannot be determined\"\ntest \"X$ac_ls_di\" = \"X$ac_pwd_ls_di\" ||\n  as_fn_error $? \"pwd does not report name of working directory\"\n\n\n# Find the source files, if location was not specified.\nif test -z \"$srcdir\"; then\n  ac_srcdir_defaulted=yes\n  # Try the directory containing this script, then the parent directory.\n  ac_confdir=`$as_dirname -- \"$as_myself\" ||\n$as_expr X\"$as_myself\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_myself\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_myself\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_myself\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$as_myself\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n  srcdir=$ac_confdir\n  if test ! -r \"$srcdir/$ac_unique_file\"; then\n    srcdir=..\n  fi\nelse\n  ac_srcdir_defaulted=no\nfi\nif test ! -r \"$srcdir/$ac_unique_file\"; then\n  test \"$ac_srcdir_defaulted\" = yes && srcdir=\"$ac_confdir or ..\"\n  as_fn_error $? \"cannot find sources ($ac_unique_file) in $srcdir\"\nfi\nac_msg=\"sources are in $srcdir, but \\`cd $srcdir' does not work\"\nac_abs_confdir=`(\n\tcd \"$srcdir\" && test -r \"./$ac_unique_file\" || as_fn_error $? \"$ac_msg\"\n\tpwd)`\n# When building in place, set srcdir=.\nif test \"$ac_abs_confdir\" = \"$ac_pwd\"; then\n  srcdir=.\nfi\n# Remove unnecessary trailing slashes from srcdir.\n# Double slashes in file names in object file debugging info\n# mess up M-x gdb in Emacs.\ncase $srcdir in\n*/) srcdir=`expr \"X$srcdir\" : 'X\\(.*[^/]\\)' \\| \"X$srcdir\" : 'X\\(.*\\)'`;;\nesac\nfor ac_var in $ac_precious_vars; do\n  eval ac_env_${ac_var}_set=\\${${ac_var}+set}\n  eval ac_env_${ac_var}_value=\\$${ac_var}\n  eval ac_cv_env_${ac_var}_set=\\${${ac_var}+set}\n  eval ac_cv_env_${ac_var}_value=\\$${ac_var}\ndone\n\n#\n# Report the --help message.\n#\nif test \"$ac_init_help\" = \"long\"; then\n  # Omit some internal or obsolete options to make the list less imposing.\n  # This message is too long to be a string in the A/UX 3.1 sh.\n  cat <<_ACEOF\n\\`configure' configures libjpeg 9.1.0 to adapt to many kinds of systems.\n\nUsage: $0 [OPTION]... [VAR=VALUE]...\n\nTo assign environment variables (e.g., CC, CFLAGS...), specify them as\nVAR=VALUE.  See below for descriptions of some of the useful variables.\n\nDefaults for the options are specified in brackets.\n\nConfiguration:\n  -h, --help              display this help and exit\n      --help=short        display options specific to this package\n      --help=recursive    display the short help of all the included packages\n  -V, --version           display version information and exit\n  -q, --quiet, --silent   do not print \\`checking ...' messages\n      --cache-file=FILE   cache test results in FILE [disabled]\n  -C, --config-cache      alias for \\`--cache-file=config.cache'\n  -n, --no-create         do not create output files\n      --srcdir=DIR        find the sources in DIR [configure dir or \\`..']\n\nInstallation directories:\n  --prefix=PREFIX         install architecture-independent files in PREFIX\n                          [$ac_default_prefix]\n  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX\n                          [PREFIX]\n\nBy default, \\`make install' will install all the files in\n\\`$ac_default_prefix/bin', \\`$ac_default_prefix/lib' etc.  You can specify\nan installation prefix other than \\`$ac_default_prefix' using \\`--prefix',\nfor instance \\`--prefix=\\$HOME'.\n\nFor better control, use the options below.\n\nFine tuning of the installation directories:\n  --bindir=DIR            user executables [EPREFIX/bin]\n  --sbindir=DIR           system admin executables [EPREFIX/sbin]\n  --libexecdir=DIR        program executables [EPREFIX/libexec]\n  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]\n  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]\n  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]\n  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]\n  --libdir=DIR            object code libraries [EPREFIX/lib]\n  --includedir=DIR        C header files [PREFIX/include]\n  --oldincludedir=DIR     C header files for non-gcc [/usr/include]\n  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]\n  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]\n  --infodir=DIR           info documentation [DATAROOTDIR/info]\n  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]\n  --mandir=DIR            man documentation [DATAROOTDIR/man]\n  --docdir=DIR            documentation root [DATAROOTDIR/doc/libjpeg]\n  --htmldir=DIR           html documentation [DOCDIR]\n  --dvidir=DIR            dvi documentation [DOCDIR]\n  --pdfdir=DIR            pdf documentation [DOCDIR]\n  --psdir=DIR             ps documentation [DOCDIR]\n_ACEOF\n\n  cat <<\\_ACEOF\n\nProgram names:\n  --program-prefix=PREFIX            prepend PREFIX to installed program names\n  --program-suffix=SUFFIX            append SUFFIX to installed program names\n  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names\n\nSystem types:\n  --build=BUILD     configure for building on BUILD [guessed]\n  --host=HOST       cross-compile to build programs to run on HOST [BUILD]\n  --target=TARGET   configure for building compilers for TARGET [HOST]\n_ACEOF\nfi\n\nif test -n \"$ac_init_help\"; then\n  case $ac_init_help in\n     short | recursive ) echo \"Configuration of libjpeg 9.1.0:\";;\n   esac\n  cat <<\\_ACEOF\n\nOptional Features:\n  --disable-option-checking  ignore unrecognized --enable/--with options\n  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)\n  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]\n  --enable-silent-rules   less verbose build output (undo: \"make V=1\")\n  --disable-silent-rules  verbose build output (undo: \"make V=0\")\n  --enable-maintainer-mode\n                          enable make rules and dependencies not useful (and\n                          sometimes confusing) to the casual installer\n  --enable-dependency-tracking\n                          do not reject slow dependency extractors\n  --disable-dependency-tracking\n                          speeds up one-time build\n  --enable-ld-version-script\n                          enable linker version script (default is enabled\n                          when possible)\n  --enable-shared[=PKGS]  build shared libraries [default=yes]\n  --enable-static[=PKGS]  build static libraries [default=yes]\n  --enable-fast-install[=PKGS]\n                          optimize for fast installation [default=yes]\n  --disable-libtool-lock  avoid locking (might break parallel builds)\n  --enable-maxmem=N     enable use of temp files, set max mem usage to N MB\n\nOptional Packages:\n  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]\n  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)\n  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use\n                          both]\n  --with-aix-soname=aix|svr4|both\n                          shared library versioning (aka \"SONAME\") variant to\n                          provide on AIX, [default=aix].\n  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]\n  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the\n                          compiler's sysroot if not specified).\n\nSome influential environment variables:\n  CC          C compiler command\n  CFLAGS      C compiler flags\n  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a\n              nonstandard directory <lib dir>\n  LIBS        libraries to pass to the linker, e.g. -l<library>\n  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if\n              you have headers in a nonstandard directory <include dir>\n  CPP         C preprocessor\n  CCAS        assembler compiler command (defaults to CC)\n  CCASFLAGS   assembler compiler flags (defaults to CFLAGS)\n  LT_SYS_LIBRARY_PATH\n              User-defined run-time library search path.\n\nUse these variables to override the choices made by `configure' or to help\nit to find libraries and programs with nonstandard names/locations.\n\nReport bugs to the package provider.\n_ACEOF\nac_status=$?\nfi\n\nif test \"$ac_init_help\" = \"recursive\"; then\n  # If there are subdirs, report their specific --help.\n  for ac_dir in : $ac_subdirs_all; do test \"x$ac_dir\" = x: && continue\n    test -d \"$ac_dir\" ||\n      { cd \"$srcdir\" && ac_pwd=`pwd` && srcdir=. && test -d \"$ac_dir\"; } ||\n      continue\n    ac_builddir=.\n\ncase \"$ac_dir\" in\n.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;\n*)\n  ac_dir_suffix=/`$as_echo \"$ac_dir\" | sed 's|^\\.[\\\\/]||'`\n  # A \"..\" for each directory in $ac_dir_suffix.\n  ac_top_builddir_sub=`$as_echo \"$ac_dir_suffix\" | sed 's|/[^\\\\/]*|/..|g;s|/||'`\n  case $ac_top_builddir_sub in\n  \"\") ac_top_builddir_sub=. ac_top_build_prefix= ;;\n  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;\n  esac ;;\nesac\nac_abs_top_builddir=$ac_pwd\nac_abs_builddir=$ac_pwd$ac_dir_suffix\n# for backward compatibility:\nac_top_builddir=$ac_top_build_prefix\n\ncase $srcdir in\n  .)  # We are building in place.\n    ac_srcdir=.\n    ac_top_srcdir=$ac_top_builddir_sub\n    ac_abs_top_srcdir=$ac_pwd ;;\n  [\\\\/]* | ?:[\\\\/]* )  # Absolute name.\n    ac_srcdir=$srcdir$ac_dir_suffix;\n    ac_top_srcdir=$srcdir\n    ac_abs_top_srcdir=$srcdir ;;\n  *) # Relative name.\n    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix\n    ac_top_srcdir=$ac_top_build_prefix$srcdir\n    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;\nesac\nac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix\n\n    cd \"$ac_dir\" || { ac_status=$?; continue; }\n    # Check for guested configure.\n    if test -f \"$ac_srcdir/configure.gnu\"; then\n      echo &&\n      $SHELL \"$ac_srcdir/configure.gnu\" --help=recursive\n    elif test -f \"$ac_srcdir/configure\"; then\n      echo &&\n      $SHELL \"$ac_srcdir/configure\" --help=recursive\n    else\n      $as_echo \"$as_me: WARNING: no configuration information is in $ac_dir\" >&2\n    fi || ac_status=$?\n    cd \"$ac_pwd\" || { ac_status=$?; break; }\n  done\nfi\n\ntest -n \"$ac_init_help\" && exit $ac_status\nif $ac_init_version; then\n  cat <<\\_ACEOF\nlibjpeg configure 9.1.0\ngenerated by GNU Autoconf 2.69\n\nCopyright (C) 2012 Free Software Foundation, Inc.\nThis configure script is free software; the Free Software Foundation\ngives unlimited permission to copy, distribute and modify it.\n_ACEOF\n  exit\nfi\n\n## ------------------------ ##\n## Autoconf initialization. ##\n## ------------------------ ##\n\n# ac_fn_c_try_compile LINENO\n# --------------------------\n# Try to compile conftest.$ac_ext, and return whether this succeeded.\nac_fn_c_try_compile ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  rm -f conftest.$ac_objext\n  if { { ac_try=\"$ac_compile\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compile\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    grep -v '^ *+' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n    mv -f conftest.er1 conftest.err\n  fi\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && {\n\t test -z \"$ac_c_werror_flag\" ||\n\t test ! -s conftest.err\n       } && test -s conftest.$ac_objext; then :\n  ac_retval=0\nelse\n  $as_echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n\tac_retval=1\nfi\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_try_compile\n\n# ac_fn_c_try_cpp LINENO\n# ----------------------\n# Try to preprocess conftest.$ac_ext, and return whether this succeeded.\nac_fn_c_try_cpp ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  if { { ac_try=\"$ac_cpp conftest.$ac_ext\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_cpp conftest.$ac_ext\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    grep -v '^ *+' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n    mv -f conftest.er1 conftest.err\n  fi\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } > conftest.i && {\n\t test -z \"$ac_c_preproc_warn_flag$ac_c_werror_flag\" ||\n\t test ! -s conftest.err\n       }; then :\n  ac_retval=0\nelse\n  $as_echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n    ac_retval=1\nfi\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_try_cpp\n\n# ac_fn_c_try_link LINENO\n# -----------------------\n# Try to link conftest.$ac_ext, and return whether this succeeded.\nac_fn_c_try_link ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  rm -f conftest.$ac_objext conftest$ac_exeext\n  if { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    grep -v '^ *+' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n    mv -f conftest.er1 conftest.err\n  fi\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && {\n\t test -z \"$ac_c_werror_flag\" ||\n\t test ! -s conftest.err\n       } && test -s conftest$ac_exeext && {\n\t test \"$cross_compiling\" = yes ||\n\t test -x conftest$ac_exeext\n       }; then :\n  ac_retval=0\nelse\n  $as_echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n\tac_retval=1\nfi\n  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information\n  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would\n  # interfere with the next link command; also delete a directory that is\n  # left behind by Apple's compiler.  We do this before executing the actions.\n  rm -rf conftest.dSYM conftest_ipa8_conftest.oo\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_try_link\n\n# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES\n# -------------------------------------------------------\n# Tests whether HEADER exists, giving a warning if it cannot be compiled using\n# the include files in INCLUDES and setting the cache variable VAR\n# accordingly.\nac_fn_c_check_header_mongrel ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  if eval \\${$3+:} false; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $2\" >&5\n$as_echo_n \"checking for $2... \" >&6; }\nif eval \\${$3+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nfi\neval ac_res=\\$$3\n\t       { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\n$as_echo \"$ac_res\" >&6; }\nelse\n  # Is the header compilable?\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking $2 usability\" >&5\n$as_echo_n \"checking $2 usability... \" >&6; }\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\n#include <$2>\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_header_compiler=yes\nelse\n  ac_header_compiler=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler\" >&5\n$as_echo \"$ac_header_compiler\" >&6; }\n\n# Is the header present?\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking $2 presence\" >&5\n$as_echo_n \"checking $2 presence... \" >&6; }\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <$2>\n_ACEOF\nif ac_fn_c_try_cpp \"$LINENO\"; then :\n  ac_header_preproc=yes\nelse\n  ac_header_preproc=no\nfi\nrm -f conftest.err conftest.i conftest.$ac_ext\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc\" >&5\n$as_echo \"$ac_header_preproc\" >&6; }\n\n# So?  What about this header?\ncase $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((\n  yes:no: )\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!\" >&5\n$as_echo \"$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!\" >&2;}\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result\" >&5\n$as_echo \"$as_me: WARNING: $2: proceeding with the compiler's result\" >&2;}\n    ;;\n  no:yes:* )\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled\" >&5\n$as_echo \"$as_me: WARNING: $2: present but cannot be compiled\" >&2;}\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?\" >&5\n$as_echo \"$as_me: WARNING: $2:     check for missing prerequisite headers?\" >&2;}\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation\" >&5\n$as_echo \"$as_me: WARNING: $2: see the Autoconf documentation\" >&2;}\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \\\"Present But Cannot Be Compiled\\\"\" >&5\n$as_echo \"$as_me: WARNING: $2:     section \\\"Present But Cannot Be Compiled\\\"\" >&2;}\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result\" >&5\n$as_echo \"$as_me: WARNING: $2: proceeding with the compiler's result\" >&2;}\n    ;;\nesac\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $2\" >&5\n$as_echo_n \"checking for $2... \" >&6; }\nif eval \\${$3+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  eval \"$3=\\$ac_header_compiler\"\nfi\neval ac_res=\\$$3\n\t       { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\n$as_echo \"$ac_res\" >&6; }\nfi\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n\n} # ac_fn_c_check_header_mongrel\n\n# ac_fn_c_try_run LINENO\n# ----------------------\n# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes\n# that executables *can* be run.\nac_fn_c_try_run ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  if { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'\n  { { case \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_try\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; }; then :\n  ac_retval=0\nelse\n  $as_echo \"$as_me: program exited with status $ac_status\" >&5\n       $as_echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n       ac_retval=$ac_status\nfi\n  rm -rf conftest.dSYM conftest_ipa8_conftest.oo\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_try_run\n\n# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES\n# -------------------------------------------------------\n# Tests whether HEADER exists and can be compiled using the include files in\n# INCLUDES, setting the cache variable VAR accordingly.\nac_fn_c_check_header_compile ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $2\" >&5\n$as_echo_n \"checking for $2... \" >&6; }\nif eval \\${$3+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\n#include <$2>\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  eval \"$3=yes\"\nelse\n  eval \"$3=no\"\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\neval ac_res=\\$$3\n\t       { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\n$as_echo \"$ac_res\" >&6; }\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n\n} # ac_fn_c_check_header_compile\n\n# ac_fn_c_check_func LINENO FUNC VAR\n# ----------------------------------\n# Tests whether FUNC exists, setting the cache variable VAR accordingly\nac_fn_c_check_func ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $2\" >&5\n$as_echo_n \"checking for $2... \" >&6; }\nif eval \\${$3+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n/* Define $2 to an innocuous variant, in case <limits.h> declares $2.\n   For example, HP-UX 11i <limits.h> declares gettimeofday.  */\n#define $2 innocuous_$2\n\n/* System header to define __stub macros and hopefully few prototypes,\n    which can conflict with char $2 (); below.\n    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n    <limits.h> exists even on freestanding compilers.  */\n\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\n#undef $2\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar $2 ();\n/* The GNU C library defines this for functions which it implements\n    to always fail with ENOSYS.  Some functions are actually named\n    something starting with __ and the normal name is an alias.  */\n#if defined __stub_$2 || defined __stub___$2\nchoke me\n#endif\n\nint\nmain ()\n{\nreturn $2 ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  eval \"$3=yes\"\nelse\n  eval \"$3=no\"\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nfi\neval ac_res=\\$$3\n\t       { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\n$as_echo \"$ac_res\" >&6; }\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n\n} # ac_fn_c_check_func\ncat >config.log <<_ACEOF\nThis file contains any messages produced by compilers while\nrunning configure, to aid debugging if configure makes a mistake.\n\nIt was created by libjpeg $as_me 9.1.0, which was\ngenerated by GNU Autoconf 2.69.  Invocation command line was\n\n  $ $0 $@\n\n_ACEOF\nexec 5>>config.log\n{\ncat <<_ASUNAME\n## --------- ##\n## Platform. ##\n## --------- ##\n\nhostname = `(hostname || uname -n) 2>/dev/null | sed 1q`\nuname -m = `(uname -m) 2>/dev/null || echo unknown`\nuname -r = `(uname -r) 2>/dev/null || echo unknown`\nuname -s = `(uname -s) 2>/dev/null || echo unknown`\nuname -v = `(uname -v) 2>/dev/null || echo unknown`\n\n/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`\n/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`\n\n/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`\n/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`\n/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`\n/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`\n/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`\n/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`\n/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`\n\n_ASUNAME\n\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    $as_echo \"PATH: $as_dir\"\n  done\nIFS=$as_save_IFS\n\n} >&5\n\ncat >&5 <<_ACEOF\n\n\n## ----------- ##\n## Core tests. ##\n## ----------- ##\n\n_ACEOF\n\n\n# Keep a trace of the command line.\n# Strip out --no-create and --no-recursion so they do not pile up.\n# Strip out --silent because we don't want to record it for future runs.\n# Also quote any args containing shell meta-characters.\n# Make two passes to allow for proper duplicate-argument suppression.\nac_configure_args=\nac_configure_args0=\nac_configure_args1=\nac_must_keep_next=false\nfor ac_pass in 1 2\ndo\n  for ac_arg\n  do\n    case $ac_arg in\n    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;\n    -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n    | -silent | --silent | --silen | --sile | --sil)\n      continue ;;\n    *\\'*)\n      ac_arg=`$as_echo \"$ac_arg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    esac\n    case $ac_pass in\n    1) as_fn_append ac_configure_args0 \" '$ac_arg'\" ;;\n    2)\n      as_fn_append ac_configure_args1 \" '$ac_arg'\"\n      if test $ac_must_keep_next = true; then\n\tac_must_keep_next=false # Got value, back to normal.\n      else\n\tcase $ac_arg in\n\t  *=* | --config-cache | -C | -disable-* | --disable-* \\\n\t  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \\\n\t  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \\\n\t  | -with-* | --with-* | -without-* | --without-* | --x)\n\t    case \"$ac_configure_args0 \" in\n\t      \"$ac_configure_args1\"*\" '$ac_arg' \"* ) continue ;;\n\t    esac\n\t    ;;\n\t  -* ) ac_must_keep_next=true ;;\n\tesac\n      fi\n      as_fn_append ac_configure_args \" '$ac_arg'\"\n      ;;\n    esac\n  done\ndone\n{ ac_configure_args0=; unset ac_configure_args0;}\n{ ac_configure_args1=; unset ac_configure_args1;}\n\n# When interrupted or exit'd, cleanup temporary files, and complete\n# config.log.  We remove comments because anyway the quotes in there\n# would cause problems or look ugly.\n# WARNING: Use '\\'' to represent an apostrophe within the trap.\n# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.\ntrap 'exit_status=$?\n  # Save into config.log some information that might help in debugging.\n  {\n    echo\n\n    $as_echo \"## ---------------- ##\n## Cache variables. ##\n## ---------------- ##\"\n    echo\n    # The following way of writing the cache mishandles newlines in values,\n(\n  for ac_var in `(set) 2>&1 | sed -n '\\''s/^\\([a-zA-Z_][a-zA-Z0-9_]*\\)=.*/\\1/p'\\''`; do\n    eval ac_val=\\$$ac_var\n    case $ac_val in #(\n    *${as_nl}*)\n      case $ac_var in #(\n      *_cv_*) { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline\" >&5\n$as_echo \"$as_me: WARNING: cache variable $ac_var contains a newline\" >&2;} ;;\n      esac\n      case $ac_var in #(\n      _ | IFS | as_nl) ;; #(\n      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(\n      *) { eval $ac_var=; unset $ac_var;} ;;\n      esac ;;\n    esac\n  done\n  (set) 2>&1 |\n    case $as_nl`(ac_space='\\'' '\\''; set) 2>&1` in #(\n    *${as_nl}ac_space=\\ *)\n      sed -n \\\n\t\"s/'\\''/'\\''\\\\\\\\'\\'''\\''/g;\n\t  s/^\\\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\\\)=\\\\(.*\\\\)/\\\\1='\\''\\\\2'\\''/p\"\n      ;; #(\n    *)\n      sed -n \"/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p\"\n      ;;\n    esac |\n    sort\n)\n    echo\n\n    $as_echo \"## ----------------- ##\n## Output variables. ##\n## ----------------- ##\"\n    echo\n    for ac_var in $ac_subst_vars\n    do\n      eval ac_val=\\$$ac_var\n      case $ac_val in\n      *\\'\\''*) ac_val=`$as_echo \"$ac_val\" | sed \"s/'\\''/'\\''\\\\\\\\\\\\\\\\'\\'''\\''/g\"`;;\n      esac\n      $as_echo \"$ac_var='\\''$ac_val'\\''\"\n    done | sort\n    echo\n\n    if test -n \"$ac_subst_files\"; then\n      $as_echo \"## ------------------- ##\n## File substitutions. ##\n## ------------------- ##\"\n      echo\n      for ac_var in $ac_subst_files\n      do\n\teval ac_val=\\$$ac_var\n\tcase $ac_val in\n\t*\\'\\''*) ac_val=`$as_echo \"$ac_val\" | sed \"s/'\\''/'\\''\\\\\\\\\\\\\\\\'\\'''\\''/g\"`;;\n\tesac\n\t$as_echo \"$ac_var='\\''$ac_val'\\''\"\n      done | sort\n      echo\n    fi\n\n    if test -s confdefs.h; then\n      $as_echo \"## ----------- ##\n## confdefs.h. ##\n## ----------- ##\"\n      echo\n      cat confdefs.h\n      echo\n    fi\n    test \"$ac_signal\" != 0 &&\n      $as_echo \"$as_me: caught signal $ac_signal\"\n    $as_echo \"$as_me: exit $exit_status\"\n  } >&5\n  rm -f core *.core core.conftest.* &&\n    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&\n    exit $exit_status\n' 0\nfor ac_signal in 1 2 13 15; do\n  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal\ndone\nac_signal=0\n\n# confdefs.h avoids OS command line length limits that DEFS can exceed.\nrm -f -r conftest* confdefs.h\n\n$as_echo \"/* confdefs.h */\" > confdefs.h\n\n# Predefined preprocessor variables.\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_NAME \"$PACKAGE_NAME\"\n_ACEOF\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"\n_ACEOF\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_VERSION \"$PACKAGE_VERSION\"\n_ACEOF\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_STRING \"$PACKAGE_STRING\"\n_ACEOF\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"\n_ACEOF\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_URL \"$PACKAGE_URL\"\n_ACEOF\n\n\n# Let the site file select an alternate cache file if it wants to.\n# Prefer an explicitly selected file to automatically selected ones.\nac_site_file1=NONE\nac_site_file2=NONE\nif test -n \"$CONFIG_SITE\"; then\n  # We do not want a PATH search for config.site.\n  case $CONFIG_SITE in #((\n    -*)  ac_site_file1=./$CONFIG_SITE;;\n    */*) ac_site_file1=$CONFIG_SITE;;\n    *)   ac_site_file1=./$CONFIG_SITE;;\n  esac\nelif test \"x$prefix\" != xNONE; then\n  ac_site_file1=$prefix/share/config.site\n  ac_site_file2=$prefix/etc/config.site\nelse\n  ac_site_file1=$ac_default_prefix/share/config.site\n  ac_site_file2=$ac_default_prefix/etc/config.site\nfi\nfor ac_site_file in \"$ac_site_file1\" \"$ac_site_file2\"\ndo\n  test \"x$ac_site_file\" = xNONE && continue\n  if test /dev/null != \"$ac_site_file\" && test -r \"$ac_site_file\"; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file\" >&5\n$as_echo \"$as_me: loading site script $ac_site_file\" >&6;}\n    sed 's/^/| /' \"$ac_site_file\" >&5\n    . \"$ac_site_file\" \\\n      || { { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"failed to load site script $ac_site_file\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\n  fi\ndone\n\nif test -r \"$cache_file\"; then\n  # Some versions of bash will fail to source /dev/null (special files\n  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.\n  if test /dev/null != \"$cache_file\" && test -f \"$cache_file\"; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: loading cache $cache_file\" >&5\n$as_echo \"$as_me: loading cache $cache_file\" >&6;}\n    case $cache_file in\n      [\\\\/]* | ?:[\\\\/]* ) . \"$cache_file\";;\n      *)                      . \"./$cache_file\";;\n    esac\n  fi\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: creating cache $cache_file\" >&5\n$as_echo \"$as_me: creating cache $cache_file\" >&6;}\n  >$cache_file\nfi\n\n# Check that the precious variables saved in the cache have kept the same\n# value.\nac_cache_corrupted=false\nfor ac_var in $ac_precious_vars; do\n  eval ac_old_set=\\$ac_cv_env_${ac_var}_set\n  eval ac_new_set=\\$ac_env_${ac_var}_set\n  eval ac_old_val=\\$ac_cv_env_${ac_var}_value\n  eval ac_new_val=\\$ac_env_${ac_var}_value\n  case $ac_old_set,$ac_new_set in\n    set,)\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: error: \\`$ac_var' was set to \\`$ac_old_val' in the previous run\" >&5\n$as_echo \"$as_me: error: \\`$ac_var' was set to \\`$ac_old_val' in the previous run\" >&2;}\n      ac_cache_corrupted=: ;;\n    ,set)\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: error: \\`$ac_var' was not set in the previous run\" >&5\n$as_echo \"$as_me: error: \\`$ac_var' was not set in the previous run\" >&2;}\n      ac_cache_corrupted=: ;;\n    ,);;\n    *)\n      if test \"x$ac_old_val\" != \"x$ac_new_val\"; then\n\t# differences in whitespace do not lead to failure.\n\tac_old_val_w=`echo x $ac_old_val`\n\tac_new_val_w=`echo x $ac_new_val`\n\tif test \"$ac_old_val_w\" != \"$ac_new_val_w\"; then\n\t  { $as_echo \"$as_me:${as_lineno-$LINENO}: error: \\`$ac_var' has changed since the previous run:\" >&5\n$as_echo \"$as_me: error: \\`$ac_var' has changed since the previous run:\" >&2;}\n\t  ac_cache_corrupted=:\n\telse\n\t  { $as_echo \"$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \\`$ac_var' since the previous run:\" >&5\n$as_echo \"$as_me: warning: ignoring whitespace changes in \\`$ac_var' since the previous run:\" >&2;}\n\t  eval $ac_var=\\$ac_old_val\n\tfi\n\t{ $as_echo \"$as_me:${as_lineno-$LINENO}:   former value:  \\`$ac_old_val'\" >&5\n$as_echo \"$as_me:   former value:  \\`$ac_old_val'\" >&2;}\n\t{ $as_echo \"$as_me:${as_lineno-$LINENO}:   current value: \\`$ac_new_val'\" >&5\n$as_echo \"$as_me:   current value: \\`$ac_new_val'\" >&2;}\n      fi;;\n  esac\n  # Pass precious variables to config.status.\n  if test \"$ac_new_set\" = set; then\n    case $ac_new_val in\n    *\\'*) ac_arg=$ac_var=`$as_echo \"$ac_new_val\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    *) ac_arg=$ac_var=$ac_new_val ;;\n    esac\n    case \" $ac_configure_args \" in\n      *\" '$ac_arg' \"*) ;; # Avoid dups.  Use of quotes ensures accuracy.\n      *) as_fn_append ac_configure_args \" '$ac_arg'\" ;;\n    esac\n  fi\ndone\nif $ac_cache_corrupted; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build\" >&5\n$as_echo \"$as_me: error: changes in the environment can compromise the build\" >&2;}\n  as_fn_error $? \"run \\`make distclean' and/or \\`rm $cache_file' and start over\" \"$LINENO\" 5\nfi\n## -------------------- ##\n## Main body of script. ##\n## -------------------- ##\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\n\n# Directory where autotools helper scripts lives.\nac_aux_dir=\nfor ac_dir in . \"$srcdir\"/.; do\n  if test -f \"$ac_dir/install-sh\"; then\n    ac_aux_dir=$ac_dir\n    ac_install_sh=\"$ac_aux_dir/install-sh -c\"\n    break\n  elif test -f \"$ac_dir/install.sh\"; then\n    ac_aux_dir=$ac_dir\n    ac_install_sh=\"$ac_aux_dir/install.sh -c\"\n    break\n  elif test -f \"$ac_dir/shtool\"; then\n    ac_aux_dir=$ac_dir\n    ac_install_sh=\"$ac_aux_dir/shtool install -c\"\n    break\n  fi\ndone\nif test -z \"$ac_aux_dir\"; then\n  as_fn_error $? \"cannot find install-sh, install.sh, or shtool in . \\\"$srcdir\\\"/.\" \"$LINENO\" 5\nfi\n\n# These three variables are undocumented and unsupported,\n# and are intended to be withdrawn in a future Autoconf release.\n# They can cause serious problems if a builder's source tree is in a directory\n# whose full name contains unusual characters.\nac_config_guess=\"$SHELL $ac_aux_dir/config.guess\"  # Please don't use this var.\nac_config_sub=\"$SHELL $ac_aux_dir/config.sub\"  # Please don't use this var.\nac_configure=\"$SHELL $ac_aux_dir/configure\"  # Please don't use this var.\n\n\n\n# Generate configuration neaders.\nac_config_headers=\"$ac_config_headers jconfig.h:jconfig.cfg\"\n\n\n# Hack: disable autoheader so that it doesn't overwrite our cfg template.\nAUTOHEADER=\"echo autoheader ignored\"\n\n# Check system type\n# Make sure we can run config.sub.\n$SHELL \"$ac_aux_dir/config.sub\" sun4 >/dev/null 2>&1 ||\n  as_fn_error $? \"cannot run $SHELL $ac_aux_dir/config.sub\" \"$LINENO\" 5\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking build system type\" >&5\n$as_echo_n \"checking build system type... \" >&6; }\nif ${ac_cv_build+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_build_alias=$build_alias\ntest \"x$ac_build_alias\" = x &&\n  ac_build_alias=`$SHELL \"$ac_aux_dir/config.guess\"`\ntest \"x$ac_build_alias\" = x &&\n  as_fn_error $? \"cannot guess build type; you must specify one\" \"$LINENO\" 5\nac_cv_build=`$SHELL \"$ac_aux_dir/config.sub\" $ac_build_alias` ||\n  as_fn_error $? \"$SHELL $ac_aux_dir/config.sub $ac_build_alias failed\" \"$LINENO\" 5\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_build\" >&5\n$as_echo \"$ac_cv_build\" >&6; }\ncase $ac_cv_build in\n*-*-*) ;;\n*) as_fn_error $? \"invalid value of canonical build\" \"$LINENO\" 5;;\nesac\nbuild=$ac_cv_build\nac_save_IFS=$IFS; IFS='-'\nset x $ac_cv_build\nshift\nbuild_cpu=$1\nbuild_vendor=$2\nshift; shift\n# Remember, the first character of IFS is used to create $*,\n# except with old shells:\nbuild_os=$*\nIFS=$ac_save_IFS\ncase $build_os in *\\ *) build_os=`echo \"$build_os\" | sed 's/ /-/g'`;; esac\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking host system type\" >&5\n$as_echo_n \"checking host system type... \" >&6; }\nif ${ac_cv_host+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test \"x$host_alias\" = x; then\n  ac_cv_host=$ac_cv_build\nelse\n  ac_cv_host=`$SHELL \"$ac_aux_dir/config.sub\" $host_alias` ||\n    as_fn_error $? \"$SHELL $ac_aux_dir/config.sub $host_alias failed\" \"$LINENO\" 5\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_host\" >&5\n$as_echo \"$ac_cv_host\" >&6; }\ncase $ac_cv_host in\n*-*-*) ;;\n*) as_fn_error $? \"invalid value of canonical host\" \"$LINENO\" 5;;\nesac\nhost=$ac_cv_host\nac_save_IFS=$IFS; IFS='-'\nset x $ac_cv_host\nshift\nhost_cpu=$1\nhost_vendor=$2\nshift; shift\n# Remember, the first character of IFS is used to create $*,\n# except with old shells:\nhost_os=$*\nIFS=$ac_save_IFS\ncase $host_os in *\\ *) host_os=`echo \"$host_os\" | sed 's/ /-/g'`;; esac\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking target system type\" >&5\n$as_echo_n \"checking target system type... \" >&6; }\nif ${ac_cv_target+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test \"x$target_alias\" = x; then\n  ac_cv_target=$ac_cv_host\nelse\n  ac_cv_target=`$SHELL \"$ac_aux_dir/config.sub\" $target_alias` ||\n    as_fn_error $? \"$SHELL $ac_aux_dir/config.sub $target_alias failed\" \"$LINENO\" 5\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_target\" >&5\n$as_echo \"$ac_cv_target\" >&6; }\ncase $ac_cv_target in\n*-*-*) ;;\n*) as_fn_error $? \"invalid value of canonical target\" \"$LINENO\" 5;;\nesac\ntarget=$ac_cv_target\nac_save_IFS=$IFS; IFS='-'\nset x $ac_cv_target\nshift\ntarget_cpu=$1\ntarget_vendor=$2\nshift; shift\n# Remember, the first character of IFS is used to create $*,\n# except with old shells:\ntarget_os=$*\nIFS=$ac_save_IFS\ncase $target_os in *\\ *) target_os=`echo \"$target_os\" | sed 's/ /-/g'`;; esac\n\n\n# The aliases save the names the user supplied, while $host etc.\n# will get canonicalized.\ntest -n \"$target_alias\" &&\n  test \"$program_prefix$program_suffix$program_transform_name\" = \\\n    NONENONEs,x,x, &&\n  program_prefix=${target_alias}-\n\n# Initialize Automake\n# Don't require all the GNU mandated files\nam__api_version='1.15'\n\n# Find a good install program.  We prefer a C program (faster),\n# so one script is as good as another.  But avoid the broken or\n# incompatible versions:\n# SysV /etc/install, /usr/sbin/install\n# SunOS /usr/etc/install\n# IRIX /sbin/install\n# AIX /bin/install\n# AmigaOS /C/install, which installs bootblocks on floppy discs\n# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag\n# AFS /usr/afsws/bin/install, which mishandles nonexistent args\n# SVR4 /usr/ucb/install, which tries to use the nonexistent group \"staff\"\n# OS/2's system install, which has a completely different semantic\n# ./install, which can be erroneously created by make from ./install.sh.\n# Reject install programs that cannot install multiple files.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install\" >&5\n$as_echo_n \"checking for a BSD-compatible install... \" >&6; }\nif test -z \"$INSTALL\"; then\nif ${ac_cv_path_install+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    # Account for people who put trailing slashes in PATH elements.\ncase $as_dir/ in #((\n  ./ | .// | /[cC]/* | \\\n  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \\\n  ?:[\\\\/]os2[\\\\/]install[\\\\/]* | ?:[\\\\/]OS2[\\\\/]INSTALL[\\\\/]* | \\\n  /usr/ucb/* ) ;;\n  *)\n    # OSF1 and SCO ODT 3.0 have their own names for install.\n    # Don't use installbsd from OSF since it installs stuff as root\n    # by default.\n    for ac_prog in ginstall scoinst install; do\n      for ac_exec_ext in '' $ac_executable_extensions; do\n\tif as_fn_executable_p \"$as_dir/$ac_prog$ac_exec_ext\"; then\n\t  if test $ac_prog = install &&\n\t    grep dspmsg \"$as_dir/$ac_prog$ac_exec_ext\" >/dev/null 2>&1; then\n\t    # AIX install.  It has an incompatible calling convention.\n\t    :\n\t  elif test $ac_prog = install &&\n\t    grep pwplus \"$as_dir/$ac_prog$ac_exec_ext\" >/dev/null 2>&1; then\n\t    # program-specific install script used by HP pwplus--don't use.\n\t    :\n\t  else\n\t    rm -rf conftest.one conftest.two conftest.dir\n\t    echo one > conftest.one\n\t    echo two > conftest.two\n\t    mkdir conftest.dir\n\t    if \"$as_dir/$ac_prog$ac_exec_ext\" -c conftest.one conftest.two \"`pwd`/conftest.dir\" &&\n\t      test -s conftest.one && test -s conftest.two &&\n\t      test -s conftest.dir/conftest.one &&\n\t      test -s conftest.dir/conftest.two\n\t    then\n\t      ac_cv_path_install=\"$as_dir/$ac_prog$ac_exec_ext -c\"\n\t      break 3\n\t    fi\n\t  fi\n\tfi\n      done\n    done\n    ;;\nesac\n\n  done\nIFS=$as_save_IFS\n\nrm -rf conftest.one conftest.two conftest.dir\n\nfi\n  if test \"${ac_cv_path_install+set}\" = set; then\n    INSTALL=$ac_cv_path_install\n  else\n    # As a last resort, use the slow shell script.  Don't cache a\n    # value for INSTALL within a source directory, because that will\n    # break other packages using the cache if that directory is\n    # removed, or if the value is a relative name.\n    INSTALL=$ac_install_sh\n  fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $INSTALL\" >&5\n$as_echo \"$INSTALL\" >&6; }\n\n# Use test -z because SunOS4 sh mishandles braces in ${var-val}.\n# It thinks the first close brace ends the variable substitution.\ntest -z \"$INSTALL_PROGRAM\" && INSTALL_PROGRAM='${INSTALL}'\n\ntest -z \"$INSTALL_SCRIPT\" && INSTALL_SCRIPT='${INSTALL}'\n\ntest -z \"$INSTALL_DATA\" && INSTALL_DATA='${INSTALL} -m 644'\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether build environment is sane\" >&5\n$as_echo_n \"checking whether build environment is sane... \" >&6; }\n# Reject unsafe characters in $srcdir or the absolute working directory\n# name.  Accept space and tab only in the latter.\nam_lf='\n'\ncase `pwd` in\n  *[\\\\\\\"\\#\\$\\&\\'\\`$am_lf]*)\n    as_fn_error $? \"unsafe absolute working directory name\" \"$LINENO\" 5;;\nesac\ncase $srcdir in\n  *[\\\\\\\"\\#\\$\\&\\'\\`$am_lf\\ \\\t]*)\n    as_fn_error $? \"unsafe srcdir value: '$srcdir'\" \"$LINENO\" 5;;\nesac\n\n# Do 'set' in a subshell so we don't clobber the current shell's\n# arguments.  Must try -L first in case configure is actually a\n# symlink; some systems play weird games with the mod time of symlinks\n# (eg FreeBSD returns the mod time of the symlink's containing\n# directory).\nif (\n   am_has_slept=no\n   for am_try in 1 2; do\n     echo \"timestamp, slept: $am_has_slept\" > conftest.file\n     set X `ls -Lt \"$srcdir/configure\" conftest.file 2> /dev/null`\n     if test \"$*\" = \"X\"; then\n\t# -L didn't work.\n\tset X `ls -t \"$srcdir/configure\" conftest.file`\n     fi\n     if test \"$*\" != \"X $srcdir/configure conftest.file\" \\\n\t&& test \"$*\" != \"X conftest.file $srcdir/configure\"; then\n\n\t# If neither matched, then we have a broken ls.  This can happen\n\t# if, for instance, CONFIG_SHELL is bash and it inherits a\n\t# broken ls alias from the environment.  This has actually\n\t# happened.  Such a system could not be considered \"sane\".\n\tas_fn_error $? \"ls -t appears to fail.  Make sure there is not a broken\n  alias in your environment\" \"$LINENO\" 5\n     fi\n     if test \"$2\" = conftest.file || test $am_try -eq 2; then\n       break\n     fi\n     # Just in case.\n     sleep 1\n     am_has_slept=yes\n   done\n   test \"$2\" = conftest.file\n   )\nthen\n   # Ok.\n   :\nelse\n   as_fn_error $? \"newly created file is older than distributed files!\nCheck your system clock\" \"$LINENO\" 5\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n# If we didn't sleep, we still need to ensure time stamps of config.status and\n# generated files are strictly newer.\nam_sleep_pid=\nif grep 'slept: no' conftest.file >/dev/null 2>&1; then\n  ( sleep 1 ) &\n  am_sleep_pid=$!\nfi\n\nrm -f conftest.file\n\ntest \"$program_prefix\" != NONE &&\n  program_transform_name=\"s&^&$program_prefix&;$program_transform_name\"\n# Use a double $ so make ignores it.\ntest \"$program_suffix\" != NONE &&\n  program_transform_name=\"s&\\$&$program_suffix&;$program_transform_name\"\n# Double any \\ or $.\n# By default was `s,x,x', remove it if useless.\nac_script='s/[\\\\$]/&&/g;s/;s,x,x,$//'\nprogram_transform_name=`$as_echo \"$program_transform_name\" | sed \"$ac_script\"`\n\n# Expand $ac_aux_dir to an absolute path.\nam_aux_dir=`cd \"$ac_aux_dir\" && pwd`\n\nif test x\"${MISSING+set}\" != xset; then\n  case $am_aux_dir in\n  *\\ * | *\\\t*)\n    MISSING=\"\\${SHELL} \\\"$am_aux_dir/missing\\\"\" ;;\n  *)\n    MISSING=\"\\${SHELL} $am_aux_dir/missing\" ;;\n  esac\nfi\n# Use eval to expand $SHELL\nif eval \"$MISSING --is-lightweight\"; then\n  am_missing_run=\"$MISSING \"\nelse\n  am_missing_run=\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing\" >&5\n$as_echo \"$as_me: WARNING: 'missing' script is too old or missing\" >&2;}\nfi\n\nif test x\"${install_sh+set}\" != xset; then\n  case $am_aux_dir in\n  *\\ * | *\\\t*)\n    install_sh=\"\\${SHELL} '$am_aux_dir/install-sh'\" ;;\n  *)\n    install_sh=\"\\${SHELL} $am_aux_dir/install-sh\"\n  esac\nfi\n\n# Installed binaries are usually stripped using 'strip' when the user\n# run \"make install-strip\".  However 'strip' might not be the right\n# tool to use in cross-compilation environments, therefore Automake\n# will honor the 'STRIP' environment variable to overrule this program.\nif test \"$cross_compiling\" != no; then\n  if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}strip\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}strip; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_STRIP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$STRIP\"; then\n  ac_cv_prog_STRIP=\"$STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_STRIP=\"${ac_tool_prefix}strip\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nSTRIP=$ac_cv_prog_STRIP\nif test -n \"$STRIP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $STRIP\" >&5\n$as_echo \"$STRIP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_STRIP\"; then\n  ac_ct_STRIP=$STRIP\n  # Extract the first word of \"strip\", so it can be a program name with args.\nset dummy strip; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_STRIP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_STRIP\"; then\n  ac_cv_prog_ac_ct_STRIP=\"$ac_ct_STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_STRIP=\"strip\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP\nif test -n \"$ac_ct_STRIP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP\" >&5\n$as_echo \"$ac_ct_STRIP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_STRIP\" = x; then\n    STRIP=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    STRIP=$ac_ct_STRIP\n  fi\nelse\n  STRIP=\"$ac_cv_prog_STRIP\"\nfi\n\nfi\nINSTALL_STRIP_PROGRAM=\"\\$(install_sh) -c -s\"\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p\" >&5\n$as_echo_n \"checking for a thread-safe mkdir -p... \" >&6; }\nif test -z \"$MKDIR_P\"; then\n  if ${ac_cv_path_mkdir+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_prog in mkdir gmkdir; do\n\t for ac_exec_ext in '' $ac_executable_extensions; do\n\t   as_fn_executable_p \"$as_dir/$ac_prog$ac_exec_ext\" || continue\n\t   case `\"$as_dir/$ac_prog$ac_exec_ext\" --version 2>&1` in #(\n\t     'mkdir (GNU coreutils) '* | \\\n\t     'mkdir (coreutils) '* | \\\n\t     'mkdir (fileutils) '4.1*)\n\t       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext\n\t       break 3;;\n\t   esac\n\t done\n       done\n  done\nIFS=$as_save_IFS\n\nfi\n\n  test -d ./--version && rmdir ./--version\n  if test \"${ac_cv_path_mkdir+set}\" = set; then\n    MKDIR_P=\"$ac_cv_path_mkdir -p\"\n  else\n    # As a last resort, use the slow shell script.  Don't cache a\n    # value for MKDIR_P within a source directory, because that will\n    # break other packages using the cache if that directory is\n    # removed, or if the value is a relative name.\n    MKDIR_P=\"$ac_install_sh -d\"\n  fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $MKDIR_P\" >&5\n$as_echo \"$MKDIR_P\" >&6; }\n\nfor ac_prog in gawk mawk nawk awk\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_AWK+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$AWK\"; then\n  ac_cv_prog_AWK=\"$AWK\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_AWK=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nAWK=$ac_cv_prog_AWK\nif test -n \"$AWK\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $AWK\" >&5\n$as_echo \"$AWK\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$AWK\" && break\ndone\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \\$(MAKE)\" >&5\n$as_echo_n \"checking whether ${MAKE-make} sets \\$(MAKE)... \" >&6; }\nset x ${MAKE-make}\nac_make=`$as_echo \"$2\" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`\nif eval \\${ac_cv_prog_make_${ac_make}_set+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat >conftest.make <<\\_ACEOF\nSHELL = /bin/sh\nall:\n\t@echo '@@@%%%=$(MAKE)=@@@%%%'\n_ACEOF\n# GNU make sometimes prints \"make[1]: Entering ...\", which would confuse us.\ncase `${MAKE-make} -f conftest.make 2>/dev/null` in\n  *@@@%%%=?*=@@@%%%*)\n    eval ac_cv_prog_make_${ac_make}_set=yes;;\n  *)\n    eval ac_cv_prog_make_${ac_make}_set=no;;\nesac\nrm -f conftest.make\nfi\nif eval test \\$ac_cv_prog_make_${ac_make}_set = yes; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n  SET_MAKE=\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n  SET_MAKE=\"MAKE=${MAKE-make}\"\nfi\n\nrm -rf .tst 2>/dev/null\nmkdir .tst 2>/dev/null\nif test -d .tst; then\n  am__leading_dot=.\nelse\n  am__leading_dot=_\nfi\nrmdir .tst 2>/dev/null\n\n# Check whether --enable-silent-rules was given.\nif test \"${enable_silent_rules+set}\" = set; then :\n  enableval=$enable_silent_rules;\nfi\n\ncase $enable_silent_rules in # (((\n  yes) AM_DEFAULT_VERBOSITY=0;;\n   no) AM_DEFAULT_VERBOSITY=1;;\n    *) AM_DEFAULT_VERBOSITY=1;;\nesac\nam_make=${MAKE-make}\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables\" >&5\n$as_echo_n \"checking whether $am_make supports nested variables... \" >&6; }\nif ${am_cv_make_support_nested_variables+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if $as_echo 'TRUE=$(BAR$(V))\nBAR0=false\nBAR1=true\nV=1\nam__doit:\n\t@$(TRUE)\n.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then\n  am_cv_make_support_nested_variables=yes\nelse\n  am_cv_make_support_nested_variables=no\nfi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables\" >&5\n$as_echo \"$am_cv_make_support_nested_variables\" >&6; }\nif test $am_cv_make_support_nested_variables = yes; then\n    AM_V='$(V)'\n  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'\nelse\n  AM_V=$AM_DEFAULT_VERBOSITY\n  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY\nfi\nAM_BACKSLASH='\\'\n\nif test \"`cd $srcdir && pwd`\" != \"`pwd`\"; then\n  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output\n  # is not polluted with repeated \"-I.\"\n  am__isrc=' -I$(srcdir)'\n  # test to see if srcdir already configured\n  if test -f $srcdir/config.status; then\n    as_fn_error $? \"source directory already configured; run \\\"make distclean\\\" there first\" \"$LINENO\" 5\n  fi\nfi\n\n# test whether we have cygpath\nif test -z \"$CYGPATH_W\"; then\n  if (cygpath --version) >/dev/null 2>/dev/null; then\n    CYGPATH_W='cygpath -w'\n  else\n    CYGPATH_W=echo\n  fi\nfi\n\n\n# Define the identity of the package.\n PACKAGE='libjpeg'\n VERSION='9.1.0'\n\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE \"$PACKAGE\"\n_ACEOF\n\n\ncat >>confdefs.h <<_ACEOF\n#define VERSION \"$VERSION\"\n_ACEOF\n\n# Some tools Automake needs.\n\nACLOCAL=${ACLOCAL-\"${am_missing_run}aclocal-${am__api_version}\"}\n\n\nAUTOCONF=${AUTOCONF-\"${am_missing_run}autoconf\"}\n\n\nAUTOMAKE=${AUTOMAKE-\"${am_missing_run}automake-${am__api_version}\"}\n\n\nAUTOHEADER=${AUTOHEADER-\"${am_missing_run}autoheader\"}\n\n\nMAKEINFO=${MAKEINFO-\"${am_missing_run}makeinfo\"}\n\n# For better backward compatibility.  To be removed once Automake 1.9.x\n# dies out for good.  For more background, see:\n# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>\n# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>\nmkdir_p='$(MKDIR_P)'\n\n# We need awk for the \"check\" target (and possibly the TAP driver).  The\n# system \"awk\" is bad on some platforms.\n# Always define AMTAR for backward compatibility.  Yes, it's still used\n# in the wild :-(  We should find a proper way to deprecate it ...\nAMTAR='$${TAR-tar}'\n\n\n# We'll loop over all known methods to create a tar archive until one works.\n_am_tools='gnutar  pax cpio none'\n\nam__tar='$${TAR-tar} chof - \"$$tardir\"' am__untar='$${TAR-tar} xf -'\n\n\n\n\n\n\n# POSIX will say in a future version that running \"rm -f\" with no argument\n# is OK; and we want to be able to make that assumption in our Makefile\n# recipes.  So use an aggressive probe to check that the usage we want is\n# actually supported \"in the wild\" to an acceptable degree.\n# See automake bug#10828.\n# To make any issue more visible, cause the running configure to be aborted\n# by default if the 'rm' program in use doesn't match our expectations; the\n# user can still override this though.\nif rm -f && rm -fr && rm -rf; then : OK; else\n  cat >&2 <<'END'\nOops!\n\nYour 'rm' program seems unable to run without file operands specified\non the command line, even when the '-f' option is present.  This is contrary\nto the behaviour of most rm programs out there, and not conforming with\nthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>\n\nPlease tell bug-automake@gnu.org about your system, including the value\nof your $PATH and any error possibly output before this message.  This\ncan help us improve future automake versions.\n\nEND\n  if test x\"$ACCEPT_INFERIOR_RM_PROGRAM\" = x\"yes\"; then\n    echo 'Configuration will proceed anyway, since you have set the' >&2\n    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to \"yes\"' >&2\n    echo >&2\n  else\n    cat >&2 <<'END'\nAborting the configuration process, to ensure you take notice of the issue.\n\nYou can download and install GNU coreutils to get an 'rm' implementation\nthat behaves properly: <http://www.gnu.org/software/coreutils/>.\n\nIf you want to complete the configuration process using your problematic\n'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM\nto \"yes\", and re-run configure.\n\nEND\n    as_fn_error $? \"Your 'rm' program is bad, sorry.\" \"$LINENO\" 5\n  fi\nfi\n\n\n# Make --enable-silent-rules the default.\n# To get verbose build output you may configure\n# with --disable-silent-rules or use \"make V=1\".\n# Check whether --enable-silent-rules was given.\nif test \"${enable_silent_rules+set}\" = set; then :\n  enableval=$enable_silent_rules;\nfi\n\ncase $enable_silent_rules in # (((\n  yes) AM_DEFAULT_VERBOSITY=0;;\n   no) AM_DEFAULT_VERBOSITY=1;;\n    *) AM_DEFAULT_VERBOSITY=0;;\nesac\nam_make=${MAKE-make}\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables\" >&5\n$as_echo_n \"checking whether $am_make supports nested variables... \" >&6; }\nif ${am_cv_make_support_nested_variables+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if $as_echo 'TRUE=$(BAR$(V))\nBAR0=false\nBAR1=true\nV=1\nam__doit:\n\t@$(TRUE)\n.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then\n  am_cv_make_support_nested_variables=yes\nelse\n  am_cv_make_support_nested_variables=no\nfi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables\" >&5\n$as_echo \"$am_cv_make_support_nested_variables\" >&6; }\nif test $am_cv_make_support_nested_variables = yes; then\n    AM_V='$(V)'\n  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'\nelse\n  AM_V=$AM_DEFAULT_VERBOSITY\n  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY\nfi\nAM_BACKSLASH='\\'\n\n\n\n\n# Add configure option --enable-maintainer-mode which enables\n# dependency checking and generation useful to package maintainers.\n# This is made an option to avoid confusing end users.\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles\" >&5\n$as_echo_n \"checking whether to enable maintainer-specific portions of Makefiles... \" >&6; }\n    # Check whether --enable-maintainer-mode was given.\nif test \"${enable_maintainer_mode+set}\" = set; then :\n  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval\nelse\n  USE_MAINTAINER_MODE=no\nfi\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE\" >&5\n$as_echo \"$USE_MAINTAINER_MODE\" >&6; }\n   if test $USE_MAINTAINER_MODE = yes; then\n  MAINTAINER_MODE_TRUE=\n  MAINTAINER_MODE_FALSE='#'\nelse\n  MAINTAINER_MODE_TRUE='#'\n  MAINTAINER_MODE_FALSE=\nfi\n\n  MAINT=$MAINTAINER_MODE_TRUE\n\n\n\n# Check for programs\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}gcc\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}gcc; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}gcc\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\n$as_echo \"$CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_CC\"; then\n  ac_ct_CC=$CC\n  # Extract the first word of \"gcc\", so it can be a program name with args.\nset dummy gcc; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"gcc\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC\" >&5\n$as_echo \"$ac_ct_CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_CC\" = x; then\n    CC=\"\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    CC=$ac_ct_CC\n  fi\nelse\n  CC=\"$ac_cv_prog_CC\"\nfi\n\nif test -z \"$CC\"; then\n          if test -n \"$ac_tool_prefix\"; then\n    # Extract the first word of \"${ac_tool_prefix}cc\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}cc; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}cc\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\n$as_echo \"$CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  fi\nfi\nif test -z \"$CC\"; then\n  # Extract the first word of \"cc\", so it can be a program name with args.\nset dummy cc; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\n  ac_prog_rejected=no\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    if test \"$as_dir/$ac_word$ac_exec_ext\" = \"/usr/ucb/cc\"; then\n       ac_prog_rejected=yes\n       continue\n     fi\n    ac_cv_prog_CC=\"cc\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nif test $ac_prog_rejected = yes; then\n  # We found a bogon in the path, so make sure we never use it.\n  set dummy $ac_cv_prog_CC\n  shift\n  if test $# != 0; then\n    # We chose a different compiler from the bogus one.\n    # However, it has the same basename, so the bogon will be chosen\n    # first if we set CC to just the basename; use the full file name.\n    shift\n    ac_cv_prog_CC=\"$as_dir/$ac_word${1+' '}$@\"\n  fi\nfi\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\n$as_echo \"$CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$CC\"; then\n  if test -n \"$ac_tool_prefix\"; then\n  for ac_prog in cl.exe\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"$ac_tool_prefix$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\n$as_echo \"$CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n    test -n \"$CC\" && break\n  done\nfi\nif test -z \"$CC\"; then\n  ac_ct_CC=$CC\n  for ac_prog in cl.exe\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC\" >&5\n$as_echo \"$ac_ct_CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$ac_ct_CC\" && break\ndone\n\n  if test \"x$ac_ct_CC\" = x; then\n    CC=\"\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    CC=$ac_ct_CC\n  fi\nfi\n\nfi\n\n\ntest -z \"$CC\" && { { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"no acceptable C compiler found in \\$PATH\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\n\n# Provide some information about the compiler.\n$as_echo \"$as_me:${as_lineno-$LINENO}: checking for C compiler version\" >&5\nset X $ac_compile\nac_compiler=$2\nfor ac_option in --version -v -V -qversion; do\n  { { ac_try=\"$ac_compiler $ac_option >&5\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compiler $ac_option >&5\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    sed '10a\\\n... rest of stderr output deleted ...\n         10q' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n  fi\n  rm -f conftest.er1 conftest.err\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\ndone\n\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nac_clean_files_save=$ac_clean_files\nac_clean_files=\"$ac_clean_files a.out a.out.dSYM a.exe b.out\"\n# Try to create an executable without -o first, disregard a.out.\n# It will help us diagnose broken compilers, and finding out an intuition\n# of exeext.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the C compiler works\" >&5\n$as_echo_n \"checking whether the C compiler works... \" >&6; }\nac_link_default=`$as_echo \"$ac_link\" | sed 's/ -o *conftest[^ ]*//'`\n\n# The possible output files:\nac_files=\"a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*\"\n\nac_rmfiles=\nfor ac_file in $ac_files\ndo\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;\n    * ) ac_rmfiles=\"$ac_rmfiles $ac_file\";;\n  esac\ndone\nrm -f $ac_rmfiles\n\nif { { ac_try=\"$ac_link_default\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link_default\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then :\n  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.\n# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'\n# in a Makefile.  We should not override ac_cv_exeext if it was cached,\n# so that the user can short-circuit this test for compilers unknown to\n# Autoconf.\nfor ac_file in $ac_files ''\ndo\n  test -f \"$ac_file\" || continue\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )\n\t;;\n    [ab].out )\n\t# We found the default executable, but exeext='' is most\n\t# certainly right.\n\tbreak;;\n    *.* )\n\tif test \"${ac_cv_exeext+set}\" = set && test \"$ac_cv_exeext\" != no;\n\tthen :; else\n\t   ac_cv_exeext=`expr \"$ac_file\" : '[^.]*\\(\\..*\\)'`\n\tfi\n\t# We set ac_cv_exeext here because the later test for it is not\n\t# safe: cross compilers may not add the suffix if given an `-o'\n\t# argument, so we may need to know it at that point already.\n\t# Even if this section looks crufty: it has the advantage of\n\t# actually working.\n\tbreak;;\n    * )\n\tbreak;;\n  esac\ndone\ntest \"$ac_cv_exeext\" = no && ac_cv_exeext=\n\nelse\n  ac_file=''\nfi\nif test -z \"$ac_file\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n$as_echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n{ { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error 77 \"C compiler cannot create executables\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name\" >&5\n$as_echo_n \"checking for C compiler default output file name... \" >&6; }\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_file\" >&5\n$as_echo \"$ac_file\" >&6; }\nac_exeext=$ac_cv_exeext\n\nrm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out\nac_clean_files=$ac_clean_files_save\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for suffix of executables\" >&5\n$as_echo_n \"checking for suffix of executables... \" >&6; }\nif { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then :\n  # If both `conftest.exe' and `conftest' are `present' (well, observable)\n# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will\n# work properly (i.e., refer to `conftest.exe'), while it won't with\n# `rm'.\nfor ac_file in conftest.exe conftest conftest.*; do\n  test -f \"$ac_file\" || continue\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;\n    *.* ) ac_cv_exeext=`expr \"$ac_file\" : '[^.]*\\(\\..*\\)'`\n\t  break;;\n    * ) break;;\n  esac\ndone\nelse\n  { { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"cannot compute suffix of executables: cannot compile and link\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\nfi\nrm -f conftest conftest$ac_cv_exeext\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext\" >&5\n$as_echo \"$ac_cv_exeext\" >&6; }\n\nrm -f conftest.$ac_ext\nEXEEXT=$ac_cv_exeext\nac_exeext=$EXEEXT\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdio.h>\nint\nmain ()\n{\nFILE *f = fopen (\"conftest.out\", \"w\");\n return ferror (f) || fclose (f) != 0;\n\n  ;\n  return 0;\n}\n_ACEOF\nac_clean_files=\"$ac_clean_files conftest.out\"\n# Check that the compiler produces executables we can run.  If not, either\n# the compiler is broken, or we cross compile.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling\" >&5\n$as_echo_n \"checking whether we are cross compiling... \" >&6; }\nif test \"$cross_compiling\" != yes; then\n  { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n  if { ac_try='./conftest$ac_cv_exeext'\n  { { case \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_try\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; }; then\n    cross_compiling=no\n  else\n    if test \"$cross_compiling\" = maybe; then\n\tcross_compiling=yes\n    else\n\t{ { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"cannot run C compiled programs.\nIf you meant to cross compile, use \\`--host'.\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\n    fi\n  fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $cross_compiling\" >&5\n$as_echo \"$cross_compiling\" >&6; }\n\nrm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out\nac_clean_files=$ac_clean_files_save\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for suffix of object files\" >&5\n$as_echo_n \"checking for suffix of object files... \" >&6; }\nif ${ac_cv_objext+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.o conftest.obj\nif { { ac_try=\"$ac_compile\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compile\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then :\n  for ac_file in conftest.o conftest.obj conftest.*; do\n  test -f \"$ac_file\" || continue;\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;\n    *) ac_cv_objext=`expr \"$ac_file\" : '.*\\.\\(.*\\)'`\n       break;;\n  esac\ndone\nelse\n  $as_echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n{ { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"cannot compute suffix of object files: cannot compile\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\nfi\nrm -f conftest.$ac_cv_objext conftest.$ac_ext\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext\" >&5\n$as_echo \"$ac_cv_objext\" >&6; }\nOBJEXT=$ac_cv_objext\nac_objext=$OBJEXT\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler\" >&5\n$as_echo_n \"checking whether we are using the GNU C compiler... \" >&6; }\nif ${ac_cv_c_compiler_gnu+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n#ifndef __GNUC__\n       choke me\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_compiler_gnu=yes\nelse\n  ac_compiler_gnu=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nac_cv_c_compiler_gnu=$ac_compiler_gnu\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu\" >&5\n$as_echo \"$ac_cv_c_compiler_gnu\" >&6; }\nif test $ac_compiler_gnu = yes; then\n  GCC=yes\nelse\n  GCC=\nfi\nac_test_CFLAGS=${CFLAGS+set}\nac_save_CFLAGS=$CFLAGS\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g\" >&5\n$as_echo_n \"checking whether $CC accepts -g... \" >&6; }\nif ${ac_cv_prog_cc_g+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_save_c_werror_flag=$ac_c_werror_flag\n   ac_c_werror_flag=yes\n   ac_cv_prog_cc_g=no\n   CFLAGS=\"-g\"\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_prog_cc_g=yes\nelse\n  CFLAGS=\"\"\n      cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n\nelse\n  ac_c_werror_flag=$ac_save_c_werror_flag\n\t CFLAGS=\"-g\"\n\t cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_prog_cc_g=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n   ac_c_werror_flag=$ac_save_c_werror_flag\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g\" >&5\n$as_echo \"$ac_cv_prog_cc_g\" >&6; }\nif test \"$ac_test_CFLAGS\" = set; then\n  CFLAGS=$ac_save_CFLAGS\nelif test $ac_cv_prog_cc_g = yes; then\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-g -O2\"\n  else\n    CFLAGS=\"-g\"\n  fi\nelse\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-O2\"\n  else\n    CFLAGS=\n  fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89\" >&5\n$as_echo_n \"checking for $CC option to accept ISO C89... \" >&6; }\nif ${ac_cv_prog_cc_c89+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_cv_prog_cc_c89=no\nac_save_CC=$CC\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdarg.h>\n#include <stdio.h>\nstruct stat;\n/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */\nstruct buf { int x; };\nFILE * (*rcsopen) (struct buf *, struct stat *, int);\nstatic char *e (p, i)\n     char **p;\n     int i;\n{\n  return p[i];\n}\nstatic char *f (char * (*g) (char **, int), char **p, ...)\n{\n  char *s;\n  va_list v;\n  va_start (v,p);\n  s = g (p, va_arg (v,int));\n  va_end (v);\n  return s;\n}\n\n/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has\n   function prototypes and stuff, but not '\\xHH' hex character constants.\n   These don't provoke an error unfortunately, instead are silently treated\n   as 'x'.  The following induces an error, until -std is added to get\n   proper ANSI mode.  Curiously '\\x00'!='x' always comes out true, for an\n   array size at least.  It's necessary to write '\\x00'==0 to get something\n   that's true only with -std.  */\nint osf4_cc_array ['\\x00' == 0 ? 1 : -1];\n\n/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters\n   inside strings and character constants.  */\n#define FOO(x) 'x'\nint xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];\n\nint test (int i, double x);\nstruct s1 {int (*f) (int a);};\nstruct s2 {int (*f) (double a);};\nint pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);\nint argc;\nchar **argv;\nint\nmain ()\n{\nreturn f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];\n  ;\n  return 0;\n}\n_ACEOF\nfor ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \\\n\t-Ae \"-Aa -D_HPUX_SOURCE\" \"-Xc -D__EXTENSIONS__\"\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  if ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_prog_cc_c89=$ac_arg\nfi\nrm -f core conftest.err conftest.$ac_objext\n  test \"x$ac_cv_prog_cc_c89\" != \"xno\" && break\ndone\nrm -f conftest.$ac_ext\nCC=$ac_save_CC\n\nfi\n# AC_CACHE_VAL\ncase \"x$ac_cv_prog_cc_c89\" in\n  x)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: none needed\" >&5\n$as_echo \"none needed\" >&6; } ;;\n  xno)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: unsupported\" >&5\n$as_echo \"unsupported\" >&6; } ;;\n  *)\n    CC=\"$CC $ac_cv_prog_cc_c89\"\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89\" >&5\n$as_echo \"$ac_cv_prog_cc_c89\" >&6; } ;;\nesac\nif test \"x$ac_cv_prog_cc_c89\" != xno; then :\n\nfi\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together\" >&5\n$as_echo_n \"checking whether $CC understands -c and -o together... \" >&6; }\nif ${am_cv_prog_cc_c_o+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\n  # Make sure it works both with $CC and with simple cc.\n  # Following AC_PROG_CC_C_O, we do the test twice because some\n  # compilers refuse to overwrite an existing .o file with -o,\n  # though they will create one.\n  am_cv_prog_cc_c_o=yes\n  for am_i in 1 2; do\n    if { echo \"$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext\" >&5\n   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5\n   ac_status=$?\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n   (exit $ac_status); } \\\n         && test -f conftest2.$ac_objext; then\n      : OK\n    else\n      am_cv_prog_cc_c_o=no\n      break\n    fi\n  done\n  rm -f core conftest*\n  unset am_i\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o\" >&5\n$as_echo \"$am_cv_prog_cc_c_o\" >&6; }\nif test \"$am_cv_prog_cc_c_o\" != yes; then\n   # Losing compiler, so override with the script.\n   # FIXME: It is wrong to rewrite CC.\n   # But if we don't then we get into trouble of one sort or another.\n   # A longer-term fix would be to have automake use am__CC in this case,\n   # and then we could set am__CC=\"\\$(top_srcdir)/compile \\$(CC)\"\n   CC=\"$am_aux_dir/compile $CC\"\nfi\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nDEPDIR=\"${am__leading_dot}deps\"\n\nac_config_commands=\"$ac_config_commands depfiles\"\n\n\nam_make=${MAKE-make}\ncat > confinc << 'END'\nam__doit:\n\t@echo this is the am__doit target\n.PHONY: am__doit\nEND\n# If we don't find an include directive, just comment out the code.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make\" >&5\n$as_echo_n \"checking for style of include used by $am_make... \" >&6; }\nam__include=\"#\"\nam__quote=\n_am_result=none\n# First try GNU make style include.\necho \"include confinc\" > confmf\n# Ignore all kinds of additional output from 'make'.\ncase `$am_make -s -f confmf 2> /dev/null` in #(\n*the\\ am__doit\\ target*)\n  am__include=include\n  am__quote=\n  _am_result=GNU\n  ;;\nesac\n# Now try BSD make style include.\nif test \"$am__include\" = \"#\"; then\n   echo '.include \"confinc\"' > confmf\n   case `$am_make -s -f confmf 2> /dev/null` in #(\n   *the\\ am__doit\\ target*)\n     am__include=.include\n     am__quote=\"\\\"\"\n     _am_result=BSD\n     ;;\n   esac\nfi\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $_am_result\" >&5\n$as_echo \"$_am_result\" >&6; }\nrm -f confinc confmf\n\n# Check whether --enable-dependency-tracking was given.\nif test \"${enable_dependency_tracking+set}\" = set; then :\n  enableval=$enable_dependency_tracking;\nfi\n\nif test \"x$enable_dependency_tracking\" != xno; then\n  am_depcomp=\"$ac_aux_dir/depcomp\"\n  AMDEPBACKSLASH='\\'\n  am__nodep='_no'\nfi\n if test \"x$enable_dependency_tracking\" != xno; then\n  AMDEP_TRUE=\n  AMDEP_FALSE='#'\nelse\n  AMDEP_TRUE='#'\n  AMDEP_FALSE=\nfi\n\n\n\ndepcc=\"$CC\"   am_compiler_list=\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc\" >&5\n$as_echo_n \"checking dependency style of $depcc... \" >&6; }\nif ${am_cv_CC_dependencies_compiler_type+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -z \"$AMDEP_TRUE\" && test -f \"$am_depcomp\"; then\n  # We make a subdir and do the tests there.  Otherwise we can end up\n  # making bogus files that we don't know about and never remove.  For\n  # instance it was reported that on HP-UX the gcc test will end up\n  # making a dummy file named 'D' -- because '-MD' means \"put the output\n  # in D\".\n  rm -rf conftest.dir\n  mkdir conftest.dir\n  # Copy depcomp to subdir because otherwise we won't find it if we're\n  # using a relative directory.\n  cp \"$am_depcomp\" conftest.dir\n  cd conftest.dir\n  # We will build objects and dependencies in a subdirectory because\n  # it helps to detect inapplicable dependency modes.  For instance\n  # both Tru64's cc and ICC support -MD to output dependencies as a\n  # side effect of compilation, but ICC will put the dependencies in\n  # the current directory while Tru64 will put them in the object\n  # directory.\n  mkdir sub\n\n  am_cv_CC_dependencies_compiler_type=none\n  if test \"$am_compiler_list\" = \"\"; then\n     am_compiler_list=`sed -n 's/^#*\\([a-zA-Z0-9]*\\))$/\\1/p' < ./depcomp`\n  fi\n  am__universal=false\n  case \" $depcc \" in #(\n     *\\ -arch\\ *\\ -arch\\ *) am__universal=true ;;\n     esac\n\n  for depmode in $am_compiler_list; do\n    # Setup a source with many dependencies, because some compilers\n    # like to wrap large dependency lists on column 80 (with \\), and\n    # we should not choose a depcomp mode which is confused by this.\n    #\n    # We need to recreate these files for each test, as the compiler may\n    # overwrite some of them when testing with obscure command lines.\n    # This happens at least with the AIX C compiler.\n    : > sub/conftest.c\n    for i in 1 2 3 4 5 6; do\n      echo '#include \"conftst'$i'.h\"' >> sub/conftest.c\n      # Using \": > sub/conftst$i.h\" creates only sub/conftst1.h with\n      # Solaris 10 /bin/sh.\n      echo '/* dummy */' > sub/conftst$i.h\n    done\n    echo \"${am__include} ${am__quote}sub/conftest.Po${am__quote}\" > confmf\n\n    # We check with '-c' and '-o' for the sake of the \"dashmstdout\"\n    # mode.  It turns out that the SunPro C++ compiler does not properly\n    # handle '-M -o', and we need to detect this.  Also, some Intel\n    # versions had trouble with output in subdirs.\n    am__obj=sub/conftest.${OBJEXT-o}\n    am__minus_obj=\"-o $am__obj\"\n    case $depmode in\n    gcc)\n      # This depmode causes a compiler race in universal mode.\n      test \"$am__universal\" = false || continue\n      ;;\n    nosideeffect)\n      # After this tag, mechanisms are not by side-effect, so they'll\n      # only be used when explicitly requested.\n      if test \"x$enable_dependency_tracking\" = xyes; then\n\tcontinue\n      else\n\tbreak\n      fi\n      ;;\n    msvc7 | msvc7msys | msvisualcpp | msvcmsys)\n      # This compiler won't grok '-c -o', but also, the minuso test has\n      # not run yet.  These depmodes are late enough in the game, and\n      # so weak that their functioning should not be impacted.\n      am__obj=conftest.${OBJEXT-o}\n      am__minus_obj=\n      ;;\n    none) break ;;\n    esac\n    if depmode=$depmode \\\n       source=sub/conftest.c object=$am__obj \\\n       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \\\n       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \\\n         >/dev/null 2>conftest.err &&\n       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&\n       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then\n      # icc doesn't choke on unknown options, it will just issue warnings\n      # or remarks (even with -Werror).  So we grep stderr for any message\n      # that says an option was ignored or not supported.\n      # When given -MP, icc 7.0 and 7.1 complain thusly:\n      #   icc: Command line warning: ignoring option '-M'; no argument required\n      # The diagnosis changed in icc 8.0:\n      #   icc: Command line remark: option '-MP' not supported\n      if (grep 'ignoring option' conftest.err ||\n          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else\n        am_cv_CC_dependencies_compiler_type=$depmode\n        break\n      fi\n    fi\n  done\n\n  cd ..\n  rm -rf conftest.dir\nelse\n  am_cv_CC_dependencies_compiler_type=none\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type\" >&5\n$as_echo \"$am_cv_CC_dependencies_compiler_type\" >&6; }\nCCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type\n\n if\n  test \"x$enable_dependency_tracking\" != xno \\\n  && test \"$am_cv_CC_dependencies_compiler_type\" = gcc3; then\n  am__fastdepCC_TRUE=\n  am__fastdepCC_FALSE='#'\nelse\n  am__fastdepCC_TRUE='#'\n  am__fastdepCC_FALSE=\nfi\n\n\n   case $ac_cv_prog_cc_stdc in #(\n  no) :\n    ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #(\n  *) :\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99\" >&5\n$as_echo_n \"checking for $CC option to accept ISO C99... \" >&6; }\nif ${ac_cv_prog_cc_c99+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_cv_prog_cc_c99=no\nac_save_CC=$CC\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdarg.h>\n#include <stdbool.h>\n#include <stdlib.h>\n#include <wchar.h>\n#include <stdio.h>\n\n// Check varargs macros.  These examples are taken from C99 6.10.3.5.\n#define debug(...) fprintf (stderr, __VA_ARGS__)\n#define showlist(...) puts (#__VA_ARGS__)\n#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))\nstatic void\ntest_varargs_macros (void)\n{\n  int x = 1234;\n  int y = 5678;\n  debug (\"Flag\");\n  debug (\"X = %d\\n\", x);\n  showlist (The first, second, and third items.);\n  report (x>y, \"x is %d but y is %d\", x, y);\n}\n\n// Check long long types.\n#define BIG64 18446744073709551615ull\n#define BIG32 4294967295ul\n#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)\n#if !BIG_OK\n  your preprocessor is broken;\n#endif\n#if BIG_OK\n#else\n  your preprocessor is broken;\n#endif\nstatic long long int bignum = -9223372036854775807LL;\nstatic unsigned long long int ubignum = BIG64;\n\nstruct incomplete_array\n{\n  int datasize;\n  double data[];\n};\n\nstruct named_init {\n  int number;\n  const wchar_t *name;\n  double average;\n};\n\ntypedef const char *ccp;\n\nstatic inline int\ntest_restrict (ccp restrict text)\n{\n  // See if C++-style comments work.\n  // Iterate through items via the restricted pointer.\n  // Also check for declarations in for loops.\n  for (unsigned int i = 0; *(text+i) != '\\0'; ++i)\n    continue;\n  return 0;\n}\n\n// Check varargs and va_copy.\nstatic void\ntest_varargs (const char *format, ...)\n{\n  va_list args;\n  va_start (args, format);\n  va_list args_copy;\n  va_copy (args_copy, args);\n\n  const char *str;\n  int number;\n  float fnumber;\n\n  while (*format)\n    {\n      switch (*format++)\n\t{\n\tcase 's': // string\n\t  str = va_arg (args_copy, const char *);\n\t  break;\n\tcase 'd': // int\n\t  number = va_arg (args_copy, int);\n\t  break;\n\tcase 'f': // float\n\t  fnumber = va_arg (args_copy, double);\n\t  break;\n\tdefault:\n\t  break;\n\t}\n    }\n  va_end (args_copy);\n  va_end (args);\n}\n\nint\nmain ()\n{\n\n  // Check bool.\n  _Bool success = false;\n\n  // Check restrict.\n  if (test_restrict (\"String literal\") == 0)\n    success = true;\n  char *restrict newvar = \"Another string\";\n\n  // Check varargs.\n  test_varargs (\"s, d' f .\", \"string\", 65, 34.234);\n  test_varargs_macros ();\n\n  // Check flexible array members.\n  struct incomplete_array *ia =\n    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));\n  ia->datasize = 10;\n  for (int i = 0; i < ia->datasize; ++i)\n    ia->data[i] = i * 1.234;\n\n  // Check named initializers.\n  struct named_init ni = {\n    .number = 34,\n    .name = L\"Test wide string\",\n    .average = 543.34343,\n  };\n\n  ni.number = 58;\n\n  int dynamic_array[ni.number];\n  dynamic_array[ni.number - 1] = 543;\n\n  // work around unused variable warnings\n  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'\n\t  || dynamic_array[ni.number - 1] != 543);\n\n  ;\n  return 0;\n}\n_ACEOF\nfor ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  if ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_prog_cc_c99=$ac_arg\nfi\nrm -f core conftest.err conftest.$ac_objext\n  test \"x$ac_cv_prog_cc_c99\" != \"xno\" && break\ndone\nrm -f conftest.$ac_ext\nCC=$ac_save_CC\n\nfi\n# AC_CACHE_VAL\ncase \"x$ac_cv_prog_cc_c99\" in\n  x)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: none needed\" >&5\n$as_echo \"none needed\" >&6; } ;;\n  xno)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: unsupported\" >&5\n$as_echo \"unsupported\" >&6; } ;;\n  *)\n    CC=\"$CC $ac_cv_prog_cc_c99\"\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99\" >&5\n$as_echo \"$ac_cv_prog_cc_c99\" >&6; } ;;\nesac\nif test \"x$ac_cv_prog_cc_c99\" != xno; then :\n  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89\" >&5\n$as_echo_n \"checking for $CC option to accept ISO C89... \" >&6; }\nif ${ac_cv_prog_cc_c89+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_cv_prog_cc_c89=no\nac_save_CC=$CC\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdarg.h>\n#include <stdio.h>\nstruct stat;\n/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */\nstruct buf { int x; };\nFILE * (*rcsopen) (struct buf *, struct stat *, int);\nstatic char *e (p, i)\n     char **p;\n     int i;\n{\n  return p[i];\n}\nstatic char *f (char * (*g) (char **, int), char **p, ...)\n{\n  char *s;\n  va_list v;\n  va_start (v,p);\n  s = g (p, va_arg (v,int));\n  va_end (v);\n  return s;\n}\n\n/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has\n   function prototypes and stuff, but not '\\xHH' hex character constants.\n   These don't provoke an error unfortunately, instead are silently treated\n   as 'x'.  The following induces an error, until -std is added to get\n   proper ANSI mode.  Curiously '\\x00'!='x' always comes out true, for an\n   array size at least.  It's necessary to write '\\x00'==0 to get something\n   that's true only with -std.  */\nint osf4_cc_array ['\\x00' == 0 ? 1 : -1];\n\n/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters\n   inside strings and character constants.  */\n#define FOO(x) 'x'\nint xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];\n\nint test (int i, double x);\nstruct s1 {int (*f) (int a);};\nstruct s2 {int (*f) (double a);};\nint pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);\nint argc;\nchar **argv;\nint\nmain ()\n{\nreturn f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];\n  ;\n  return 0;\n}\n_ACEOF\nfor ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \\\n\t-Ae \"-Aa -D_HPUX_SOURCE\" \"-Xc -D__EXTENSIONS__\"\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  if ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_prog_cc_c89=$ac_arg\nfi\nrm -f core conftest.err conftest.$ac_objext\n  test \"x$ac_cv_prog_cc_c89\" != \"xno\" && break\ndone\nrm -f conftest.$ac_ext\nCC=$ac_save_CC\n\nfi\n# AC_CACHE_VAL\ncase \"x$ac_cv_prog_cc_c89\" in\n  x)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: none needed\" >&5\n$as_echo \"none needed\" >&6; } ;;\n  xno)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: unsupported\" >&5\n$as_echo \"unsupported\" >&6; } ;;\n  *)\n    CC=\"$CC $ac_cv_prog_cc_c89\"\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89\" >&5\n$as_echo \"$ac_cv_prog_cc_c89\" >&6; } ;;\nesac\nif test \"x$ac_cv_prog_cc_c89\" != xno; then :\n  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89\nelse\n  ac_cv_prog_cc_stdc=no\nfi\n\nfi\n ;;\nesac\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C\" >&5\n$as_echo_n \"checking for $CC option to accept ISO Standard C... \" >&6; }\n  if ${ac_cv_prog_cc_stdc+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nfi\n\n  case $ac_cv_prog_cc_stdc in #(\n  no) :\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: unsupported\" >&5\n$as_echo \"unsupported\" >&6; } ;; #(\n  '') :\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: none needed\" >&5\n$as_echo \"none needed\" >&6; } ;; #(\n  *) :\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc\" >&5\n$as_echo \"$ac_cv_prog_cc_stdc\" >&6; } ;;\nesac\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor\" >&5\n$as_echo_n \"checking how to run the C preprocessor... \" >&6; }\n# On Suns, sometimes $CPP names a directory.\nif test -n \"$CPP\" && test -d \"$CPP\"; then\n  CPP=\nfi\nif test -z \"$CPP\"; then\n  if ${ac_cv_prog_CPP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n      # Double quotes because CPP needs to be expanded\n    for CPP in \"$CC -E\" \"$CC -E -traditional-cpp\" \"/lib/cpp\"\n    do\n      ac_preproc_ok=false\nfor ac_c_preproc_warn_flag in '' yes\ndo\n  # Use a header file that comes with gcc, so configuring glibc\n  # with a fresh cross-compiler works.\n  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n  # <limits.h> exists even on freestanding compilers.\n  # On the NeXT, cc -E runs the code through the compiler's parser,\n  # not just through cpp. \"Syntax error\" is here to catch this case.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\t\t     Syntax error\n_ACEOF\nif ac_fn_c_try_cpp \"$LINENO\"; then :\n\nelse\n  # Broken: fails on valid input.\ncontinue\nfi\nrm -f conftest.err conftest.i conftest.$ac_ext\n\n  # OK, works on sane cases.  Now check whether nonexistent headers\n  # can be detected and how.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <ac_nonexistent.h>\n_ACEOF\nif ac_fn_c_try_cpp \"$LINENO\"; then :\n  # Broken: success on invalid input.\ncontinue\nelse\n  # Passes both tests.\nac_preproc_ok=:\nbreak\nfi\nrm -f conftest.err conftest.i conftest.$ac_ext\n\ndone\n# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.\nrm -f conftest.i conftest.err conftest.$ac_ext\nif $ac_preproc_ok; then :\n  break\nfi\n\n    done\n    ac_cv_prog_CPP=$CPP\n\nfi\n  CPP=$ac_cv_prog_CPP\nelse\n  ac_cv_prog_CPP=$CPP\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CPP\" >&5\n$as_echo \"$CPP\" >&6; }\nac_preproc_ok=false\nfor ac_c_preproc_warn_flag in '' yes\ndo\n  # Use a header file that comes with gcc, so configuring glibc\n  # with a fresh cross-compiler works.\n  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n  # <limits.h> exists even on freestanding compilers.\n  # On the NeXT, cc -E runs the code through the compiler's parser,\n  # not just through cpp. \"Syntax error\" is here to catch this case.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\t\t     Syntax error\n_ACEOF\nif ac_fn_c_try_cpp \"$LINENO\"; then :\n\nelse\n  # Broken: fails on valid input.\ncontinue\nfi\nrm -f conftest.err conftest.i conftest.$ac_ext\n\n  # OK, works on sane cases.  Now check whether nonexistent headers\n  # can be detected and how.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <ac_nonexistent.h>\n_ACEOF\nif ac_fn_c_try_cpp \"$LINENO\"; then :\n  # Broken: success on invalid input.\ncontinue\nelse\n  # Passes both tests.\nac_preproc_ok=:\nbreak\nfi\nrm -f conftest.err conftest.i conftest.$ac_ext\n\ndone\n# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.\nrm -f conftest.i conftest.err conftest.$ac_ext\nif $ac_preproc_ok; then :\n\nelse\n  { { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"C preprocessor \\\"$CPP\\\" fails sanity check\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\nfi\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \\$(MAKE)\" >&5\n$as_echo_n \"checking whether ${MAKE-make} sets \\$(MAKE)... \" >&6; }\nset x ${MAKE-make}\nac_make=`$as_echo \"$2\" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`\nif eval \\${ac_cv_prog_make_${ac_make}_set+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat >conftest.make <<\\_ACEOF\nSHELL = /bin/sh\nall:\n\t@echo '@@@%%%=$(MAKE)=@@@%%%'\n_ACEOF\n# GNU make sometimes prints \"make[1]: Entering ...\", which would confuse us.\ncase `${MAKE-make} -f conftest.make 2>/dev/null` in\n  *@@@%%%=?*=@@@%%%*)\n    eval ac_cv_prog_make_${ac_make}_set=yes;;\n  *)\n    eval ac_cv_prog_make_${ac_make}_set=no;;\nesac\nrm -f conftest.make\nfi\nif eval test \\$ac_cv_prog_make_${ac_make}_set = yes; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n  SET_MAKE=\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n  SET_MAKE=\"MAKE=${MAKE-make}\"\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether ln -s works\" >&5\n$as_echo_n \"checking whether ln -s works... \" >&6; }\nLN_S=$as_ln_s\nif test \"$LN_S\" = \"ln -s\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no, using $LN_S\" >&5\n$as_echo \"no, using $LN_S\" >&6; }\nfi\n\n\nif test -n \"$ac_tool_prefix\"; then\n  for ac_prog in ar lib \"link -lib\"\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_AR+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$AR\"; then\n  ac_cv_prog_AR=\"$AR\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_AR=\"$ac_tool_prefix$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nAR=$ac_cv_prog_AR\nif test -n \"$AR\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $AR\" >&5\n$as_echo \"$AR\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n    test -n \"$AR\" && break\n  done\nfi\nif test -z \"$AR\"; then\n  ac_ct_AR=$AR\n  for ac_prog in ar lib \"link -lib\"\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_AR+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_AR\"; then\n  ac_cv_prog_ac_ct_AR=\"$ac_ct_AR\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_AR=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_AR=$ac_cv_prog_ac_ct_AR\nif test -n \"$ac_ct_AR\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR\" >&5\n$as_echo \"$ac_ct_AR\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$ac_ct_AR\" && break\ndone\n\n  if test \"x$ac_ct_AR\" = x; then\n    AR=\"false\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    AR=$ac_ct_AR\n  fi\nfi\n\n: ${AR=ar}\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface\" >&5\n$as_echo_n \"checking the archiver ($AR) interface... \" >&6; }\nif ${am_cv_ar_interface+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n   am_cv_ar_interface=ar\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\nint some_variable = 0;\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'\n      { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$am_ar_try\\\"\"; } >&5\n  (eval $am_ar_try) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n      if test \"$ac_status\" -eq 0; then\n        am_cv_ar_interface=ar\n      else\n        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'\n        { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$am_ar_try\\\"\"; } >&5\n  (eval $am_ar_try) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n        if test \"$ac_status\" -eq 0; then\n          am_cv_ar_interface=lib\n        else\n          am_cv_ar_interface=unknown\n        fi\n      fi\n      rm -f conftest.lib libconftest.a\n\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n   ac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface\" >&5\n$as_echo \"$am_cv_ar_interface\" >&6; }\n\ncase $am_cv_ar_interface in\nar)\n  ;;\nlib)\n  # Microsoft lib, so override with the ar-lib wrapper script.\n  # FIXME: It is wrong to rewrite AR.\n  # But if we don't then we get into trouble of one sort or another.\n  # A longer-term fix would be to have automake use am__AR in this case,\n  # and then we could set am__AR=\"$am_aux_dir/ar-lib \\$(AR)\" or something\n  # similar.\n  AR=\"$am_aux_dir/ar-lib $AR\"\n  ;;\nunknown)\n  as_fn_error $? \"could not determine $AR interface\" \"$LINENO\" 5\n  ;;\nesac\n\n# By default we simply use the C compiler to build assembly code.\n\ntest \"${CCAS+set}\" = set || CCAS=$CC\ntest \"${CCASFLAGS+set}\" = set || CCASFLAGS=$CFLAGS\n\n\n\ndepcc=\"$CCAS\"   am_compiler_list=\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc\" >&5\n$as_echo_n \"checking dependency style of $depcc... \" >&6; }\nif ${am_cv_CCAS_dependencies_compiler_type+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -z \"$AMDEP_TRUE\" && test -f \"$am_depcomp\"; then\n  # We make a subdir and do the tests there.  Otherwise we can end up\n  # making bogus files that we don't know about and never remove.  For\n  # instance it was reported that on HP-UX the gcc test will end up\n  # making a dummy file named 'D' -- because '-MD' means \"put the output\n  # in D\".\n  rm -rf conftest.dir\n  mkdir conftest.dir\n  # Copy depcomp to subdir because otherwise we won't find it if we're\n  # using a relative directory.\n  cp \"$am_depcomp\" conftest.dir\n  cd conftest.dir\n  # We will build objects and dependencies in a subdirectory because\n  # it helps to detect inapplicable dependency modes.  For instance\n  # both Tru64's cc and ICC support -MD to output dependencies as a\n  # side effect of compilation, but ICC will put the dependencies in\n  # the current directory while Tru64 will put them in the object\n  # directory.\n  mkdir sub\n\n  am_cv_CCAS_dependencies_compiler_type=none\n  if test \"$am_compiler_list\" = \"\"; then\n     am_compiler_list=`sed -n 's/^#*\\([a-zA-Z0-9]*\\))$/\\1/p' < ./depcomp`\n  fi\n  am__universal=false\n\n\n  for depmode in $am_compiler_list; do\n    # Setup a source with many dependencies, because some compilers\n    # like to wrap large dependency lists on column 80 (with \\), and\n    # we should not choose a depcomp mode which is confused by this.\n    #\n    # We need to recreate these files for each test, as the compiler may\n    # overwrite some of them when testing with obscure command lines.\n    # This happens at least with the AIX C compiler.\n    : > sub/conftest.c\n    for i in 1 2 3 4 5 6; do\n      echo '#include \"conftst'$i'.h\"' >> sub/conftest.c\n      # Using \": > sub/conftst$i.h\" creates only sub/conftst1.h with\n      # Solaris 10 /bin/sh.\n      echo '/* dummy */' > sub/conftst$i.h\n    done\n    echo \"${am__include} ${am__quote}sub/conftest.Po${am__quote}\" > confmf\n\n    # We check with '-c' and '-o' for the sake of the \"dashmstdout\"\n    # mode.  It turns out that the SunPro C++ compiler does not properly\n    # handle '-M -o', and we need to detect this.  Also, some Intel\n    # versions had trouble with output in subdirs.\n    am__obj=sub/conftest.${OBJEXT-o}\n    am__minus_obj=\"-o $am__obj\"\n    case $depmode in\n    gcc)\n      # This depmode causes a compiler race in universal mode.\n      test \"$am__universal\" = false || continue\n      ;;\n    nosideeffect)\n      # After this tag, mechanisms are not by side-effect, so they'll\n      # only be used when explicitly requested.\n      if test \"x$enable_dependency_tracking\" = xyes; then\n\tcontinue\n      else\n\tbreak\n      fi\n      ;;\n    msvc7 | msvc7msys | msvisualcpp | msvcmsys)\n      # This compiler won't grok '-c -o', but also, the minuso test has\n      # not run yet.  These depmodes are late enough in the game, and\n      # so weak that their functioning should not be impacted.\n      am__obj=conftest.${OBJEXT-o}\n      am__minus_obj=\n      ;;\n    none) break ;;\n    esac\n    if depmode=$depmode \\\n       source=sub/conftest.c object=$am__obj \\\n       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \\\n       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \\\n         >/dev/null 2>conftest.err &&\n       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&\n       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then\n      # icc doesn't choke on unknown options, it will just issue warnings\n      # or remarks (even with -Werror).  So we grep stderr for any message\n      # that says an option was ignored or not supported.\n      # When given -MP, icc 7.0 and 7.1 complain thusly:\n      #   icc: Command line warning: ignoring option '-M'; no argument required\n      # The diagnosis changed in icc 8.0:\n      #   icc: Command line remark: option '-MP' not supported\n      if (grep 'ignoring option' conftest.err ||\n          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else\n        am_cv_CCAS_dependencies_compiler_type=$depmode\n        break\n      fi\n    fi\n  done\n\n  cd ..\n  rm -rf conftest.dir\nelse\n  am_cv_CCAS_dependencies_compiler_type=none\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type\" >&5\n$as_echo \"$am_cv_CCAS_dependencies_compiler_type\" >&6; }\nCCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type\n\n if\n  test \"x$enable_dependency_tracking\" != xno \\\n  && test \"$am_cv_CCAS_dependencies_compiler_type\" = gcc3; then\n  am__fastdepCCAS_TRUE=\n  am__fastdepCCAS_FALSE='#'\nelse\n  am__fastdepCCAS_TRUE='#'\n  am__fastdepCCAS_FALSE=\nfi\n\n\n\n# Check if LD supports linker scripts,\n# and define automake conditional HAVE_LD_VERSION_SCRIPT if so.\n# Check whether --enable-ld-version-script was given.\nif test \"${enable_ld_version_script+set}\" = set; then :\n  enableval=$enable_ld_version_script; have_ld_version_script=$enableval\nfi\n\nif test -z \"$have_ld_version_script\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if LD -Wl,--version-script works\" >&5\n$as_echo_n \"checking if LD -Wl,--version-script works... \" >&6; }\n  save_LDFLAGS=\"$LDFLAGS\"\n  LDFLAGS=\"$LDFLAGS -Wl,--version-script=conftest.map\"\n  cat > conftest.map <<EOF\nVERS_1 {\n        global: sym;\n};\n\nVERS_2 {\n        global: sym;\n} VERS_1;\nEOF\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  have_ld_version_script=yes\nelse\n  have_ld_version_script=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n  rm -f conftest.map\n  LDFLAGS=\"$save_LDFLAGS\"\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $have_ld_version_script\" >&5\n$as_echo \"$have_ld_version_script\" >&6; }\nfi\n if test \"$have_ld_version_script\" = \"yes\"; then\n  HAVE_LD_VERSION_SCRIPT_TRUE=\n  HAVE_LD_VERSION_SCRIPT_FALSE='#'\nelse\n  HAVE_LD_VERSION_SCRIPT_TRUE='#'\n  HAVE_LD_VERSION_SCRIPT_FALSE=\nfi\n\n\n# See if compiler supports prototypes.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for function prototypes\" >&5\n$as_echo_n \"checking for function prototypes... \" >&6; }\nif ${ijg_cv_have_prototypes+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint testfunction (int arg1, int * arg2); /* check prototypes */\nstruct methods_struct {\t\t/* check method-pointer declarations */\n  int (*error_exit) (char *msgtext);\n  int (*trace_message) (char *msgtext);\n  int (*another_method) (void);\n};\nint testfunction (int arg1, int * arg2) /* check definitions */\n{ return arg2[arg1]; }\nint test2function (void)\t/* check void arg list */\n{ return 0; }\n\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ijg_cv_have_prototypes=yes\nelse\n  ijg_cv_have_prototypes=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ijg_cv_have_prototypes\" >&5\n$as_echo \"$ijg_cv_have_prototypes\" >&6; }\nif test $ijg_cv_have_prototypes = yes; then\n\n$as_echo \"#define HAVE_PROTOTYPES 1\" >>confdefs.h\n\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: Your compiler does not seem to know about function prototypes.\n    Perhaps it needs a special switch to enable ANSI C mode.\n    If so, we recommend running configure like this:\n       ./configure  CC='cc -switch'\n    where -switch is the proper switch.\" >&5\n$as_echo \"$as_me: WARNING: Your compiler does not seem to know about function prototypes.\n    Perhaps it needs a special switch to enable ANSI C mode.\n    If so, we recommend running configure like this:\n       ./configure  CC='cc -switch'\n    where -switch is the proper switch.\" >&2;}\nfi\n\n# Check header files\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e\" >&5\n$as_echo_n \"checking for grep that handles long lines and -e... \" >&6; }\nif ${ac_cv_path_GREP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -z \"$GREP\"; then\n  ac_path_GREP_found=false\n  # Loop through the user's path and test for each of PROGNAME-LIST\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_prog in grep ggrep; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      ac_path_GREP=\"$as_dir/$ac_prog$ac_exec_ext\"\n      as_fn_executable_p \"$ac_path_GREP\" || continue\n# Check for GNU ac_path_GREP and select it if it is found.\n  # Check for GNU $ac_path_GREP\ncase `\"$ac_path_GREP\" --version 2>&1` in\n*GNU*)\n  ac_cv_path_GREP=\"$ac_path_GREP\" ac_path_GREP_found=:;;\n*)\n  ac_count=0\n  $as_echo_n 0123456789 >\"conftest.in\"\n  while :\n  do\n    cat \"conftest.in\" \"conftest.in\" >\"conftest.tmp\"\n    mv \"conftest.tmp\" \"conftest.in\"\n    cp \"conftest.in\" \"conftest.nl\"\n    $as_echo 'GREP' >> \"conftest.nl\"\n    \"$ac_path_GREP\" -e 'GREP$' -e '-(cannot match)-' < \"conftest.nl\" >\"conftest.out\" 2>/dev/null || break\n    diff \"conftest.out\" \"conftest.nl\" >/dev/null 2>&1 || break\n    as_fn_arith $ac_count + 1 && ac_count=$as_val\n    if test $ac_count -gt ${ac_path_GREP_max-0}; then\n      # Best one so far, save it but keep looking for a better one\n      ac_cv_path_GREP=\"$ac_path_GREP\"\n      ac_path_GREP_max=$ac_count\n    fi\n    # 10*(2^10) chars as input seems more than enough\n    test $ac_count -gt 10 && break\n  done\n  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;\nesac\n\n      $ac_path_GREP_found && break 3\n    done\n  done\n  done\nIFS=$as_save_IFS\n  if test -z \"$ac_cv_path_GREP\"; then\n    as_fn_error $? \"no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin\" \"$LINENO\" 5\n  fi\nelse\n  ac_cv_path_GREP=$GREP\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP\" >&5\n$as_echo \"$ac_cv_path_GREP\" >&6; }\n GREP=\"$ac_cv_path_GREP\"\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for egrep\" >&5\n$as_echo_n \"checking for egrep... \" >&6; }\nif ${ac_cv_path_EGREP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1\n   then ac_cv_path_EGREP=\"$GREP -E\"\n   else\n     if test -z \"$EGREP\"; then\n  ac_path_EGREP_found=false\n  # Loop through the user's path and test for each of PROGNAME-LIST\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_prog in egrep; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      ac_path_EGREP=\"$as_dir/$ac_prog$ac_exec_ext\"\n      as_fn_executable_p \"$ac_path_EGREP\" || continue\n# Check for GNU ac_path_EGREP and select it if it is found.\n  # Check for GNU $ac_path_EGREP\ncase `\"$ac_path_EGREP\" --version 2>&1` in\n*GNU*)\n  ac_cv_path_EGREP=\"$ac_path_EGREP\" ac_path_EGREP_found=:;;\n*)\n  ac_count=0\n  $as_echo_n 0123456789 >\"conftest.in\"\n  while :\n  do\n    cat \"conftest.in\" \"conftest.in\" >\"conftest.tmp\"\n    mv \"conftest.tmp\" \"conftest.in\"\n    cp \"conftest.in\" \"conftest.nl\"\n    $as_echo 'EGREP' >> \"conftest.nl\"\n    \"$ac_path_EGREP\" 'EGREP$' < \"conftest.nl\" >\"conftest.out\" 2>/dev/null || break\n    diff \"conftest.out\" \"conftest.nl\" >/dev/null 2>&1 || break\n    as_fn_arith $ac_count + 1 && ac_count=$as_val\n    if test $ac_count -gt ${ac_path_EGREP_max-0}; then\n      # Best one so far, save it but keep looking for a better one\n      ac_cv_path_EGREP=\"$ac_path_EGREP\"\n      ac_path_EGREP_max=$ac_count\n    fi\n    # 10*(2^10) chars as input seems more than enough\n    test $ac_count -gt 10 && break\n  done\n  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;\nesac\n\n      $ac_path_EGREP_found && break 3\n    done\n  done\n  done\nIFS=$as_save_IFS\n  if test -z \"$ac_cv_path_EGREP\"; then\n    as_fn_error $? \"no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin\" \"$LINENO\" 5\n  fi\nelse\n  ac_cv_path_EGREP=$EGREP\nfi\n\n   fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP\" >&5\n$as_echo \"$ac_cv_path_EGREP\" >&6; }\n EGREP=\"$ac_cv_path_EGREP\"\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for ANSI C header files\" >&5\n$as_echo_n \"checking for ANSI C header files... \" >&6; }\nif ${ac_cv_header_stdc+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdlib.h>\n#include <stdarg.h>\n#include <string.h>\n#include <float.h>\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_header_stdc=yes\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n\nif test $ac_cv_header_stdc = yes; then\n  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <string.h>\n\n_ACEOF\nif (eval \"$ac_cpp conftest.$ac_ext\") 2>&5 |\n  $EGREP \"memchr\" >/dev/null 2>&1; then :\n\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f conftest*\n\nfi\n\nif test $ac_cv_header_stdc = yes; then\n  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdlib.h>\n\n_ACEOF\nif (eval \"$ac_cpp conftest.$ac_ext\") 2>&5 |\n  $EGREP \"free\" >/dev/null 2>&1; then :\n\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f conftest*\n\nfi\n\nif test $ac_cv_header_stdc = yes; then\n  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.\n  if test \"$cross_compiling\" = yes; then :\n  :\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <ctype.h>\n#include <stdlib.h>\n#if ((' ' & 0x0FF) == 0x020)\n# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')\n# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))\n#else\n# define ISLOWER(c) \\\n\t\t   (('a' <= (c) && (c) <= 'i') \\\n\t\t     || ('j' <= (c) && (c) <= 'r') \\\n\t\t     || ('s' <= (c) && (c) <= 'z'))\n# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))\n#endif\n\n#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))\nint\nmain ()\n{\n  int i;\n  for (i = 0; i < 256; i++)\n    if (XOR (islower (i), ISLOWER (i))\n\t|| toupper (i) != TOUPPER (i))\n      return 2;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_run \"$LINENO\"; then :\n\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \\\n  conftest.$ac_objext conftest.beam conftest.$ac_ext\nfi\n\nfi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc\" >&5\n$as_echo \"$ac_cv_header_stdc\" >&6; }\nif test $ac_cv_header_stdc = yes; then\n\n$as_echo \"#define STDC_HEADERS 1\" >>confdefs.h\n\nfi\n\n# On IRIX 5.3, sys/types and inttypes.h are conflicting.\nfor ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \\\n\t\t  inttypes.h stdint.h unistd.h\ndo :\n  as_ac_Header=`$as_echo \"ac_cv_header_$ac_header\" | $as_tr_sh`\nac_fn_c_check_header_compile \"$LINENO\" \"$ac_header\" \"$as_ac_Header\" \"$ac_includes_default\n\"\nif eval test \\\"x\\$\"$as_ac_Header\"\\\" = x\"yes\"; then :\n  cat >>confdefs.h <<_ACEOF\n#define `$as_echo \"HAVE_$ac_header\" | $as_tr_cpp` 1\n_ACEOF\n\nfi\n\ndone\n\n\nfor ac_header in stddef.h stdlib.h locale.h\ndo :\n  as_ac_Header=`$as_echo \"ac_cv_header_$ac_header\" | $as_tr_sh`\nac_fn_c_check_header_mongrel \"$LINENO\" \"$ac_header\" \"$as_ac_Header\" \"$ac_includes_default\"\nif eval test \\\"x\\$\"$as_ac_Header\"\\\" = x\"yes\"; then :\n  cat >>confdefs.h <<_ACEOF\n#define `$as_echo \"HAVE_$ac_header\" | $as_tr_cpp` 1\n_ACEOF\n\nfi\n\ndone\n\nac_fn_c_check_header_mongrel \"$LINENO\" \"string.h\" \"ac_cv_header_string_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_string_h\" = xyes; then :\n\nelse\n\n$as_echo \"#define NEED_BSD_STRINGS 1\" >>confdefs.h\n\nfi\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse4.2\" >&5\n$as_echo_n \"checking whether C compiler accepts -msse4.2... \" >&6; }\nif ${ax_cv_check_cflags___msse4_2+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n\n  ax_check_save_flags=$CFLAGS\n  CFLAGS=\"$CFLAGS  -msse4.2\"\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ax_cv_check_cflags___msse4_2=yes\nelse\n  ax_cv_check_cflags___msse4_2=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n  CFLAGS=$ax_check_save_flags\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse4_2\" >&5\n$as_echo \"$ax_cv_check_cflags___msse4_2\" >&6; }\nif test \"x$ax_cv_check_cflags___msse4_2\" = xyes; then :\n  ac_fn_c_check_header_mongrel \"$LINENO\" \"immintrin.h\" \"ac_cv_header_immintrin_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_immintrin_h\" = xyes; then :\n\nif ${CFLAGS+:} false; then :\n\n  case \" $CFLAGS \" in #(\n  *\" -DUSE_SSE -msse4.2 \"*) :\n    { { $as_echo \"$as_me:${as_lineno-$LINENO}: : CFLAGS already contains -DUSE_SSE -msse4.2\"; } >&5\n  (: CFLAGS already contains -DUSE_SSE -msse4.2) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } ;; #(\n  *) :\n\n     as_fn_append CFLAGS \" -DUSE_SSE -msse4.2\"\n     { { $as_echo \"$as_me:${as_lineno-$LINENO}: : CFLAGS=\\\"\\$CFLAGS\\\"\"; } >&5\n  (: CFLAGS=\"$CFLAGS\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n     ;;\nesac\n\nelse\n\n  CFLAGS=-DUSE_SSE -msse4.2\n  { { $as_echo \"$as_me:${as_lineno-$LINENO}: : CFLAGS=\\\"\\$CFLAGS\\\"\"; } >&5\n  (: CFLAGS=\"$CFLAGS\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n\nfi\n\nfi\n\n\nelse\n  :\nfi\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -march=armv8-a\" >&5\n$as_echo_n \"checking whether C compiler accepts -march=armv8-a... \" >&6; }\nif ${ax_cv_check_cflags___march_armv8_a+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n\n  ax_check_save_flags=$CFLAGS\n  CFLAGS=\"$CFLAGS  -march=armv8-a\"\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ax_cv_check_cflags___march_armv8_a=yes\nelse\n  ax_cv_check_cflags___march_armv8_a=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n  CFLAGS=$ax_check_save_flags\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___march_armv8_a\" >&5\n$as_echo \"$ax_cv_check_cflags___march_armv8_a\" >&6; }\nif test \"x$ax_cv_check_cflags___march_armv8_a\" = xyes; then :\n  ac_fn_c_check_header_mongrel \"$LINENO\" \"arm_neon.h\" \"ac_cv_header_arm_neon_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_arm_neon_h\" = xyes; then :\n\nif ${CFLAGS+:} false; then :\n\n  case \" $CFLAGS \" in #(\n  *\" -DUSE_NEON -march=armv8-a \"*) :\n    { { $as_echo \"$as_me:${as_lineno-$LINENO}: : CFLAGS already contains -DUSE_NEON -march=armv8-a\"; } >&5\n  (: CFLAGS already contains -DUSE_NEON -march=armv8-a) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } ;; #(\n  *) :\n\n     as_fn_append CFLAGS \" -DUSE_NEON -march=armv8-a\"\n     { { $as_echo \"$as_me:${as_lineno-$LINENO}: : CFLAGS=\\\"\\$CFLAGS\\\"\"; } >&5\n  (: CFLAGS=\"$CFLAGS\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n     ;;\nesac\n\nelse\n\n  CFLAGS=-DUSE_NEON -march=armv8-a\n  { { $as_echo \"$as_me:${as_lineno-$LINENO}: : CFLAGS=\\\"\\$CFLAGS\\\"\"; } >&5\n  (: CFLAGS=\"$CFLAGS\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n\nfi\n CCASFLAGS=\"-DUSE_NEON\"\nfi\n\n\nelse\n  :\nfi\n\n\n# See whether type size_t is defined in any ANSI-standard places;\n# if not, perhaps it is defined in <sys/types.h>.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for size_t\" >&5\n$as_echo_n \"checking for size_t... \" >&6; }\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n#ifdef HAVE_STDDEF_H\n#include <stddef.h>\n#endif\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#include <stdio.h>\n#ifdef NEED_BSD_STRINGS\n#include <strings.h>\n#else\n#include <string.h>\n#endif\ntypedef size_t my_size_t;\n\nint\nmain ()\n{\n my_size_t foovar;\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ijg_size_t_ok=yes\nelse\n  ijg_size_t_ok=\"not ANSI, perhaps it is in sys/types.h\"\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ijg_size_t_ok\" >&5\n$as_echo \"$ijg_size_t_ok\" >&6; }\nif test \"$ijg_size_t_ok\" != yes; then\n  ac_fn_c_check_header_mongrel \"$LINENO\" \"sys/types.h\" \"ac_cv_header_sys_types_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_sys_types_h\" = xyes; then :\n\n$as_echo \"#define NEED_SYS_TYPES_H 1\" >>confdefs.h\n\n      cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <sys/types.h>\n_ACEOF\nif (eval \"$ac_cpp conftest.$ac_ext\") 2>&5 |\n  $EGREP \"size_t\" >/dev/null 2>&1; then :\n  ijg_size_t_ok=\"size_t is in sys/types.h\"\nelse\n  ijg_size_t_ok=no\nfi\nrm -f conftest*\n\nelse\n  ijg_size_t_ok=no\nfi\n\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ijg_size_t_ok\" >&5\n$as_echo \"$ijg_size_t_ok\" >&6; }\n  if test \"$ijg_size_t_ok\" = no; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: Type size_t is not defined in any of the usual places.\n      Try putting '\\\"typedef unsigned int size_t;\\\"' in jconfig.h.\" >&5\n$as_echo \"$as_me: WARNING: Type size_t is not defined in any of the usual places.\n      Try putting '\\\"typedef unsigned int size_t;\\\"' in jconfig.h.\" >&2;}\n  fi\nfi\n\n# Check compiler characteristics\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for type unsigned char\" >&5\n$as_echo_n \"checking for type unsigned char... \" >&6; }\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n unsigned char un_char;\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n\n$as_echo \"#define HAVE_UNSIGNED_CHAR 1\" >>confdefs.h\n\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for type unsigned short\" >&5\n$as_echo_n \"checking for type unsigned short... \" >&6; }\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n unsigned short un_short;\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n\n$as_echo \"#define HAVE_UNSIGNED_SHORT 1\" >>confdefs.h\n\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for type void\" >&5\n$as_echo_n \"checking for type void... \" >&6; }\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Caution: a C++ compiler will insist on valid prototypes */\ntypedef void * void_ptr;\t/* check void * */\n#ifdef HAVE_PROTOTYPES\t\t/* check ptr to function returning void */\ntypedef void (*void_func) (int a, int b);\n#else\ntypedef void (*void_func) ();\n#endif\n\n#ifdef HAVE_PROTOTYPES\t\t/* check void function result */\nvoid test3function (void_ptr arg1, void_func arg2)\n#else\nvoid test3function (arg1, arg2)\n     void_ptr arg1;\n     void_func arg2;\n#endif\n{\n  char * locptr = (char *) arg1; /* check casting to and from void * */\n  arg1 = (void *) locptr;\n  (*arg2) (1, 2);\t\t/* check call of fcn returning void */\n}\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n\n$as_echo \"#define void char\" >>confdefs.h\n\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const\" >&5\n$as_echo_n \"checking for an ANSI C-conforming const... \" >&6; }\nif ${ac_cv_c_const+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n#ifndef __cplusplus\n  /* Ultrix mips cc rejects this sort of thing.  */\n  typedef int charset[2];\n  const charset cs = { 0, 0 };\n  /* SunOS 4.1.1 cc rejects this.  */\n  char const *const *pcpcc;\n  char **ppc;\n  /* NEC SVR4.0.2 mips cc rejects this.  */\n  struct point {int x, y;};\n  static struct point const zero = {0,0};\n  /* AIX XL C 1.02.0.0 rejects this.\n     It does not let you subtract one const X* pointer from another in\n     an arm of an if-expression whose if-part is not a constant\n     expression */\n  const char *g = \"string\";\n  pcpcc = &g + (g ? g-g : 0);\n  /* HPUX 7.0 cc rejects these. */\n  ++pcpcc;\n  ppc = (char**) pcpcc;\n  pcpcc = (char const *const *) ppc;\n  { /* SCO 3.2v4 cc rejects this sort of thing.  */\n    char tx;\n    char *t = &tx;\n    char const *s = 0 ? (char *) 0 : (char const *) 0;\n\n    *t++ = 0;\n    if (s) return 0;\n  }\n  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */\n    int x[] = {25, 17};\n    const int *foo = &x[0];\n    ++foo;\n  }\n  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */\n    typedef const int *iptr;\n    iptr p = 0;\n    ++p;\n  }\n  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying\n       \"k.c\", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */\n    struct s { int j; const int *ap[3]; } bx;\n    struct s *b = &bx; b->j = 5;\n  }\n  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */\n    const int foo = 10;\n    if (!foo) return 0;\n  }\n  return !cs[0] && !zero.x;\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_c_const=yes\nelse\n  ac_cv_c_const=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const\" >&5\n$as_echo \"$ac_cv_c_const\" >&6; }\nif test $ac_cv_c_const = no; then\n\n$as_echo \"#define const /**/\" >>confdefs.h\n\nfi\n\n\n# Check for non-broken inline under various spellings\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for inline\" >&5\n$as_echo_n \"checking for inline... \" >&6; }\nijg_cv_inline=\"\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n} __inline__ int foo() { return 0; }\nint bar() { return foo();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ijg_cv_inline=\"__inline__\"\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n} __inline int foo() { return 0; }\nint bar() { return foo();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ijg_cv_inline=\"__inline\"\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n} inline int foo() { return 0; }\nint bar() { return foo();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ijg_cv_inline=\"inline\"\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ijg_cv_inline\" >&5\n$as_echo \"$ijg_cv_inline\" >&6; }\n\ncat >>confdefs.h <<_ACEOF\n#define INLINE $ijg_cv_inline\n_ACEOF\n\n\n# We cannot check for bogus warnings, but at least we can check for errors\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for broken incomplete types\" >&5\n$as_echo_n \"checking for broken incomplete types... \" >&6; }\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n typedef struct undefined_structure * undef_struct_ptr;\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: ok\" >&5\n$as_echo \"ok\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: broken\" >&5\n$as_echo \"broken\" >&6; }\n\n$as_echo \"#define INCOMPLETE_TYPES_BROKEN 1\" >>confdefs.h\n\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n\n# Test whether global names are unique to at least 15 chars\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for short external names\" >&5\n$as_echo_n \"checking for short external names... \" >&6; }\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint possibly_duplicate_function () { return 0; }\nint possibly_dupli_function () { return 1; }\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: ok\" >&5\n$as_echo \"ok\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: short\" >&5\n$as_echo \"short\" >&6; }\n\n$as_echo \"#define NEED_SHORT_EXTERNAL_NAMES 1\" >>confdefs.h\n\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n\n# Run-time checks\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking to see if char is signed\" >&5\n$as_echo_n \"checking to see if char is signed... \" >&6; }\nif test \"$cross_compiling\" = yes; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: Assuming that char is signed on target machine.\n    If it is unsigned, this will be a little bit inefficient.\" >&5\n$as_echo \"$as_me: WARNING: Assuming that char is signed on target machine.\n    If it is unsigned, this will be a little bit inefficient.\" >&2;}\n\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#include <stdio.h>\n#ifdef HAVE_PROTOTYPES\nint is_char_signed (int arg)\n#else\nint is_char_signed (arg)\n     int arg;\n#endif\n{\n  if (arg == 189) {\t\t/* expected result for unsigned char */\n    return 0;\t\t\t/* type char is unsigned */\n  }\n  else if (arg != -67) {\t/* expected result for signed char */\n    printf(\"Hmm, it seems 'char' is not eight bits wide on your machine.\\n\");\n    printf(\"I fear the JPEG software will not work at all.\\n\\n\");\n  }\n  return 1;\t\t\t/* assume char is signed otherwise */\n}\nchar signed_char_check = (char) (-67);\nint main() {\n  exit(is_char_signed((int) signed_char_check));\n}\n_ACEOF\nif ac_fn_c_try_run \"$LINENO\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n\n$as_echo \"#define CHAR_IS_UNSIGNED 1\" >>confdefs.h\n\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nfi\nrm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \\\n  conftest.$ac_objext conftest.beam conftest.$ac_ext\nfi\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking to see if right shift is signed\" >&5\n$as_echo_n \"checking to see if right shift is signed... \" >&6; }\nif test \"$cross_compiling\" = yes; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: Assuming that right shift is signed on target machine.\" >&5\n$as_echo \"Assuming that right shift is signed on target machine.\" >&6; }\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#include <stdio.h>\n#ifdef HAVE_PROTOTYPES\nint is_shifting_signed (long arg)\n#else\nint is_shifting_signed (arg)\n     long arg;\n#endif\n/* See whether right-shift on a long is signed or not. */\n{\n  long res = arg >> 4;\n\n  if (res == -0x7F7E80CL) {\t/* expected result for signed shift */\n    return 1;\t\t\t/* right shift is signed */\n  }\n  /* see if unsigned-shift hack will fix it. */\n  /* we can't just test exact value since it depends on width of long... */\n  res |= (~0L) << (32-4);\n  if (res == -0x7F7E80CL) {\t/* expected result now? */\n    return 0;\t\t\t/* right shift is unsigned */\n  }\n  printf(\"Right shift isn't acting as I expect it to.\\n\");\n  printf(\"I fear the JPEG software will not work at all.\\n\\n\");\n  return 0;\t\t\t/* try it with unsigned anyway */\n}\nint main() {\n  exit(is_shifting_signed(-0x7F7E80B1L));\n}\n_ACEOF\nif ac_fn_c_try_run \"$LINENO\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n\n$as_echo \"#define RIGHT_SHIFT_IS_UNSIGNED 1\" >>confdefs.h\n\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nfi\nrm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \\\n  conftest.$ac_objext conftest.beam conftest.$ac_ext\nfi\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking to see if fopen accepts b spec\" >&5\n$as_echo_n \"checking to see if fopen accepts b spec... \" >&6; }\nif test \"$cross_compiling\" = yes; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: Assuming that it does.\" >&5\n$as_echo \"Assuming that it does.\" >&6; }\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#include <stdio.h>\nint main() {\n  if (fopen(\"conftestdata\", \"wb\") != NULL)\n    exit(0);\n  exit(1);\n}\n_ACEOF\nif ac_fn_c_try_run \"$LINENO\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n\n$as_echo \"#define DONT_USE_B_MODE 1\" >>confdefs.h\n\nfi\nrm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \\\n  conftest.$ac_objext conftest.beam conftest.$ac_ext\nfi\n\n\n# Configure libtool\nenable_win32_dll=yes\n\ncase $host in\n*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)\n  if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}as\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}as; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_AS+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$AS\"; then\n  ac_cv_prog_AS=\"$AS\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_AS=\"${ac_tool_prefix}as\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nAS=$ac_cv_prog_AS\nif test -n \"$AS\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $AS\" >&5\n$as_echo \"$AS\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_AS\"; then\n  ac_ct_AS=$AS\n  # Extract the first word of \"as\", so it can be a program name with args.\nset dummy as; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_AS+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_AS\"; then\n  ac_cv_prog_ac_ct_AS=\"$ac_ct_AS\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_AS=\"as\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_AS=$ac_cv_prog_ac_ct_AS\nif test -n \"$ac_ct_AS\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS\" >&5\n$as_echo \"$ac_ct_AS\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_AS\" = x; then\n    AS=\"false\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    AS=$ac_ct_AS\n  fi\nelse\n  AS=\"$ac_cv_prog_AS\"\nfi\n\n  if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}dlltool\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}dlltool; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_DLLTOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$DLLTOOL\"; then\n  ac_cv_prog_DLLTOOL=\"$DLLTOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_DLLTOOL=\"${ac_tool_prefix}dlltool\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nDLLTOOL=$ac_cv_prog_DLLTOOL\nif test -n \"$DLLTOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $DLLTOOL\" >&5\n$as_echo \"$DLLTOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_DLLTOOL\"; then\n  ac_ct_DLLTOOL=$DLLTOOL\n  # Extract the first word of \"dlltool\", so it can be a program name with args.\nset dummy dlltool; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_DLLTOOL\"; then\n  ac_cv_prog_ac_ct_DLLTOOL=\"$ac_ct_DLLTOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_DLLTOOL=\"dlltool\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL\nif test -n \"$ac_ct_DLLTOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL\" >&5\n$as_echo \"$ac_ct_DLLTOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_DLLTOOL\" = x; then\n    DLLTOOL=\"false\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    DLLTOOL=$ac_ct_DLLTOOL\n  fi\nelse\n  DLLTOOL=\"$ac_cv_prog_DLLTOOL\"\nfi\n\n  if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}objdump\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}objdump; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_OBJDUMP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$OBJDUMP\"; then\n  ac_cv_prog_OBJDUMP=\"$OBJDUMP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_OBJDUMP=\"${ac_tool_prefix}objdump\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nOBJDUMP=$ac_cv_prog_OBJDUMP\nif test -n \"$OBJDUMP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $OBJDUMP\" >&5\n$as_echo \"$OBJDUMP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_OBJDUMP\"; then\n  ac_ct_OBJDUMP=$OBJDUMP\n  # Extract the first word of \"objdump\", so it can be a program name with args.\nset dummy objdump; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_OBJDUMP\"; then\n  ac_cv_prog_ac_ct_OBJDUMP=\"$ac_ct_OBJDUMP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_OBJDUMP=\"objdump\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP\nif test -n \"$ac_ct_OBJDUMP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP\" >&5\n$as_echo \"$ac_ct_OBJDUMP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_OBJDUMP\" = x; then\n    OBJDUMP=\"false\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    OBJDUMP=$ac_ct_OBJDUMP\n  fi\nelse\n  OBJDUMP=\"$ac_cv_prog_OBJDUMP\"\nfi\n\n  ;;\nesac\n\ntest -z \"$AS\" && AS=as\n\n\n\n\n\ntest -z \"$DLLTOOL\" && DLLTOOL=dlltool\n\n\n\n\n\ntest -z \"$OBJDUMP\" && OBJDUMP=objdump\n\n\n\n\n\n\n\ncase `pwd` in\n  *\\ * | *\\\t*)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \\`pwd\\`\" >&5\n$as_echo \"$as_me: WARNING: Libtool does not cope well with whitespace in \\`pwd\\`\" >&2;} ;;\nesac\n\n\n\nmacro_version='2.4.6'\nmacro_revision='2.4.6'\n\n\n\n\n\n\n\n\n\n\n\n\n\nltmain=$ac_aux_dir/ltmain.sh\n\n# Backslashify metacharacters that are still active within\n# double-quoted strings.\nsed_quote_subst='s/\\([\"`$\\\\]\\)/\\\\\\1/g'\n\n# Same as above, but do not quote variable references.\ndouble_quote_subst='s/\\([\"`\\\\]\\)/\\\\\\1/g'\n\n# Sed substitution to delay expansion of an escaped shell variable in a\n# double_quote_subst'ed string.\ndelay_variable_subst='s/\\\\\\\\\\\\\\\\\\\\\\$/\\\\\\\\\\\\$/g'\n\n# Sed substitution to delay expansion of an escaped single quote.\ndelay_single_quote_subst='s/'\\''/'\\'\\\\\\\\\\\\\\'\\''/g'\n\n# Sed substitution to avoid accidental globbing in evaled expressions\nno_glob_subst='s/\\*/\\\\\\*/g'\n\nECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\nECHO=$ECHO$ECHO$ECHO$ECHO$ECHO\nECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to print strings\" >&5\n$as_echo_n \"checking how to print strings... \" >&6; }\n# Test print first, because it will be a builtin if present.\nif test \"X`( print -r -- -n ) 2>/dev/null`\" = X-n && \\\n   test \"X`print -r -- $ECHO 2>/dev/null`\" = \"X$ECHO\"; then\n  ECHO='print -r --'\nelif test \"X`printf %s $ECHO 2>/dev/null`\" = \"X$ECHO\"; then\n  ECHO='printf %s\\n'\nelse\n  # Use this function as a fallback that always works.\n  func_fallback_echo ()\n  {\n    eval 'cat <<_LTECHO_EOF\n$1\n_LTECHO_EOF'\n  }\n  ECHO='func_fallback_echo'\nfi\n\n# func_echo_all arg...\n# Invoke $ECHO with all args, space-separated.\nfunc_echo_all ()\n{\n    $ECHO \"\"\n}\n\ncase $ECHO in\n  printf*) { $as_echo \"$as_me:${as_lineno-$LINENO}: result: printf\" >&5\n$as_echo \"printf\" >&6; } ;;\n  print*) { $as_echo \"$as_me:${as_lineno-$LINENO}: result: print -r\" >&5\n$as_echo \"print -r\" >&6; } ;;\n  *) { $as_echo \"$as_me:${as_lineno-$LINENO}: result: cat\" >&5\n$as_echo \"cat\" >&6; } ;;\nesac\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output\" >&5\n$as_echo_n \"checking for a sed that does not truncate output... \" >&6; }\nif ${ac_cv_path_SED+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/\n     for ac_i in 1 2 3 4 5 6 7; do\n       ac_script=\"$ac_script$as_nl$ac_script\"\n     done\n     echo \"$ac_script\" 2>/dev/null | sed 99q >conftest.sed\n     { ac_script=; unset ac_script;}\n     if test -z \"$SED\"; then\n  ac_path_SED_found=false\n  # Loop through the user's path and test for each of PROGNAME-LIST\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_prog in sed gsed; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      ac_path_SED=\"$as_dir/$ac_prog$ac_exec_ext\"\n      as_fn_executable_p \"$ac_path_SED\" || continue\n# Check for GNU ac_path_SED and select it if it is found.\n  # Check for GNU $ac_path_SED\ncase `\"$ac_path_SED\" --version 2>&1` in\n*GNU*)\n  ac_cv_path_SED=\"$ac_path_SED\" ac_path_SED_found=:;;\n*)\n  ac_count=0\n  $as_echo_n 0123456789 >\"conftest.in\"\n  while :\n  do\n    cat \"conftest.in\" \"conftest.in\" >\"conftest.tmp\"\n    mv \"conftest.tmp\" \"conftest.in\"\n    cp \"conftest.in\" \"conftest.nl\"\n    $as_echo '' >> \"conftest.nl\"\n    \"$ac_path_SED\" -f conftest.sed < \"conftest.nl\" >\"conftest.out\" 2>/dev/null || break\n    diff \"conftest.out\" \"conftest.nl\" >/dev/null 2>&1 || break\n    as_fn_arith $ac_count + 1 && ac_count=$as_val\n    if test $ac_count -gt ${ac_path_SED_max-0}; then\n      # Best one so far, save it but keep looking for a better one\n      ac_cv_path_SED=\"$ac_path_SED\"\n      ac_path_SED_max=$ac_count\n    fi\n    # 10*(2^10) chars as input seems more than enough\n    test $ac_count -gt 10 && break\n  done\n  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;\nesac\n\n      $ac_path_SED_found && break 3\n    done\n  done\n  done\nIFS=$as_save_IFS\n  if test -z \"$ac_cv_path_SED\"; then\n    as_fn_error $? \"no acceptable sed could be found in \\$PATH\" \"$LINENO\" 5\n  fi\nelse\n  ac_cv_path_SED=$SED\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED\" >&5\n$as_echo \"$ac_cv_path_SED\" >&6; }\n SED=\"$ac_cv_path_SED\"\n  rm -f conftest.sed\n\ntest -z \"$SED\" && SED=sed\nXsed=\"$SED -e 1s/^X//\"\n\n\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for fgrep\" >&5\n$as_echo_n \"checking for fgrep... \" >&6; }\nif ${ac_cv_path_FGREP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1\n   then ac_cv_path_FGREP=\"$GREP -F\"\n   else\n     if test -z \"$FGREP\"; then\n  ac_path_FGREP_found=false\n  # Loop through the user's path and test for each of PROGNAME-LIST\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_prog in fgrep; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      ac_path_FGREP=\"$as_dir/$ac_prog$ac_exec_ext\"\n      as_fn_executable_p \"$ac_path_FGREP\" || continue\n# Check for GNU ac_path_FGREP and select it if it is found.\n  # Check for GNU $ac_path_FGREP\ncase `\"$ac_path_FGREP\" --version 2>&1` in\n*GNU*)\n  ac_cv_path_FGREP=\"$ac_path_FGREP\" ac_path_FGREP_found=:;;\n*)\n  ac_count=0\n  $as_echo_n 0123456789 >\"conftest.in\"\n  while :\n  do\n    cat \"conftest.in\" \"conftest.in\" >\"conftest.tmp\"\n    mv \"conftest.tmp\" \"conftest.in\"\n    cp \"conftest.in\" \"conftest.nl\"\n    $as_echo 'FGREP' >> \"conftest.nl\"\n    \"$ac_path_FGREP\" FGREP < \"conftest.nl\" >\"conftest.out\" 2>/dev/null || break\n    diff \"conftest.out\" \"conftest.nl\" >/dev/null 2>&1 || break\n    as_fn_arith $ac_count + 1 && ac_count=$as_val\n    if test $ac_count -gt ${ac_path_FGREP_max-0}; then\n      # Best one so far, save it but keep looking for a better one\n      ac_cv_path_FGREP=\"$ac_path_FGREP\"\n      ac_path_FGREP_max=$ac_count\n    fi\n    # 10*(2^10) chars as input seems more than enough\n    test $ac_count -gt 10 && break\n  done\n  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;\nesac\n\n      $ac_path_FGREP_found && break 3\n    done\n  done\n  done\nIFS=$as_save_IFS\n  if test -z \"$ac_cv_path_FGREP\"; then\n    as_fn_error $? \"no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin\" \"$LINENO\" 5\n  fi\nelse\n  ac_cv_path_FGREP=$FGREP\nfi\n\n   fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP\" >&5\n$as_echo \"$ac_cv_path_FGREP\" >&6; }\n FGREP=\"$ac_cv_path_FGREP\"\n\n\ntest -z \"$GREP\" && GREP=grep\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# Check whether --with-gnu-ld was given.\nif test \"${with_gnu_ld+set}\" = set; then :\n  withval=$with_gnu_ld; test no = \"$withval\" || with_gnu_ld=yes\nelse\n  with_gnu_ld=no\nfi\n\nac_prog=ld\nif test yes = \"$GCC\"; then\n  # Check if gcc -print-prog-name=ld gives a path.\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for ld used by $CC\" >&5\n$as_echo_n \"checking for ld used by $CC... \" >&6; }\n  case $host in\n  *-*-mingw*)\n    # gcc leaves a trailing carriage return, which upsets mingw\n    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\\015'` ;;\n  *)\n    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;\n  esac\n  case $ac_prog in\n    # Accept absolute paths.\n    [\\\\/]* | ?:[\\\\/]*)\n      re_direlt='/[^/][^/]*/\\.\\./'\n      # Canonicalize the pathname of ld\n      ac_prog=`$ECHO \"$ac_prog\"| $SED 's%\\\\\\\\%/%g'`\n      while $ECHO \"$ac_prog\" | $GREP \"$re_direlt\" > /dev/null 2>&1; do\n\tac_prog=`$ECHO $ac_prog| $SED \"s%$re_direlt%/%\"`\n      done\n      test -z \"$LD\" && LD=$ac_prog\n      ;;\n  \"\")\n    # If it fails, then pretend we aren't using GCC.\n    ac_prog=ld\n    ;;\n  *)\n    # If it is relative, then search for the first ld in PATH.\n    with_gnu_ld=unknown\n    ;;\n  esac\nelif test yes = \"$with_gnu_ld\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for GNU ld\" >&5\n$as_echo_n \"checking for GNU ld... \" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for non-GNU ld\" >&5\n$as_echo_n \"checking for non-GNU ld... \" >&6; }\nfi\nif ${lt_cv_path_LD+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -z \"$LD\"; then\n  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\n  for ac_dir in $PATH; do\n    IFS=$lt_save_ifs\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/$ac_prog\" || test -f \"$ac_dir/$ac_prog$ac_exeext\"; then\n      lt_cv_path_LD=$ac_dir/$ac_prog\n      # Check to see if the program is GNU ld.  I'd rather use --version,\n      # but apparently some variants of GNU ld only accept -v.\n      # Break only if it was the GNU/non-GNU ld that we prefer.\n      case `\"$lt_cv_path_LD\" -v 2>&1 </dev/null` in\n      *GNU* | *'with BFD'*)\n\ttest no != \"$with_gnu_ld\" && break\n\t;;\n      *)\n\ttest yes != \"$with_gnu_ld\" && break\n\t;;\n      esac\n    fi\n  done\n  IFS=$lt_save_ifs\nelse\n  lt_cv_path_LD=$LD # Let the user override the test with a path.\nfi\nfi\n\nLD=$lt_cv_path_LD\nif test -n \"$LD\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $LD\" >&5\n$as_echo \"$LD\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\ntest -z \"$LD\" && as_fn_error $? \"no acceptable ld found in \\$PATH\" \"$LINENO\" 5\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld\" >&5\n$as_echo_n \"checking if the linker ($LD) is GNU ld... \" >&6; }\nif ${lt_cv_prog_gnu_ld+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  # I'd rather use --version here, but apparently some GNU lds only accept -v.\ncase `$LD -v 2>&1 </dev/null` in\n*GNU* | *'with BFD'*)\n  lt_cv_prog_gnu_ld=yes\n  ;;\n*)\n  lt_cv_prog_gnu_ld=no\n  ;;\nesac\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld\" >&5\n$as_echo \"$lt_cv_prog_gnu_ld\" >&6; }\nwith_gnu_ld=$lt_cv_prog_gnu_ld\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)\" >&5\n$as_echo_n \"checking for BSD- or MS-compatible name lister (nm)... \" >&6; }\nif ${lt_cv_path_NM+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$NM\"; then\n  # Let the user override the test.\n  lt_cv_path_NM=$NM\nelse\n  lt_nm_to_check=${ac_tool_prefix}nm\n  if test -n \"$ac_tool_prefix\" && test \"$build\" = \"$host\"; then\n    lt_nm_to_check=\"$lt_nm_to_check nm\"\n  fi\n  for lt_tmp_nm in $lt_nm_to_check; do\n    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\n    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do\n      IFS=$lt_save_ifs\n      test -z \"$ac_dir\" && ac_dir=.\n      tmp_nm=$ac_dir/$lt_tmp_nm\n      if test -f \"$tmp_nm\" || test -f \"$tmp_nm$ac_exeext\"; then\n\t# Check to see if the nm accepts a BSD-compat flag.\n\t# Adding the 'sed 1q' prevents false positives on HP-UX, which says:\n\t#   nm: unknown option \"B\" ignored\n\t# Tru64's nm complains that /dev/null is an invalid object file\n\t# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty\n\tcase $build_os in\n\tmingw*) lt_bad_file=conftest.nm/nofile ;;\n\t*) lt_bad_file=/dev/null ;;\n\tesac\n\tcase `\"$tmp_nm\" -B $lt_bad_file 2>&1 | sed '1q'` in\n\t*$lt_bad_file* | *'Invalid file or object type'*)\n\t  lt_cv_path_NM=\"$tmp_nm -B\"\n\t  break 2\n\t  ;;\n\t*)\n\t  case `\"$tmp_nm\" -p /dev/null 2>&1 | sed '1q'` in\n\t  */dev/null*)\n\t    lt_cv_path_NM=\"$tmp_nm -p\"\n\t    break 2\n\t    ;;\n\t  *)\n\t    lt_cv_path_NM=${lt_cv_path_NM=\"$tmp_nm\"} # keep the first match, but\n\t    continue # so that we can try to find one that supports BSD flags\n\t    ;;\n\t  esac\n\t  ;;\n\tesac\n      fi\n    done\n    IFS=$lt_save_ifs\n  done\n  : ${lt_cv_path_NM=no}\nfi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM\" >&5\n$as_echo \"$lt_cv_path_NM\" >&6; }\nif test no != \"$lt_cv_path_NM\"; then\n  NM=$lt_cv_path_NM\nelse\n  # Didn't find any BSD compatible name lister, look for dumpbin.\n  if test -n \"$DUMPBIN\"; then :\n    # Let the user override the test.\n  else\n    if test -n \"$ac_tool_prefix\"; then\n  for ac_prog in dumpbin \"link -dump\"\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_DUMPBIN+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$DUMPBIN\"; then\n  ac_cv_prog_DUMPBIN=\"$DUMPBIN\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_DUMPBIN=\"$ac_tool_prefix$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nDUMPBIN=$ac_cv_prog_DUMPBIN\nif test -n \"$DUMPBIN\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $DUMPBIN\" >&5\n$as_echo \"$DUMPBIN\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n    test -n \"$DUMPBIN\" && break\n  done\nfi\nif test -z \"$DUMPBIN\"; then\n  ac_ct_DUMPBIN=$DUMPBIN\n  for ac_prog in dumpbin \"link -dump\"\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_DUMPBIN\"; then\n  ac_cv_prog_ac_ct_DUMPBIN=\"$ac_ct_DUMPBIN\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_DUMPBIN=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN\nif test -n \"$ac_ct_DUMPBIN\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN\" >&5\n$as_echo \"$ac_ct_DUMPBIN\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$ac_ct_DUMPBIN\" && break\ndone\n\n  if test \"x$ac_ct_DUMPBIN\" = x; then\n    DUMPBIN=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    DUMPBIN=$ac_ct_DUMPBIN\n  fi\nfi\n\n    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in\n    *COFF*)\n      DUMPBIN=\"$DUMPBIN -symbols -headers\"\n      ;;\n    *)\n      DUMPBIN=:\n      ;;\n    esac\n  fi\n\n  if test : != \"$DUMPBIN\"; then\n    NM=$DUMPBIN\n  fi\nfi\ntest -z \"$NM\" && NM=nm\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface\" >&5\n$as_echo_n \"checking the name lister ($NM) interface... \" >&6; }\nif ${lt_cv_nm_interface+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_nm_interface=\"BSD nm\"\n  echo \"int some_variable = 0;\" > conftest.$ac_ext\n  (eval echo \"\\\"\\$as_me:$LINENO: $ac_compile\\\"\" >&5)\n  (eval \"$ac_compile\" 2>conftest.err)\n  cat conftest.err >&5\n  (eval echo \"\\\"\\$as_me:$LINENO: $NM \\\\\\\"conftest.$ac_objext\\\\\\\"\\\"\" >&5)\n  (eval \"$NM \\\"conftest.$ac_objext\\\"\" 2>conftest.err > conftest.out)\n  cat conftest.err >&5\n  (eval echo \"\\\"\\$as_me:$LINENO: output\\\"\" >&5)\n  cat conftest.out >&5\n  if $GREP 'External.*some_variable' conftest.out > /dev/null; then\n    lt_cv_nm_interface=\"MS dumpbin\"\n  fi\n  rm -f conftest*\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface\" >&5\n$as_echo \"$lt_cv_nm_interface\" >&6; }\n\n# find the maximum length of command line arguments\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments\" >&5\n$as_echo_n \"checking the maximum length of command line arguments... \" >&6; }\nif ${lt_cv_sys_max_cmd_len+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n    i=0\n  teststring=ABCD\n\n  case $build_os in\n  msdosdjgpp*)\n    # On DJGPP, this test can blow up pretty badly due to problems in libc\n    # (any single argument exceeding 2000 bytes causes a buffer overrun\n    # during glob expansion).  Even if it were fixed, the result of this\n    # check would be larger than it should be.\n    lt_cv_sys_max_cmd_len=12288;    # 12K is about right\n    ;;\n\n  gnu*)\n    # Under GNU Hurd, this test is not required because there is\n    # no limit to the length of command line arguments.\n    # Libtool will interpret -1 as no limit whatsoever\n    lt_cv_sys_max_cmd_len=-1;\n    ;;\n\n  cygwin* | mingw* | cegcc*)\n    # On Win9x/ME, this test blows up -- it succeeds, but takes\n    # about 5 minutes as the teststring grows exponentially.\n    # Worse, since 9x/ME are not pre-emptively multitasking,\n    # you end up with a \"frozen\" computer, even though with patience\n    # the test eventually succeeds (with a max line length of 256k).\n    # Instead, let's just punt: use the minimum linelength reported by\n    # all of the supported platforms: 8192 (on NT/2K/XP).\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  mint*)\n    # On MiNT this can take a long time and run out of memory.\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  amigaos*)\n    # On AmigaOS with pdksh, this test takes hours, literally.\n    # So we just punt and use a minimum line length of 8192.\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)\n    # This has been around since 386BSD, at least.  Likely further.\n    if test -x /sbin/sysctl; then\n      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`\n    elif test -x /usr/sbin/sysctl; then\n      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`\n    else\n      lt_cv_sys_max_cmd_len=65536\t# usable default for all BSDs\n    fi\n    # And add a safety zone\n    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 4`\n    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\* 3`\n    ;;\n\n  interix*)\n    # We know the value 262144 and hardcode it with a safety zone (like BSD)\n    lt_cv_sys_max_cmd_len=196608\n    ;;\n\n  os2*)\n    # The test takes a long time on OS/2.\n    lt_cv_sys_max_cmd_len=8192\n    ;;\n\n  osf*)\n    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure\n    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not\n    # nice to cause kernel panics so lets avoid the loop below.\n    # First set a reasonable default.\n    lt_cv_sys_max_cmd_len=16384\n    #\n    if test -x /sbin/sysconfig; then\n      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in\n        *1*) lt_cv_sys_max_cmd_len=-1 ;;\n      esac\n    fi\n    ;;\n  sco3.2v5*)\n    lt_cv_sys_max_cmd_len=102400\n    ;;\n  sysv5* | sco5v6* | sysv4.2uw2*)\n    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`\n    if test -n \"$kargmax\"; then\n      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[\t ]//'`\n    else\n      lt_cv_sys_max_cmd_len=32768\n    fi\n    ;;\n  *)\n    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`\n    if test -n \"$lt_cv_sys_max_cmd_len\" && \\\n       test undefined != \"$lt_cv_sys_max_cmd_len\"; then\n      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 4`\n      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\* 3`\n    else\n      # Make teststring a little bigger before we do anything with it.\n      # a 1K string should be a reasonable start.\n      for i in 1 2 3 4 5 6 7 8; do\n        teststring=$teststring$teststring\n      done\n      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}\n      # If test is not a shell built-in, we'll probably end up computing a\n      # maximum length that is only half of the actual maximum length, but\n      # we can't tell.\n      while { test X`env echo \"$teststring$teststring\" 2>/dev/null` \\\n\t         = \"X$teststring$teststring\"; } >/dev/null 2>&1 &&\n\t      test 17 != \"$i\" # 1/2 MB should be enough\n      do\n        i=`expr $i + 1`\n        teststring=$teststring$teststring\n      done\n      # Only check the string length outside the loop.\n      lt_cv_sys_max_cmd_len=`expr \"X$teststring\" : \".*\" 2>&1`\n      teststring=\n      # Add a significant safety factor because C++ compilers can tack on\n      # massive amounts of additional arguments before passing them to the\n      # linker.  It appears as though 1/2 is a usable value.\n      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 2`\n    fi\n    ;;\n  esac\n\nfi\n\nif test -n \"$lt_cv_sys_max_cmd_len\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len\" >&5\n$as_echo \"$lt_cv_sys_max_cmd_len\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: none\" >&5\n$as_echo \"none\" >&6; }\nfi\nmax_cmd_len=$lt_cv_sys_max_cmd_len\n\n\n\n\n\n\n: ${CP=\"cp -f\"}\n: ${MV=\"mv -f\"}\n: ${RM=\"rm -f\"}\n\nif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then\n  lt_unset=unset\nelse\n  lt_unset=false\nfi\n\n\n\n\n\n# test EBCDIC or ASCII\ncase `echo X|tr X '\\101'` in\n A) # ASCII based system\n    # \\n is not interpreted correctly by Solaris 8 /usr/ucb/tr\n  lt_SP2NL='tr \\040 \\012'\n  lt_NL2SP='tr \\015\\012 \\040\\040'\n  ;;\n *) # EBCDIC based system\n  lt_SP2NL='tr \\100 \\n'\n  lt_NL2SP='tr \\r\\n \\100\\100'\n  ;;\nesac\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format\" >&5\n$as_echo_n \"checking how to convert $build file names to $host format... \" >&6; }\nif ${lt_cv_to_host_file_cmd+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  case $host in\n  *-*-mingw* )\n    case $build in\n      *-*-mingw* ) # actually msys\n        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32\n        ;;\n      *-*-cygwin* )\n        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32\n        ;;\n      * ) # otherwise, assume *nix\n        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32\n        ;;\n    esac\n    ;;\n  *-*-cygwin* )\n    case $build in\n      *-*-mingw* ) # actually msys\n        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin\n        ;;\n      *-*-cygwin* )\n        lt_cv_to_host_file_cmd=func_convert_file_noop\n        ;;\n      * ) # otherwise, assume *nix\n        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin\n        ;;\n    esac\n    ;;\n  * ) # unhandled hosts (and \"normal\" native builds)\n    lt_cv_to_host_file_cmd=func_convert_file_noop\n    ;;\nesac\n\nfi\n\nto_host_file_cmd=$lt_cv_to_host_file_cmd\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd\" >&5\n$as_echo \"$lt_cv_to_host_file_cmd\" >&6; }\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format\" >&5\n$as_echo_n \"checking how to convert $build file names to toolchain format... \" >&6; }\nif ${lt_cv_to_tool_file_cmd+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  #assume ordinary cross tools, or native build.\nlt_cv_to_tool_file_cmd=func_convert_file_noop\ncase $host in\n  *-*-mingw* )\n    case $build in\n      *-*-mingw* ) # actually msys\n        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32\n        ;;\n    esac\n    ;;\nesac\n\nfi\n\nto_tool_file_cmd=$lt_cv_to_tool_file_cmd\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd\" >&5\n$as_echo \"$lt_cv_to_tool_file_cmd\" >&6; }\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files\" >&5\n$as_echo_n \"checking for $LD option to reload object files... \" >&6; }\nif ${lt_cv_ld_reload_flag+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_ld_reload_flag='-r'\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag\" >&5\n$as_echo \"$lt_cv_ld_reload_flag\" >&6; }\nreload_flag=$lt_cv_ld_reload_flag\ncase $reload_flag in\n\"\" | \" \"*) ;;\n*) reload_flag=\" $reload_flag\" ;;\nesac\nreload_cmds='$LD$reload_flag -o $output$reload_objs'\ncase $host_os in\n  cygwin* | mingw* | pw32* | cegcc*)\n    if test yes != \"$GCC\"; then\n      reload_cmds=false\n    fi\n    ;;\n  darwin*)\n    if test yes = \"$GCC\"; then\n      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'\n    else\n      reload_cmds='$LD$reload_flag -o $output$reload_objs'\n    fi\n    ;;\nesac\n\n\n\n\n\n\n\n\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}objdump\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}objdump; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_OBJDUMP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$OBJDUMP\"; then\n  ac_cv_prog_OBJDUMP=\"$OBJDUMP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_OBJDUMP=\"${ac_tool_prefix}objdump\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nOBJDUMP=$ac_cv_prog_OBJDUMP\nif test -n \"$OBJDUMP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $OBJDUMP\" >&5\n$as_echo \"$OBJDUMP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_OBJDUMP\"; then\n  ac_ct_OBJDUMP=$OBJDUMP\n  # Extract the first word of \"objdump\", so it can be a program name with args.\nset dummy objdump; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_OBJDUMP\"; then\n  ac_cv_prog_ac_ct_OBJDUMP=\"$ac_ct_OBJDUMP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_OBJDUMP=\"objdump\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP\nif test -n \"$ac_ct_OBJDUMP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP\" >&5\n$as_echo \"$ac_ct_OBJDUMP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_OBJDUMP\" = x; then\n    OBJDUMP=\"false\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    OBJDUMP=$ac_ct_OBJDUMP\n  fi\nelse\n  OBJDUMP=\"$ac_cv_prog_OBJDUMP\"\nfi\n\ntest -z \"$OBJDUMP\" && OBJDUMP=objdump\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries\" >&5\n$as_echo_n \"checking how to recognize dependent libraries... \" >&6; }\nif ${lt_cv_deplibs_check_method+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_file_magic_cmd='$MAGIC_CMD'\nlt_cv_file_magic_test_file=\nlt_cv_deplibs_check_method='unknown'\n# Need to set the preceding variable on all platforms that support\n# interlibrary dependencies.\n# 'none' -- dependencies not supported.\n# 'unknown' -- same as none, but documents that we really don't know.\n# 'pass_all' -- all dependencies passed with no checks.\n# 'test_compile' -- check by making test program.\n# 'file_magic [[regex]]' -- check by looking for files in library path\n# that responds to the $file_magic_cmd with a given extended regex.\n# If you have 'file' or equivalent on your system and you're not sure\n# whether 'pass_all' will *always* work, you probably want this one.\n\ncase $host_os in\naix[4-9]*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nbeos*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nbsdi[45]*)\n  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'\n  lt_cv_file_magic_cmd='/usr/bin/file -L'\n  lt_cv_file_magic_test_file=/shlib/libc.so\n  ;;\n\ncygwin*)\n  # func_win32_libid is a shell function defined in ltmain.sh\n  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'\n  lt_cv_file_magic_cmd='func_win32_libid'\n  ;;\n\nmingw* | pw32*)\n  # Base MSYS/MinGW do not provide the 'file' command needed by\n  # func_win32_libid shell function, so use a weaker test based on 'objdump',\n  # unless we find 'file', for example because we are cross-compiling.\n  if ( file / ) >/dev/null 2>&1; then\n    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'\n    lt_cv_file_magic_cmd='func_win32_libid'\n  else\n    # Keep this pattern in sync with the one in func_win32_libid.\n    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'\n    lt_cv_file_magic_cmd='$OBJDUMP -f'\n  fi\n  ;;\n\ncegcc*)\n  # use the weaker test based on 'objdump'. See mingw*.\n  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'\n  lt_cv_file_magic_cmd='$OBJDUMP -f'\n  ;;\n\ndarwin* | rhapsody*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nfreebsd* | dragonfly*)\n  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then\n    case $host_cpu in\n    i*86 )\n      # Not sure whether the presence of OpenBSD here was a mistake.\n      # Let's accept both of them until this is cleared up.\n      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'\n      lt_cv_file_magic_cmd=/usr/bin/file\n      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`\n      ;;\n    esac\n  else\n    lt_cv_deplibs_check_method=pass_all\n  fi\n  ;;\n\nhaiku*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nhpux10.20* | hpux11*)\n  lt_cv_file_magic_cmd=/usr/bin/file\n  case $host_cpu in\n  ia64*)\n    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'\n    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so\n    ;;\n  hppa*64*)\n    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\\.[0-9]'\n    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl\n    ;;\n  *)\n    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\\.[0-9]) shared library'\n    lt_cv_file_magic_test_file=/usr/lib/libc.sl\n    ;;\n  esac\n  ;;\n\ninterix[3-9]*)\n  # PIC code is broken on Interix 3.x, that's why |\\.a not |_pic\\.a here\n  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\\.so|\\.a)$'\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $LD in\n  *-32|*\"-32 \") libmagic=32-bit;;\n  *-n32|*\"-n32 \") libmagic=N32;;\n  *-64|*\"-64 \") libmagic=64-bit;;\n  *) libmagic=never-match;;\n  esac\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\n# This must be glibc/ELF.\nlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nnetbsd* | netbsdelf*-gnu)\n  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then\n    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\\.so\\.[0-9]+\\.[0-9]+|_pic\\.a)$'\n  else\n    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\\.so|_pic\\.a)$'\n  fi\n  ;;\n\nnewos6*)\n  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'\n  lt_cv_file_magic_cmd=/usr/bin/file\n  lt_cv_file_magic_test_file=/usr/lib/libnls.so\n  ;;\n\n*nto* | *qnx*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nopenbsd* | bitrig*)\n  if test -z \"`echo __ELF__ | $CC -E - | $GREP __ELF__`\"; then\n    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\\.so\\.[0-9]+\\.[0-9]+|\\.so|_pic\\.a)$'\n  else\n    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\\.so\\.[0-9]+\\.[0-9]+|_pic\\.a)$'\n  fi\n  ;;\n\nosf3* | osf4* | osf5*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nrdos*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsolaris*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsysv4 | sysv4.3*)\n  case $host_vendor in\n  motorola)\n    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'\n    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`\n    ;;\n  ncr)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  sequent)\n    lt_cv_file_magic_cmd='/bin/file'\n    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'\n    ;;\n  sni)\n    lt_cv_file_magic_cmd='/bin/file'\n    lt_cv_deplibs_check_method=\"file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib\"\n    lt_cv_file_magic_test_file=/lib/libc.so\n    ;;\n  siemens)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  pc)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  esac\n  ;;\n\ntpf*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\nos2*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\nesac\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method\" >&5\n$as_echo \"$lt_cv_deplibs_check_method\" >&6; }\n\nfile_magic_glob=\nwant_nocaseglob=no\nif test \"$build\" = \"$host\"; then\n  case $host_os in\n  mingw* | pw32*)\n    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then\n      want_nocaseglob=yes\n    else\n      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e \"s/\\(..\\)/s\\/[\\1]\\/[\\1]\\/g;/g\"`\n    fi\n    ;;\n  esac\nfi\n\nfile_magic_cmd=$lt_cv_file_magic_cmd\ndeplibs_check_method=$lt_cv_deplibs_check_method\ntest -z \"$deplibs_check_method\" && deplibs_check_method=unknown\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}dlltool\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}dlltool; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_DLLTOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$DLLTOOL\"; then\n  ac_cv_prog_DLLTOOL=\"$DLLTOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_DLLTOOL=\"${ac_tool_prefix}dlltool\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nDLLTOOL=$ac_cv_prog_DLLTOOL\nif test -n \"$DLLTOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $DLLTOOL\" >&5\n$as_echo \"$DLLTOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_DLLTOOL\"; then\n  ac_ct_DLLTOOL=$DLLTOOL\n  # Extract the first word of \"dlltool\", so it can be a program name with args.\nset dummy dlltool; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_DLLTOOL\"; then\n  ac_cv_prog_ac_ct_DLLTOOL=\"$ac_ct_DLLTOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_DLLTOOL=\"dlltool\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL\nif test -n \"$ac_ct_DLLTOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL\" >&5\n$as_echo \"$ac_ct_DLLTOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_DLLTOOL\" = x; then\n    DLLTOOL=\"false\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    DLLTOOL=$ac_ct_DLLTOOL\n  fi\nelse\n  DLLTOOL=\"$ac_cv_prog_DLLTOOL\"\nfi\n\ntest -z \"$DLLTOOL\" && DLLTOOL=dlltool\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries\" >&5\n$as_echo_n \"checking how to associate runtime and link libraries... \" >&6; }\nif ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_sharedlib_from_linklib_cmd='unknown'\n\ncase $host_os in\ncygwin* | mingw* | pw32* | cegcc*)\n  # two different shell functions defined in ltmain.sh;\n  # decide which one to use based on capabilities of $DLLTOOL\n  case `$DLLTOOL --help 2>&1` in\n  *--identify-strict*)\n    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib\n    ;;\n  *)\n    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback\n    ;;\n  esac\n  ;;\n*)\n  # fallback: assume linklib IS sharedlib\n  lt_cv_sharedlib_from_linklib_cmd=$ECHO\n  ;;\nesac\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd\" >&5\n$as_echo \"$lt_cv_sharedlib_from_linklib_cmd\" >&6; }\nsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd\ntest -z \"$sharedlib_from_linklib_cmd\" && sharedlib_from_linklib_cmd=$ECHO\n\n\n\n\n\n\n\nif test -n \"$ac_tool_prefix\"; then\n  for ac_prog in ar\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_AR+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$AR\"; then\n  ac_cv_prog_AR=\"$AR\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_AR=\"$ac_tool_prefix$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nAR=$ac_cv_prog_AR\nif test -n \"$AR\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $AR\" >&5\n$as_echo \"$AR\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n    test -n \"$AR\" && break\n  done\nfi\nif test -z \"$AR\"; then\n  ac_ct_AR=$AR\n  for ac_prog in ar\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_AR+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_AR\"; then\n  ac_cv_prog_ac_ct_AR=\"$ac_ct_AR\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_AR=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_AR=$ac_cv_prog_ac_ct_AR\nif test -n \"$ac_ct_AR\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR\" >&5\n$as_echo \"$ac_ct_AR\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$ac_ct_AR\" && break\ndone\n\n  if test \"x$ac_ct_AR\" = x; then\n    AR=\"false\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    AR=$ac_ct_AR\n  fi\nfi\n\n: ${AR=ar}\n: ${AR_FLAGS=cru}\n\n\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support\" >&5\n$as_echo_n \"checking for archiver @FILE support... \" >&6; }\nif ${lt_cv_ar_at_file+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_ar_at_file=no\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  echo conftest.$ac_objext > conftest.lst\n      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'\n      { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$lt_ar_try\\\"\"; } >&5\n  (eval $lt_ar_try) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n      if test 0 -eq \"$ac_status\"; then\n\t# Ensure the archiver fails upon bogus file names.\n\trm -f conftest.$ac_objext libconftest.a\n\t{ { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$lt_ar_try\\\"\"; } >&5\n  (eval $lt_ar_try) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n\tif test 0 -ne \"$ac_status\"; then\n          lt_cv_ar_at_file=@\n        fi\n      fi\n      rm -f conftest.* libconftest.a\n\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file\" >&5\n$as_echo \"$lt_cv_ar_at_file\" >&6; }\n\nif test no = \"$lt_cv_ar_at_file\"; then\n  archiver_list_spec=\nelse\n  archiver_list_spec=$lt_cv_ar_at_file\nfi\n\n\n\n\n\n\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}strip\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}strip; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_STRIP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$STRIP\"; then\n  ac_cv_prog_STRIP=\"$STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_STRIP=\"${ac_tool_prefix}strip\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nSTRIP=$ac_cv_prog_STRIP\nif test -n \"$STRIP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $STRIP\" >&5\n$as_echo \"$STRIP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_STRIP\"; then\n  ac_ct_STRIP=$STRIP\n  # Extract the first word of \"strip\", so it can be a program name with args.\nset dummy strip; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_STRIP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_STRIP\"; then\n  ac_cv_prog_ac_ct_STRIP=\"$ac_ct_STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_STRIP=\"strip\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP\nif test -n \"$ac_ct_STRIP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP\" >&5\n$as_echo \"$ac_ct_STRIP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_STRIP\" = x; then\n    STRIP=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    STRIP=$ac_ct_STRIP\n  fi\nelse\n  STRIP=\"$ac_cv_prog_STRIP\"\nfi\n\ntest -z \"$STRIP\" && STRIP=:\n\n\n\n\n\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}ranlib\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}ranlib; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_RANLIB+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$RANLIB\"; then\n  ac_cv_prog_RANLIB=\"$RANLIB\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_RANLIB=\"${ac_tool_prefix}ranlib\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nRANLIB=$ac_cv_prog_RANLIB\nif test -n \"$RANLIB\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $RANLIB\" >&5\n$as_echo \"$RANLIB\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_RANLIB\"; then\n  ac_ct_RANLIB=$RANLIB\n  # Extract the first word of \"ranlib\", so it can be a program name with args.\nset dummy ranlib; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_RANLIB+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_RANLIB\"; then\n  ac_cv_prog_ac_ct_RANLIB=\"$ac_ct_RANLIB\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_RANLIB=\"ranlib\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB\nif test -n \"$ac_ct_RANLIB\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB\" >&5\n$as_echo \"$ac_ct_RANLIB\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_RANLIB\" = x; then\n    RANLIB=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    RANLIB=$ac_ct_RANLIB\n  fi\nelse\n  RANLIB=\"$ac_cv_prog_RANLIB\"\nfi\n\ntest -z \"$RANLIB\" && RANLIB=:\n\n\n\n\n\n\n# Determine commands to create old-style static archives.\nold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'\nold_postinstall_cmds='chmod 644 $oldlib'\nold_postuninstall_cmds=\n\nif test -n \"$RANLIB\"; then\n  case $host_os in\n  bitrig* | openbsd*)\n    old_postinstall_cmds=\"$old_postinstall_cmds~\\$RANLIB -t \\$tool_oldlib\"\n    ;;\n  *)\n    old_postinstall_cmds=\"$old_postinstall_cmds~\\$RANLIB \\$tool_oldlib\"\n    ;;\n  esac\n  old_archive_cmds=\"$old_archive_cmds~\\$RANLIB \\$tool_oldlib\"\nfi\n\ncase $host_os in\n  darwin*)\n    lock_old_archive_extraction=yes ;;\n  *)\n    lock_old_archive_extraction=no ;;\nesac\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# If no C compiler flags were specified, use CFLAGS.\nLTCFLAGS=${LTCFLAGS-\"$CFLAGS\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n\n\n# Check for command to grab the raw symbol name followed by C symbol from nm.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object\" >&5\n$as_echo_n \"checking command to parse $NM output from $compiler object... \" >&6; }\nif ${lt_cv_sys_global_symbol_pipe+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n\n# These are sane defaults that work on at least a few old systems.\n# [They come from Ultrix.  What could be older than Ultrix?!! ;)]\n\n# Character class describing NM global symbol codes.\nsymcode='[BCDEGRST]'\n\n# Regexp to match symbols that can be accessed directly from C.\nsympat='\\([_A-Za-z][_A-Za-z0-9]*\\)'\n\n# Define system-specific variables.\ncase $host_os in\naix*)\n  symcode='[BCDT]'\n  ;;\ncygwin* | mingw* | pw32* | cegcc*)\n  symcode='[ABCDGISTW]'\n  ;;\nhpux*)\n  if test ia64 = \"$host_cpu\"; then\n    symcode='[ABCDEGRST]'\n  fi\n  ;;\nirix* | nonstopux*)\n  symcode='[BCDEGRST]'\n  ;;\nosf*)\n  symcode='[BCDEGQRST]'\n  ;;\nsolaris*)\n  symcode='[BDRT]'\n  ;;\nsco3.2v5*)\n  symcode='[DT]'\n  ;;\nsysv4.2uw2*)\n  symcode='[DT]'\n  ;;\nsysv5* | sco5v6* | unixware* | OpenUNIX*)\n  symcode='[ABDT]'\n  ;;\nsysv4)\n  symcode='[DFNSTU]'\n  ;;\nesac\n\n# If we're using GNU nm, then use its standard symbol codes.\ncase `$NM -V 2>&1` in\n*GNU* | *'with BFD'*)\n  symcode='[ABCDGIRSTW]' ;;\nesac\n\nif test \"$lt_cv_nm_interface\" = \"MS dumpbin\"; then\n  # Gets list of data symbols to import.\n  lt_cv_sys_global_symbol_to_import=\"sed -n -e 's/^I .* \\(.*\\)$/\\1/p'\"\n  # Adjust the below global symbol transforms to fixup imported variables.\n  lt_cdecl_hook=\" -e 's/^I .* \\(.*\\)$/extern __declspec(dllimport) char \\1;/p'\"\n  lt_c_name_hook=\" -e 's/^I .* \\(.*\\)$/  {\\\"\\1\\\", (void *) 0},/p'\"\n  lt_c_name_lib_hook=\"\\\n  -e 's/^I .* \\(lib.*\\)$/  {\\\"\\1\\\", (void *) 0},/p'\\\n  -e 's/^I .* \\(.*\\)$/  {\\\"lib\\1\\\", (void *) 0},/p'\"\nelse\n  # Disable hooks by default.\n  lt_cv_sys_global_symbol_to_import=\n  lt_cdecl_hook=\n  lt_c_name_hook=\n  lt_c_name_lib_hook=\nfi\n\n# Transform an extracted symbol line into a proper C declaration.\n# Some systems (esp. on ia64) link data and code symbols differently,\n# so use this general approach.\nlt_cv_sys_global_symbol_to_cdecl=\"sed -n\"\\\n$lt_cdecl_hook\\\n\" -e 's/^T .* \\(.*\\)$/extern int \\1();/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(.*\\)$/extern char \\1;/p'\"\n\n# Transform an extracted symbol line into symbol name and symbol address\nlt_cv_sys_global_symbol_to_c_name_address=\"sed -n\"\\\n$lt_c_name_hook\\\n\" -e 's/^: \\(.*\\) .*$/  {\\\"\\1\\\", (void *) 0},/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(.*\\)$/  {\\\"\\1\\\", (void *) \\&\\1},/p'\"\n\n# Transform an extracted symbol line into symbol name with lib prefix and\n# symbol address.\nlt_cv_sys_global_symbol_to_c_name_address_lib_prefix=\"sed -n\"\\\n$lt_c_name_lib_hook\\\n\" -e 's/^: \\(.*\\) .*$/  {\\\"\\1\\\", (void *) 0},/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(lib.*\\)$/  {\\\"\\1\\\", (void *) \\&\\1},/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(.*\\)$/  {\\\"lib\\1\\\", (void *) \\&\\1},/p'\"\n\n# Handle CRLF in mingw tool chain\nopt_cr=\ncase $build_os in\nmingw*)\n  opt_cr=`$ECHO 'x\\{0,1\\}' | tr x '\\015'` # option cr in regexp\n  ;;\nesac\n\n# Try without a prefix underscore, then with it.\nfor ac_symprfx in \"\" \"_\"; do\n\n  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.\n  symxfrm=\"\\\\1 $ac_symprfx\\\\2 \\\\2\"\n\n  # Write the raw and C identifiers.\n  if test \"$lt_cv_nm_interface\" = \"MS dumpbin\"; then\n    # Fake it for dumpbin and say T for any non-static function,\n    # D for any global variable and I for any imported variable.\n    # Also find C++ and __fastcall symbols from MSVC++,\n    # which start with @ or ?.\n    lt_cv_sys_global_symbol_pipe=\"$AWK '\"\\\n\"     {last_section=section; section=\\$ 3};\"\\\n\"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};\"\\\n\"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};\"\\\n\"     /^ *Symbol name *: /{split(\\$ 0,sn,\\\":\\\"); si=substr(sn[2],2)};\"\\\n\"     /^ *Type *: code/{print \\\"T\\\",si,substr(si,length(prfx))};\"\\\n\"     /^ *Type *: data/{print \\\"I\\\",si,substr(si,length(prfx))};\"\\\n\"     \\$ 0!~/External *\\|/{next};\"\\\n\"     / 0+ UNDEF /{next}; / UNDEF \\([^|]\\)*()/{next};\"\\\n\"     {if(hide[section]) next};\"\\\n\"     {f=\\\"D\\\"}; \\$ 0~/\\(\\).*\\|/{f=\\\"T\\\"};\"\\\n\"     {split(\\$ 0,a,/\\||\\r/); split(a[2],s)};\"\\\n\"     s[1]~/^[@?]/{print f,s[1],s[1]; next};\"\\\n\"     s[1]~prfx {split(s[1],t,\\\"@\\\"); print f,t[1],substr(t[1],length(prfx))}\"\\\n\"     ' prfx=^$ac_symprfx\"\n  else\n    lt_cv_sys_global_symbol_pipe=\"sed -n -e 's/^.*[\t ]\\($symcode$symcode*\\)[\t ][\t ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'\"\n  fi\n  lt_cv_sys_global_symbol_pipe=\"$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'\"\n\n  # Check to see that the pipe works correctly.\n  pipe_works=no\n\n  rm -f conftest*\n  cat > conftest.$ac_ext <<_LT_EOF\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nchar nm_test_var;\nvoid nm_test_func(void);\nvoid nm_test_func(void){}\n#ifdef __cplusplus\n}\n#endif\nint main(){nm_test_var='a';nm_test_func();return(0);}\n_LT_EOF\n\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then\n    # Now try to grab the symbols.\n    nlist=conftest.nm\n    if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$NM conftest.$ac_objext \\| \"$lt_cv_sys_global_symbol_pipe\" \\> $nlist\\\"\"; } >&5\n  (eval $NM conftest.$ac_objext \\| \"$lt_cv_sys_global_symbol_pipe\" \\> $nlist) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && test -s \"$nlist\"; then\n      # Try sorting and uniquifying the output.\n      if sort \"$nlist\" | uniq > \"$nlist\"T; then\n\tmv -f \"$nlist\"T \"$nlist\"\n      else\n\trm -f \"$nlist\"T\n      fi\n\n      # Make sure that we snagged all the symbols we need.\n      if $GREP ' nm_test_var$' \"$nlist\" >/dev/null; then\n\tif $GREP ' nm_test_func$' \"$nlist\" >/dev/null; then\n\t  cat <<_LT_EOF > conftest.$ac_ext\n/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */\n#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE\n/* DATA imports from DLLs on WIN32 can't be const, because runtime\n   relocations are performed -- see ld's documentation on pseudo-relocs.  */\n# define LT_DLSYM_CONST\n#elif defined __osf__\n/* This system does not cope well with relocations in const data.  */\n# define LT_DLSYM_CONST\n#else\n# define LT_DLSYM_CONST const\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n_LT_EOF\n\t  # Now generate the symbol file.\n\t  eval \"$lt_cv_sys_global_symbol_to_cdecl\"' < \"$nlist\" | $GREP -v main >> conftest.$ac_ext'\n\n\t  cat <<_LT_EOF >> conftest.$ac_ext\n\n/* The mapping between symbol names and symbols.  */\nLT_DLSYM_CONST struct {\n  const char *name;\n  void       *address;\n}\nlt__PROGRAM__LTX_preloaded_symbols[] =\n{\n  { \"@PROGRAM@\", (void *) 0 },\n_LT_EOF\n\t  $SED \"s/^$symcode$symcode* .* \\(.*\\)$/  {\\\"\\1\\\", (void *) \\&\\1},/\" < \"$nlist\" | $GREP -v main >> conftest.$ac_ext\n\t  cat <<\\_LT_EOF >> conftest.$ac_ext\n  {0, (void *) 0}\n};\n\n/* This works around a problem in FreeBSD linker */\n#ifdef FREEBSD_WORKAROUND\nstatic const void *lt_preloaded_setup() {\n  return lt__PROGRAM__LTX_preloaded_symbols;\n}\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n_LT_EOF\n\t  # Now try linking the two files.\n\t  mv conftest.$ac_objext conftstm.$ac_objext\n\t  lt_globsym_save_LIBS=$LIBS\n\t  lt_globsym_save_CFLAGS=$CFLAGS\n\t  LIBS=conftstm.$ac_objext\n\t  CFLAGS=\"$CFLAGS$lt_prog_compiler_no_builtin_flag\"\n\t  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_link\\\"\"; } >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && test -s conftest$ac_exeext; then\n\t    pipe_works=yes\n\t  fi\n\t  LIBS=$lt_globsym_save_LIBS\n\t  CFLAGS=$lt_globsym_save_CFLAGS\n\telse\n\t  echo \"cannot find nm_test_func in $nlist\" >&5\n\tfi\n      else\n\techo \"cannot find nm_test_var in $nlist\" >&5\n      fi\n    else\n      echo \"cannot run $lt_cv_sys_global_symbol_pipe\" >&5\n    fi\n  else\n    echo \"$progname: failed program was:\" >&5\n    cat conftest.$ac_ext >&5\n  fi\n  rm -rf conftest* conftst*\n\n  # Do not use the global_symbol_pipe unless it works.\n  if test yes = \"$pipe_works\"; then\n    break\n  else\n    lt_cv_sys_global_symbol_pipe=\n  fi\ndone\n\nfi\n\nif test -z \"$lt_cv_sys_global_symbol_pipe\"; then\n  lt_cv_sys_global_symbol_to_cdecl=\nfi\nif test -z \"$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: failed\" >&5\n$as_echo \"failed\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: ok\" >&5\n$as_echo \"ok\" >&6; }\nfi\n\n# Response file support.\nif test \"$lt_cv_nm_interface\" = \"MS dumpbin\"; then\n  nm_file_list_spec='@'\nelif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then\n  nm_file_list_spec='@'\nfi\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for sysroot\" >&5\n$as_echo_n \"checking for sysroot... \" >&6; }\n\n# Check whether --with-sysroot was given.\nif test \"${with_sysroot+set}\" = set; then :\n  withval=$with_sysroot;\nelse\n  with_sysroot=no\nfi\n\n\nlt_sysroot=\ncase $with_sysroot in #(\n yes)\n   if test yes = \"$GCC\"; then\n     lt_sysroot=`$CC --print-sysroot 2>/dev/null`\n   fi\n   ;; #(\n /*)\n   lt_sysroot=`echo \"$with_sysroot\" | sed -e \"$sed_quote_subst\"`\n   ;; #(\n no|'')\n   ;; #(\n *)\n   { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $with_sysroot\" >&5\n$as_echo \"$with_sysroot\" >&6; }\n   as_fn_error $? \"The sysroot must be an absolute path.\" \"$LINENO\" 5\n   ;;\nesac\n\n { $as_echo \"$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}\" >&5\n$as_echo \"${lt_sysroot:-no}\" >&6; }\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for a working dd\" >&5\n$as_echo_n \"checking for a working dd... \" >&6; }\nif ${ac_cv_path_lt_DD+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  printf 0123456789abcdef0123456789abcdef >conftest.i\ncat conftest.i conftest.i >conftest2.i\n: ${lt_DD:=$DD}\nif test -z \"$lt_DD\"; then\n  ac_path_lt_DD_found=false\n  # Loop through the user's path and test for each of PROGNAME-LIST\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_prog in dd; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      ac_path_lt_DD=\"$as_dir/$ac_prog$ac_exec_ext\"\n      as_fn_executable_p \"$ac_path_lt_DD\" || continue\nif \"$ac_path_lt_DD\" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then\n  cmp -s conftest.i conftest.out \\\n  && ac_cv_path_lt_DD=\"$ac_path_lt_DD\" ac_path_lt_DD_found=:\nfi\n      $ac_path_lt_DD_found && break 3\n    done\n  done\n  done\nIFS=$as_save_IFS\n  if test -z \"$ac_cv_path_lt_DD\"; then\n    :\n  fi\nelse\n  ac_cv_path_lt_DD=$lt_DD\nfi\n\nrm -f conftest.i conftest2.i conftest.out\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD\" >&5\n$as_echo \"$ac_cv_path_lt_DD\" >&6; }\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes\" >&5\n$as_echo_n \"checking how to truncate binary pipes... \" >&6; }\nif ${lt_cv_truncate_bin+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  printf 0123456789abcdef0123456789abcdef >conftest.i\ncat conftest.i conftest.i >conftest2.i\nlt_cv_truncate_bin=\nif \"$ac_cv_path_lt_DD\" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then\n  cmp -s conftest.i conftest.out \\\n  && lt_cv_truncate_bin=\"$ac_cv_path_lt_DD bs=4096 count=1\"\nfi\nrm -f conftest.i conftest2.i conftest.out\ntest -z \"$lt_cv_truncate_bin\" && lt_cv_truncate_bin=\"$SED -e 4q\"\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin\" >&5\n$as_echo \"$lt_cv_truncate_bin\" >&6; }\n\n\n\n\n\n\n\n# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.\nfunc_cc_basename ()\n{\n    for cc_temp in $*\"\"; do\n      case $cc_temp in\n        compile | *[\\\\/]compile | ccache | *[\\\\/]ccache ) ;;\n        distcc | *[\\\\/]distcc | purify | *[\\\\/]purify ) ;;\n        \\-*) ;;\n        *) break;;\n      esac\n    done\n    func_cc_basename_result=`$ECHO \"$cc_temp\" | $SED \"s%.*/%%; s%^$host_alias-%%\"`\n}\n\n# Check whether --enable-libtool-lock was given.\nif test \"${enable_libtool_lock+set}\" = set; then :\n  enableval=$enable_libtool_lock;\nfi\n\ntest no = \"$enable_libtool_lock\" || enable_libtool_lock=yes\n\n# Some flags need to be propagated to the compiler or linker for good\n# libtool support.\ncase $host in\nia64-*-hpux*)\n  # Find out what ABI is being produced by ac_compile, and set mode\n  # options accordingly.\n  echo 'int i;' > conftest.$ac_ext\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then\n    case `/usr/bin/file conftest.$ac_objext` in\n      *ELF-32*)\n\tHPUX_IA64_MODE=32\n\t;;\n      *ELF-64*)\n\tHPUX_IA64_MODE=64\n\t;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\n*-*-irix6*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.\n  echo '#line '$LINENO' \"configure\"' > conftest.$ac_ext\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then\n    if test yes = \"$lt_cv_prog_gnu_ld\"; then\n      case `/usr/bin/file conftest.$ac_objext` in\n\t*32-bit*)\n\t  LD=\"${LD-ld} -melf32bsmip\"\n\t  ;;\n\t*N32*)\n\t  LD=\"${LD-ld} -melf32bmipn32\"\n\t  ;;\n\t*64-bit*)\n\t  LD=\"${LD-ld} -melf64bmip\"\n\t;;\n      esac\n    else\n      case `/usr/bin/file conftest.$ac_objext` in\n\t*32-bit*)\n\t  LD=\"${LD-ld} -32\"\n\t  ;;\n\t*N32*)\n\t  LD=\"${LD-ld} -n32\"\n\t  ;;\n\t*64-bit*)\n\t  LD=\"${LD-ld} -64\"\n\t  ;;\n      esac\n    fi\n  fi\n  rm -rf conftest*\n  ;;\n\nmips64*-*linux*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.\n  echo '#line '$LINENO' \"configure\"' > conftest.$ac_ext\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then\n    emul=elf\n    case `/usr/bin/file conftest.$ac_objext` in\n      *32-bit*)\n\temul=\"${emul}32\"\n\t;;\n      *64-bit*)\n\temul=\"${emul}64\"\n\t;;\n    esac\n    case `/usr/bin/file conftest.$ac_objext` in\n      *MSB*)\n\temul=\"${emul}btsmip\"\n\t;;\n      *LSB*)\n\temul=\"${emul}ltsmip\"\n\t;;\n    esac\n    case `/usr/bin/file conftest.$ac_objext` in\n      *N32*)\n\temul=\"${emul}n32\"\n\t;;\n    esac\n    LD=\"${LD-ld} -m $emul\"\n  fi\n  rm -rf conftest*\n  ;;\n\nx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \\\ns390*-*linux*|s390*-*tpf*|sparc*-*linux*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.  Note that the listed cases only cover the\n  # situations where additional linker options are needed (such as when\n  # doing 32-bit compilation for a host where ld defaults to 64-bit, or\n  # vice versa); the common cases where no linker options are needed do\n  # not appear in the list.\n  echo 'int i;' > conftest.$ac_ext\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then\n    case `/usr/bin/file conftest.o` in\n      *32-bit*)\n\tcase $host in\n\t  x86_64-*kfreebsd*-gnu)\n\t    LD=\"${LD-ld} -m elf_i386_fbsd\"\n\t    ;;\n\t  x86_64-*linux*)\n\t    case `/usr/bin/file conftest.o` in\n\t      *x86-64*)\n\t\tLD=\"${LD-ld} -m elf32_x86_64\"\n\t\t;;\n\t      *)\n\t\tLD=\"${LD-ld} -m elf_i386\"\n\t\t;;\n\t    esac\n\t    ;;\n\t  powerpc64le-*linux*)\n\t    LD=\"${LD-ld} -m elf32lppclinux\"\n\t    ;;\n\t  powerpc64-*linux*)\n\t    LD=\"${LD-ld} -m elf32ppclinux\"\n\t    ;;\n\t  s390x-*linux*)\n\t    LD=\"${LD-ld} -m elf_s390\"\n\t    ;;\n\t  sparc64-*linux*)\n\t    LD=\"${LD-ld} -m elf32_sparc\"\n\t    ;;\n\tesac\n\t;;\n      *64-bit*)\n\tcase $host in\n\t  x86_64-*kfreebsd*-gnu)\n\t    LD=\"${LD-ld} -m elf_x86_64_fbsd\"\n\t    ;;\n\t  x86_64-*linux*)\n\t    LD=\"${LD-ld} -m elf_x86_64\"\n\t    ;;\n\t  powerpcle-*linux*)\n\t    LD=\"${LD-ld} -m elf64lppc\"\n\t    ;;\n\t  powerpc-*linux*)\n\t    LD=\"${LD-ld} -m elf64ppc\"\n\t    ;;\n\t  s390*-*linux*|s390*-*tpf*)\n\t    LD=\"${LD-ld} -m elf64_s390\"\n\t    ;;\n\t  sparc*-*linux*)\n\t    LD=\"${LD-ld} -m elf64_sparc\"\n\t    ;;\n\tesac\n\t;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\n\n*-*-sco3.2v5*)\n  # On SCO OpenServer 5, we need -belf to get full-featured binaries.\n  SAVE_CFLAGS=$CFLAGS\n  CFLAGS=\"$CFLAGS -belf\"\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf\" >&5\n$as_echo_n \"checking whether the C compiler needs -belf... \" >&6; }\nif ${lt_cv_cc_needs_belf+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n     cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  lt_cv_cc_needs_belf=yes\nelse\n  lt_cv_cc_needs_belf=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n     ac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf\" >&5\n$as_echo \"$lt_cv_cc_needs_belf\" >&6; }\n  if test yes != \"$lt_cv_cc_needs_belf\"; then\n    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf\n    CFLAGS=$SAVE_CFLAGS\n  fi\n  ;;\n*-*solaris*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.\n  echo 'int i;' > conftest.$ac_ext\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then\n    case `/usr/bin/file conftest.o` in\n    *64-bit*)\n      case $lt_cv_prog_gnu_ld in\n      yes*)\n        case $host in\n        i?86-*-solaris*|x86_64-*-solaris*)\n          LD=\"${LD-ld} -m elf_x86_64\"\n          ;;\n        sparc*-*-solaris*)\n          LD=\"${LD-ld} -m elf64_sparc\"\n          ;;\n        esac\n        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.\n        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then\n          LD=${LD-ld}_sol2\n        fi\n        ;;\n      *)\n\tif ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then\n\t  LD=\"${LD-ld} -64\"\n\tfi\n\t;;\n      esac\n      ;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\nesac\n\nneed_locks=$enable_libtool_lock\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}mt\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}mt; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_MANIFEST_TOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$MANIFEST_TOOL\"; then\n  ac_cv_prog_MANIFEST_TOOL=\"$MANIFEST_TOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_MANIFEST_TOOL=\"${ac_tool_prefix}mt\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nMANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL\nif test -n \"$MANIFEST_TOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL\" >&5\n$as_echo \"$MANIFEST_TOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_MANIFEST_TOOL\"; then\n  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL\n  # Extract the first word of \"mt\", so it can be a program name with args.\nset dummy mt; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_MANIFEST_TOOL\"; then\n  ac_cv_prog_ac_ct_MANIFEST_TOOL=\"$ac_ct_MANIFEST_TOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_MANIFEST_TOOL=\"mt\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL\nif test -n \"$ac_ct_MANIFEST_TOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL\" >&5\n$as_echo \"$ac_ct_MANIFEST_TOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_MANIFEST_TOOL\" = x; then\n    MANIFEST_TOOL=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL\n  fi\nelse\n  MANIFEST_TOOL=\"$ac_cv_prog_MANIFEST_TOOL\"\nfi\n\ntest -z \"$MANIFEST_TOOL\" && MANIFEST_TOOL=mt\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool\" >&5\n$as_echo_n \"checking if $MANIFEST_TOOL is a manifest tool... \" >&6; }\nif ${lt_cv_path_mainfest_tool+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_path_mainfest_tool=no\n  echo \"$as_me:$LINENO: $MANIFEST_TOOL '-?'\" >&5\n  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out\n  cat conftest.err >&5\n  if $GREP 'Manifest Tool' conftest.out > /dev/null; then\n    lt_cv_path_mainfest_tool=yes\n  fi\n  rm -f conftest*\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool\" >&5\n$as_echo \"$lt_cv_path_mainfest_tool\" >&6; }\nif test yes != \"$lt_cv_path_mainfest_tool\"; then\n  MANIFEST_TOOL=:\nfi\n\n\n\n\n\n\n  case $host_os in\n    rhapsody* | darwin*)\n    if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}dsymutil\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}dsymutil; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_DSYMUTIL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$DSYMUTIL\"; then\n  ac_cv_prog_DSYMUTIL=\"$DSYMUTIL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_DSYMUTIL=\"${ac_tool_prefix}dsymutil\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nDSYMUTIL=$ac_cv_prog_DSYMUTIL\nif test -n \"$DSYMUTIL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL\" >&5\n$as_echo \"$DSYMUTIL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_DSYMUTIL\"; then\n  ac_ct_DSYMUTIL=$DSYMUTIL\n  # Extract the first word of \"dsymutil\", so it can be a program name with args.\nset dummy dsymutil; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_DSYMUTIL\"; then\n  ac_cv_prog_ac_ct_DSYMUTIL=\"$ac_ct_DSYMUTIL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_DSYMUTIL=\"dsymutil\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL\nif test -n \"$ac_ct_DSYMUTIL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL\" >&5\n$as_echo \"$ac_ct_DSYMUTIL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_DSYMUTIL\" = x; then\n    DSYMUTIL=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    DSYMUTIL=$ac_ct_DSYMUTIL\n  fi\nelse\n  DSYMUTIL=\"$ac_cv_prog_DSYMUTIL\"\nfi\n\n    if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}nmedit\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}nmedit; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_NMEDIT+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$NMEDIT\"; then\n  ac_cv_prog_NMEDIT=\"$NMEDIT\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_NMEDIT=\"${ac_tool_prefix}nmedit\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nNMEDIT=$ac_cv_prog_NMEDIT\nif test -n \"$NMEDIT\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $NMEDIT\" >&5\n$as_echo \"$NMEDIT\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_NMEDIT\"; then\n  ac_ct_NMEDIT=$NMEDIT\n  # Extract the first word of \"nmedit\", so it can be a program name with args.\nset dummy nmedit; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_NMEDIT\"; then\n  ac_cv_prog_ac_ct_NMEDIT=\"$ac_ct_NMEDIT\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_NMEDIT=\"nmedit\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT\nif test -n \"$ac_ct_NMEDIT\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT\" >&5\n$as_echo \"$ac_ct_NMEDIT\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_NMEDIT\" = x; then\n    NMEDIT=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    NMEDIT=$ac_ct_NMEDIT\n  fi\nelse\n  NMEDIT=\"$ac_cv_prog_NMEDIT\"\nfi\n\n    if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}lipo\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}lipo; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_LIPO+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$LIPO\"; then\n  ac_cv_prog_LIPO=\"$LIPO\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_LIPO=\"${ac_tool_prefix}lipo\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nLIPO=$ac_cv_prog_LIPO\nif test -n \"$LIPO\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $LIPO\" >&5\n$as_echo \"$LIPO\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_LIPO\"; then\n  ac_ct_LIPO=$LIPO\n  # Extract the first word of \"lipo\", so it can be a program name with args.\nset dummy lipo; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_LIPO+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_LIPO\"; then\n  ac_cv_prog_ac_ct_LIPO=\"$ac_ct_LIPO\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_LIPO=\"lipo\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO\nif test -n \"$ac_ct_LIPO\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO\" >&5\n$as_echo \"$ac_ct_LIPO\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_LIPO\" = x; then\n    LIPO=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    LIPO=$ac_ct_LIPO\n  fi\nelse\n  LIPO=\"$ac_cv_prog_LIPO\"\nfi\n\n    if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}otool\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}otool; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_OTOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$OTOOL\"; then\n  ac_cv_prog_OTOOL=\"$OTOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_OTOOL=\"${ac_tool_prefix}otool\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nOTOOL=$ac_cv_prog_OTOOL\nif test -n \"$OTOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $OTOOL\" >&5\n$as_echo \"$OTOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_OTOOL\"; then\n  ac_ct_OTOOL=$OTOOL\n  # Extract the first word of \"otool\", so it can be a program name with args.\nset dummy otool; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_OTOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_OTOOL\"; then\n  ac_cv_prog_ac_ct_OTOOL=\"$ac_ct_OTOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_OTOOL=\"otool\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL\nif test -n \"$ac_ct_OTOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL\" >&5\n$as_echo \"$ac_ct_OTOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_OTOOL\" = x; then\n    OTOOL=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    OTOOL=$ac_ct_OTOOL\n  fi\nelse\n  OTOOL=\"$ac_cv_prog_OTOOL\"\nfi\n\n    if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}otool64\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}otool64; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_OTOOL64+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$OTOOL64\"; then\n  ac_cv_prog_OTOOL64=\"$OTOOL64\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_OTOOL64=\"${ac_tool_prefix}otool64\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nOTOOL64=$ac_cv_prog_OTOOL64\nif test -n \"$OTOOL64\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $OTOOL64\" >&5\n$as_echo \"$OTOOL64\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_OTOOL64\"; then\n  ac_ct_OTOOL64=$OTOOL64\n  # Extract the first word of \"otool64\", so it can be a program name with args.\nset dummy otool64; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_OTOOL64\"; then\n  ac_cv_prog_ac_ct_OTOOL64=\"$ac_ct_OTOOL64\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_OTOOL64=\"otool64\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64\nif test -n \"$ac_ct_OTOOL64\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64\" >&5\n$as_echo \"$ac_ct_OTOOL64\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_OTOOL64\" = x; then\n    OTOOL64=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    OTOOL64=$ac_ct_OTOOL64\n  fi\nelse\n  OTOOL64=\"$ac_cv_prog_OTOOL64\"\nfi\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag\" >&5\n$as_echo_n \"checking for -single_module linker flag... \" >&6; }\nif ${lt_cv_apple_cc_single_mod+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_apple_cc_single_mod=no\n      if test -z \"$LT_MULTI_MODULE\"; then\n\t# By default we will add the -single_module flag. You can override\n\t# by either setting the environment variable LT_MULTI_MODULE\n\t# non-empty at configure time, or by adding -multi_module to the\n\t# link flags.\n\trm -rf libconftest.dylib*\n\techo \"int foo(void){return 1;}\" > conftest.c\n\techo \"$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \\\n-dynamiclib -Wl,-single_module conftest.c\" >&5\n\t$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \\\n\t  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err\n        _lt_result=$?\n\t# If there is a non-empty error log, and \"single_module\"\n\t# appears in it, assume the flag caused a linker warning\n        if test -s conftest.err && $GREP single_module conftest.err; then\n\t  cat conftest.err >&5\n\t# Otherwise, if the output was created with a 0 exit code from\n\t# the compiler, it worked.\n\telif test -f libconftest.dylib && test 0 = \"$_lt_result\"; then\n\t  lt_cv_apple_cc_single_mod=yes\n\telse\n\t  cat conftest.err >&5\n\tfi\n\trm -rf libconftest.dylib*\n\trm -f conftest.*\n      fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod\" >&5\n$as_echo \"$lt_cv_apple_cc_single_mod\" >&6; }\n\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag\" >&5\n$as_echo_n \"checking for -exported_symbols_list linker flag... \" >&6; }\nif ${lt_cv_ld_exported_symbols_list+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_ld_exported_symbols_list=no\n      save_LDFLAGS=$LDFLAGS\n      echo \"_main\" > conftest.sym\n      LDFLAGS=\"$LDFLAGS -Wl,-exported_symbols_list,conftest.sym\"\n      cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  lt_cv_ld_exported_symbols_list=yes\nelse\n  lt_cv_ld_exported_symbols_list=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n\tLDFLAGS=$save_LDFLAGS\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list\" >&5\n$as_echo \"$lt_cv_ld_exported_symbols_list\" >&6; }\n\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag\" >&5\n$as_echo_n \"checking for -force_load linker flag... \" >&6; }\nif ${lt_cv_ld_force_load+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_ld_force_load=no\n      cat > conftest.c << _LT_EOF\nint forced_loaded() { return 2;}\n_LT_EOF\n      echo \"$LTCC $LTCFLAGS -c -o conftest.o conftest.c\" >&5\n      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5\n      echo \"$AR cru libconftest.a conftest.o\" >&5\n      $AR cru libconftest.a conftest.o 2>&5\n      echo \"$RANLIB libconftest.a\" >&5\n      $RANLIB libconftest.a 2>&5\n      cat > conftest.c << _LT_EOF\nint main() { return 0;}\n_LT_EOF\n      echo \"$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a\" >&5\n      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err\n      _lt_result=$?\n      if test -s conftest.err && $GREP force_load conftest.err; then\n\tcat conftest.err >&5\n      elif test -f conftest && test 0 = \"$_lt_result\" && $GREP forced_load conftest >/dev/null 2>&1; then\n\tlt_cv_ld_force_load=yes\n      else\n\tcat conftest.err >&5\n      fi\n        rm -f conftest.err libconftest.a conftest conftest.c\n        rm -rf conftest.dSYM\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load\" >&5\n$as_echo \"$lt_cv_ld_force_load\" >&6; }\n    case $host_os in\n    rhapsody* | darwin1.[012])\n      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;\n    darwin1.*)\n      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;\n    darwin*) # darwin 5.x on\n      # if running on 10.5 or later, the deployment target defaults\n      # to the OS version, if on x86, and 10.4, the deployment\n      # target defaults to 10.4. Don't you love it?\n      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in\n\t10.0,*86*-darwin8*|10.0,*-darwin[91]*)\n\t  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;\n\t10.[012][,.]*)\n\t  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;\n\t10.*)\n\t  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;\n      esac\n    ;;\n  esac\n    if test yes = \"$lt_cv_apple_cc_single_mod\"; then\n      _lt_dar_single_mod='$single_module'\n    fi\n    if test yes = \"$lt_cv_ld_exported_symbols_list\"; then\n      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'\n    else\n      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'\n    fi\n    if test : != \"$DSYMUTIL\" && test no = \"$lt_cv_ld_force_load\"; then\n      _lt_dsymutil='~$DSYMUTIL $lib || :'\n    else\n      _lt_dsymutil=\n    fi\n    ;;\n  esac\n\n# func_munge_path_list VARIABLE PATH\n# -----------------------------------\n# VARIABLE is name of variable containing _space_ separated list of\n# directories to be munged by the contents of PATH, which is string\n# having a format:\n# \"DIR[:DIR]:\"\n#       string \"DIR[ DIR]\" will be prepended to VARIABLE\n# \":DIR[:DIR]\"\n#       string \"DIR[ DIR]\" will be appended to VARIABLE\n# \"DIRP[:DIRP]::[DIRA:]DIRA\"\n#       string \"DIRP[ DIRP]\" will be prepended to VARIABLE and string\n#       \"DIRA[ DIRA]\" will be appended to VARIABLE\n# \"DIR[:DIR]\"\n#       VARIABLE will be replaced by \"DIR[ DIR]\"\nfunc_munge_path_list ()\n{\n    case x$2 in\n    x)\n        ;;\n    *:)\n        eval $1=\\\"`$ECHO $2 | $SED 's/:/ /g'` \\$$1\\\"\n        ;;\n    x:*)\n        eval $1=\\\"\\$$1 `$ECHO $2 | $SED 's/:/ /g'`\\\"\n        ;;\n    *::*)\n        eval $1=\\\"\\$$1\\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\\\"\n        eval $1=\\\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\\ \\$$1\\\"\n        ;;\n    *)\n        eval $1=\\\"`$ECHO $2 | $SED 's/:/ /g'`\\\"\n        ;;\n    esac\n}\n\nfor ac_header in dlfcn.h\ndo :\n  ac_fn_c_check_header_compile \"$LINENO\" \"dlfcn.h\" \"ac_cv_header_dlfcn_h\" \"$ac_includes_default\n\"\nif test \"x$ac_cv_header_dlfcn_h\" = xyes; then :\n  cat >>confdefs.h <<_ACEOF\n#define HAVE_DLFCN_H 1\n_ACEOF\n\nfi\n\ndone\n\n\n\n\n\n# Set options\n\n\n\n        enable_dlopen=no\n\n\n\n            # Check whether --enable-shared was given.\nif test \"${enable_shared+set}\" = set; then :\n  enableval=$enable_shared; p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_shared=yes ;;\n    no) enable_shared=no ;;\n    *)\n      enable_shared=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for pkg in $enableval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_shared=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac\nelse\n  enable_shared=yes\nfi\n\n\n\n\n\n\n\n\n\n  # Check whether --enable-static was given.\nif test \"${enable_static+set}\" = set; then :\n  enableval=$enable_static; p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_static=yes ;;\n    no) enable_static=no ;;\n    *)\n     enable_static=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for pkg in $enableval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_static=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac\nelse\n  enable_static=yes\nfi\n\n\n\n\n\n\n\n\n\n\n# Check whether --with-pic was given.\nif test \"${with_pic+set}\" = set; then :\n  withval=$with_pic; lt_p=${PACKAGE-default}\n    case $withval in\n    yes|no) pic_mode=$withval ;;\n    *)\n      pic_mode=default\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for lt_pkg in $withval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$lt_pkg\" = \"X$lt_p\"; then\n\t  pic_mode=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac\nelse\n  pic_mode=default\nfi\n\n\n\n\n\n\n\n\n  # Check whether --enable-fast-install was given.\nif test \"${enable_fast_install+set}\" = set; then :\n  enableval=$enable_fast_install; p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_fast_install=yes ;;\n    no) enable_fast_install=no ;;\n    *)\n      enable_fast_install=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for pkg in $enableval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_fast_install=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac\nelse\n  enable_fast_install=yes\nfi\n\n\n\n\n\n\n\n\n  shared_archive_member_spec=\ncase $host,$enable_shared in\npower*-*-aix[5-9]*,yes)\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide\" >&5\n$as_echo_n \"checking which variant of shared library versioning to provide... \" >&6; }\n\n# Check whether --with-aix-soname was given.\nif test \"${with_aix_soname+set}\" = set; then :\n  withval=$with_aix_soname; case $withval in\n    aix|svr4|both)\n      ;;\n    *)\n      as_fn_error $? \"Unknown argument to --with-aix-soname\" \"$LINENO\" 5\n      ;;\n    esac\n    lt_cv_with_aix_soname=$with_aix_soname\nelse\n  if ${lt_cv_with_aix_soname+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_with_aix_soname=aix\nfi\n\n    with_aix_soname=$lt_cv_with_aix_soname\nfi\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $with_aix_soname\" >&5\n$as_echo \"$with_aix_soname\" >&6; }\n  if test aix != \"$with_aix_soname\"; then\n    # For the AIX way of multilib, we name the shared archive member\n    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',\n    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.\n    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,\n    # the AIX toolchain works better with OBJECT_MODE set (default 32).\n    if test 64 = \"${OBJECT_MODE-32}\"; then\n      shared_archive_member_spec=shr_64\n    else\n      shared_archive_member_spec=shr\n    fi\n  fi\n  ;;\n*)\n  with_aix_soname=aix\n  ;;\nesac\n\n\n\n\n\n\n\n\n\n\n# This can be used to rebuild libtool when needed\nLIBTOOL_DEPS=$ltmain\n\n# Always use our own libtool.\nLIBTOOL='$(SHELL) $(top_builddir)/libtool'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ntest -z \"$LN_S\" && LN_S=\"ln -s\"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nif test -n \"${ZSH_VERSION+set}\"; then\n   setopt NO_GLOB_SUBST\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for objdir\" >&5\n$as_echo_n \"checking for objdir... \" >&6; }\nif ${lt_cv_objdir+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  rm -f .libs 2>/dev/null\nmkdir .libs 2>/dev/null\nif test -d .libs; then\n  lt_cv_objdir=.libs\nelse\n  # MS-DOS does not allow filenames that begin with a dot.\n  lt_cv_objdir=_libs\nfi\nrmdir .libs 2>/dev/null\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir\" >&5\n$as_echo \"$lt_cv_objdir\" >&6; }\nobjdir=$lt_cv_objdir\n\n\n\n\n\ncat >>confdefs.h <<_ACEOF\n#define LT_OBJDIR \"$lt_cv_objdir/\"\n_ACEOF\n\n\n\n\ncase $host_os in\naix3*)\n  # AIX sometimes has problems with the GCC collect2 program.  For some\n  # reason, if we set the COLLECT_NAMES environment variable, the problems\n  # vanish in a puff of smoke.\n  if test set != \"${COLLECT_NAMES+set}\"; then\n    COLLECT_NAMES=\n    export COLLECT_NAMES\n  fi\n  ;;\nesac\n\n# Global variables:\nofile=libtool\ncan_build_shared=yes\n\n# All known linkers require a '.a' archive for static linking (except MSVC,\n# which needs '.lib').\nlibext=a\n\nwith_gnu_ld=$lt_cv_prog_gnu_ld\n\nold_CC=$CC\nold_CFLAGS=$CFLAGS\n\n# Set sane defaults for various variables\ntest -z \"$CC\" && CC=cc\ntest -z \"$LTCC\" && LTCC=$CC\ntest -z \"$LTCFLAGS\" && LTCFLAGS=$CFLAGS\ntest -z \"$LD\" && LD=ld\ntest -z \"$ac_objext\" && ac_objext=o\n\nfunc_cc_basename $compiler\ncc_basename=$func_cc_basename_result\n\n\n# Only perform the check for file, if the check method requires it\ntest -z \"$MAGIC_CMD\" && MAGIC_CMD=file\ncase $deplibs_check_method in\nfile_magic*)\n  if test \"$file_magic_cmd\" = '$MAGIC_CMD'; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file\" >&5\n$as_echo_n \"checking for ${ac_tool_prefix}file... \" >&6; }\nif ${lt_cv_path_MAGIC_CMD+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  case $MAGIC_CMD in\n[\\\\/*] |  ?:[\\\\/]*)\n  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.\n  ;;\n*)\n  lt_save_MAGIC_CMD=$MAGIC_CMD\n  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\n  ac_dummy=\"/usr/bin$PATH_SEPARATOR$PATH\"\n  for ac_dir in $ac_dummy; do\n    IFS=$lt_save_ifs\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/${ac_tool_prefix}file\"; then\n      lt_cv_path_MAGIC_CMD=$ac_dir/\"${ac_tool_prefix}file\"\n      if test -n \"$file_magic_test_file\"; then\n\tcase $deplibs_check_method in\n\t\"file_magic \"*)\n\t  file_magic_regex=`expr \"$deplibs_check_method\" : \"file_magic \\(.*\\)\"`\n\t  MAGIC_CMD=$lt_cv_path_MAGIC_CMD\n\t  if eval $file_magic_cmd \\$file_magic_test_file 2> /dev/null |\n\t    $EGREP \"$file_magic_regex\" > /dev/null; then\n\t    :\n\t  else\n\t    cat <<_LT_EOF 1>&2\n\n*** Warning: the command libtool uses to detect shared libraries,\n*** $file_magic_cmd, produces output that libtool cannot recognize.\n*** The result is that libtool may fail to recognize shared libraries\n*** as such.  This will affect the creation of libtool libraries that\n*** depend on shared libraries, but programs linked with such libtool\n*** libraries will work regardless of this problem.  Nevertheless, you\n*** may want to report the problem to your system manager and/or to\n*** bug-libtool@gnu.org\n\n_LT_EOF\n\t  fi ;;\n\tesac\n      fi\n      break\n    fi\n  done\n  IFS=$lt_save_ifs\n  MAGIC_CMD=$lt_save_MAGIC_CMD\n  ;;\nesac\nfi\n\nMAGIC_CMD=$lt_cv_path_MAGIC_CMD\nif test -n \"$MAGIC_CMD\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD\" >&5\n$as_echo \"$MAGIC_CMD\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n\n\n\nif test -z \"$lt_cv_path_MAGIC_CMD\"; then\n  if test -n \"$ac_tool_prefix\"; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for file\" >&5\n$as_echo_n \"checking for file... \" >&6; }\nif ${lt_cv_path_MAGIC_CMD+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  case $MAGIC_CMD in\n[\\\\/*] |  ?:[\\\\/]*)\n  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.\n  ;;\n*)\n  lt_save_MAGIC_CMD=$MAGIC_CMD\n  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\n  ac_dummy=\"/usr/bin$PATH_SEPARATOR$PATH\"\n  for ac_dir in $ac_dummy; do\n    IFS=$lt_save_ifs\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/file\"; then\n      lt_cv_path_MAGIC_CMD=$ac_dir/\"file\"\n      if test -n \"$file_magic_test_file\"; then\n\tcase $deplibs_check_method in\n\t\"file_magic \"*)\n\t  file_magic_regex=`expr \"$deplibs_check_method\" : \"file_magic \\(.*\\)\"`\n\t  MAGIC_CMD=$lt_cv_path_MAGIC_CMD\n\t  if eval $file_magic_cmd \\$file_magic_test_file 2> /dev/null |\n\t    $EGREP \"$file_magic_regex\" > /dev/null; then\n\t    :\n\t  else\n\t    cat <<_LT_EOF 1>&2\n\n*** Warning: the command libtool uses to detect shared libraries,\n*** $file_magic_cmd, produces output that libtool cannot recognize.\n*** The result is that libtool may fail to recognize shared libraries\n*** as such.  This will affect the creation of libtool libraries that\n*** depend on shared libraries, but programs linked with such libtool\n*** libraries will work regardless of this problem.  Nevertheless, you\n*** may want to report the problem to your system manager and/or to\n*** bug-libtool@gnu.org\n\n_LT_EOF\n\t  fi ;;\n\tesac\n      fi\n      break\n    fi\n  done\n  IFS=$lt_save_ifs\n  MAGIC_CMD=$lt_save_MAGIC_CMD\n  ;;\nesac\nfi\n\nMAGIC_CMD=$lt_cv_path_MAGIC_CMD\nif test -n \"$MAGIC_CMD\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD\" >&5\n$as_echo \"$MAGIC_CMD\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  else\n    MAGIC_CMD=:\n  fi\nfi\n\n  fi\n  ;;\nesac\n\n# Use C for the default configuration in the libtool script\n\nlt_save_CC=$CC\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\n# Source file extension for C test sources.\nac_ext=c\n\n# Object file extension for compiled C test sources.\nobjext=o\nobjext=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"int some_variable = 0;\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='int main(){return(0);}'\n\n\n\n\n\n\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# If no C compiler flags were specified, use CFLAGS.\nLTCFLAGS=${LTCFLAGS-\"$CFLAGS\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n\n# Save the default compiler, since it gets overwritten when the other\n# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.\ncompiler_DEFAULT=$CC\n\n# save warnings/boilerplate of simple test code\nac_outfile=conftest.$ac_objext\necho \"$lt_simple_compile_test_code\" >conftest.$ac_ext\neval \"$ac_compile\" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err\n_lt_compiler_boilerplate=`cat conftest.err`\n$RM conftest*\n\nac_outfile=conftest.$ac_objext\necho \"$lt_simple_link_test_code\" >conftest.$ac_ext\neval \"$ac_link\" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err\n_lt_linker_boilerplate=`cat conftest.err`\n$RM -r conftest*\n\n\nif test -n \"$compiler\"; then\n\nlt_prog_compiler_no_builtin_flag=\n\nif test yes = \"$GCC\"; then\n  case $cc_basename in\n  nvcc*)\n    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;\n  *)\n    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;\n  esac\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions\" >&5\n$as_echo_n \"checking if $compiler supports -fno-rtti -fno-exceptions... \" >&6; }\nif ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler_rtti_exceptions=no\n   ac_outfile=conftest.$ac_objext\n   echo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"-fno-rtti -fno-exceptions\"  ## exclude from sc_useless_quotes_in_assignment\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}\\{0,1\\} :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:$LINENO: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&5\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings other than the usual output.\n     $ECHO \"$_lt_compiler_boilerplate\" | $SED '/^$/d' >conftest.exp\n     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2\n     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then\n       lt_cv_prog_compiler_rtti_exceptions=yes\n     fi\n   fi\n   $RM conftest*\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions\" >&5\n$as_echo \"$lt_cv_prog_compiler_rtti_exceptions\" >&6; }\n\nif test yes = \"$lt_cv_prog_compiler_rtti_exceptions\"; then\n    lt_prog_compiler_no_builtin_flag=\"$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions\"\nelse\n    :\nfi\n\nfi\n\n\n\n\n\n\n  lt_prog_compiler_wl=\nlt_prog_compiler_pic=\nlt_prog_compiler_static=\n\n\n  if test yes = \"$GCC\"; then\n    lt_prog_compiler_wl='-Wl,'\n    lt_prog_compiler_static='-static'\n\n    case $host_os in\n      aix*)\n      # All AIX code is PIC.\n      if test ia64 = \"$host_cpu\"; then\n\t# AIX 5 now supports IA64 processor\n\tlt_prog_compiler_static='-Bstatic'\n      fi\n      lt_prog_compiler_pic='-fPIC'\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            lt_prog_compiler_pic='-fPIC'\n        ;;\n      m68k)\n            # FIXME: we need at least 68020 code to build shared libraries, but\n            # adding the '-m68020' flag to GCC prevents building anything better,\n            # like '-m68040'.\n            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'\n        ;;\n      esac\n      ;;\n\n    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)\n      # PIC is the default for these OSes.\n      ;;\n\n    mingw* | cygwin* | pw32* | os2* | cegcc*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      # Although the cygwin gcc ignores -fPIC, still need this for old-style\n      # (--disable-auto-import) libraries\n      lt_prog_compiler_pic='-DDLL_EXPORT'\n      case $host_os in\n      os2*)\n\tlt_prog_compiler_static='$wl-static'\n\t;;\n      esac\n      ;;\n\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      lt_prog_compiler_pic='-fno-common'\n      ;;\n\n    haiku*)\n      # PIC is the default for Haiku.\n      # The \"-static\" flag exists, but is broken.\n      lt_prog_compiler_static=\n      ;;\n\n    hpux*)\n      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit\n      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag\n      # sets the default TLS model and affects inlining.\n      case $host_cpu in\n      hppa*64*)\n\t# +Z the default\n\t;;\n      *)\n\tlt_prog_compiler_pic='-fPIC'\n\t;;\n      esac\n      ;;\n\n    interix[3-9]*)\n      # Interix 3.x gcc -fpic/-fPIC options generate broken code.\n      # Instead, we relocate shared libraries at runtime.\n      ;;\n\n    msdosdjgpp*)\n      # Just because we use GCC doesn't mean we suddenly get shared libraries\n      # on systems that don't support them.\n      lt_prog_compiler_can_build_shared=no\n      enable_shared=no\n      ;;\n\n    *nto* | *qnx*)\n      # QNX uses GNU C++, but need to define -shared option too, otherwise\n      # it will coredump.\n      lt_prog_compiler_pic='-fPIC -shared'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tlt_prog_compiler_pic=-Kconform_pic\n      fi\n      ;;\n\n    *)\n      lt_prog_compiler_pic='-fPIC'\n      ;;\n    esac\n\n    case $cc_basename in\n    nvcc*) # Cuda Compiler Driver 2.2\n      lt_prog_compiler_wl='-Xlinker '\n      if test -n \"$lt_prog_compiler_pic\"; then\n        lt_prog_compiler_pic=\"-Xcompiler $lt_prog_compiler_pic\"\n      fi\n      ;;\n    esac\n  else\n    # PORTME Check for flag to pass linker flags through the system compiler.\n    case $host_os in\n    aix*)\n      lt_prog_compiler_wl='-Wl,'\n      if test ia64 = \"$host_cpu\"; then\n\t# AIX 5 now supports IA64 processor\n\tlt_prog_compiler_static='-Bstatic'\n      else\n\tlt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'\n      fi\n      ;;\n\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      lt_prog_compiler_pic='-fno-common'\n      case $cc_basename in\n      nagfor*)\n        # NAG Fortran compiler\n        lt_prog_compiler_wl='-Wl,-Wl,,'\n        lt_prog_compiler_pic='-PIC'\n        lt_prog_compiler_static='-Bstatic'\n        ;;\n      esac\n      ;;\n\n    mingw* | cygwin* | pw32* | os2* | cegcc*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      lt_prog_compiler_pic='-DDLL_EXPORT'\n      case $host_os in\n      os2*)\n\tlt_prog_compiler_static='$wl-static'\n\t;;\n      esac\n      ;;\n\n    hpux9* | hpux10* | hpux11*)\n      lt_prog_compiler_wl='-Wl,'\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case $host_cpu in\n      hppa*64*|ia64*)\n\t# +Z the default\n\t;;\n      *)\n\tlt_prog_compiler_pic='+Z'\n\t;;\n      esac\n      # Is there a better lt_prog_compiler_static that works with the bundled CC?\n      lt_prog_compiler_static='$wl-a ${wl}archive'\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      lt_prog_compiler_wl='-Wl,'\n      # PIC (with -KPIC) is the default.\n      lt_prog_compiler_static='-non_shared'\n      ;;\n\n    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n      case $cc_basename in\n      # old Intel for x86_64, which still supported -KPIC.\n      ecc*)\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='-KPIC'\n\tlt_prog_compiler_static='-static'\n        ;;\n      # icc used to be incompatible with GCC.\n      # ICC 10 doesn't accept -KPIC any more.\n      icc* | ifort*)\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='-fPIC'\n\tlt_prog_compiler_static='-static'\n        ;;\n      # Lahey Fortran 8.1.\n      lf95*)\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='--shared'\n\tlt_prog_compiler_static='--static'\n\t;;\n      nagfor*)\n\t# NAG Fortran compiler\n\tlt_prog_compiler_wl='-Wl,-Wl,,'\n\tlt_prog_compiler_pic='-PIC'\n\tlt_prog_compiler_static='-Bstatic'\n\t;;\n      tcc*)\n\t# Fabrice Bellard et al's Tiny C Compiler\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='-fPIC'\n\tlt_prog_compiler_static='-static'\n\t;;\n      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)\n        # Portland Group compilers (*not* the Pentium gcc compiler,\n\t# which looks to be a dead project)\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='-fpic'\n\tlt_prog_compiler_static='-Bstatic'\n        ;;\n      ccc*)\n        lt_prog_compiler_wl='-Wl,'\n        # All Alpha code is PIC.\n        lt_prog_compiler_static='-non_shared'\n        ;;\n      xl* | bgxl* | bgf* | mpixl*)\n\t# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='-qpic'\n\tlt_prog_compiler_static='-qstaticlink'\n\t;;\n      *)\n\tcase `$CC -V 2>&1 | sed 5q` in\n\t*Sun\\ Ceres\\ Fortran* | *Sun*Fortran*\\ [1-7].* | *Sun*Fortran*\\ 8.[0-3]*)\n\t  # Sun Fortran 8.3 passes all unrecognized flags to the linker\n\t  lt_prog_compiler_pic='-KPIC'\n\t  lt_prog_compiler_static='-Bstatic'\n\t  lt_prog_compiler_wl=''\n\t  ;;\n\t*Sun\\ F* | *Sun*Fortran*)\n\t  lt_prog_compiler_pic='-KPIC'\n\t  lt_prog_compiler_static='-Bstatic'\n\t  lt_prog_compiler_wl='-Qoption ld '\n\t  ;;\n\t*Sun\\ C*)\n\t  # Sun C 5.9\n\t  lt_prog_compiler_pic='-KPIC'\n\t  lt_prog_compiler_static='-Bstatic'\n\t  lt_prog_compiler_wl='-Wl,'\n\t  ;;\n        *Intel*\\ [CF]*Compiler*)\n\t  lt_prog_compiler_wl='-Wl,'\n\t  lt_prog_compiler_pic='-fPIC'\n\t  lt_prog_compiler_static='-static'\n\t  ;;\n\t*Portland\\ Group*)\n\t  lt_prog_compiler_wl='-Wl,'\n\t  lt_prog_compiler_pic='-fpic'\n\t  lt_prog_compiler_static='-Bstatic'\n\t  ;;\n\tesac\n\t;;\n      esac\n      ;;\n\n    newsos6)\n      lt_prog_compiler_pic='-KPIC'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    *nto* | *qnx*)\n      # QNX uses GNU C++, but need to define -shared option too, otherwise\n      # it will coredump.\n      lt_prog_compiler_pic='-fPIC -shared'\n      ;;\n\n    osf3* | osf4* | osf5*)\n      lt_prog_compiler_wl='-Wl,'\n      # All OSF/1 code is PIC.\n      lt_prog_compiler_static='-non_shared'\n      ;;\n\n    rdos*)\n      lt_prog_compiler_static='-non_shared'\n      ;;\n\n    solaris*)\n      lt_prog_compiler_pic='-KPIC'\n      lt_prog_compiler_static='-Bstatic'\n      case $cc_basename in\n      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)\n\tlt_prog_compiler_wl='-Qoption ld ';;\n      *)\n\tlt_prog_compiler_wl='-Wl,';;\n      esac\n      ;;\n\n    sunos4*)\n      lt_prog_compiler_wl='-Qoption ld '\n      lt_prog_compiler_pic='-PIC'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    sysv4 | sysv4.2uw2* | sysv4.3*)\n      lt_prog_compiler_wl='-Wl,'\n      lt_prog_compiler_pic='-KPIC'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tlt_prog_compiler_pic='-Kconform_pic'\n\tlt_prog_compiler_static='-Bstatic'\n      fi\n      ;;\n\n    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)\n      lt_prog_compiler_wl='-Wl,'\n      lt_prog_compiler_pic='-KPIC'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    unicos*)\n      lt_prog_compiler_wl='-Wl,'\n      lt_prog_compiler_can_build_shared=no\n      ;;\n\n    uts4*)\n      lt_prog_compiler_pic='-pic'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    *)\n      lt_prog_compiler_can_build_shared=no\n      ;;\n    esac\n  fi\n\ncase $host_os in\n  # For platforms that do not support PIC, -DPIC is meaningless:\n  *djgpp*)\n    lt_prog_compiler_pic=\n    ;;\n  *)\n    lt_prog_compiler_pic=\"$lt_prog_compiler_pic -DPIC\"\n    ;;\nesac\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC\" >&5\n$as_echo_n \"checking for $compiler option to produce PIC... \" >&6; }\nif ${lt_cv_prog_compiler_pic+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic\" >&5\n$as_echo \"$lt_cv_prog_compiler_pic\" >&6; }\nlt_prog_compiler_pic=$lt_cv_prog_compiler_pic\n\n#\n# Check to make sure the PIC flag actually works.\n#\nif test -n \"$lt_prog_compiler_pic\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works\" >&5\n$as_echo_n \"checking if $compiler PIC flag $lt_prog_compiler_pic works... \" >&6; }\nif ${lt_cv_prog_compiler_pic_works+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler_pic_works=no\n   ac_outfile=conftest.$ac_objext\n   echo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"$lt_prog_compiler_pic -DPIC\"  ## exclude from sc_useless_quotes_in_assignment\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}\\{0,1\\} :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:$LINENO: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&5\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings other than the usual output.\n     $ECHO \"$_lt_compiler_boilerplate\" | $SED '/^$/d' >conftest.exp\n     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2\n     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then\n       lt_cv_prog_compiler_pic_works=yes\n     fi\n   fi\n   $RM conftest*\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works\" >&5\n$as_echo \"$lt_cv_prog_compiler_pic_works\" >&6; }\n\nif test yes = \"$lt_cv_prog_compiler_pic_works\"; then\n    case $lt_prog_compiler_pic in\n     \"\" | \" \"*) ;;\n     *) lt_prog_compiler_pic=\" $lt_prog_compiler_pic\" ;;\n     esac\nelse\n    lt_prog_compiler_pic=\n     lt_prog_compiler_can_build_shared=no\nfi\n\nfi\n\n\n\n\n\n\n\n\n\n\n\n#\n# Check to make sure the static flag actually works.\n#\nwl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\\\"$lt_prog_compiler_static\\\"\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works\" >&5\n$as_echo_n \"checking if $compiler static flag $lt_tmp_static_flag works... \" >&6; }\nif ${lt_cv_prog_compiler_static_works+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler_static_works=no\n   save_LDFLAGS=$LDFLAGS\n   LDFLAGS=\"$LDFLAGS $lt_tmp_static_flag\"\n   echo \"$lt_simple_link_test_code\" > conftest.$ac_ext\n   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then\n     # The linker can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test -s conftest.err; then\n       # Append any errors to the config.log.\n       cat conftest.err 1>&5\n       $ECHO \"$_lt_linker_boilerplate\" | $SED '/^$/d' > conftest.exp\n       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2\n       if diff conftest.exp conftest.er2 >/dev/null; then\n         lt_cv_prog_compiler_static_works=yes\n       fi\n     else\n       lt_cv_prog_compiler_static_works=yes\n     fi\n   fi\n   $RM -r conftest*\n   LDFLAGS=$save_LDFLAGS\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works\" >&5\n$as_echo \"$lt_cv_prog_compiler_static_works\" >&6; }\n\nif test yes = \"$lt_cv_prog_compiler_static_works\"; then\n    :\nelse\n    lt_prog_compiler_static=\nfi\n\n\n\n\n\n\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext\" >&5\n$as_echo_n \"checking if $compiler supports -c -o file.$ac_objext... \" >&6; }\nif ${lt_cv_prog_compiler_c_o+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler_c_o=no\n   $RM -r conftest 2>/dev/null\n   mkdir conftest\n   cd conftest\n   mkdir out\n   echo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n   lt_compiler_flag=\"-o out/conftest2.$ac_objext\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}\\{0,1\\} :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:$LINENO: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>out/conftest.err)\n   ac_status=$?\n   cat out/conftest.err >&5\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s out/conftest2.$ac_objext\n   then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     $ECHO \"$_lt_compiler_boilerplate\" | $SED '/^$/d' > out/conftest.exp\n     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2\n     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then\n       lt_cv_prog_compiler_c_o=yes\n     fi\n   fi\n   chmod u+w . 2>&5\n   $RM conftest*\n   # SGI C++ compiler will create directory out/ii_files/ for\n   # template instantiation\n   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files\n   $RM out/* && rmdir out\n   cd ..\n   $RM -r conftest\n   $RM conftest*\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o\" >&5\n$as_echo \"$lt_cv_prog_compiler_c_o\" >&6; }\n\n\n\n\n\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext\" >&5\n$as_echo_n \"checking if $compiler supports -c -o file.$ac_objext... \" >&6; }\nif ${lt_cv_prog_compiler_c_o+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler_c_o=no\n   $RM -r conftest 2>/dev/null\n   mkdir conftest\n   cd conftest\n   mkdir out\n   echo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n   lt_compiler_flag=\"-o out/conftest2.$ac_objext\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}\\{0,1\\} :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:$LINENO: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>out/conftest.err)\n   ac_status=$?\n   cat out/conftest.err >&5\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s out/conftest2.$ac_objext\n   then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     $ECHO \"$_lt_compiler_boilerplate\" | $SED '/^$/d' > out/conftest.exp\n     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2\n     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then\n       lt_cv_prog_compiler_c_o=yes\n     fi\n   fi\n   chmod u+w . 2>&5\n   $RM conftest*\n   # SGI C++ compiler will create directory out/ii_files/ for\n   # template instantiation\n   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files\n   $RM out/* && rmdir out\n   cd ..\n   $RM -r conftest\n   $RM conftest*\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o\" >&5\n$as_echo \"$lt_cv_prog_compiler_c_o\" >&6; }\n\n\n\n\nhard_links=nottested\nif test no = \"$lt_cv_prog_compiler_c_o\" && test no != \"$need_locks\"; then\n  # do not overwrite the value of need_locks provided by the user\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links\" >&5\n$as_echo_n \"checking if we can lock with hard links... \" >&6; }\n  hard_links=yes\n  $RM conftest*\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  touch conftest.a\n  ln conftest.a conftest.b 2>&5 || hard_links=no\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $hard_links\" >&5\n$as_echo \"$hard_links\" >&6; }\n  if test no = \"$hard_links\"; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe\" >&5\n$as_echo \"$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe\" >&2;}\n    need_locks=warn\n  fi\nelse\n  need_locks=no\nfi\n\n\n\n\n\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries\" >&5\n$as_echo_n \"checking whether the $compiler linker ($LD) supports shared libraries... \" >&6; }\n\n  runpath_var=\n  allow_undefined_flag=\n  always_export_symbols=no\n  archive_cmds=\n  archive_expsym_cmds=\n  compiler_needs_object=no\n  enable_shared_with_static_runtimes=no\n  export_dynamic_flag_spec=\n  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  hardcode_automatic=no\n  hardcode_direct=no\n  hardcode_direct_absolute=no\n  hardcode_libdir_flag_spec=\n  hardcode_libdir_separator=\n  hardcode_minus_L=no\n  hardcode_shlibpath_var=unsupported\n  inherit_rpath=no\n  link_all_deplibs=unknown\n  module_cmds=\n  module_expsym_cmds=\n  old_archive_from_new_cmds=\n  old_archive_from_expsyms_cmds=\n  thread_safe_flag_spec=\n  whole_archive_flag_spec=\n  # include_expsyms should be a list of space-separated symbols to be *always*\n  # included in the symbol list\n  include_expsyms=\n  # exclude_expsyms can be an extended regexp of symbols to exclude\n  # it will be wrapped by ' (' and ')$', so one must not match beginning or\n  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',\n  # as well as any symbol that contains 'd'.\n  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'\n  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out\n  # platforms (ab)use it in PIC code, but their linkers get confused if\n  # the symbol is explicitly referenced.  Since portable code cannot\n  # rely on this symbol name, it's probably fine to never include it in\n  # preloaded symbol tables.\n  # Exclude shared library initialization/finalization symbols.\n  extract_expsyms_cmds=\n\n  case $host_os in\n  cygwin* | mingw* | pw32* | cegcc*)\n    # FIXME: the MSVC++ port hasn't been tested in a loooong time\n    # When not using gcc, we currently assume that we are using\n    # Microsoft Visual C++.\n    if test yes != \"$GCC\"; then\n      with_gnu_ld=no\n    fi\n    ;;\n  interix*)\n    # we just hope/assume this is gcc and not c89 (= MSVC++)\n    with_gnu_ld=yes\n    ;;\n  openbsd* | bitrig*)\n    with_gnu_ld=no\n    ;;\n  linux* | k*bsd*-gnu | gnu*)\n    link_all_deplibs=no\n    ;;\n  esac\n\n  ld_shlibs=yes\n\n  # On some targets, GNU ld is compatible enough with the native linker\n  # that we're better off using the native interface for both.\n  lt_use_gnu_ld_interface=no\n  if test yes = \"$with_gnu_ld\"; then\n    case $host_os in\n      aix*)\n\t# The AIX port of GNU ld has always aspired to compatibility\n\t# with the native linker.  However, as the warning in the GNU ld\n\t# block says, versions before 2.19.5* couldn't really create working\n\t# shared libraries, regardless of the interface used.\n\tcase `$LD -v 2>&1` in\n\t  *\\ \\(GNU\\ Binutils\\)\\ 2.19.5*) ;;\n\t  *\\ \\(GNU\\ Binutils\\)\\ 2.[2-9]*) ;;\n\t  *\\ \\(GNU\\ Binutils\\)\\ [3-9]*) ;;\n\t  *)\n\t    lt_use_gnu_ld_interface=yes\n\t    ;;\n\tesac\n\t;;\n      *)\n\tlt_use_gnu_ld_interface=yes\n\t;;\n    esac\n  fi\n\n  if test yes = \"$lt_use_gnu_ld_interface\"; then\n    # If archive_cmds runs LD, not CC, wlarc should be empty\n    wlarc='$wl'\n\n    # Set some defaults for GNU ld with shared library support. These\n    # are reset later if shared libraries are not supported. Putting them\n    # here allows them to be overridden if necessary.\n    runpath_var=LD_RUN_PATH\n    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n    export_dynamic_flag_spec='$wl--export-dynamic'\n    # ancient GNU ld didn't support --whole-archive et. al.\n    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then\n      whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'\n    else\n      whole_archive_flag_spec=\n    fi\n    supports_anon_versioning=no\n    case `$LD -v | $SED -e 's/(^)\\+)\\s\\+//' 2>&1` in\n      *GNU\\ gold*) supports_anon_versioning=yes ;;\n      *\\ [01].* | *\\ 2.[0-9].* | *\\ 2.10.*) ;; # catch versions < 2.11\n      *\\ 2.11.93.0.2\\ *) supports_anon_versioning=yes ;; # RH7.3 ...\n      *\\ 2.11.92.0.12\\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...\n      *\\ 2.11.*) ;; # other 2.11 versions\n      *) supports_anon_versioning=yes ;;\n    esac\n\n    # See if GNU ld supports shared libraries.\n    case $host_os in\n    aix[3-9]*)\n      # On AIX/PPC, the GNU linker is very broken\n      if test ia64 != \"$host_cpu\"; then\n\tld_shlibs=no\n\tcat <<_LT_EOF 1>&2\n\n*** Warning: the GNU linker, at least up to release 2.19, is reported\n*** to be unable to reliably create shared libraries on AIX.\n*** Therefore, libtool is disabling shared libraries support.  If you\n*** really care for shared libraries, you may want to install binutils\n*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.\n*** You will then need to restart the configuration process.\n\n_LT_EOF\n      fi\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n            archive_expsym_cmds=''\n        ;;\n      m68k)\n            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO \"#define NAME $libname\" > $output_objdir/a2ixlibrary.data~$ECHO \"#define LIBRARY_ID 1\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define VERSION $major\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define REVISION $revision\" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'\n            hardcode_libdir_flag_spec='-L$libdir'\n            hardcode_minus_L=yes\n        ;;\n      esac\n      ;;\n\n    beos*)\n      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\tallow_undefined_flag=unsupported\n\t# Joseph Beckenbach <jrb3@best.com> says some releases of gcc\n\t# support --undefined.  This deserves some investigation.  FIXME\n\tarchive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    cygwin* | mingw* | pw32* | cegcc*)\n      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,\n      # as there is no search path for DLLs.\n      hardcode_libdir_flag_spec='-L$libdir'\n      export_dynamic_flag_spec='$wl--export-all-symbols'\n      allow_undefined_flag=unsupported\n      always_export_symbols=no\n      enable_shared_with_static_runtimes=yes\n      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[BCDGRS][ ]/s/.*[ ]\\([^ ]*\\)/\\1 DATA/;s/^.*[ ]__nm__\\([^ ]*\\)[ ][^ ]*/\\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\\'' | sort | uniq > $export_symbols'\n      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'\n\n      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then\n        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'\n\t# If the export-symbols file already is a .def file, use it as\n\t# is; otherwise, prepend EXPORTS...\n\tarchive_expsym_cmds='if   test DEF = \"`$SED -n     -e '\\''s/^[\t ]*//'\\''     -e '\\''/^\\(;.*\\)*$/d'\\''     -e '\\''s/^\\(EXPORTS\\|LIBRARY\\)\\([\t ].*\\)*$/DEF/p'\\''     -e q     $export_symbols`\" ; then\n          cp $export_symbols $output_objdir/$soname.def;\n        else\n          echo EXPORTS > $output_objdir/$soname.def;\n          cat $export_symbols >> $output_objdir/$soname.def;\n        fi~\n        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    haiku*)\n      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n      link_all_deplibs=yes\n      ;;\n\n    os2*)\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_minus_L=yes\n      allow_undefined_flag=unsupported\n      shrext_cmds=.dll\n      archive_cmds='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\temxexp $libobjs | $SED /\"_DLL_InitTerm\"/d >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      archive_expsym_cmds='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\tprefix_cmds=\"$SED\"~\n\tif test EXPORTS = \"`$SED 1q $export_symbols`\"; then\n\t  prefix_cmds=\"$prefix_cmds -e 1d\";\n\tfi~\n\tprefix_cmds=\"$prefix_cmds -e \\\"s/^\\(.*\\)$/_\\1/g\\\"\"~\n\tcat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'\n      enable_shared_with_static_runtimes=yes\n      ;;\n\n    interix[3-9]*)\n      hardcode_direct=no\n      hardcode_shlibpath_var=no\n      hardcode_libdir_flag_spec='$wl-rpath,$libdir'\n      export_dynamic_flag_spec='$wl-E'\n      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.\n      # Instead, shared libraries are loaded at an image base (0x10000000 by\n      # default) and relocated if they conflict, which is a slow very memory\n      # consuming and fragmenting process.  To avoid this, we pick a random,\n      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link\n      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.\n      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \\* 262144 + 1342177280` -o $lib'\n      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'\n      ;;\n\n    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)\n      tmp_diet=no\n      if test linux-dietlibc = \"$host_os\"; then\n\tcase $cc_basename in\n\t  diet\\ *) tmp_diet=yes;;\t# linux-dietlibc with static linking (!diet-dyn)\n\tesac\n      fi\n      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \\\n\t && test no = \"$tmp_diet\"\n      then\n\ttmp_addflag=' $pic_flag'\n\ttmp_sharedflag='-shared'\n\tcase $cc_basename,$host_cpu in\n        pgcc*)\t\t\t\t# Portland Group C compiler\n\t  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'\n\t  tmp_addflag=' $pic_flag'\n\t  ;;\n\tpgf77* | pgf90* | pgf95* | pgfortran*)\n\t\t\t\t\t# Portland Group f77 and f90 compilers\n\t  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'\n\t  tmp_addflag=' $pic_flag -Mnomain' ;;\n\tecc*,ia64* | icc*,ia64*)\t# Intel C compiler on ia64\n\t  tmp_addflag=' -i_dynamic' ;;\n\tefc*,ia64* | ifort*,ia64*)\t# Intel Fortran compiler on ia64\n\t  tmp_addflag=' -i_dynamic -nofor_main' ;;\n\tifc* | ifort*)\t\t\t# Intel Fortran compiler\n\t  tmp_addflag=' -nofor_main' ;;\n\tlf95*)\t\t\t\t# Lahey Fortran 8.1\n\t  whole_archive_flag_spec=\n\t  tmp_sharedflag='--shared' ;;\n        nagfor*)                        # NAGFOR 5.3\n          tmp_sharedflag='-Wl,-shared' ;;\n\txl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)\n\t  tmp_sharedflag='-qmkshrobj'\n\t  tmp_addflag= ;;\n\tnvcc*)\t# Cuda Compiler Driver 2.2\n\t  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'\n\t  compiler_needs_object=yes\n\t  ;;\n\tesac\n\tcase `$CC -V 2>&1 | sed 5q` in\n\t*Sun\\ C*)\t\t\t# Sun C 5.9\n\t  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'\n\t  compiler_needs_object=yes\n\t  tmp_sharedflag='-G' ;;\n\t*Sun\\ F*)\t\t\t# Sun Fortran 8.3\n\t  tmp_sharedflag='-G' ;;\n\tesac\n\tarchive_cmds='$CC '\"$tmp_sharedflag\"\"$tmp_addflag\"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\n        if test yes = \"$supports_anon_versioning\"; then\n          archive_expsym_cmds='echo \"{ global:\" > $output_objdir/$libname.ver~\n            cat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n            echo \"local: *; };\" >> $output_objdir/$libname.ver~\n            $CC '\"$tmp_sharedflag\"\"$tmp_addflag\"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'\n        fi\n\n\tcase $cc_basename in\n\ttcc*)\n\t  export_dynamic_flag_spec='-rdynamic'\n\t  ;;\n\txlf* | bgf* | bgxlf* | mpixlf*)\n\t  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself\n\t  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'\n\t  hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n\t  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'\n\t  if test yes = \"$supports_anon_versioning\"; then\n\t    archive_expsym_cmds='echo \"{ global:\" > $output_objdir/$libname.ver~\n              cat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n              echo \"local: *; };\" >> $output_objdir/$libname.ver~\n              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'\n\t  fi\n\t  ;;\n\tesac\n      else\n        ld_shlibs=no\n      fi\n      ;;\n\n    netbsd* | netbsdelf*-gnu)\n      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n\tarchive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'\n\twlarc=\n      else\n\tarchive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n      fi\n      ;;\n\n    solaris*)\n      if $LD -v 2>&1 | $GREP 'BFD 2\\.8' > /dev/null; then\n\tld_shlibs=no\n\tcat <<_LT_EOF 1>&2\n\n*** Warning: The releases 2.8.* of the GNU linker cannot reliably\n*** create shared libraries on Solaris systems.  Therefore, libtool\n*** is disabling shared libraries support.  We urge you to upgrade GNU\n*** binutils to release 2.9.1 or newer.  Another option is to modify\n*** your PATH or compiler configuration so that the native linker is\n*** used, and then restart.\n\n_LT_EOF\n      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\tarchive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)\n      case `$LD -v 2>&1` in\n        *\\ [01].* | *\\ 2.[0-9].* | *\\ 2.1[0-5].*)\n\tld_shlibs=no\n\tcat <<_LT_EOF 1>&2\n\n*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot\n*** reliably create shared libraries on SCO systems.  Therefore, libtool\n*** is disabling shared libraries support.  We urge you to upgrade GNU\n*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify\n*** your PATH or compiler configuration so that the native linker is\n*** used, and then restart.\n\n_LT_EOF\n\t;;\n\t*)\n\t  # For security reasons, it is highly recommended that you always\n\t  # use absolute paths for naming shared libraries, and exclude the\n\t  # DT_RUNPATH tag from executables and libraries.  But doing so\n\t  # requires that you compile everything twice, which is a pain.\n\t  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\t    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n\t    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n\t  else\n\t    ld_shlibs=no\n\t  fi\n\t;;\n      esac\n      ;;\n\n    sunos4*)\n      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      wlarc=\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    *)\n      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\tarchive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n    esac\n\n    if test no = \"$ld_shlibs\"; then\n      runpath_var=\n      hardcode_libdir_flag_spec=\n      export_dynamic_flag_spec=\n      whole_archive_flag_spec=\n    fi\n  else\n    # PORTME fill in a description of your system's linker (not GNU ld)\n    case $host_os in\n    aix3*)\n      allow_undefined_flag=unsupported\n      always_export_symbols=yes\n      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'\n      # Note: this linker hardcodes the directories in LIBPATH if there\n      # are no directories specified by -L.\n      hardcode_minus_L=yes\n      if test yes = \"$GCC\" && test -z \"$lt_prog_compiler_static\"; then\n\t# Neither direct hardcoding nor static linking is supported with a\n\t# broken collect2.\n\thardcode_direct=unsupported\n      fi\n      ;;\n\n    aix[4-9]*)\n      if test ia64 = \"$host_cpu\"; then\n\t# On IA64, the linker does run time linking by default, so we don't\n\t# have to do anything special.\n\taix_use_runtimelinking=no\n\texp_sym_flag='-Bexport'\n\tno_entry_flag=\n      else\n\t# If we're using GNU nm, then we don't want the \"-C\" option.\n\t# -C means demangle to GNU nm, but means don't demangle to AIX nm.\n\t# Without the \"-l\" option, or with the \"-B\" option, AIX nm treats\n\t# weak defined symbols like other global defined symbols, whereas\n\t# GNU nm marks them as \"W\".\n\t# While the 'weak' keyword is ignored in the Export File, we need\n\t# it in the Import File for the 'aix-soname' feature, so we have\n\t# to replace the \"-B\" option with \"-P\" for AIX nm.\n\tif $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then\n\t  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'\n\telse\n\t  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'\n\tfi\n\taix_use_runtimelinking=no\n\n\t# Test if we are trying to use run time linking or normal\n\t# AIX style linking. If -brtl is somewhere in LDFLAGS, we\n\t# have runtime linking enabled, and use it for executables.\n\t# For shared libraries, we enable/disable runtime linking\n\t# depending on the kind of the shared library created -\n\t# when \"with_aix_soname,aix_use_runtimelinking\" is:\n\t# \"aix,no\"   lib.a(lib.so.V) shared, rtl:no,  for executables\n\t# \"aix,yes\"  lib.so          shared, rtl:yes, for executables\n\t#            lib.a           static archive\n\t# \"both,no\"  lib.so.V(shr.o) shared, rtl:yes\n\t#            lib.a(lib.so.V) shared, rtl:no,  for executables\n\t# \"both,yes\" lib.so.V(shr.o) shared, rtl:yes, for executables\n\t#            lib.a(lib.so.V) shared, rtl:no\n\t# \"svr4,*\"   lib.so.V(shr.o) shared, rtl:yes, for executables\n\t#            lib.a           static archive\n\tcase $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)\n\t  for ld_flag in $LDFLAGS; do\n\t  if (test x-brtl = \"x$ld_flag\" || test x-Wl,-brtl = \"x$ld_flag\"); then\n\t    aix_use_runtimelinking=yes\n\t    break\n\t  fi\n\t  done\n\t  if test svr4,no = \"$with_aix_soname,$aix_use_runtimelinking\"; then\n\t    # With aix-soname=svr4, we create the lib.so.V shared archives only,\n\t    # so we don't have lib.a shared libs to link our executables.\n\t    # We have to force runtime linking in this case.\n\t    aix_use_runtimelinking=yes\n\t    LDFLAGS=\"$LDFLAGS -Wl,-brtl\"\n\t  fi\n\t  ;;\n\tesac\n\n\texp_sym_flag='-bexport'\n\tno_entry_flag='-bnoentry'\n      fi\n\n      # When large executables or shared objects are built, AIX ld can\n      # have problems creating the table of contents.  If linking a library\n      # or program results in \"error TOC overflow\" add -mminimal-toc to\n      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not\n      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.\n\n      archive_cmds=''\n      hardcode_direct=yes\n      hardcode_direct_absolute=yes\n      hardcode_libdir_separator=':'\n      link_all_deplibs=yes\n      file_list_spec='$wl-f,'\n      case $with_aix_soname,$aix_use_runtimelinking in\n      aix,*) ;; # traditional, no import file\n      svr4,* | *,yes) # use import file\n\t# The Import File defines what to hardcode.\n\thardcode_direct=no\n\thardcode_direct_absolute=no\n\t;;\n      esac\n\n      if test yes = \"$GCC\"; then\n\tcase $host_os in aix4.[012]|aix4.[012].*)\n\t# We only want to do this on AIX 4.2 and lower, the check\n\t# below for broken collect2 doesn't work under 4.3+\n\t  collect2name=`$CC -print-prog-name=collect2`\n\t  if test -f \"$collect2name\" &&\n\t   strings \"$collect2name\" | $GREP resolve_lib_name >/dev/null\n\t  then\n\t  # We have reworked collect2\n\t  :\n\t  else\n\t  # We have old collect2\n\t  hardcode_direct=unsupported\n\t  # It fails to find uninstalled libraries when the uninstalled\n\t  # path is not listed in the libpath.  Setting hardcode_minus_L\n\t  # to unsupported forces relinking\n\t  hardcode_minus_L=yes\n\t  hardcode_libdir_flag_spec='-L$libdir'\n\t  hardcode_libdir_separator=\n\t  fi\n\t  ;;\n\tesac\n\tshared_flag='-shared'\n\tif test yes = \"$aix_use_runtimelinking\"; then\n\t  shared_flag=\"$shared_flag \"'$wl-G'\n\tfi\n\t# Need to ensure runtime linking is disabled for the traditional\n\t# shared library, or the linker may eventually find shared libraries\n\t# /with/ Import File - we do not want to mix them.\n\tshared_flag_aix='-shared'\n\tshared_flag_svr4='-shared $wl-G'\n      else\n\t# not using gcc\n\tif test ia64 = \"$host_cpu\"; then\n\t# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release\n\t# chokes on -Wl,-G. The following line is correct:\n\t  shared_flag='-G'\n\telse\n\t  if test yes = \"$aix_use_runtimelinking\"; then\n\t    shared_flag='$wl-G'\n\t  else\n\t    shared_flag='$wl-bM:SRE'\n\t  fi\n\t  shared_flag_aix='$wl-bM:SRE'\n\t  shared_flag_svr4='$wl-G'\n\tfi\n      fi\n\n      export_dynamic_flag_spec='$wl-bexpall'\n      # It seems that -bexpall does not export symbols beginning with\n      # underscore (_), so it is better to generate a list of symbols to export.\n      always_export_symbols=yes\n      if test aix,yes = \"$with_aix_soname,$aix_use_runtimelinking\"; then\n\t# Warning - without using the other runtime loading flags (-brtl),\n\t# -berok will link without error, but may produce a broken library.\n\tallow_undefined_flag='-berok'\n        # Determine the default libpath from the value encoded in an\n        # empty executable.\n        if test set = \"${lt_cv_aix_libpath+set}\"; then\n  aix_libpath=$lt_cv_aix_libpath\nelse\n  if ${lt_cv_aix_libpath_+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n\n  lt_aix_libpath_sed='\n      /Import File Strings/,/^$/ {\n\t  /^0/ {\n\t      s/^0  *\\([^ ]*\\) *$/\\1/\n\t      p\n\t  }\n      }'\n  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e \"$lt_aix_libpath_sed\"`\n  # Check for a 64-bit object if we didn't find anything.\n  if test -z \"$lt_cv_aix_libpath_\"; then\n    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e \"$lt_aix_libpath_sed\"`\n  fi\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n  if test -z \"$lt_cv_aix_libpath_\"; then\n    lt_cv_aix_libpath_=/usr/lib:/lib\n  fi\n\nfi\n\n  aix_libpath=$lt_cv_aix_libpath_\nfi\n\n        hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'\"$aix_libpath\"\n        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\n      else\n\tif test ia64 = \"$host_cpu\"; then\n\t  hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'\n\t  allow_undefined_flag=\"-z nodefs\"\n\t  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\"\n\telse\n\t # Determine the default libpath from the value encoded in an\n\t # empty executable.\n\t if test set = \"${lt_cv_aix_libpath+set}\"; then\n  aix_libpath=$lt_cv_aix_libpath\nelse\n  if ${lt_cv_aix_libpath_+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n\n  lt_aix_libpath_sed='\n      /Import File Strings/,/^$/ {\n\t  /^0/ {\n\t      s/^0  *\\([^ ]*\\) *$/\\1/\n\t      p\n\t  }\n      }'\n  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e \"$lt_aix_libpath_sed\"`\n  # Check for a 64-bit object if we didn't find anything.\n  if test -z \"$lt_cv_aix_libpath_\"; then\n    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e \"$lt_aix_libpath_sed\"`\n  fi\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n  if test -z \"$lt_cv_aix_libpath_\"; then\n    lt_cv_aix_libpath_=/usr/lib:/lib\n  fi\n\nfi\n\n  aix_libpath=$lt_cv_aix_libpath_\nfi\n\n\t hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'\"$aix_libpath\"\n\t  # Warning - without using the other run time loading flags,\n\t  # -berok will link without error, but may produce a broken library.\n\t  no_undefined_flag=' $wl-bernotok'\n\t  allow_undefined_flag=' $wl-berok'\n\t  if test yes = \"$with_gnu_ld\"; then\n\t    # We only use this code for GNU lds that support --whole-archive.\n\t    whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'\n\t  else\n\t    # Exported symbols can be pulled into shared objects from archives\n\t    whole_archive_flag_spec='$convenience'\n\t  fi\n\t  archive_cmds_need_lc=yes\n\t  archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'\n\t  # -brtl affects multiple linker settings, -berok does not and is overridden later\n\t  compiler_flags_filtered='`func_echo_all \"$compiler_flags \" | $SED -e \"s%-brtl\\\\([, ]\\\\)%-berok\\\\1%g\"`'\n\t  if test svr4 != \"$with_aix_soname\"; then\n\t    # This is similar to how AIX traditionally builds its shared libraries.\n\t    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'\n\t  fi\n\t  if test aix != \"$with_aix_soname\"; then\n\t    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'\n\t  else\n\t    # used by -dlpreopen to get the symbols\n\t    archive_expsym_cmds=\"$archive_expsym_cmds\"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'\n\t  fi\n\t  archive_expsym_cmds=\"$archive_expsym_cmds\"'~$RM -r $output_objdir/$realname.d'\n\tfi\n      fi\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n            archive_expsym_cmds=''\n        ;;\n      m68k)\n            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO \"#define NAME $libname\" > $output_objdir/a2ixlibrary.data~$ECHO \"#define LIBRARY_ID 1\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define VERSION $major\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define REVISION $revision\" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'\n            hardcode_libdir_flag_spec='-L$libdir'\n            hardcode_minus_L=yes\n        ;;\n      esac\n      ;;\n\n    bsdi[45]*)\n      export_dynamic_flag_spec=-rdynamic\n      ;;\n\n    cygwin* | mingw* | pw32* | cegcc*)\n      # When not using gcc, we currently assume that we are using\n      # Microsoft Visual C++.\n      # hardcode_libdir_flag_spec is actually meaningless, as there is\n      # no search path for DLLs.\n      case $cc_basename in\n      cl*)\n\t# Native MSVC\n\thardcode_libdir_flag_spec=' '\n\tallow_undefined_flag=unsupported\n\talways_export_symbols=yes\n\tfile_list_spec='@'\n\t# Tell ltmain to make .lib files, not .a files.\n\tlibext=lib\n\t# Tell ltmain to make .dll files, not .so files.\n\tshrext_cmds=.dll\n\t# FIXME: Setting linknames here is a bad hack.\n\tarchive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:\"$tool_output_objdir$libname.dll.lib\"~linknames='\n\tarchive_expsym_cmds='if   test DEF = \"`$SED -n     -e '\\''s/^[\t ]*//'\\''     -e '\\''/^\\(;.*\\)*$/d'\\''     -e '\\''s/^\\(EXPORTS\\|LIBRARY\\)\\([\t ].*\\)*$/DEF/p'\\''     -e q     $export_symbols`\" ; then\n            cp \"$export_symbols\" \"$output_objdir/$soname.def\";\n            echo \"$tool_output_objdir$soname.def\" > \"$output_objdir/$soname.exp\";\n          else\n            $SED -e '\\''s/^/-link -EXPORT:/'\\'' < $export_symbols > $output_objdir/$soname.exp;\n          fi~\n          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs \"@$tool_output_objdir$soname.exp\" -Wl,-DLL,-IMPLIB:\"$tool_output_objdir$libname.dll.lib\"~\n          linknames='\n\t# The linker will not automatically build a static lib if we build a DLL.\n\t# _LT_TAGVAR(old_archive_from_new_cmds, )='true'\n\tenable_shared_with_static_runtimes=yes\n\texclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'\n\texport_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[BCDGRS][ ]/s/.*[ ]\\([^ ]*\\)/\\1,DATA/'\\'' | $SED -e '\\''/^[AITW][ ]/s/.*[ ]//'\\'' | sort | uniq > $export_symbols'\n\t# Don't use ranlib\n\told_postinstall_cmds='chmod 644 $oldlib'\n\tpostlink_cmds='lt_outputfile=\"@OUTPUT@\"~\n          lt_tool_outputfile=\"@TOOL_OUTPUT@\"~\n          case $lt_outputfile in\n            *.exe|*.EXE) ;;\n            *)\n              lt_outputfile=$lt_outputfile.exe\n              lt_tool_outputfile=$lt_tool_outputfile.exe\n              ;;\n          esac~\n          if test : != \"$MANIFEST_TOOL\" && test -f \"$lt_outputfile.manifest\"; then\n            $MANIFEST_TOOL -manifest \"$lt_tool_outputfile.manifest\" -outputresource:\"$lt_tool_outputfile\" || exit 1;\n            $RM \"$lt_outputfile.manifest\";\n          fi'\n\t;;\n      *)\n\t# Assume MSVC wrapper\n\thardcode_libdir_flag_spec=' '\n\tallow_undefined_flag=unsupported\n\t# Tell ltmain to make .lib files, not .a files.\n\tlibext=lib\n\t# Tell ltmain to make .dll files, not .so files.\n\tshrext_cmds=.dll\n\t# FIXME: Setting linknames here is a bad hack.\n\tarchive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all \"$deplibs\" | $SED '\\''s/ -lc$//'\\''` -link -dll~linknames='\n\t# The linker will automatically build a .lib file if we build a DLL.\n\told_archive_from_new_cmds='true'\n\t# FIXME: Should let the user specify the lib program.\n\told_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'\n\tenable_shared_with_static_runtimes=yes\n\t;;\n      esac\n      ;;\n\n    darwin* | rhapsody*)\n\n\n  archive_cmds_need_lc=no\n  hardcode_direct=no\n  hardcode_automatic=yes\n  hardcode_shlibpath_var=unsupported\n  if test yes = \"$lt_cv_ld_force_load\"; then\n    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\\\"`'\n\n  else\n    whole_archive_flag_spec=''\n  fi\n  link_all_deplibs=yes\n  allow_undefined_flag=$_lt_dar_allow_undefined\n  case $cc_basename in\n     ifort*|nagfor*) _lt_dar_can_shared=yes ;;\n     *) _lt_dar_can_shared=$GCC ;;\n  esac\n  if test yes = \"$_lt_dar_can_shared\"; then\n    output_verbose_link_cmd=func_echo_all\n    archive_cmds=\"\\$CC -dynamiclib \\$allow_undefined_flag -o \\$lib \\$libobjs \\$deplibs \\$compiler_flags -install_name \\$rpath/\\$soname \\$verstring $_lt_dar_single_mod$_lt_dsymutil\"\n    module_cmds=\"\\$CC \\$allow_undefined_flag -o \\$lib -bundle \\$libobjs \\$deplibs \\$compiler_flags$_lt_dsymutil\"\n    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\"\n    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\"\n\n  else\n  ld_shlibs=no\n  fi\n\n      ;;\n\n    dgux*)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_shlibpath_var=no\n      ;;\n\n    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor\n    # support.  Future versions do this automatically, but an explicit c++rt0.o\n    # does not break anything, and helps significantly (at the cost of a little\n    # extra space).\n    freebsd2.2*)\n      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'\n      hardcode_libdir_flag_spec='-R$libdir'\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    # Unfortunately, older versions of FreeBSD 2 do not have this feature.\n    freebsd2.*)\n      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct=yes\n      hardcode_minus_L=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.\n    freebsd* | dragonfly*)\n      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n      hardcode_libdir_flag_spec='-R$libdir'\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    hpux9*)\n      if test yes = \"$GCC\"; then\n\tarchive_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'\n      else\n\tarchive_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'\n      fi\n      hardcode_libdir_flag_spec='$wl+b $wl$libdir'\n      hardcode_libdir_separator=:\n      hardcode_direct=yes\n\n      # hardcode_minus_L: Not really in the search PATH,\n      # but as the default location of the library.\n      hardcode_minus_L=yes\n      export_dynamic_flag_spec='$wl-E'\n      ;;\n\n    hpux10*)\n      if test yes,no = \"$GCC,$with_gnu_ld\"; then\n\tarchive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'\n      fi\n      if test no = \"$with_gnu_ld\"; then\n\thardcode_libdir_flag_spec='$wl+b $wl$libdir'\n\thardcode_libdir_separator=:\n\thardcode_direct=yes\n\thardcode_direct_absolute=yes\n\texport_dynamic_flag_spec='$wl-E'\n\t# hardcode_minus_L: Not really in the search PATH,\n\t# but as the default location of the library.\n\thardcode_minus_L=yes\n      fi\n      ;;\n\n    hpux11*)\n      if test yes,no = \"$GCC,$with_gnu_ld\"; then\n\tcase $host_cpu in\n\thppa*64*)\n\t  archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tia64*)\n\t  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\t  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tesac\n      else\n\tcase $host_cpu in\n\thppa*64*)\n\t  archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tia64*)\n\t  archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\n\t  # Older versions of the 11.00 compiler do not understand -b yet\n\t  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)\n\t  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $CC understands -b\" >&5\n$as_echo_n \"checking if $CC understands -b... \" >&6; }\nif ${lt_cv_prog_compiler__b+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler__b=no\n   save_LDFLAGS=$LDFLAGS\n   LDFLAGS=\"$LDFLAGS -b\"\n   echo \"$lt_simple_link_test_code\" > conftest.$ac_ext\n   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then\n     # The linker can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test -s conftest.err; then\n       # Append any errors to the config.log.\n       cat conftest.err 1>&5\n       $ECHO \"$_lt_linker_boilerplate\" | $SED '/^$/d' > conftest.exp\n       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2\n       if diff conftest.exp conftest.er2 >/dev/null; then\n         lt_cv_prog_compiler__b=yes\n       fi\n     else\n       lt_cv_prog_compiler__b=yes\n     fi\n   fi\n   $RM -r conftest*\n   LDFLAGS=$save_LDFLAGS\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b\" >&5\n$as_echo \"$lt_cv_prog_compiler__b\" >&6; }\n\nif test yes = \"$lt_cv_prog_compiler__b\"; then\n    archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\nelse\n    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'\nfi\n\n\t  ;;\n\tesac\n      fi\n      if test no = \"$with_gnu_ld\"; then\n\thardcode_libdir_flag_spec='$wl+b $wl$libdir'\n\thardcode_libdir_separator=:\n\n\tcase $host_cpu in\n\thppa*64*|ia64*)\n\t  hardcode_direct=no\n\t  hardcode_shlibpath_var=no\n\t  ;;\n\t*)\n\t  hardcode_direct=yes\n\t  hardcode_direct_absolute=yes\n\t  export_dynamic_flag_spec='$wl-E'\n\n\t  # hardcode_minus_L: Not really in the search PATH,\n\t  # but as the default location of the library.\n\t  hardcode_minus_L=yes\n\t  ;;\n\tesac\n      fi\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      if test yes = \"$GCC\"; then\n\tarchive_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'\n\t# Try to use the -exported_symbol ld option, if it does not\n\t# work, assume that -exports_file does not work either and\n\t# implicitly export all symbols.\n\t# This should be the same for all languages, so no per-tag cache variable.\n\t{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol\" >&5\n$as_echo_n \"checking whether the $host_os linker accepts -exported_symbol... \" >&6; }\nif ${lt_cv_irix_exported_symbol+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  save_LDFLAGS=$LDFLAGS\n\t   LDFLAGS=\"$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null\"\n\t   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\nint foo (void) { return 0; }\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  lt_cv_irix_exported_symbol=yes\nelse\n  lt_cv_irix_exported_symbol=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n           LDFLAGS=$save_LDFLAGS\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol\" >&5\n$as_echo \"$lt_cv_irix_exported_symbol\" >&6; }\n\tif test yes = \"$lt_cv_irix_exported_symbol\"; then\n          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'\n\tfi\n\tlink_all_deplibs=no\n      else\n\tarchive_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'\n\tarchive_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'\n      fi\n      archive_cmds_need_lc='no'\n      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n      hardcode_libdir_separator=:\n      inherit_rpath=yes\n      link_all_deplibs=yes\n      ;;\n\n    linux*)\n      case $cc_basename in\n      tcc*)\n\t# Fabrice Bellard et al's Tiny C Compiler\n\tld_shlibs=yes\n\tarchive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t;;\n      esac\n      ;;\n\n    netbsd* | netbsdelf*-gnu)\n      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n\tarchive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out\n      else\n\tarchive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF\n      fi\n      hardcode_libdir_flag_spec='-R$libdir'\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    newsos6)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct=yes\n      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n      hardcode_libdir_separator=:\n      hardcode_shlibpath_var=no\n      ;;\n\n    *nto* | *qnx*)\n      ;;\n\n    openbsd* | bitrig*)\n      if test -f /usr/libexec/ld.so; then\n\thardcode_direct=yes\n\thardcode_shlibpath_var=no\n\thardcode_direct_absolute=yes\n\tif test -z \"`echo __ELF__ | $CC -E - | $GREP __ELF__`\"; then\n\t  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'\n\t  hardcode_libdir_flag_spec='$wl-rpath,$libdir'\n\t  export_dynamic_flag_spec='$wl-E'\n\telse\n\t  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t  hardcode_libdir_flag_spec='$wl-rpath,$libdir'\n\tfi\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    os2*)\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_minus_L=yes\n      allow_undefined_flag=unsupported\n      shrext_cmds=.dll\n      archive_cmds='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\temxexp $libobjs | $SED /\"_DLL_InitTerm\"/d >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      archive_expsym_cmds='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\tprefix_cmds=\"$SED\"~\n\tif test EXPORTS = \"`$SED 1q $export_symbols`\"; then\n\t  prefix_cmds=\"$prefix_cmds -e 1d\";\n\tfi~\n\tprefix_cmds=\"$prefix_cmds -e \\\"s/^\\(.*\\)$/_\\1/g\\\"\"~\n\tcat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'\n      enable_shared_with_static_runtimes=yes\n      ;;\n\n    osf3*)\n      if test yes = \"$GCC\"; then\n\tallow_undefined_flag=' $wl-expect_unresolved $wl\\*'\n\tarchive_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'\n      else\n\tallow_undefined_flag=' -expect_unresolved \\*'\n\tarchive_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'\n      fi\n      archive_cmds_need_lc='no'\n      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n      hardcode_libdir_separator=:\n      ;;\n\n    osf4* | osf5*)\t# as osf3* with the addition of -msym flag\n      if test yes = \"$GCC\"; then\n\tallow_undefined_flag=' $wl-expect_unresolved $wl\\*'\n\tarchive_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'\n\thardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n      else\n\tallow_undefined_flag=' -expect_unresolved \\*'\n\tarchive_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'\n\tarchive_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~\n          $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'\n\n\t# Both c and cxx compiler support -rpath directly\n\thardcode_libdir_flag_spec='-rpath $libdir'\n      fi\n      archive_cmds_need_lc='no'\n      hardcode_libdir_separator=:\n      ;;\n\n    solaris*)\n      no_undefined_flag=' -z defs'\n      if test yes = \"$GCC\"; then\n\twlarc='$wl'\n\tarchive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n          $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'\n      else\n\tcase `$CC -V 2>&1` in\n\t*\"Compilers 5.0\"*)\n\t  wlarc=''\n\t  archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  archive_expsym_cmds='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'\n\t  ;;\n\t*)\n\t  wlarc='$wl'\n\t  archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  archive_expsym_cmds='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'\n\t  ;;\n\tesac\n      fi\n      hardcode_libdir_flag_spec='-R$libdir'\n      hardcode_shlibpath_var=no\n      case $host_os in\n      solaris2.[0-5] | solaris2.[0-5].*) ;;\n      *)\n\t# The compiler driver will combine and reorder linker options,\n\t# but understands '-z linker_flag'.  GCC discards it without '$wl',\n\t# but is careful enough not to reorder.\n\t# Supported since Solaris 2.6 (maybe 2.5.1?)\n\tif test yes = \"$GCC\"; then\n\t  whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'\n\telse\n\t  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'\n\tfi\n\t;;\n      esac\n      link_all_deplibs=yes\n      ;;\n\n    sunos4*)\n      if test sequent = \"$host_vendor\"; then\n\t# Use $CC to link under sequent, because it throws in some extra .o\n\t# files that make .init and .fini sections work.\n\tarchive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'\n      fi\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_direct=yes\n      hardcode_minus_L=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    sysv4)\n      case $host_vendor in\n\tsni)\n\t  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  hardcode_direct=yes # is this really true???\n\t;;\n\tsiemens)\n\t  ## LD is ld it makes a PLAMLIB\n\t  ## CC just makes a GrossModule.\n\t  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'\n\t  reload_cmds='$CC -r -o $output$reload_objs'\n\t  hardcode_direct=no\n        ;;\n\tmotorola)\n\t  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  hardcode_direct=no #Motorola manual says yes, but my tests say they lie\n\t;;\n      esac\n      runpath_var='LD_RUN_PATH'\n      hardcode_shlibpath_var=no\n      ;;\n\n    sysv4.3*)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_shlibpath_var=no\n      export_dynamic_flag_spec='-Bexport'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tarchive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\thardcode_shlibpath_var=no\n\trunpath_var=LD_RUN_PATH\n\thardcode_runpath_var=yes\n\tld_shlibs=yes\n      fi\n      ;;\n\n    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)\n      no_undefined_flag='$wl-z,text'\n      archive_cmds_need_lc=no\n      hardcode_shlibpath_var=no\n      runpath_var='LD_RUN_PATH'\n\n      if test yes = \"$GCC\"; then\n\tarchive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      fi\n      ;;\n\n    sysv5* | sco3.2v5* | sco5v6*)\n      # Note: We CANNOT use -z defs as we might desire, because we do not\n      # link with -lc, and that would cause any symbols used from libc to\n      # always be unresolved, which means just about no library would\n      # ever link correctly.  If we're not using GNU ld we use -z text\n      # though, which does catch some bad symbols but isn't as heavy-handed\n      # as -z defs.\n      no_undefined_flag='$wl-z,text'\n      allow_undefined_flag='$wl-z,nodefs'\n      archive_cmds_need_lc=no\n      hardcode_shlibpath_var=no\n      hardcode_libdir_flag_spec='$wl-R,$libdir'\n      hardcode_libdir_separator=':'\n      link_all_deplibs=yes\n      export_dynamic_flag_spec='$wl-Bexport'\n      runpath_var='LD_RUN_PATH'\n\n      if test yes = \"$GCC\"; then\n\tarchive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      fi\n      ;;\n\n    uts4*)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_shlibpath_var=no\n      ;;\n\n    *)\n      ld_shlibs=no\n      ;;\n    esac\n\n    if test sni = \"$host_vendor\"; then\n      case $host in\n      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n\texport_dynamic_flag_spec='$wl-Blargedynsym'\n\t;;\n      esac\n    fi\n  fi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ld_shlibs\" >&5\n$as_echo \"$ld_shlibs\" >&6; }\ntest no = \"$ld_shlibs\" && can_build_shared=no\n\nwith_gnu_ld=$with_gnu_ld\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#\n# Do we need to explicitly link libc?\n#\ncase \"x$archive_cmds_need_lc\" in\nx|xyes)\n  # Assume -lc should be added\n  archive_cmds_need_lc=yes\n\n  if test yes,yes = \"$GCC,$enable_shared\"; then\n    case $archive_cmds in\n    *'~'*)\n      # FIXME: we may have to deal with multi-command sequences.\n      ;;\n    '$CC '*)\n      # Test whether the compiler implicitly links with -lc since on some\n      # systems, -lgcc has to come before -lc. If gcc already passes -lc\n      # to ld, don't add -lc before -lgcc.\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in\" >&5\n$as_echo_n \"checking whether -lc should be explicitly linked in... \" >&6; }\nif ${lt_cv_archive_cmds_need_lc+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  $RM conftest*\n\techo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n\tif { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } 2>conftest.err; then\n\t  soname=conftest\n\t  lib=conftest\n\t  libobjs=conftest.$ac_objext\n\t  deplibs=\n\t  wl=$lt_prog_compiler_wl\n\t  pic_flag=$lt_prog_compiler_pic\n\t  compiler_flags=-v\n\t  linker_flags=-v\n\t  verstring=\n\t  output_objdir=.\n\t  libname=conftest\n\t  lt_save_allow_undefined_flag=$allow_undefined_flag\n\t  allow_undefined_flag=\n\t  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$archive_cmds 2\\>\\&1 \\| $GREP \\\" -lc \\\" \\>/dev/null 2\\>\\&1\\\"\"; } >&5\n  (eval $archive_cmds 2\\>\\&1 \\| $GREP \\\" -lc \\\" \\>/dev/null 2\\>\\&1) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n\t  then\n\t    lt_cv_archive_cmds_need_lc=no\n\t  else\n\t    lt_cv_archive_cmds_need_lc=yes\n\t  fi\n\t  allow_undefined_flag=$lt_save_allow_undefined_flag\n\telse\n\t  cat conftest.err 1>&5\n\tfi\n\t$RM conftest*\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc\" >&5\n$as_echo \"$lt_cv_archive_cmds_need_lc\" >&6; }\n      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc\n      ;;\n    esac\n  fi\n  ;;\nesac\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics\" >&5\n$as_echo_n \"checking dynamic linker characteristics... \" >&6; }\n\nif test yes = \"$GCC\"; then\n  case $host_os in\n    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;\n    *) lt_awk_arg='/^libraries:/' ;;\n  esac\n  case $host_os in\n    mingw* | cegcc*) lt_sed_strip_eq='s|=\\([A-Za-z]:\\)|\\1|g' ;;\n    *) lt_sed_strip_eq='s|=/|/|g' ;;\n  esac\n  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e \"s/^libraries://\" -e $lt_sed_strip_eq`\n  case $lt_search_path_spec in\n  *\\;*)\n    # if the path contains \";\" then we assume it to be the separator\n    # otherwise default to the standard path separator (i.e. \":\") - it is\n    # assumed that no part of a normal pathname contains \";\" but that should\n    # okay in the real world where \";\" in dirpaths is itself problematic.\n    lt_search_path_spec=`$ECHO \"$lt_search_path_spec\" | $SED 's/;/ /g'`\n    ;;\n  *)\n    lt_search_path_spec=`$ECHO \"$lt_search_path_spec\" | $SED \"s/$PATH_SEPARATOR/ /g\"`\n    ;;\n  esac\n  # Ok, now we have the path, separated by spaces, we can step through it\n  # and add multilib dir if necessary...\n  lt_tmp_lt_search_path_spec=\n  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`\n  # ...but if some path component already ends with the multilib dir we assume\n  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).\n  case \"$lt_multi_os_dir; $lt_search_path_spec \" in\n  \"/; \"* | \"/.; \"* | \"/./; \"* | *\"$lt_multi_os_dir \"* | *\"$lt_multi_os_dir/ \"*)\n    lt_multi_os_dir=\n    ;;\n  esac\n  for lt_sys_path in $lt_search_path_spec; do\n    if test -d \"$lt_sys_path$lt_multi_os_dir\"; then\n      lt_tmp_lt_search_path_spec=\"$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir\"\n    elif test -n \"$lt_multi_os_dir\"; then\n      test -d \"$lt_sys_path\" && \\\n\tlt_tmp_lt_search_path_spec=\"$lt_tmp_lt_search_path_spec $lt_sys_path\"\n    fi\n  done\n  lt_search_path_spec=`$ECHO \"$lt_tmp_lt_search_path_spec\" | awk '\nBEGIN {RS = \" \"; FS = \"/|\\n\";} {\n  lt_foo = \"\";\n  lt_count = 0;\n  for (lt_i = NF; lt_i > 0; lt_i--) {\n    if ($lt_i != \"\" && $lt_i != \".\") {\n      if ($lt_i == \"..\") {\n        lt_count++;\n      } else {\n        if (lt_count == 0) {\n          lt_foo = \"/\" $lt_i lt_foo;\n        } else {\n          lt_count--;\n        }\n      }\n    }\n  }\n  if (lt_foo != \"\") { lt_freq[lt_foo]++; }\n  if (lt_freq[lt_foo] == 1) { print lt_foo; }\n}'`\n  # AWK program above erroneously prepends '/' to C:/dos/paths\n  # for these hosts.\n  case $host_os in\n    mingw* | cegcc*) lt_search_path_spec=`$ECHO \"$lt_search_path_spec\" |\\\n      $SED 's|/\\([A-Za-z]:\\)|\\1|g'` ;;\n  esac\n  sys_lib_search_path_spec=`$ECHO \"$lt_search_path_spec\" | $lt_NL2SP`\nelse\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\nfi\nlibrary_names_spec=\nlibname_spec='lib$name'\nsoname_spec=\nshrext_cmds=.so\npostinstall_cmds=\npostuninstall_cmds=\nfinish_cmds=\nfinish_eval=\nshlibpath_var=\nshlibpath_overrides_runpath=unknown\nversion_type=none\ndynamic_linker=\"$host_os ld.so\"\nsys_lib_dlsearch_path_spec=\"/lib /usr/lib\"\nneed_lib_prefix=unknown\nhardcode_into_libs=no\n\n# when you set need_version to no, make sure it does not cause -set_version\n# flags to be left without arguments\nneed_version=unknown\n\n\n\ncase $host_os in\naix3*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'\n  shlibpath_var=LIBPATH\n\n  # AIX 3 has no versioning support, so we append a major version to the name.\n  soname_spec='$libname$release$shared_ext$major'\n  ;;\n\naix[4-9]*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  hardcode_into_libs=yes\n  if test ia64 = \"$host_cpu\"; then\n    # AIX 5 supports IA64\n    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'\n    shlibpath_var=LD_LIBRARY_PATH\n  else\n    # With GCC up to 2.95.x, collect2 would create an import file\n    # for dependence libraries.  The import file would start with\n    # the line '#! .'.  This would cause the generated library to\n    # depend on '.', always an invalid library.  This was fixed in\n    # development snapshots of GCC prior to 3.0.\n    case $host_os in\n      aix4 | aix4.[01] | aix4.[01].*)\n      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'\n\t   echo ' yes '\n\t   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then\n\t:\n      else\n\tcan_build_shared=no\n      fi\n      ;;\n    esac\n    # Using Import Files as archive members, it is possible to support\n    # filename-based versioning of shared library archives on AIX. While\n    # this would work for both with and without runtime linking, it will\n    # prevent static linking of such archives. So we do filename-based\n    # shared library versioning with .so extension only, which is used\n    # when both runtime linking and shared linking is enabled.\n    # Unfortunately, runtime linking may impact performance, so we do\n    # not want this to be the default eventually. Also, we use the\n    # versioned .so libs for executables only if there is the -brtl\n    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.\n    # To allow for filename-based versioning support, we need to create\n    # libNAME.so.V as an archive file, containing:\n    # *) an Import File, referring to the versioned filename of the\n    #    archive as well as the shared archive member, telling the\n    #    bitwidth (32 or 64) of that shared object, and providing the\n    #    list of exported symbols of that shared object, eventually\n    #    decorated with the 'weak' keyword\n    # *) the shared object with the F_LOADONLY flag set, to really avoid\n    #    it being seen by the linker.\n    # At run time we better use the real file rather than another symlink,\n    # but for link time we create the symlink libNAME.so -> libNAME.so.V\n\n    case $with_aix_soname,$aix_use_runtimelinking in\n    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct\n    # soname into executable. Probably we can add versioning support to\n    # collect2, so additional links can be useful in future.\n    aix,yes) # traditional libtool\n      dynamic_linker='AIX unversionable lib.so'\n      # If using run time linking (on AIX 4.2 or later) use lib<name>.so\n      # instead of lib<name>.a to let people know that these are not\n      # typical AIX shared libraries.\n      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n      ;;\n    aix,no) # traditional AIX only\n      dynamic_linker='AIX lib.a(lib.so.V)'\n      # We preserve .a as extension for shared libraries through AIX4.2\n      # and later when we are not doing run time linking.\n      library_names_spec='$libname$release.a $libname.a'\n      soname_spec='$libname$release$shared_ext$major'\n      ;;\n    svr4,*) # full svr4 only\n      dynamic_linker=\"AIX lib.so.V($shared_archive_member_spec.o)\"\n      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'\n      # We do not specify a path in Import Files, so LIBPATH fires.\n      shlibpath_overrides_runpath=yes\n      ;;\n    *,yes) # both, prefer svr4\n      dynamic_linker=\"AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)\"\n      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'\n      # unpreferred sharedlib libNAME.a needs extra handling\n      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\"'\n      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\"'\n      # We do not specify a path in Import Files, so LIBPATH fires.\n      shlibpath_overrides_runpath=yes\n      ;;\n    *,no) # both, prefer aix\n      dynamic_linker=\"AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)\"\n      library_names_spec='$libname$release.a $libname.a'\n      soname_spec='$libname$release$shared_ext$major'\n      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling\n      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)'\n      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\"'\n      ;;\n    esac\n    shlibpath_var=LIBPATH\n  fi\n  ;;\n\namigaos*)\n  case $host_cpu in\n  powerpc)\n    # Since July 2007 AmigaOS4 officially supports .so libraries.\n    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    ;;\n  m68k)\n    library_names_spec='$libname.ixlibrary $libname.a'\n    # Create ${libname}_ixlibrary.a entries in /sys/libs.\n    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'\n    ;;\n  esac\n  ;;\n\nbeos*)\n  library_names_spec='$libname$shared_ext'\n  dynamic_linker=\"$host_os ld.so\"\n  shlibpath_var=LIBRARY_PATH\n  ;;\n\nbsdi[45]*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=\"/shlib /usr/lib /usr/local/lib\"\n  # the default ld.so.conf also contains /usr/contrib/lib and\n  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow\n  # libtool to hard-code these into programs\n  ;;\n\ncygwin* | mingw* | pw32* | cegcc*)\n  version_type=windows\n  shrext_cmds=.dll\n  need_version=no\n  need_lib_prefix=no\n\n  case $GCC,$cc_basename in\n  yes,*)\n    # gcc\n    library_names_spec='$libname.dll.a'\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\$file`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\$base_file'\\''i; echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname~\n      chmod a+x \\$dldir/$dlname~\n      if test -n '\\''$stripme'\\'' && test -n '\\''$striplib'\\''; then\n        eval '\\''$striplib \\$dldir/$dlname'\\'' || exit \\$?;\n      fi'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $RM \\$dlpath'\n    shlibpath_overrides_runpath=yes\n\n    case $host_os in\n    cygwin*)\n      # Cygwin DLLs use 'cyg' prefix rather than 'lib'\n      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'\n\n      sys_lib_search_path_spec=\"$sys_lib_search_path_spec /usr/lib/w32api\"\n      ;;\n    mingw* | cegcc*)\n      # MinGW DLLs use traditional 'lib' prefix\n      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'\n      ;;\n    pw32*)\n      # pw32 DLLs use 'pw' prefix rather than 'lib'\n      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'\n      ;;\n    esac\n    dynamic_linker='Win32 ld.exe'\n    ;;\n\n  *,cl*)\n    # Native MSVC\n    libname_spec='$name'\n    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'\n    library_names_spec='$libname.dll.lib'\n\n    case $build_os in\n    mingw*)\n      sys_lib_search_path_spec=\n      lt_save_ifs=$IFS\n      IFS=';'\n      for lt_path in $LIB\n      do\n        IFS=$lt_save_ifs\n        # Let DOS variable expansion print the short 8.3 style file name.\n        lt_path=`cd \"$lt_path\" 2>/dev/null && cmd //C \"for %i in (\".\") do @echo %~si\"`\n        sys_lib_search_path_spec=\"$sys_lib_search_path_spec $lt_path\"\n      done\n      IFS=$lt_save_ifs\n      # Convert to MSYS style.\n      sys_lib_search_path_spec=`$ECHO \"$sys_lib_search_path_spec\" | sed -e 's|\\\\\\\\|/|g' -e 's| \\\\([a-zA-Z]\\\\):| /\\\\1|g' -e 's|^ ||'`\n      ;;\n    cygwin*)\n      # Convert to unix form, then to dos form, then back to unix form\n      # but this time dos style (no spaces!) so that the unix form looks\n      # like /cygdrive/c/PROGRA~1:/cygdr...\n      sys_lib_search_path_spec=`cygpath --path --unix \"$LIB\"`\n      sys_lib_search_path_spec=`cygpath --path --dos \"$sys_lib_search_path_spec\" 2>/dev/null`\n      sys_lib_search_path_spec=`cygpath --path --unix \"$sys_lib_search_path_spec\" | $SED -e \"s/$PATH_SEPARATOR/ /g\"`\n      ;;\n    *)\n      sys_lib_search_path_spec=$LIB\n      if $ECHO \"$sys_lib_search_path_spec\" | $GREP ';[c-zC-Z]:/' >/dev/null; then\n        # It is most probably a Windows format PATH.\n        sys_lib_search_path_spec=`$ECHO \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n      else\n        sys_lib_search_path_spec=`$ECHO \"$sys_lib_search_path_spec\" | $SED -e \"s/$PATH_SEPARATOR/ /g\"`\n      fi\n      # FIXME: find the short name or the path components, as spaces are\n      # common. (e.g. \"Program Files\" -> \"PROGRA~1\")\n      ;;\n    esac\n\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\$file`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\$base_file'\\''i; echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $RM \\$dlpath'\n    shlibpath_overrides_runpath=yes\n    dynamic_linker='Win32 link.exe'\n    ;;\n\n  *)\n    # Assume MSVC wrapper\n    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'\n    dynamic_linker='Win32 ld.exe'\n    ;;\n  esac\n  # FIXME: first we should search . and the directory the executable is in\n  shlibpath_var=PATH\n  ;;\n\ndarwin* | rhapsody*)\n  dynamic_linker=\"$host_os dyld\"\n  version_type=darwin\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'\n  soname_spec='$libname$release$major$shared_ext'\n  shlibpath_overrides_runpath=yes\n  shlibpath_var=DYLD_LIBRARY_PATH\n  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'\n\n  sys_lib_search_path_spec=\"$sys_lib_search_path_spec /usr/local/lib\"\n  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'\n  ;;\n\ndgux*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nfreebsd* | dragonfly*)\n  # DragonFly does not have aout.  When/if they implement a new\n  # versioning mechanism, adjust this.\n  if test -x /usr/bin/objformat; then\n    objformat=`/usr/bin/objformat`\n  else\n    case $host_os in\n    freebsd[23].*) objformat=aout ;;\n    *) objformat=elf ;;\n    esac\n  fi\n  version_type=freebsd-$objformat\n  case $version_type in\n    freebsd-elf*)\n      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n      soname_spec='$libname$release$shared_ext$major'\n      need_version=no\n      need_lib_prefix=no\n      ;;\n    freebsd-*)\n      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n      need_version=yes\n      ;;\n  esac\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_os in\n  freebsd2.*)\n    shlibpath_overrides_runpath=yes\n    ;;\n  freebsd3.[01]* | freebsdelf3.[01]*)\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \\\n  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)\n    shlibpath_overrides_runpath=no\n    hardcode_into_libs=yes\n    ;;\n  *) # from 4.6 on, and DragonFly\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  esac\n  ;;\n\nhaiku*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  dynamic_linker=\"$host_os runtime_loader\"\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'\n  hardcode_into_libs=yes\n  ;;\n\nhpux9* | hpux10* | hpux11*)\n  # Give a soname corresponding to the major version so that dld.sl refuses to\n  # link against other versions.\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  case $host_cpu in\n  ia64*)\n    shrext_cmds='.so'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.so\"\n    shlibpath_var=LD_LIBRARY_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    if test 32 = \"$HPUX_IA64_MODE\"; then\n      sys_lib_search_path_spec=\"/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib\"\n      sys_lib_dlsearch_path_spec=/usr/lib/hpux32\n    else\n      sys_lib_search_path_spec=\"/usr/lib/hpux64 /usr/local/lib/hpux64\"\n      sys_lib_dlsearch_path_spec=/usr/lib/hpux64\n    fi\n    ;;\n  hppa*64*)\n    shrext_cmds='.sl'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    sys_lib_search_path_spec=\"/usr/lib/pa20_64 /usr/ccs/lib/pa20_64\"\n    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n    ;;\n  *)\n    shrext_cmds='.sl'\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=SHLIB_PATH\n    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    ;;\n  esac\n  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...\n  postinstall_cmds='chmod 555 $lib'\n  # or fails outright, so override atomically:\n  install_override_mode=555\n  ;;\n\ninterix[3-9]*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $host_os in\n    nonstopux*) version_type=nonstopux ;;\n    *)\n\tif test yes = \"$lt_cv_prog_gnu_ld\"; then\n\t\tversion_type=linux # correct to gnu/linux during the next big refactor\n\telse\n\t\tversion_type=irix\n\tfi ;;\n  esac\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='$libname$release$shared_ext$major'\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'\n  case $host_os in\n  irix5* | nonstopux*)\n    libsuff= shlibsuff=\n    ;;\n  *)\n    case $LD in # libtool.m4 will add one of these switches to LD\n    *-32|*\"-32 \"|*-melf32bsmip|*\"-melf32bsmip \")\n      libsuff= shlibsuff= libmagic=32-bit;;\n    *-n32|*\"-n32 \"|*-melf32bmipn32|*\"-melf32bmipn32 \")\n      libsuff=32 shlibsuff=N32 libmagic=N32;;\n    *-64|*\"-64 \"|*-melf64bmip|*\"-melf64bmip \")\n      libsuff=64 shlibsuff=64 libmagic=64-bit;;\n    *) libsuff= shlibsuff= libmagic=never-match;;\n    esac\n    ;;\n  esac\n  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_search_path_spec=\"/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff\"\n  sys_lib_dlsearch_path_spec=\"/usr/lib$libsuff /lib$libsuff\"\n  hardcode_into_libs=yes\n  ;;\n\n# No shared lib support for Linux oldld, aout, or coff.\nlinux*oldld* | linux*aout* | linux*coff*)\n  dynamic_linker=no\n  ;;\n\nlinux*android*)\n  version_type=none # Android doesn't support versioned libraries.\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext'\n  soname_spec='$libname$release$shared_ext'\n  finish_cmds=\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  dynamic_linker='Android linker'\n  # Don't embed -rpath directories since the linker doesn't support them.\n  hardcode_libdir_flag_spec='-L$libdir'\n  ;;\n\n# This must be glibc/ELF.\nlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -n $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n\n  # Some binutils ld are patched to set DT_RUNPATH\n  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_shlibpath_overrides_runpath=no\n    save_LDFLAGS=$LDFLAGS\n    save_libdir=$libdir\n    eval \"libdir=/foo; wl=\\\"$lt_prog_compiler_wl\\\"; \\\n\t LDFLAGS=\\\"\\$LDFLAGS $hardcode_libdir_flag_spec\\\"\"\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep \"RUNPATH.*$libdir\" >/dev/null; then :\n  lt_cv_shlibpath_overrides_runpath=yes\nfi\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n    LDFLAGS=$save_LDFLAGS\n    libdir=$save_libdir\n\nfi\n\n  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath\n\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  # Ideally, we could use ldconfig to report *all* directores which are\n  # searched for libraries, however this is still not possible.  Aside from not\n  # being certain /sbin/ldconfig is available, command\n  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,\n  # even though it is searched at run-time.  Try to do the best guess by\n  # appending ld.so.conf contents (and includes) to the search path.\n  if test -f /etc/ld.so.conf; then\n    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/#.*//;/^[\t ]*hwcap[\t ]/d;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/\"//g;/^$/d' | tr '\\n' ' '`\n    sys_lib_dlsearch_path_spec=\"/lib /usr/lib $lt_ld_extra\"\n  fi\n\n  # We used to test for /lib/ld.so.1 and disable shared libraries on\n  # powerpc, because MkLinux only supported shared libraries with the\n  # GNU dynamic linker.  Since this was broken with cross compilers,\n  # most powerpc-linux boxes support dynamic linking these days and\n  # people can always --disable-shared, the test was removed, and we\n  # assume the GNU/Linux dynamic linker is in use.\n  dynamic_linker='GNU/Linux ld.so'\n  ;;\n\nnetbsdelf*-gnu)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='NetBSD ld.elf_so'\n  ;;\n\nnetbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n    finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n    dynamic_linker='NetBSD (a.out) ld.so'\n  else\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    dynamic_linker='NetBSD ld.elf_so'\n  fi\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  ;;\n\nnewsos6)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\n*nto* | *qnx*)\n  version_type=qnx\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='ldqnx.so'\n  ;;\n\nopenbsd* | bitrig*)\n  version_type=sunos\n  sys_lib_dlsearch_path_spec=/usr/lib\n  need_lib_prefix=no\n  if test -z \"`echo __ELF__ | $CC -E - | $GREP __ELF__`\"; then\n    need_version=no\n  else\n    need_version=yes\n  fi\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nos2*)\n  libname_spec='$name'\n  version_type=windows\n  shrext_cmds=.dll\n  need_version=no\n  need_lib_prefix=no\n  # OS/2 can only load a DLL with a base name of 8 characters or less.\n  soname_spec='`test -n \"$os2dllname\" && libname=\"$os2dllname\";\n    v=$($ECHO $release$versuffix | tr -d .-);\n    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);\n    $ECHO $n$v`$shared_ext'\n  library_names_spec='${libname}_dll.$libext'\n  dynamic_linker='OS/2 ld.exe'\n  shlibpath_var=BEGINLIBPATH\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n  postinstall_cmds='base_file=`basename \\$file`~\n    dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\$base_file'\\''i; $ECHO \\$dlname'\\''`~\n    dldir=$destdir/`dirname \\$dlpath`~\n    test -d \\$dldir || mkdir -p \\$dldir~\n    $install_prog $dir/$dlname \\$dldir/$dlname~\n    chmod a+x \\$dldir/$dlname~\n    if test -n '\\''$stripme'\\'' && test -n '\\''$striplib'\\''; then\n      eval '\\''$striplib \\$dldir/$dlname'\\'' || exit \\$?;\n    fi'\n  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; $ECHO \\$dlname'\\''`~\n    dlpath=$dir/\\$dldll~\n    $RM \\$dlpath'\n  ;;\n\nosf3* | osf4* | osf5*)\n  version_type=osf\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='$libname$release$shared_ext$major'\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib\"\n  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n  ;;\n\nrdos*)\n  dynamic_linker=no\n  ;;\n\nsolaris*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  # ldd complains unless libraries are executable\n  postinstall_cmds='chmod +x $lib'\n  ;;\n\nsunos4*)\n  version_type=sunos\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/usr/etc\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  if test yes = \"$with_gnu_ld\"; then\n    need_lib_prefix=no\n  fi\n  need_version=yes\n  ;;\n\nsysv4 | sysv4.3*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_vendor in\n    sni)\n      shlibpath_overrides_runpath=no\n      need_lib_prefix=no\n      runpath_var=LD_RUN_PATH\n      ;;\n    siemens)\n      need_lib_prefix=no\n      ;;\n    motorola)\n      need_lib_prefix=no\n      need_version=no\n      shlibpath_overrides_runpath=no\n      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'\n      ;;\n  esac\n  ;;\n\nsysv4*MP*)\n  if test -d /usr/nec; then\n    version_type=linux # correct to gnu/linux during the next big refactor\n    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'\n    soname_spec='$libname$shared_ext.$major'\n    shlibpath_var=LD_LIBRARY_PATH\n  fi\n  ;;\n\nsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)\n  version_type=sco\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  if test yes = \"$with_gnu_ld\"; then\n    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'\n  else\n    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'\n    case $host_os in\n      sco3.2v5*)\n        sys_lib_search_path_spec=\"$sys_lib_search_path_spec /lib\"\n\t;;\n    esac\n  fi\n  sys_lib_dlsearch_path_spec='/usr/lib'\n  ;;\n\ntpf*)\n  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  ;;\n\nuts4*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\n*)\n  dynamic_linker=no\n  ;;\nesac\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $dynamic_linker\" >&5\n$as_echo \"$dynamic_linker\" >&6; }\ntest no = \"$dynamic_linker\" && can_build_shared=no\n\nvariables_saved_for_relink=\"PATH $shlibpath_var $runpath_var\"\nif test yes = \"$GCC\"; then\n  variables_saved_for_relink=\"$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH\"\nfi\n\nif test set = \"${lt_cv_sys_lib_search_path_spec+set}\"; then\n  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec\nfi\n\nif test set = \"${lt_cv_sys_lib_dlsearch_path_spec+set}\"; then\n  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec\nfi\n\n# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...\nconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec\n\n# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code\nfunc_munge_path_list sys_lib_dlsearch_path_spec \"$LT_SYS_LIBRARY_PATH\"\n\n# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool\nconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs\" >&5\n$as_echo_n \"checking how to hardcode library paths into programs... \" >&6; }\nhardcode_action=\nif test -n \"$hardcode_libdir_flag_spec\" ||\n   test -n \"$runpath_var\" ||\n   test yes = \"$hardcode_automatic\"; then\n\n  # We can hardcode non-existent directories.\n  if test no != \"$hardcode_direct\" &&\n     # If the only mechanism to avoid hardcoding is shlibpath_var, we\n     # have to relink, otherwise we might link with an installed library\n     # when we should be linking with a yet-to-be-installed one\n     ## test no != \"$_LT_TAGVAR(hardcode_shlibpath_var, )\" &&\n     test no != \"$hardcode_minus_L\"; then\n    # Linking always hardcodes the temporary library directory.\n    hardcode_action=relink\n  else\n    # We can link without hardcoding, and we can hardcode nonexisting dirs.\n    hardcode_action=immediate\n  fi\nelse\n  # We cannot hardcode anything, or else we can only hardcode existing\n  # directories.\n  hardcode_action=unsupported\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $hardcode_action\" >&5\n$as_echo \"$hardcode_action\" >&6; }\n\nif test relink = \"$hardcode_action\" ||\n   test yes = \"$inherit_rpath\"; then\n  # Fast installation is not supported\n  enable_fast_install=no\nelif test yes = \"$shlibpath_overrides_runpath\" ||\n     test no = \"$enable_shared\"; then\n  # Fast installation is not necessary\n  enable_fast_install=needless\nfi\n\n\n\n\n\n\n  if test yes != \"$enable_dlopen\"; then\n  enable_dlopen=unknown\n  enable_dlopen_self=unknown\n  enable_dlopen_self_static=unknown\nelse\n  lt_cv_dlopen=no\n  lt_cv_dlopen_libs=\n\n  case $host_os in\n  beos*)\n    lt_cv_dlopen=load_add_on\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n    ;;\n\n  mingw* | pw32* | cegcc*)\n    lt_cv_dlopen=LoadLibrary\n    lt_cv_dlopen_libs=\n    ;;\n\n  cygwin*)\n    lt_cv_dlopen=dlopen\n    lt_cv_dlopen_libs=\n    ;;\n\n  darwin*)\n    # if libdl is installed we need to link against it\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl\" >&5\n$as_echo_n \"checking for dlopen in -ldl... \" >&6; }\nif ${ac_cv_lib_dl_dlopen+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldl  $LIBS\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar dlopen ();\nint\nmain ()\n{\nreturn dlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  ac_cv_lib_dl_dlopen=yes\nelse\n  ac_cv_lib_dl_dlopen=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen\" >&5\n$as_echo \"$ac_cv_lib_dl_dlopen\" >&6; }\nif test \"x$ac_cv_lib_dl_dlopen\" = xyes; then :\n  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl\nelse\n\n    lt_cv_dlopen=dyld\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n\nfi\n\n    ;;\n\n  tpf*)\n    # Don't try to run any link tests for TPF.  We know it's impossible\n    # because TPF is a cross-compiler, and we know how we open DSOs.\n    lt_cv_dlopen=dlopen\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=no\n    ;;\n\n  *)\n    ac_fn_c_check_func \"$LINENO\" \"shl_load\" \"ac_cv_func_shl_load\"\nif test \"x$ac_cv_func_shl_load\" = xyes; then :\n  lt_cv_dlopen=shl_load\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld\" >&5\n$as_echo_n \"checking for shl_load in -ldld... \" >&6; }\nif ${ac_cv_lib_dld_shl_load+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldld  $LIBS\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar shl_load ();\nint\nmain ()\n{\nreturn shl_load ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  ac_cv_lib_dld_shl_load=yes\nelse\n  ac_cv_lib_dld_shl_load=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load\" >&5\n$as_echo \"$ac_cv_lib_dld_shl_load\" >&6; }\nif test \"x$ac_cv_lib_dld_shl_load\" = xyes; then :\n  lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld\nelse\n  ac_fn_c_check_func \"$LINENO\" \"dlopen\" \"ac_cv_func_dlopen\"\nif test \"x$ac_cv_func_dlopen\" = xyes; then :\n  lt_cv_dlopen=dlopen\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl\" >&5\n$as_echo_n \"checking for dlopen in -ldl... \" >&6; }\nif ${ac_cv_lib_dl_dlopen+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldl  $LIBS\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar dlopen ();\nint\nmain ()\n{\nreturn dlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  ac_cv_lib_dl_dlopen=yes\nelse\n  ac_cv_lib_dl_dlopen=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen\" >&5\n$as_echo \"$ac_cv_lib_dl_dlopen\" >&6; }\nif test \"x$ac_cv_lib_dl_dlopen\" = xyes; then :\n  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld\" >&5\n$as_echo_n \"checking for dlopen in -lsvld... \" >&6; }\nif ${ac_cv_lib_svld_dlopen+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-lsvld  $LIBS\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar dlopen ();\nint\nmain ()\n{\nreturn dlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  ac_cv_lib_svld_dlopen=yes\nelse\n  ac_cv_lib_svld_dlopen=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen\" >&5\n$as_echo \"$ac_cv_lib_svld_dlopen\" >&6; }\nif test \"x$ac_cv_lib_svld_dlopen\" = xyes; then :\n  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld\" >&5\n$as_echo_n \"checking for dld_link in -ldld... \" >&6; }\nif ${ac_cv_lib_dld_dld_link+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldld  $LIBS\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar dld_link ();\nint\nmain ()\n{\nreturn dld_link ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  ac_cv_lib_dld_dld_link=yes\nelse\n  ac_cv_lib_dld_dld_link=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link\" >&5\n$as_echo \"$ac_cv_lib_dld_dld_link\" >&6; }\nif test \"x$ac_cv_lib_dld_dld_link\" = xyes; then :\n  lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n    ;;\n  esac\n\n  if test no = \"$lt_cv_dlopen\"; then\n    enable_dlopen=no\n  else\n    enable_dlopen=yes\n  fi\n\n  case $lt_cv_dlopen in\n  dlopen)\n    save_CPPFLAGS=$CPPFLAGS\n    test yes = \"$ac_cv_header_dlfcn_h\" && CPPFLAGS=\"$CPPFLAGS -DHAVE_DLFCN_H\"\n\n    save_LDFLAGS=$LDFLAGS\n    wl=$lt_prog_compiler_wl eval LDFLAGS=\\\"\\$LDFLAGS $export_dynamic_flag_spec\\\"\n\n    save_LIBS=$LIBS\n    LIBS=\"$lt_cv_dlopen_libs $LIBS\"\n\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself\" >&5\n$as_echo_n \"checking whether a program can dlopen itself... \" >&6; }\nif ${lt_cv_dlopen_self+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  \t  if test yes = \"$cross_compiling\"; then :\n  lt_cv_dlopen_self=cross\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<_LT_EOF\n#line $LINENO \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n/* When -fvisibility=hidden is used, assume the code has been annotated\n   correspondingly for the symbols needed.  */\n#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))\nint fnord () __attribute__((visibility(\"default\")));\n#endif\n\nint fnord () { return 42; }\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else\n        {\n\t  if (dlsym( self,\"_fnord\"))  status = $lt_dlneed_uscore;\n          else puts (dlerror ());\n\t}\n      /* dlclose (self); */\n    }\n  else\n    puts (dlerror ());\n\n  return status;\n}\n_LT_EOF\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_link\\\"\"; } >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && test -s \"conftest$ac_exeext\" 2>/dev/null; then\n    (./conftest; exit; ) >&5 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;\n      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;\n      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;\n    esac\n  else :\n    # compilation failed\n    lt_cv_dlopen_self=no\n  fi\nfi\nrm -fr conftest*\n\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self\" >&5\n$as_echo \"$lt_cv_dlopen_self\" >&6; }\n\n    if test yes = \"$lt_cv_dlopen_self\"; then\n      wl=$lt_prog_compiler_wl eval LDFLAGS=\\\"\\$LDFLAGS $lt_prog_compiler_static\\\"\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself\" >&5\n$as_echo_n \"checking whether a statically linked program can dlopen itself... \" >&6; }\nif ${lt_cv_dlopen_self_static+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  \t  if test yes = \"$cross_compiling\"; then :\n  lt_cv_dlopen_self_static=cross\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<_LT_EOF\n#line $LINENO \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n/* When -fvisibility=hidden is used, assume the code has been annotated\n   correspondingly for the symbols needed.  */\n#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))\nint fnord () __attribute__((visibility(\"default\")));\n#endif\n\nint fnord () { return 42; }\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else\n        {\n\t  if (dlsym( self,\"_fnord\"))  status = $lt_dlneed_uscore;\n          else puts (dlerror ());\n\t}\n      /* dlclose (self); */\n    }\n  else\n    puts (dlerror ());\n\n  return status;\n}\n_LT_EOF\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_link\\\"\"; } >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && test -s \"conftest$ac_exeext\" 2>/dev/null; then\n    (./conftest; exit; ) >&5 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;\n      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;\n      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;\n    esac\n  else :\n    # compilation failed\n    lt_cv_dlopen_self_static=no\n  fi\nfi\nrm -fr conftest*\n\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static\" >&5\n$as_echo \"$lt_cv_dlopen_self_static\" >&6; }\n    fi\n\n    CPPFLAGS=$save_CPPFLAGS\n    LDFLAGS=$save_LDFLAGS\n    LIBS=$save_LIBS\n    ;;\n  esac\n\n  case $lt_cv_dlopen_self in\n  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;\n  *) enable_dlopen_self=unknown ;;\n  esac\n\n  case $lt_cv_dlopen_self_static in\n  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;\n  *) enable_dlopen_self_static=unknown ;;\n  esac\nfi\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nstriplib=\nold_striplib=\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible\" >&5\n$as_echo_n \"checking whether stripping libraries is possible... \" >&6; }\nif test -n \"$STRIP\" && $STRIP -V 2>&1 | $GREP \"GNU strip\" >/dev/null; then\n  test -z \"$old_striplib\" && old_striplib=\"$STRIP --strip-debug\"\n  test -z \"$striplib\" && striplib=\"$STRIP --strip-unneeded\"\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n# FIXME - insert some real tests, host_os isn't really good enough\n  case $host_os in\n  darwin*)\n    if test -n \"$STRIP\"; then\n      striplib=\"$STRIP -x\"\n      old_striplib=\"$STRIP -S\"\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n    else\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n    fi\n    ;;\n  *)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n    ;;\n  esac\nfi\n\n\n\n\n\n\n\n\n\n\n\n\n  # Report what library types will actually be built\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries\" >&5\n$as_echo_n \"checking if libtool supports shared libraries... \" >&6; }\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $can_build_shared\" >&5\n$as_echo \"$can_build_shared\" >&6; }\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries\" >&5\n$as_echo_n \"checking whether to build shared libraries... \" >&6; }\n  test no = \"$can_build_shared\" && enable_shared=no\n\n  # On AIX, shared libraries and static libraries use the same namespace, and\n  # are all built from PIC.\n  case $host_os in\n  aix3*)\n    test yes = \"$enable_shared\" && enable_static=no\n    if test -n \"$RANLIB\"; then\n      archive_cmds=\"$archive_cmds~\\$RANLIB \\$lib\"\n      postinstall_cmds='$RANLIB $lib'\n    fi\n    ;;\n\n  aix[4-9]*)\n    if test ia64 != \"$host_cpu\"; then\n      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in\n      yes,aix,yes) ;;\t\t\t# shared object as lib.so file only\n      yes,svr4,*) ;;\t\t\t# shared object as lib.so archive member only\n      yes,*) enable_static=no ;;\t# shared object in lib.a archive as well\n      esac\n    fi\n    ;;\n  esac\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $enable_shared\" >&5\n$as_echo \"$enable_shared\" >&6; }\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether to build static libraries\" >&5\n$as_echo_n \"checking whether to build static libraries... \" >&6; }\n  # Make sure either enable_shared or enable_static is yes.\n  test yes = \"$enable_shared\" || enable_static=yes\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $enable_static\" >&5\n$as_echo \"$enable_static\" >&6; }\n\n\n\n\nfi\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nCC=$lt_save_CC\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        ac_config_commands=\"$ac_config_commands libtool\"\n\n\n\n\n# Only expand once:\n\n\n\n# Select memory manager depending on user input.\n# If no \"-enable-maxmem\", use jmemnobs\nMEMORYMGR='jmemnobs'\nMAXMEM=\"no\"\n# Check whether --enable-maxmem was given.\nif test \"${enable_maxmem+set}\" = set; then :\n  enableval=$enable_maxmem; MAXMEM=\"$enableval\"\nfi\n\nif test \"x$MAXMEM\" = xyes; then\n  MAXMEM=1\nfi\nif test \"x$MAXMEM\" != xno; then\n  if test -n \"`echo $MAXMEM | sed 's/[0-9]//g'`\"; then\n    as_fn_error $? \"non-numeric argument to --enable-maxmem\" \"$LINENO\" 5\n  fi\n  DEFAULTMAXMEM=`expr $MAXMEM \\* 1048576`\n\ncat >>confdefs.h <<_ACEOF\n#define DEFAULT_MAX_MEM ${DEFAULTMAXMEM}\n_ACEOF\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for 'tmpfile()'\" >&5\n$as_echo_n \"checking for 'tmpfile()'... \" >&6; }\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdio.h>\nint\nmain ()\n{\n FILE * tfile = tmpfile();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n    MEMORYMGR='jmemansi'\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n        MEMORYMGR='jmemname'\n\n    # Test for the need to remove temporary files using a signal handler\n    # (for cjpeg/djpeg)\n\n$as_echo \"#define NEED_SIGNAL_CATCHER 1\" >>confdefs.h\n\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for 'mktemp()'\" >&5\n$as_echo_n \"checking for 'mktemp()'... \" >&6; }\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n char fname[80]; mktemp(fname);\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n\n$as_echo \"#define NO_MKTEMP 1\" >>confdefs.h\n\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nfi\n\n\n# Extract the library version IDs from jpeglib.h.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking libjpeg version number\" >&5\n$as_echo_n \"checking libjpeg version number... \" >&6; }\nmajor=`sed -ne 's/^#define JPEG_LIB_VERSION_MAJOR *\\([0-9][0-9]*\\).*$/\\1/p' $srcdir/jpeglib.h`\nminor=`sed -ne 's/^#define JPEG_LIB_VERSION_MINOR *\\([0-9][0-9]*\\).*$/\\1/p' $srcdir/jpeglib.h`\nJPEG_LIB_VERSION=`expr $major + $minor`:0:$minor\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $JPEG_LIB_VERSION\" >&5\n$as_echo \"$JPEG_LIB_VERSION\" >&6; }\n\nac_config_files=\"$ac_config_files Makefile\"\n\ncat >confcache <<\\_ACEOF\n# This file is a shell script that caches the results of configure\n# tests run on this system so they can be shared between configure\n# scripts and configure runs, see configure's option --config-cache.\n# It is not useful on other systems.  If it contains results you don't\n# want to keep, you may remove or edit it.\n#\n# config.status only pays attention to the cache file if you give it\n# the --recheck option to rerun configure.\n#\n# `ac_cv_env_foo' variables (set or unset) will be overridden when\n# loading this file, other *unset* `ac_cv_foo' will be assigned the\n# following values.\n\n_ACEOF\n\n# The following way of writing the cache mishandles newlines in values,\n# but we know of no workaround that is simple, portable, and efficient.\n# So, we kill variables containing newlines.\n# Ultrix sh set writes to stderr and can't be redirected directly,\n# and sets the high bit in the cache file unless we assign to the vars.\n(\n  for ac_var in `(set) 2>&1 | sed -n 's/^\\([a-zA-Z_][a-zA-Z0-9_]*\\)=.*/\\1/p'`; do\n    eval ac_val=\\$$ac_var\n    case $ac_val in #(\n    *${as_nl}*)\n      case $ac_var in #(\n      *_cv_*) { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline\" >&5\n$as_echo \"$as_me: WARNING: cache variable $ac_var contains a newline\" >&2;} ;;\n      esac\n      case $ac_var in #(\n      _ | IFS | as_nl) ;; #(\n      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(\n      *) { eval $ac_var=; unset $ac_var;} ;;\n      esac ;;\n    esac\n  done\n\n  (set) 2>&1 |\n    case $as_nl`(ac_space=' '; set) 2>&1` in #(\n    *${as_nl}ac_space=\\ *)\n      # `set' does not quote correctly, so add quotes: double-quote\n      # substitution turns \\\\\\\\ into \\\\, and sed turns \\\\ into \\.\n      sed -n \\\n\t\"s/'/'\\\\\\\\''/g;\n\t  s/^\\\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\\\)=\\\\(.*\\\\)/\\\\1='\\\\2'/p\"\n      ;; #(\n    *)\n      # `set' quotes correctly as required by POSIX, so do not add quotes.\n      sed -n \"/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p\"\n      ;;\n    esac |\n    sort\n) |\n  sed '\n     /^ac_cv_env_/b end\n     t clear\n     :clear\n     s/^\\([^=]*\\)=\\(.*[{}].*\\)$/test \"${\\1+set}\" = set || &/\n     t end\n     s/^\\([^=]*\\)=\\(.*\\)$/\\1=${\\1=\\2}/\n     :end' >>confcache\nif diff \"$cache_file\" confcache >/dev/null 2>&1; then :; else\n  if test -w \"$cache_file\"; then\n    if test \"x$cache_file\" != \"x/dev/null\"; then\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: updating cache $cache_file\" >&5\n$as_echo \"$as_me: updating cache $cache_file\" >&6;}\n      if test ! -f \"$cache_file\" || test -h \"$cache_file\"; then\n\tcat confcache >\"$cache_file\"\n      else\n        case $cache_file in #(\n        */* | ?:*)\n\t  mv -f confcache \"$cache_file\"$$ &&\n\t  mv -f \"$cache_file\"$$ \"$cache_file\" ;; #(\n        *)\n\t  mv -f confcache \"$cache_file\" ;;\n\tesac\n      fi\n    fi\n  else\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file\" >&5\n$as_echo \"$as_me: not updating unwritable cache $cache_file\" >&6;}\n  fi\nfi\nrm -f confcache\n\ntest \"x$prefix\" = xNONE && prefix=$ac_default_prefix\n# Let make expand exec_prefix.\ntest \"x$exec_prefix\" = xNONE && exec_prefix='${prefix}'\n\nDEFS=-DHAVE_CONFIG_H\n\nac_libobjs=\nac_ltlibobjs=\nU=\nfor ac_i in : $LIBOBJS; do test \"x$ac_i\" = x: && continue\n  # 1. Remove the extension, and $U if already installed.\n  ac_script='s/\\$U\\././;s/\\.o$//;s/\\.obj$//'\n  ac_i=`$as_echo \"$ac_i\" | sed \"$ac_script\"`\n  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR\n  #    will be set to the directory where LIBOBJS objects are built.\n  as_fn_append ac_libobjs \" \\${LIBOBJDIR}$ac_i\\$U.$ac_objext\"\n  as_fn_append ac_ltlibobjs \" \\${LIBOBJDIR}$ac_i\"'$U.lo'\ndone\nLIBOBJS=$ac_libobjs\n\nLTLIBOBJS=$ac_ltlibobjs\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure\" >&5\n$as_echo_n \"checking that generated files are newer than configure... \" >&6; }\n   if test -n \"$am_sleep_pid\"; then\n     # Hide warnings about reused PIDs.\n     wait $am_sleep_pid 2>/dev/null\n   fi\n   { $as_echo \"$as_me:${as_lineno-$LINENO}: result: done\" >&5\n$as_echo \"done\" >&6; }\n if test -n \"$EXEEXT\"; then\n  am__EXEEXT_TRUE=\n  am__EXEEXT_FALSE='#'\nelse\n  am__EXEEXT_TRUE='#'\n  am__EXEEXT_FALSE=\nfi\n\nif test -z \"${MAINTAINER_MODE_TRUE}\" && test -z \"${MAINTAINER_MODE_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"MAINTAINER_MODE\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${AMDEP_TRUE}\" && test -z \"${AMDEP_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"AMDEP\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${am__fastdepCC_TRUE}\" && test -z \"${am__fastdepCC_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"am__fastdepCC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${am__fastdepCCAS_TRUE}\" && test -z \"${am__fastdepCCAS_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"am__fastdepCCAS\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${HAVE_LD_VERSION_SCRIPT_TRUE}\" && test -z \"${HAVE_LD_VERSION_SCRIPT_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"HAVE_LD_VERSION_SCRIPT\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\n\n: \"${CONFIG_STATUS=./config.status}\"\nac_write_fail=0\nac_clean_files_save=$ac_clean_files\nac_clean_files=\"$ac_clean_files $CONFIG_STATUS\"\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS\" >&5\n$as_echo \"$as_me: creating $CONFIG_STATUS\" >&6;}\nas_write_fail=0\ncat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1\n#! $SHELL\n# Generated by $as_me.\n# Run this file to recreate the current configuration.\n# Compiler output produced by configure, useful for debugging\n# configure, is in config.log if it exists.\n\ndebug=false\nac_cs_recheck=false\nac_cs_silent=false\n\nSHELL=\\${CONFIG_SHELL-$SHELL}\nexport SHELL\n_ASEOF\ncat >>$CONFIG_STATUS <<\\_ASEOF || as_write_fail=1\n## -------------------- ##\n## M4sh Initialization. ##\n## -------------------- ##\n\n# Be more Bourne compatible\nDUALCASE=1; export DUALCASE # for MKS sh\nif test -n \"${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on ${1+\"$@\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '${1+\"$@\"}'='\"$@\"'\n  setopt NO_GLOB_SUBST\nelse\n  case `(set -o) 2>/dev/null` in #(\n  *posix*) :\n    set -o posix ;; #(\n  *) :\n     ;;\nesac\nfi\n\n\nas_nl='\n'\nexport as_nl\n# Printing a long string crashes Solaris 7 /usr/bin/printf.\nas_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\nas_echo=$as_echo$as_echo$as_echo$as_echo$as_echo\nas_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo\n# Prefer a ksh shell builtin over an external printf program on Solaris,\n# but without wasting forks for bash or zsh.\nif test -z \"$BASH_VERSION$ZSH_VERSION\" \\\n    && (test \"X`print -r -- $as_echo`\" = \"X$as_echo\") 2>/dev/null; then\n  as_echo='print -r --'\n  as_echo_n='print -rn --'\nelif (test \"X`printf %s $as_echo`\" = \"X$as_echo\") 2>/dev/null; then\n  as_echo='printf %s\\n'\n  as_echo_n='printf %s'\nelse\n  if test \"X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`\" = \"X-n $as_echo\"; then\n    as_echo_body='eval /usr/ucb/echo -n \"$1$as_nl\"'\n    as_echo_n='/usr/ucb/echo -n'\n  else\n    as_echo_body='eval expr \"X$1\" : \"X\\\\(.*\\\\)\"'\n    as_echo_n_body='eval\n      arg=$1;\n      case $arg in #(\n      *\"$as_nl\"*)\n\texpr \"X$arg\" : \"X\\\\(.*\\\\)$as_nl\";\n\targ=`expr \"X$arg\" : \".*$as_nl\\\\(.*\\\\)\"`;;\n      esac;\n      expr \"X$arg\" : \"X\\\\(.*\\\\)\" | tr -d \"$as_nl\"\n    '\n    export as_echo_n_body\n    as_echo_n='sh -c $as_echo_n_body as_echo'\n  fi\n  export as_echo_body\n  as_echo='sh -c $as_echo_body as_echo'\nfi\n\n# The user is always right.\nif test \"${PATH_SEPARATOR+set}\" != set; then\n  PATH_SEPARATOR=:\n  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {\n    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||\n      PATH_SEPARATOR=';'\n  }\nfi\n\n\n# IFS\n# We need space, tab and new line, in precisely that order.  Quoting is\n# there to prevent editors from complaining about space-tab.\n# (If _AS_PATH_WALK were called with IFS unset, it would disable word\n# splitting by setting IFS to empty value.)\nIFS=\" \"\"\t$as_nl\"\n\n# Find who we are.  Look in the path if we contain no directory separator.\nas_myself=\ncase $0 in #((\n  *[\\\\/]* ) as_myself=$0 ;;\n  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    test -r \"$as_dir/$0\" && as_myself=$as_dir/$0 && break\n  done\nIFS=$as_save_IFS\n\n     ;;\nesac\n# We did not find ourselves, most probably we were run as `sh COMMAND'\n# in which case we are not to be found in the path.\nif test \"x$as_myself\" = x; then\n  as_myself=$0\nfi\nif test ! -f \"$as_myself\"; then\n  $as_echo \"$as_myself: error: cannot find myself; rerun with an absolute file name\" >&2\n  exit 1\nfi\n\n# Unset variables that we do not need and which cause bugs (e.g. in\n# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the \"|| exit 1\"\n# suppresses any \"Segmentation fault\" message there.  '((' could\n# trigger a bug in pdksh 5.2.14.\nfor as_var in BASH_ENV ENV MAIL MAILPATH\ndo eval test x\\${$as_var+set} = xset \\\n  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :\ndone\nPS1='$ '\nPS2='> '\nPS4='+ '\n\n# NLS nuisances.\nLC_ALL=C\nexport LC_ALL\nLANGUAGE=C\nexport LANGUAGE\n\n# CDPATH.\n(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n\n\n# as_fn_error STATUS ERROR [LINENO LOG_FD]\n# ----------------------------------------\n# Output \"`basename $0`: error: ERROR\" to stderr. If LINENO and LOG_FD are\n# provided, also output the error to LOG_FD, referencing LINENO. Then exit the\n# script with STATUS, using 1 if that was 0.\nas_fn_error ()\n{\n  as_status=$1; test $as_status -eq 0 && as_status=1\n  if test \"$4\"; then\n    as_lineno=${as_lineno-\"$3\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n    $as_echo \"$as_me:${as_lineno-$LINENO}: error: $2\" >&$4\n  fi\n  $as_echo \"$as_me: error: $2\" >&2\n  as_fn_exit $as_status\n} # as_fn_error\n\n\n# as_fn_set_status STATUS\n# -----------------------\n# Set $? to STATUS, without forking.\nas_fn_set_status ()\n{\n  return $1\n} # as_fn_set_status\n\n# as_fn_exit STATUS\n# -----------------\n# Exit the shell with STATUS, even in a \"trap 0\" or \"set -e\" context.\nas_fn_exit ()\n{\n  set +e\n  as_fn_set_status $1\n  exit $1\n} # as_fn_exit\n\n# as_fn_unset VAR\n# ---------------\n# Portably unset VAR.\nas_fn_unset ()\n{\n  { eval $1=; unset $1;}\n}\nas_unset=as_fn_unset\n# as_fn_append VAR VALUE\n# ----------------------\n# Append the text in VALUE to the end of the definition contained in VAR. Take\n# advantage of any shell optimizations that allow amortized linear growth over\n# repeated appends, instead of the typical quadratic growth present in naive\n# implementations.\nif (eval \"as_var=1; as_var+=2; test x\\$as_var = x12\") 2>/dev/null; then :\n  eval 'as_fn_append ()\n  {\n    eval $1+=\\$2\n  }'\nelse\n  as_fn_append ()\n  {\n    eval $1=\\$$1\\$2\n  }\nfi # as_fn_append\n\n# as_fn_arith ARG...\n# ------------------\n# Perform arithmetic evaluation on the ARGs, and store the result in the\n# global $as_val. Take advantage of shells that can avoid forks. The arguments\n# must be portable across $(()) and expr.\nif (eval \"test \\$(( 1 + 1 )) = 2\") 2>/dev/null; then :\n  eval 'as_fn_arith ()\n  {\n    as_val=$(( $* ))\n  }'\nelse\n  as_fn_arith ()\n  {\n    as_val=`expr \"$@\" || test $? -eq 1`\n  }\nfi # as_fn_arith\n\n\nif expr a : '\\(a\\)' >/dev/null 2>&1 &&\n   test \"X`expr 00001 : '.*\\(...\\)'`\" = X001; then\n  as_expr=expr\nelse\n  as_expr=false\nfi\n\nif (basename -- /) >/dev/null 2>&1 && test \"X`basename -- / 2>&1`\" = \"X/\"; then\n  as_basename=basename\nelse\n  as_basename=false\nfi\n\nif (as_dir=`dirname -- /` && test \"X$as_dir\" = X/) >/dev/null 2>&1; then\n  as_dirname=dirname\nelse\n  as_dirname=false\nfi\n\nas_me=`$as_basename -- \"$0\" ||\n$as_expr X/\"$0\" : '.*/\\([^/][^/]*\\)/*$' \\| \\\n\t X\"$0\" : 'X\\(//\\)$' \\| \\\n\t X\"$0\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X/\"$0\" |\n    sed '/^.*\\/\\([^/][^/]*\\)\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n\n# Avoid depending upon Character Ranges.\nas_cr_letters='abcdefghijklmnopqrstuvwxyz'\nas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'\nas_cr_Letters=$as_cr_letters$as_cr_LETTERS\nas_cr_digits='0123456789'\nas_cr_alnum=$as_cr_Letters$as_cr_digits\n\nECHO_C= ECHO_N= ECHO_T=\ncase `echo -n x` in #(((((\n-n*)\n  case `echo 'xy\\c'` in\n  *c*) ECHO_T='\t';;\t# ECHO_T is single tab character.\n  xy)  ECHO_C='\\c';;\n  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null\n       ECHO_T='\t';;\n  esac;;\n*)\n  ECHO_N='-n';;\nesac\n\nrm -f conf$$ conf$$.exe conf$$.file\nif test -d conf$$.dir; then\n  rm -f conf$$.dir/conf$$.file\nelse\n  rm -f conf$$.dir\n  mkdir conf$$.dir 2>/dev/null\nfi\nif (echo >conf$$.file) 2>/dev/null; then\n  if ln -s conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s='ln -s'\n    # ... but there are two gotchas:\n    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.\n    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.\n    # In both cases, we have to default to `cp -pR'.\n    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||\n      as_ln_s='cp -pR'\n  elif ln conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s=ln\n  else\n    as_ln_s='cp -pR'\n  fi\nelse\n  as_ln_s='cp -pR'\nfi\nrm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file\nrmdir conf$$.dir 2>/dev/null\n\n\n# as_fn_mkdir_p\n# -------------\n# Create \"$as_dir\" as a directory, including parents if necessary.\nas_fn_mkdir_p ()\n{\n\n  case $as_dir in #(\n  -*) as_dir=./$as_dir;;\n  esac\n  test -d \"$as_dir\" || eval $as_mkdir_p || {\n    as_dirs=\n    while :; do\n      case $as_dir in #(\n      *\\'*) as_qdir=`$as_echo \"$as_dir\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;; #'(\n      *) as_qdir=$as_dir;;\n      esac\n      as_dirs=\"'$as_qdir' $as_dirs\"\n      as_dir=`$as_dirname -- \"$as_dir\" ||\n$as_expr X\"$as_dir\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_dir\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$as_dir\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n      test -d \"$as_dir\" && break\n    done\n    test -z \"$as_dirs\" || eval \"mkdir $as_dirs\"\n  } || test -d \"$as_dir\" || as_fn_error $? \"cannot create directory $as_dir\"\n\n\n} # as_fn_mkdir_p\nif mkdir -p . 2>/dev/null; then\n  as_mkdir_p='mkdir -p \"$as_dir\"'\nelse\n  test -d ./-p && rmdir ./-p\n  as_mkdir_p=false\nfi\n\n\n# as_fn_executable_p FILE\n# -----------------------\n# Test if FILE is an executable regular file.\nas_fn_executable_p ()\n{\n  test -f \"$1\" && test -x \"$1\"\n} # as_fn_executable_p\nas_test_x='test -x'\nas_executable_p=as_fn_executable_p\n\n# Sed expression to map a string onto a valid CPP name.\nas_tr_cpp=\"eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'\"\n\n# Sed expression to map a string onto a valid variable name.\nas_tr_sh=\"eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'\"\n\n\nexec 6>&1\n## ----------------------------------- ##\n## Main body of $CONFIG_STATUS script. ##\n## ----------------------------------- ##\n_ASEOF\ntest $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n# Save the log message, to keep $0 and so on meaningful, and to\n# report actual input values of CONFIG_FILES etc. instead of their\n# values after options handling.\nac_log=\"\nThis file was extended by libjpeg $as_me 9.1.0, which was\ngenerated by GNU Autoconf 2.69.  Invocation command line was\n\n  CONFIG_FILES    = $CONFIG_FILES\n  CONFIG_HEADERS  = $CONFIG_HEADERS\n  CONFIG_LINKS    = $CONFIG_LINKS\n  CONFIG_COMMANDS = $CONFIG_COMMANDS\n  $ $0 $@\n\non `(hostname || uname -n) 2>/dev/null | sed 1q`\n\"\n\n_ACEOF\n\ncase $ac_config_files in *\"\n\"*) set x $ac_config_files; shift; ac_config_files=$*;;\nesac\n\ncase $ac_config_headers in *\"\n\"*) set x $ac_config_headers; shift; ac_config_headers=$*;;\nesac\n\n\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n# Files that config.status was made for.\nconfig_files=\"$ac_config_files\"\nconfig_headers=\"$ac_config_headers\"\nconfig_commands=\"$ac_config_commands\"\n\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nac_cs_usage=\"\\\n\\`$as_me' instantiates files and other configuration actions\nfrom templates according to the current configuration.  Unless the files\nand actions are specified as TAGs, all are instantiated by default.\n\nUsage: $0 [OPTION]... [TAG]...\n\n  -h, --help       print this help, then exit\n  -V, --version    print version number and configuration settings, then exit\n      --config     print configuration, then exit\n  -q, --quiet, --silent\n                   do not print progress messages\n  -d, --debug      don't remove temporary files\n      --recheck    update $as_me by reconfiguring in the same conditions\n      --file=FILE[:TEMPLATE]\n                   instantiate the configuration file FILE\n      --header=FILE[:TEMPLATE]\n                   instantiate the configuration header FILE\n\nConfiguration files:\n$config_files\n\nConfiguration headers:\n$config_headers\n\nConfiguration commands:\n$config_commands\n\nReport bugs to the package provider.\"\n\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\nac_cs_config=\"`$as_echo \"$ac_configure_args\" | sed 's/^ //; s/[\\\\\"\"\\`\\$]/\\\\\\\\&/g'`\"\nac_cs_version=\"\\\\\nlibjpeg config.status 9.1.0\nconfigured by $0, generated by GNU Autoconf 2.69,\n  with options \\\\\"\\$ac_cs_config\\\\\"\n\nCopyright (C) 2012 Free Software Foundation, Inc.\nThis config.status script is free software; the Free Software Foundation\ngives unlimited permission to copy, distribute and modify it.\"\n\nac_pwd='$ac_pwd'\nsrcdir='$srcdir'\nINSTALL='$INSTALL'\nMKDIR_P='$MKDIR_P'\nAWK='$AWK'\ntest -n \"\\$AWK\" || AWK=awk\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n# The default lists apply if the user does not specify any file.\nac_need_defaults=:\nwhile test $# != 0\ndo\n  case $1 in\n  --*=?*)\n    ac_option=`expr \"X$1\" : 'X\\([^=]*\\)='`\n    ac_optarg=`expr \"X$1\" : 'X[^=]*=\\(.*\\)'`\n    ac_shift=:\n    ;;\n  --*=)\n    ac_option=`expr \"X$1\" : 'X\\([^=]*\\)='`\n    ac_optarg=\n    ac_shift=:\n    ;;\n  *)\n    ac_option=$1\n    ac_optarg=$2\n    ac_shift=shift\n    ;;\n  esac\n\n  case $ac_option in\n  # Handling of the options.\n  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)\n    ac_cs_recheck=: ;;\n  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )\n    $as_echo \"$ac_cs_version\"; exit ;;\n  --config | --confi | --conf | --con | --co | --c )\n    $as_echo \"$ac_cs_config\"; exit ;;\n  --debug | --debu | --deb | --de | --d | -d )\n    debug=: ;;\n  --file | --fil | --fi | --f )\n    $ac_shift\n    case $ac_optarg in\n    *\\'*) ac_optarg=`$as_echo \"$ac_optarg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    '') as_fn_error $? \"missing file argument\" ;;\n    esac\n    as_fn_append CONFIG_FILES \" '$ac_optarg'\"\n    ac_need_defaults=false;;\n  --header | --heade | --head | --hea )\n    $ac_shift\n    case $ac_optarg in\n    *\\'*) ac_optarg=`$as_echo \"$ac_optarg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    esac\n    as_fn_append CONFIG_HEADERS \" '$ac_optarg'\"\n    ac_need_defaults=false;;\n  --he | --h)\n    # Conflict between --help and --header\n    as_fn_error $? \"ambiguous option: \\`$1'\nTry \\`$0 --help' for more information.\";;\n  --help | --hel | -h )\n    $as_echo \"$ac_cs_usage\"; exit ;;\n  -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n  | -silent | --silent | --silen | --sile | --sil | --si | --s)\n    ac_cs_silent=: ;;\n\n  # This is an error.\n  -*) as_fn_error $? \"unrecognized option: \\`$1'\nTry \\`$0 --help' for more information.\" ;;\n\n  *) as_fn_append ac_config_targets \" $1\"\n     ac_need_defaults=false ;;\n\n  esac\n  shift\ndone\n\nac_configure_extra_args=\n\nif $ac_cs_silent; then\n  exec 6>/dev/null\n  ac_configure_extra_args=\"$ac_configure_extra_args --silent\"\nfi\n\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\nif \\$ac_cs_recheck; then\n  set X $SHELL '$0' $ac_configure_args \\$ac_configure_extra_args --no-create --no-recursion\n  shift\n  \\$as_echo \"running CONFIG_SHELL=$SHELL \\$*\" >&6\n  CONFIG_SHELL='$SHELL'\n  export CONFIG_SHELL\n  exec \"\\$@\"\nfi\n\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nexec 5>>config.log\n{\n  echo\n  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX\n## Running $as_me. ##\n_ASBOX\n  $as_echo \"$ac_log\"\n} >&5\n\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n#\n# INIT-COMMANDS\n#\nAMDEP_TRUE=\"$AMDEP_TRUE\" ac_aux_dir=\"$ac_aux_dir\"\n\n\n# The HP-UX ksh and POSIX shell print the target directory to stdout\n# if CDPATH is set.\n(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n\nsed_quote_subst='$sed_quote_subst'\ndouble_quote_subst='$double_quote_subst'\ndelay_variable_subst='$delay_variable_subst'\nAS='`$ECHO \"$AS\" | $SED \"$delay_single_quote_subst\"`'\nDLLTOOL='`$ECHO \"$DLLTOOL\" | $SED \"$delay_single_quote_subst\"`'\nOBJDUMP='`$ECHO \"$OBJDUMP\" | $SED \"$delay_single_quote_subst\"`'\nmacro_version='`$ECHO \"$macro_version\" | $SED \"$delay_single_quote_subst\"`'\nmacro_revision='`$ECHO \"$macro_revision\" | $SED \"$delay_single_quote_subst\"`'\nenable_shared='`$ECHO \"$enable_shared\" | $SED \"$delay_single_quote_subst\"`'\nenable_static='`$ECHO \"$enable_static\" | $SED \"$delay_single_quote_subst\"`'\npic_mode='`$ECHO \"$pic_mode\" | $SED \"$delay_single_quote_subst\"`'\nenable_fast_install='`$ECHO \"$enable_fast_install\" | $SED \"$delay_single_quote_subst\"`'\nshared_archive_member_spec='`$ECHO \"$shared_archive_member_spec\" | $SED \"$delay_single_quote_subst\"`'\nSHELL='`$ECHO \"$SHELL\" | $SED \"$delay_single_quote_subst\"`'\nECHO='`$ECHO \"$ECHO\" | $SED \"$delay_single_quote_subst\"`'\nPATH_SEPARATOR='`$ECHO \"$PATH_SEPARATOR\" | $SED \"$delay_single_quote_subst\"`'\nhost_alias='`$ECHO \"$host_alias\" | $SED \"$delay_single_quote_subst\"`'\nhost='`$ECHO \"$host\" | $SED \"$delay_single_quote_subst\"`'\nhost_os='`$ECHO \"$host_os\" | $SED \"$delay_single_quote_subst\"`'\nbuild_alias='`$ECHO \"$build_alias\" | $SED \"$delay_single_quote_subst\"`'\nbuild='`$ECHO \"$build\" | $SED \"$delay_single_quote_subst\"`'\nbuild_os='`$ECHO \"$build_os\" | $SED \"$delay_single_quote_subst\"`'\nSED='`$ECHO \"$SED\" | $SED \"$delay_single_quote_subst\"`'\nXsed='`$ECHO \"$Xsed\" | $SED \"$delay_single_quote_subst\"`'\nGREP='`$ECHO \"$GREP\" | $SED \"$delay_single_quote_subst\"`'\nEGREP='`$ECHO \"$EGREP\" | $SED \"$delay_single_quote_subst\"`'\nFGREP='`$ECHO \"$FGREP\" | $SED \"$delay_single_quote_subst\"`'\nLD='`$ECHO \"$LD\" | $SED \"$delay_single_quote_subst\"`'\nNM='`$ECHO \"$NM\" | $SED \"$delay_single_quote_subst\"`'\nLN_S='`$ECHO \"$LN_S\" | $SED \"$delay_single_quote_subst\"`'\nmax_cmd_len='`$ECHO \"$max_cmd_len\" | $SED \"$delay_single_quote_subst\"`'\nac_objext='`$ECHO \"$ac_objext\" | $SED \"$delay_single_quote_subst\"`'\nexeext='`$ECHO \"$exeext\" | $SED \"$delay_single_quote_subst\"`'\nlt_unset='`$ECHO \"$lt_unset\" | $SED \"$delay_single_quote_subst\"`'\nlt_SP2NL='`$ECHO \"$lt_SP2NL\" | $SED \"$delay_single_quote_subst\"`'\nlt_NL2SP='`$ECHO \"$lt_NL2SP\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_to_host_file_cmd='`$ECHO \"$lt_cv_to_host_file_cmd\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_to_tool_file_cmd='`$ECHO \"$lt_cv_to_tool_file_cmd\" | $SED \"$delay_single_quote_subst\"`'\nreload_flag='`$ECHO \"$reload_flag\" | $SED \"$delay_single_quote_subst\"`'\nreload_cmds='`$ECHO \"$reload_cmds\" | $SED \"$delay_single_quote_subst\"`'\ndeplibs_check_method='`$ECHO \"$deplibs_check_method\" | $SED \"$delay_single_quote_subst\"`'\nfile_magic_cmd='`$ECHO \"$file_magic_cmd\" | $SED \"$delay_single_quote_subst\"`'\nfile_magic_glob='`$ECHO \"$file_magic_glob\" | $SED \"$delay_single_quote_subst\"`'\nwant_nocaseglob='`$ECHO \"$want_nocaseglob\" | $SED \"$delay_single_quote_subst\"`'\nsharedlib_from_linklib_cmd='`$ECHO \"$sharedlib_from_linklib_cmd\" | $SED \"$delay_single_quote_subst\"`'\nAR='`$ECHO \"$AR\" | $SED \"$delay_single_quote_subst\"`'\nAR_FLAGS='`$ECHO \"$AR_FLAGS\" | $SED \"$delay_single_quote_subst\"`'\narchiver_list_spec='`$ECHO \"$archiver_list_spec\" | $SED \"$delay_single_quote_subst\"`'\nSTRIP='`$ECHO \"$STRIP\" | $SED \"$delay_single_quote_subst\"`'\nRANLIB='`$ECHO \"$RANLIB\" | $SED \"$delay_single_quote_subst\"`'\nold_postinstall_cmds='`$ECHO \"$old_postinstall_cmds\" | $SED \"$delay_single_quote_subst\"`'\nold_postuninstall_cmds='`$ECHO \"$old_postuninstall_cmds\" | $SED \"$delay_single_quote_subst\"`'\nold_archive_cmds='`$ECHO \"$old_archive_cmds\" | $SED \"$delay_single_quote_subst\"`'\nlock_old_archive_extraction='`$ECHO \"$lock_old_archive_extraction\" | $SED \"$delay_single_quote_subst\"`'\nCC='`$ECHO \"$CC\" | $SED \"$delay_single_quote_subst\"`'\nCFLAGS='`$ECHO \"$CFLAGS\" | $SED \"$delay_single_quote_subst\"`'\ncompiler='`$ECHO \"$compiler\" | $SED \"$delay_single_quote_subst\"`'\nGCC='`$ECHO \"$GCC\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_sys_global_symbol_pipe='`$ECHO \"$lt_cv_sys_global_symbol_pipe\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_sys_global_symbol_to_cdecl='`$ECHO \"$lt_cv_sys_global_symbol_to_cdecl\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_sys_global_symbol_to_import='`$ECHO \"$lt_cv_sys_global_symbol_to_import\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_sys_global_symbol_to_c_name_address='`$ECHO \"$lt_cv_sys_global_symbol_to_c_name_address\" | $SED \"$delay_single_quote_subst\"`'\nlt_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\"`'\nlt_cv_nm_interface='`$ECHO \"$lt_cv_nm_interface\" | $SED \"$delay_single_quote_subst\"`'\nnm_file_list_spec='`$ECHO \"$nm_file_list_spec\" | $SED \"$delay_single_quote_subst\"`'\nlt_sysroot='`$ECHO \"$lt_sysroot\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_truncate_bin='`$ECHO \"$lt_cv_truncate_bin\" | $SED \"$delay_single_quote_subst\"`'\nobjdir='`$ECHO \"$objdir\" | $SED \"$delay_single_quote_subst\"`'\nMAGIC_CMD='`$ECHO \"$MAGIC_CMD\" | $SED \"$delay_single_quote_subst\"`'\nlt_prog_compiler_no_builtin_flag='`$ECHO \"$lt_prog_compiler_no_builtin_flag\" | $SED \"$delay_single_quote_subst\"`'\nlt_prog_compiler_pic='`$ECHO \"$lt_prog_compiler_pic\" | $SED \"$delay_single_quote_subst\"`'\nlt_prog_compiler_wl='`$ECHO \"$lt_prog_compiler_wl\" | $SED \"$delay_single_quote_subst\"`'\nlt_prog_compiler_static='`$ECHO \"$lt_prog_compiler_static\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_prog_compiler_c_o='`$ECHO \"$lt_cv_prog_compiler_c_o\" | $SED \"$delay_single_quote_subst\"`'\nneed_locks='`$ECHO \"$need_locks\" | $SED \"$delay_single_quote_subst\"`'\nMANIFEST_TOOL='`$ECHO \"$MANIFEST_TOOL\" | $SED \"$delay_single_quote_subst\"`'\nDSYMUTIL='`$ECHO \"$DSYMUTIL\" | $SED \"$delay_single_quote_subst\"`'\nNMEDIT='`$ECHO \"$NMEDIT\" | $SED \"$delay_single_quote_subst\"`'\nLIPO='`$ECHO \"$LIPO\" | $SED \"$delay_single_quote_subst\"`'\nOTOOL='`$ECHO \"$OTOOL\" | $SED \"$delay_single_quote_subst\"`'\nOTOOL64='`$ECHO \"$OTOOL64\" | $SED \"$delay_single_quote_subst\"`'\nlibext='`$ECHO \"$libext\" | $SED \"$delay_single_quote_subst\"`'\nshrext_cmds='`$ECHO \"$shrext_cmds\" | $SED \"$delay_single_quote_subst\"`'\nextract_expsyms_cmds='`$ECHO \"$extract_expsyms_cmds\" | $SED \"$delay_single_quote_subst\"`'\narchive_cmds_need_lc='`$ECHO \"$archive_cmds_need_lc\" | $SED \"$delay_single_quote_subst\"`'\nenable_shared_with_static_runtimes='`$ECHO \"$enable_shared_with_static_runtimes\" | $SED \"$delay_single_quote_subst\"`'\nexport_dynamic_flag_spec='`$ECHO \"$export_dynamic_flag_spec\" | $SED \"$delay_single_quote_subst\"`'\nwhole_archive_flag_spec='`$ECHO \"$whole_archive_flag_spec\" | $SED \"$delay_single_quote_subst\"`'\ncompiler_needs_object='`$ECHO \"$compiler_needs_object\" | $SED \"$delay_single_quote_subst\"`'\nold_archive_from_new_cmds='`$ECHO \"$old_archive_from_new_cmds\" | $SED \"$delay_single_quote_subst\"`'\nold_archive_from_expsyms_cmds='`$ECHO \"$old_archive_from_expsyms_cmds\" | $SED \"$delay_single_quote_subst\"`'\narchive_cmds='`$ECHO \"$archive_cmds\" | $SED \"$delay_single_quote_subst\"`'\narchive_expsym_cmds='`$ECHO \"$archive_expsym_cmds\" | $SED \"$delay_single_quote_subst\"`'\nmodule_cmds='`$ECHO \"$module_cmds\" | $SED \"$delay_single_quote_subst\"`'\nmodule_expsym_cmds='`$ECHO \"$module_expsym_cmds\" | $SED \"$delay_single_quote_subst\"`'\nwith_gnu_ld='`$ECHO \"$with_gnu_ld\" | $SED \"$delay_single_quote_subst\"`'\nallow_undefined_flag='`$ECHO \"$allow_undefined_flag\" | $SED \"$delay_single_quote_subst\"`'\nno_undefined_flag='`$ECHO \"$no_undefined_flag\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_libdir_flag_spec='`$ECHO \"$hardcode_libdir_flag_spec\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_libdir_separator='`$ECHO \"$hardcode_libdir_separator\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_direct='`$ECHO \"$hardcode_direct\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_direct_absolute='`$ECHO \"$hardcode_direct_absolute\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_minus_L='`$ECHO \"$hardcode_minus_L\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_shlibpath_var='`$ECHO \"$hardcode_shlibpath_var\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_automatic='`$ECHO \"$hardcode_automatic\" | $SED \"$delay_single_quote_subst\"`'\ninherit_rpath='`$ECHO \"$inherit_rpath\" | $SED \"$delay_single_quote_subst\"`'\nlink_all_deplibs='`$ECHO \"$link_all_deplibs\" | $SED \"$delay_single_quote_subst\"`'\nalways_export_symbols='`$ECHO \"$always_export_symbols\" | $SED \"$delay_single_quote_subst\"`'\nexport_symbols_cmds='`$ECHO \"$export_symbols_cmds\" | $SED \"$delay_single_quote_subst\"`'\nexclude_expsyms='`$ECHO \"$exclude_expsyms\" | $SED \"$delay_single_quote_subst\"`'\ninclude_expsyms='`$ECHO \"$include_expsyms\" | $SED \"$delay_single_quote_subst\"`'\nprelink_cmds='`$ECHO \"$prelink_cmds\" | $SED \"$delay_single_quote_subst\"`'\npostlink_cmds='`$ECHO \"$postlink_cmds\" | $SED \"$delay_single_quote_subst\"`'\nfile_list_spec='`$ECHO \"$file_list_spec\" | $SED \"$delay_single_quote_subst\"`'\nvariables_saved_for_relink='`$ECHO \"$variables_saved_for_relink\" | $SED \"$delay_single_quote_subst\"`'\nneed_lib_prefix='`$ECHO \"$need_lib_prefix\" | $SED \"$delay_single_quote_subst\"`'\nneed_version='`$ECHO \"$need_version\" | $SED \"$delay_single_quote_subst\"`'\nversion_type='`$ECHO \"$version_type\" | $SED \"$delay_single_quote_subst\"`'\nrunpath_var='`$ECHO \"$runpath_var\" | $SED \"$delay_single_quote_subst\"`'\nshlibpath_var='`$ECHO \"$shlibpath_var\" | $SED \"$delay_single_quote_subst\"`'\nshlibpath_overrides_runpath='`$ECHO \"$shlibpath_overrides_runpath\" | $SED \"$delay_single_quote_subst\"`'\nlibname_spec='`$ECHO \"$libname_spec\" | $SED \"$delay_single_quote_subst\"`'\nlibrary_names_spec='`$ECHO \"$library_names_spec\" | $SED \"$delay_single_quote_subst\"`'\nsoname_spec='`$ECHO \"$soname_spec\" | $SED \"$delay_single_quote_subst\"`'\ninstall_override_mode='`$ECHO \"$install_override_mode\" | $SED \"$delay_single_quote_subst\"`'\npostinstall_cmds='`$ECHO \"$postinstall_cmds\" | $SED \"$delay_single_quote_subst\"`'\npostuninstall_cmds='`$ECHO \"$postuninstall_cmds\" | $SED \"$delay_single_quote_subst\"`'\nfinish_cmds='`$ECHO \"$finish_cmds\" | $SED \"$delay_single_quote_subst\"`'\nfinish_eval='`$ECHO \"$finish_eval\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_into_libs='`$ECHO \"$hardcode_into_libs\" | $SED \"$delay_single_quote_subst\"`'\nsys_lib_search_path_spec='`$ECHO \"$sys_lib_search_path_spec\" | $SED \"$delay_single_quote_subst\"`'\nconfigure_time_dlsearch_path='`$ECHO \"$configure_time_dlsearch_path\" | $SED \"$delay_single_quote_subst\"`'\nconfigure_time_lt_sys_library_path='`$ECHO \"$configure_time_lt_sys_library_path\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_action='`$ECHO \"$hardcode_action\" | $SED \"$delay_single_quote_subst\"`'\nenable_dlopen='`$ECHO \"$enable_dlopen\" | $SED \"$delay_single_quote_subst\"`'\nenable_dlopen_self='`$ECHO \"$enable_dlopen_self\" | $SED \"$delay_single_quote_subst\"`'\nenable_dlopen_self_static='`$ECHO \"$enable_dlopen_self_static\" | $SED \"$delay_single_quote_subst\"`'\nold_striplib='`$ECHO \"$old_striplib\" | $SED \"$delay_single_quote_subst\"`'\nstriplib='`$ECHO \"$striplib\" | $SED \"$delay_single_quote_subst\"`'\n\nLTCC='$LTCC'\nLTCFLAGS='$LTCFLAGS'\ncompiler='$compiler_DEFAULT'\n\n# A function that is used when there is no print builtin or printf.\nfunc_fallback_echo ()\n{\n  eval 'cat <<_LTECHO_EOF\n\\$1\n_LTECHO_EOF'\n}\n\n# Quote evaled strings.\nfor var in AS \\\nDLLTOOL \\\nOBJDUMP \\\nSHELL \\\nECHO \\\nPATH_SEPARATOR \\\nSED \\\nGREP \\\nEGREP \\\nFGREP \\\nLD \\\nNM \\\nLN_S \\\nlt_SP2NL \\\nlt_NL2SP \\\nreload_flag \\\ndeplibs_check_method \\\nfile_magic_cmd \\\nfile_magic_glob \\\nwant_nocaseglob \\\nsharedlib_from_linklib_cmd \\\nAR \\\nAR_FLAGS \\\narchiver_list_spec \\\nSTRIP \\\nRANLIB \\\nCC \\\nCFLAGS \\\ncompiler \\\nlt_cv_sys_global_symbol_pipe \\\nlt_cv_sys_global_symbol_to_cdecl \\\nlt_cv_sys_global_symbol_to_import \\\nlt_cv_sys_global_symbol_to_c_name_address \\\nlt_cv_sys_global_symbol_to_c_name_address_lib_prefix \\\nlt_cv_nm_interface \\\nnm_file_list_spec \\\nlt_cv_truncate_bin \\\nlt_prog_compiler_no_builtin_flag \\\nlt_prog_compiler_pic \\\nlt_prog_compiler_wl \\\nlt_prog_compiler_static \\\nlt_cv_prog_compiler_c_o \\\nneed_locks \\\nMANIFEST_TOOL \\\nDSYMUTIL \\\nNMEDIT \\\nLIPO \\\nOTOOL \\\nOTOOL64 \\\nshrext_cmds \\\nexport_dynamic_flag_spec \\\nwhole_archive_flag_spec \\\ncompiler_needs_object \\\nwith_gnu_ld \\\nallow_undefined_flag \\\nno_undefined_flag \\\nhardcode_libdir_flag_spec \\\nhardcode_libdir_separator \\\nexclude_expsyms \\\ninclude_expsyms \\\nfile_list_spec \\\nvariables_saved_for_relink \\\nlibname_spec \\\nlibrary_names_spec \\\nsoname_spec \\\ninstall_override_mode \\\nfinish_eval \\\nold_striplib \\\nstriplib; do\n    case \\`eval \\\\\\\\\\$ECHO \\\\\\\\\"\"\\\\\\\\\\$\\$var\"\\\\\\\\\"\\` in\n    *[\\\\\\\\\\\\\\`\\\\\"\\\\\\$]*)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\`\\\\\\$ECHO \\\\\"\\\\\\$\\$var\\\\\" | \\\\\\$SED \\\\\"\\\\\\$sed_quote_subst\\\\\"\\\\\\`\\\\\\\\\\\\\"\" ## exclude from sc_prohibit_nested_quotes\n      ;;\n    *)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\$\\$var\\\\\\\\\\\\\"\"\n      ;;\n    esac\ndone\n\n# Double-quote double-evaled strings.\nfor var in reload_cmds \\\nold_postinstall_cmds \\\nold_postuninstall_cmds \\\nold_archive_cmds \\\nextract_expsyms_cmds \\\nold_archive_from_new_cmds \\\nold_archive_from_expsyms_cmds \\\narchive_cmds \\\narchive_expsym_cmds \\\nmodule_cmds \\\nmodule_expsym_cmds \\\nexport_symbols_cmds \\\nprelink_cmds \\\npostlink_cmds \\\npostinstall_cmds \\\npostuninstall_cmds \\\nfinish_cmds \\\nsys_lib_search_path_spec \\\nconfigure_time_dlsearch_path \\\nconfigure_time_lt_sys_library_path; do\n    case \\`eval \\\\\\\\\\$ECHO \\\\\\\\\"\"\\\\\\\\\\$\\$var\"\\\\\\\\\"\\` in\n    *[\\\\\\\\\\\\\\`\\\\\"\\\\\\$]*)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\`\\\\\\$ECHO \\\\\"\\\\\\$\\$var\\\\\" | \\\\\\$SED -e \\\\\"\\\\\\$double_quote_subst\\\\\" -e \\\\\"\\\\\\$sed_quote_subst\\\\\" -e \\\\\"\\\\\\$delay_variable_subst\\\\\"\\\\\\`\\\\\\\\\\\\\"\" ## exclude from sc_prohibit_nested_quotes\n      ;;\n    *)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\$\\$var\\\\\\\\\\\\\"\"\n      ;;\n    esac\ndone\n\nac_aux_dir='$ac_aux_dir'\n\n# See if we are running on zsh, and set the options that allow our\n# commands through without removal of \\ escapes INIT.\nif test -n \"\\${ZSH_VERSION+set}\"; then\n   setopt NO_GLOB_SUBST\nfi\n\n\n    PACKAGE='$PACKAGE'\n    VERSION='$VERSION'\n    RM='$RM'\n    ofile='$ofile'\n\n\n\n\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n\n# Handling of arguments.\nfor ac_config_target in $ac_config_targets\ndo\n  case $ac_config_target in\n    \"jconfig.h\") CONFIG_HEADERS=\"$CONFIG_HEADERS jconfig.h:jconfig.cfg\" ;;\n    \"depfiles\") CONFIG_COMMANDS=\"$CONFIG_COMMANDS depfiles\" ;;\n    \"libtool\") CONFIG_COMMANDS=\"$CONFIG_COMMANDS libtool\" ;;\n    \"Makefile\") CONFIG_FILES=\"$CONFIG_FILES Makefile\" ;;\n\n  *) as_fn_error $? \"invalid argument: \\`$ac_config_target'\" \"$LINENO\" 5;;\n  esac\ndone\n\n\n# If the user did not use the arguments to specify the items to instantiate,\n# then the envvar interface is used.  Set only those that are not.\n# We use the long form for the default assignment because of an extremely\n# bizarre bug on SunOS 4.1.3.\nif $ac_need_defaults; then\n  test \"${CONFIG_FILES+set}\" = set || CONFIG_FILES=$config_files\n  test \"${CONFIG_HEADERS+set}\" = set || CONFIG_HEADERS=$config_headers\n  test \"${CONFIG_COMMANDS+set}\" = set || CONFIG_COMMANDS=$config_commands\nfi\n\n# Have a temporary directory for convenience.  Make it in the build tree\n# simply because there is no reason against having it here, and in addition,\n# creating and moving files from /tmp can sometimes cause problems.\n# Hook for its removal unless debugging.\n# Note that there is a small window in which the directory will not be cleaned:\n# after its creation but before its name has been assigned to `$tmp'.\n$debug ||\n{\n  tmp= ac_tmp=\n  trap 'exit_status=$?\n  : \"${ac_tmp:=$tmp}\"\n  { test ! -d \"$ac_tmp\" || rm -fr \"$ac_tmp\"; } && exit $exit_status\n' 0\n  trap 'as_fn_exit 1' 1 2 13 15\n}\n# Create a (secure) tmp directory for tmp files.\n\n{\n  tmp=`(umask 077 && mktemp -d \"./confXXXXXX\") 2>/dev/null` &&\n  test -d \"$tmp\"\n}  ||\n{\n  tmp=./conf$$-$RANDOM\n  (umask 077 && mkdir \"$tmp\")\n} || as_fn_error $? \"cannot create a temporary directory in .\" \"$LINENO\" 5\nac_tmp=$tmp\n\n# Set up the scripts for CONFIG_FILES section.\n# No need to generate them if there are no CONFIG_FILES.\n# This happens for instance with `./config.status config.h'.\nif test -n \"$CONFIG_FILES\"; then\n\n\nac_cr=`echo X | tr X '\\015'`\n# On cygwin, bash can eat \\r inside `` if the user requested igncr.\n# But we know of no other shell where ac_cr would be empty at this\n# point, so we can use a bashism as a fallback.\nif test \"x$ac_cr\" = x; then\n  eval ac_cr=\\$\\'\\\\r\\'\nfi\nac_cs_awk_cr=`$AWK 'BEGIN { print \"a\\rb\" }' </dev/null 2>/dev/null`\nif test \"$ac_cs_awk_cr\" = \"a${ac_cr}b\"; then\n  ac_cs_awk_cr='\\\\r'\nelse\n  ac_cs_awk_cr=$ac_cr\nfi\n\necho 'BEGIN {' >\"$ac_tmp/subs1.awk\" &&\n_ACEOF\n\n\n{\n  echo \"cat >conf$$subs.awk <<_ACEOF\" &&\n  echo \"$ac_subst_vars\" | sed 's/.*/&!$&$ac_delim/' &&\n  echo \"_ACEOF\"\n} >conf$$subs.sh ||\n  as_fn_error $? \"could not make $CONFIG_STATUS\" \"$LINENO\" 5\nac_delim_num=`echo \"$ac_subst_vars\" | grep -c '^'`\nac_delim='%!_!# '\nfor ac_last_try in false false false false false :; do\n  . ./conf$$subs.sh ||\n    as_fn_error $? \"could not make $CONFIG_STATUS\" \"$LINENO\" 5\n\n  ac_delim_n=`sed -n \"s/.*$ac_delim\\$/X/p\" conf$$subs.awk | grep -c X`\n  if test $ac_delim_n = $ac_delim_num; then\n    break\n  elif $ac_last_try; then\n    as_fn_error $? \"could not make $CONFIG_STATUS\" \"$LINENO\" 5\n  else\n    ac_delim=\"$ac_delim!$ac_delim _$ac_delim!! \"\n  fi\ndone\nrm -f conf$$subs.sh\n\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\ncat >>\"\\$ac_tmp/subs1.awk\" <<\\\\_ACAWK &&\n_ACEOF\nsed -n '\nh\ns/^/S[\"/; s/!.*/\"]=/\np\ng\ns/^[^!]*!//\n:repl\nt repl\ns/'\"$ac_delim\"'$//\nt delim\n:nl\nh\ns/\\(.\\{148\\}\\)..*/\\1/\nt more1\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\\\\n\"\\\\/\np\nn\nb repl\n:more1\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"\\\\/\np\ng\ns/.\\{148\\}//\nt nl\n:delim\nh\ns/\\(.\\{148\\}\\)..*/\\1/\nt more2\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"/\np\nb\n:more2\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"\\\\/\np\ng\ns/.\\{148\\}//\nt delim\n' <conf$$subs.awk | sed '\n/^[^\"\"]/{\n  N\n  s/\\n//\n}\n' >>$CONFIG_STATUS || ac_write_fail=1\nrm -f conf$$subs.awk\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n_ACAWK\ncat >>\"\\$ac_tmp/subs1.awk\" <<_ACAWK &&\n  for (key in S) S_is_set[key] = 1\n  FS = \"\u0007\"\n\n}\n{\n  line = $ 0\n  nfields = split(line, field, \"@\")\n  substed = 0\n  len = length(field[1])\n  for (i = 2; i < nfields; i++) {\n    key = field[i]\n    keylen = length(key)\n    if (S_is_set[key]) {\n      value = S[key]\n      line = substr(line, 1, len) \"\" value \"\" substr(line, len + keylen + 3)\n      len += length(value) + length(field[++i])\n      substed = 1\n    } else\n      len += 1 + keylen\n  }\n\n  print line\n}\n\n_ACAWK\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nif sed \"s/$ac_cr//\" < /dev/null > /dev/null 2>&1; then\n  sed \"s/$ac_cr\\$//; s/$ac_cr/$ac_cs_awk_cr/g\"\nelse\n  cat\nfi < \"$ac_tmp/subs1.awk\" > \"$ac_tmp/subs.awk\" \\\n  || as_fn_error $? \"could not setup config files machinery\" \"$LINENO\" 5\n_ACEOF\n\n# VPATH may cause trouble with some makes, so we remove sole $(srcdir),\n# ${srcdir} and @srcdir@ entries from VPATH if srcdir is \".\", strip leading and\n# trailing colons and then remove the whole line if VPATH becomes empty\n# (actually we leave an empty line to preserve line numbers).\nif test \"x$srcdir\" = x.; then\n  ac_vpsub='/^[\t ]*VPATH[\t ]*=[\t ]*/{\nh\ns///\ns/^/:/\ns/[\t ]*$/:/\ns/:\\$(srcdir):/:/g\ns/:\\${srcdir}:/:/g\ns/:@srcdir@:/:/g\ns/^:*//\ns/:*$//\nx\ns/\\(=[\t ]*\\).*/\\1/\nG\ns/\\n//\ns/^[^=]*=[\t ]*$//\n}'\nfi\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nfi # test -n \"$CONFIG_FILES\"\n\n# Set up the scripts for CONFIG_HEADERS section.\n# No need to generate them if there are no CONFIG_HEADERS.\n# This happens for instance with `./config.status Makefile'.\nif test -n \"$CONFIG_HEADERS\"; then\ncat >\"$ac_tmp/defines.awk\" <<\\_ACAWK ||\nBEGIN {\n_ACEOF\n\n# Transform confdefs.h into an awk script `defines.awk', embedded as\n# here-document in config.status, that substitutes the proper values into\n# config.h.in to produce config.h.\n\n# Create a delimiter string that does not exist in confdefs.h, to ease\n# handling of long lines.\nac_delim='%!_!# '\nfor ac_last_try in false false :; do\n  ac_tt=`sed -n \"/$ac_delim/p\" confdefs.h`\n  if test -z \"$ac_tt\"; then\n    break\n  elif $ac_last_try; then\n    as_fn_error $? \"could not make $CONFIG_HEADERS\" \"$LINENO\" 5\n  else\n    ac_delim=\"$ac_delim!$ac_delim _$ac_delim!! \"\n  fi\ndone\n\n# For the awk script, D is an array of macro values keyed by name,\n# likewise P contains macro parameters if any.  Preserve backslash\n# newline sequences.\n\nac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*\nsed -n '\ns/.\\{148\\}/&'\"$ac_delim\"'/g\nt rset\n:rset\ns/^[\t ]*#[\t ]*define[\t ][\t ]*/ /\nt def\nd\n:def\ns/\\\\$//\nt bsnl\ns/[\"\\\\]/\\\\&/g\ns/^ \\('\"$ac_word_re\"'\\)\\(([^()]*)\\)[\t ]*\\(.*\\)/P[\"\\1\"]=\"\\2\"\\\nD[\"\\1\"]=\" \\3\"/p\ns/^ \\('\"$ac_word_re\"'\\)[\t ]*\\(.*\\)/D[\"\\1\"]=\" \\2\"/p\nd\n:bsnl\ns/[\"\\\\]/\\\\&/g\ns/^ \\('\"$ac_word_re\"'\\)\\(([^()]*)\\)[\t ]*\\(.*\\)/P[\"\\1\"]=\"\\2\"\\\nD[\"\\1\"]=\" \\3\\\\\\\\\\\\n\"\\\\/p\nt cont\ns/^ \\('\"$ac_word_re\"'\\)[\t ]*\\(.*\\)/D[\"\\1\"]=\" \\2\\\\\\\\\\\\n\"\\\\/p\nt cont\nd\n:cont\nn\ns/.\\{148\\}/&'\"$ac_delim\"'/g\nt clear\n:clear\ns/\\\\$//\nt bsnlc\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"/p\nd\n:bsnlc\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\\\\\\\\\\\\n\"\\\\/p\nb cont\n' <confdefs.h | sed '\ns/'\"$ac_delim\"'/\"\\\\\\\n\"/g' >>$CONFIG_STATUS || ac_write_fail=1\n\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n  for (key in D) D_is_set[key] = 1\n  FS = \"\u0007\"\n}\n/^[\\t ]*#[\\t ]*(define|undef)[\\t ]+$ac_word_re([\\t (]|\\$)/ {\n  line = \\$ 0\n  split(line, arg, \" \")\n  if (arg[1] == \"#\") {\n    defundef = arg[2]\n    mac1 = arg[3]\n  } else {\n    defundef = substr(arg[1], 2)\n    mac1 = arg[2]\n  }\n  split(mac1, mac2, \"(\") #)\n  macro = mac2[1]\n  prefix = substr(line, 1, index(line, defundef) - 1)\n  if (D_is_set[macro]) {\n    # Preserve the white space surrounding the \"#\".\n    print prefix \"define\", macro P[macro] D[macro]\n    next\n  } else {\n    # Replace #undef with comments.  This is necessary, for example,\n    # in the case of _POSIX_SOURCE, which is predefined and required\n    # on some systems where configure will not decide to define it.\n    if (defundef == \"undef\") {\n      print \"/*\", prefix defundef, macro, \"*/\"\n      next\n    }\n  }\n}\n{ print }\n_ACAWK\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n  as_fn_error $? \"could not setup config headers machinery\" \"$LINENO\" 5\nfi # test -n \"$CONFIG_HEADERS\"\n\n\neval set X \"  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS\"\nshift\nfor ac_tag\ndo\n  case $ac_tag in\n  :[FHLC]) ac_mode=$ac_tag; continue;;\n  esac\n  case $ac_mode$ac_tag in\n  :[FHL]*:*);;\n  :L* | :C*:*) as_fn_error $? \"invalid tag \\`$ac_tag'\" \"$LINENO\" 5;;\n  :[FH]-) ac_tag=-:-;;\n  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;\n  esac\n  ac_save_IFS=$IFS\n  IFS=:\n  set x $ac_tag\n  IFS=$ac_save_IFS\n  shift\n  ac_file=$1\n  shift\n\n  case $ac_mode in\n  :L) ac_source=$1;;\n  :[FH])\n    ac_file_inputs=\n    for ac_f\n    do\n      case $ac_f in\n      -) ac_f=\"$ac_tmp/stdin\";;\n      *) # Look for the file first in the build tree, then in the source tree\n\t # (if the path is not absolute).  The absolute path cannot be DOS-style,\n\t # because $ac_f cannot contain `:'.\n\t test -f \"$ac_f\" ||\n\t   case $ac_f in\n\t   [\\\\/$]*) false;;\n\t   *) test -f \"$srcdir/$ac_f\" && ac_f=\"$srcdir/$ac_f\";;\n\t   esac ||\n\t   as_fn_error 1 \"cannot find input file: \\`$ac_f'\" \"$LINENO\" 5;;\n      esac\n      case $ac_f in *\\'*) ac_f=`$as_echo \"$ac_f\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;; esac\n      as_fn_append ac_file_inputs \" '$ac_f'\"\n    done\n\n    # Let's still pretend it is `configure' which instantiates (i.e., don't\n    # use $as_me), people would be surprised to read:\n    #    /* config.h.  Generated by config.status.  */\n    configure_input='Generated from '`\n\t  $as_echo \"$*\" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'\n\t`' by configure.'\n    if test x\"$ac_file\" != x-; then\n      configure_input=\"$ac_file.  $configure_input\"\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: creating $ac_file\" >&5\n$as_echo \"$as_me: creating $ac_file\" >&6;}\n    fi\n    # Neutralize special characters interpreted by sed in replacement strings.\n    case $configure_input in #(\n    *\\&* | *\\|* | *\\\\* )\n       ac_sed_conf_input=`$as_echo \"$configure_input\" |\n       sed 's/[\\\\\\\\&|]/\\\\\\\\&/g'`;; #(\n    *) ac_sed_conf_input=$configure_input;;\n    esac\n\n    case $ac_tag in\n    *:-:* | *:-) cat >\"$ac_tmp/stdin\" \\\n      || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5 ;;\n    esac\n    ;;\n  esac\n\n  ac_dir=`$as_dirname -- \"$ac_file\" ||\n$as_expr X\"$ac_file\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$ac_file\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$ac_file\" : 'X\\(//\\)$' \\| \\\n\t X\"$ac_file\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$ac_file\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n  as_dir=\"$ac_dir\"; as_fn_mkdir_p\n  ac_builddir=.\n\ncase \"$ac_dir\" in\n.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;\n*)\n  ac_dir_suffix=/`$as_echo \"$ac_dir\" | sed 's|^\\.[\\\\/]||'`\n  # A \"..\" for each directory in $ac_dir_suffix.\n  ac_top_builddir_sub=`$as_echo \"$ac_dir_suffix\" | sed 's|/[^\\\\/]*|/..|g;s|/||'`\n  case $ac_top_builddir_sub in\n  \"\") ac_top_builddir_sub=. ac_top_build_prefix= ;;\n  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;\n  esac ;;\nesac\nac_abs_top_builddir=$ac_pwd\nac_abs_builddir=$ac_pwd$ac_dir_suffix\n# for backward compatibility:\nac_top_builddir=$ac_top_build_prefix\n\ncase $srcdir in\n  .)  # We are building in place.\n    ac_srcdir=.\n    ac_top_srcdir=$ac_top_builddir_sub\n    ac_abs_top_srcdir=$ac_pwd ;;\n  [\\\\/]* | ?:[\\\\/]* )  # Absolute name.\n    ac_srcdir=$srcdir$ac_dir_suffix;\n    ac_top_srcdir=$srcdir\n    ac_abs_top_srcdir=$srcdir ;;\n  *) # Relative name.\n    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix\n    ac_top_srcdir=$ac_top_build_prefix$srcdir\n    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;\nesac\nac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix\n\n\n  case $ac_mode in\n  :F)\n  #\n  # CONFIG_FILE\n  #\n\n  case $INSTALL in\n  [\\\\/$]* | ?:[\\\\/]* ) ac_INSTALL=$INSTALL ;;\n  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;\n  esac\n  ac_MKDIR_P=$MKDIR_P\n  case $MKDIR_P in\n  [\\\\/$]* | ?:[\\\\/]* ) ;;\n  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;\n  esac\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n# If the template does not know about datarootdir, expand it.\n# FIXME: This hack should be removed a few years after 2.60.\nac_datarootdir_hack=; ac_datarootdir_seen=\nac_sed_dataroot='\n/datarootdir/ {\n  p\n  q\n}\n/@datadir@/p\n/@docdir@/p\n/@infodir@/p\n/@localedir@/p\n/@mandir@/p'\ncase `eval \"sed -n \\\"\\$ac_sed_dataroot\\\" $ac_file_inputs\"` in\n*datarootdir*) ac_datarootdir_seen=yes;;\n*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting\" >&5\n$as_echo \"$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting\" >&2;}\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n  ac_datarootdir_hack='\n  s&@datadir@&$datadir&g\n  s&@docdir@&$docdir&g\n  s&@infodir@&$infodir&g\n  s&@localedir@&$localedir&g\n  s&@mandir@&$mandir&g\n  s&\\\\\\${datarootdir}&$datarootdir&g' ;;\nesac\n_ACEOF\n\n# Neutralize VPATH when `$srcdir' = `.'.\n# Shell code in configure.ac might set extrasub.\n# FIXME: do we really want to maintain this feature?\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\nac_sed_extra=\"$ac_vpsub\n$extrasub\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n:t\n/@[a-zA-Z_][a-zA-Z_0-9]*@/!b\ns|@configure_input@|$ac_sed_conf_input|;t t\ns&@top_builddir@&$ac_top_builddir_sub&;t t\ns&@top_build_prefix@&$ac_top_build_prefix&;t t\ns&@srcdir@&$ac_srcdir&;t t\ns&@abs_srcdir@&$ac_abs_srcdir&;t t\ns&@top_srcdir@&$ac_top_srcdir&;t t\ns&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t\ns&@builddir@&$ac_builddir&;t t\ns&@abs_builddir@&$ac_abs_builddir&;t t\ns&@abs_top_builddir@&$ac_abs_top_builddir&;t t\ns&@INSTALL@&$ac_INSTALL&;t t\ns&@MKDIR_P@&$ac_MKDIR_P&;t t\n$ac_datarootdir_hack\n\"\neval sed \\\"\\$ac_sed_extra\\\" \"$ac_file_inputs\" | $AWK -f \"$ac_tmp/subs.awk\" \\\n  >$ac_tmp/out || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n\ntest -z \"$ac_datarootdir_hack$ac_datarootdir_seen\" &&\n  { ac_out=`sed -n '/\\${datarootdir}/p' \"$ac_tmp/out\"`; test -n \"$ac_out\"; } &&\n  { ac_out=`sed -n '/^[\t ]*datarootdir[\t ]*:*=/p' \\\n      \"$ac_tmp/out\"`; test -z \"$ac_out\"; } &&\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \\`datarootdir'\nwhich seems to be undefined.  Please make sure it is defined\" >&5\n$as_echo \"$as_me: WARNING: $ac_file contains a reference to the variable \\`datarootdir'\nwhich seems to be undefined.  Please make sure it is defined\" >&2;}\n\n  rm -f \"$ac_tmp/stdin\"\n  case $ac_file in\n  -) cat \"$ac_tmp/out\" && rm -f \"$ac_tmp/out\";;\n  *) rm -f \"$ac_file\" && mv \"$ac_tmp/out\" \"$ac_file\";;\n  esac \\\n  || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n ;;\n  :H)\n  #\n  # CONFIG_HEADER\n  #\n  if test x\"$ac_file\" != x-; then\n    {\n      $as_echo \"/* $configure_input  */\" \\\n      && eval '$AWK -f \"$ac_tmp/defines.awk\"' \"$ac_file_inputs\"\n    } >\"$ac_tmp/config.h\" \\\n      || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n    if diff \"$ac_file\" \"$ac_tmp/config.h\" >/dev/null 2>&1; then\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: $ac_file is unchanged\" >&5\n$as_echo \"$as_me: $ac_file is unchanged\" >&6;}\n    else\n      rm -f \"$ac_file\"\n      mv \"$ac_tmp/config.h\" \"$ac_file\" \\\n\t|| as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n    fi\n  else\n    $as_echo \"/* $configure_input  */\" \\\n      && eval '$AWK -f \"$ac_tmp/defines.awk\"' \"$ac_file_inputs\" \\\n      || as_fn_error $? \"could not create -\" \"$LINENO\" 5\n  fi\n# Compute \"$ac_file\"'s index in $config_headers.\n_am_arg=\"$ac_file\"\n_am_stamp_count=1\nfor _am_header in $config_headers :; do\n  case $_am_header in\n    $_am_arg | $_am_arg:* )\n      break ;;\n    * )\n      _am_stamp_count=`expr $_am_stamp_count + 1` ;;\n  esac\ndone\necho \"timestamp for $_am_arg\" >`$as_dirname -- \"$_am_arg\" ||\n$as_expr X\"$_am_arg\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$_am_arg\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$_am_arg\" : 'X\\(//\\)$' \\| \\\n\t X\"$_am_arg\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$_am_arg\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`/stamp-h$_am_stamp_count\n ;;\n\n  :C)  { $as_echo \"$as_me:${as_lineno-$LINENO}: executing $ac_file commands\" >&5\n$as_echo \"$as_me: executing $ac_file commands\" >&6;}\n ;;\n  esac\n\n\n  case $ac_file$ac_mode in\n    \"depfiles\":C) test x\"$AMDEP_TRUE\" != x\"\" || {\n  # Older Autoconf quotes --file arguments for eval, but not when files\n  # are listed without --file.  Let's play safe and only enable the eval\n  # if we detect the quoting.\n  case $CONFIG_FILES in\n  *\\'*) eval set x \"$CONFIG_FILES\" ;;\n  *)   set x $CONFIG_FILES ;;\n  esac\n  shift\n  for mf\n  do\n    # Strip MF so we end up with the name of the file.\n    mf=`echo \"$mf\" | sed -e 's/:.*$//'`\n    # Check whether this is an Automake generated Makefile or not.\n    # We used to match only the files named 'Makefile.in', but\n    # some people rename them; so instead we look at the file content.\n    # Grep'ing the first line is not enough: some people post-process\n    # each Makefile.in and add a new line on top of each file to say so.\n    # Grep'ing the whole file is not good either: AIX grep has a line\n    # limit of 2048, but all sed's we know have understand at least 4000.\n    if sed -n 's,^#.*generated by automake.*,X,p' \"$mf\" | grep X >/dev/null 2>&1; then\n      dirpart=`$as_dirname -- \"$mf\" ||\n$as_expr X\"$mf\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$mf\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$mf\" : 'X\\(//\\)$' \\| \\\n\t X\"$mf\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$mf\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n    else\n      continue\n    fi\n    # Extract the definition of DEPDIR, am__include, and am__quote\n    # from the Makefile without running 'make'.\n    DEPDIR=`sed -n 's/^DEPDIR = //p' < \"$mf\"`\n    test -z \"$DEPDIR\" && continue\n    am__include=`sed -n 's/^am__include = //p' < \"$mf\"`\n    test -z \"$am__include\" && continue\n    am__quote=`sed -n 's/^am__quote = //p' < \"$mf\"`\n    # Find all dependency output files, they are included files with\n    # $(DEPDIR) in their names.  We invoke sed twice because it is the\n    # simplest approach to changing $(DEPDIR) to its actual value in the\n    # expansion.\n    for file in `sed -n \"\n      s/^$am__include $am__quote\\(.*(DEPDIR).*\\)$am__quote\"'$/\\1/p' <\"$mf\" | \\\n\t sed -e 's/\\$(DEPDIR)/'\"$DEPDIR\"'/g'`; do\n      # Make sure the directory exists.\n      test -f \"$dirpart/$file\" && continue\n      fdir=`$as_dirname -- \"$file\" ||\n$as_expr X\"$file\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$file\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$file\" : 'X\\(//\\)$' \\| \\\n\t X\"$file\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$file\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n      as_dir=$dirpart/$fdir; as_fn_mkdir_p\n      # echo \"creating $dirpart/$file\"\n      echo '# dummy' > \"$dirpart/$file\"\n    done\n  done\n}\n ;;\n    \"libtool\":C)\n\n    # See if we are running on zsh, and set the options that allow our\n    # commands through without removal of \\ escapes.\n    if test -n \"${ZSH_VERSION+set}\"; then\n      setopt NO_GLOB_SUBST\n    fi\n\n    cfgfile=${ofile}T\n    trap \"$RM \\\"$cfgfile\\\"; exit 1\" 1 2 15\n    $RM \"$cfgfile\"\n\n    cat <<_LT_EOF >> \"$cfgfile\"\n#! $SHELL\n# Generated automatically by $as_me ($PACKAGE) $VERSION\n# NOTE: Changes made to this file will be lost: look at ltmain.sh.\n\n# Provide generalized library-building support services.\n# Written by Gordon Matzigkeit, 1996\n\n# Copyright (C) 2014 Free Software Foundation, Inc.\n# This is free software; see the source for copying conditions.  There is NO\n# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n# GNU Libtool is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of of the License, or\n# (at your option) any later version.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program or library that is built\n# using GNU Libtool, you may include this file under the  same\n# distribution terms that you use for the rest of that program.\n#\n# GNU Libtool is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n\n# The names of the tagged configurations supported by this script.\navailable_tags=''\n\n# Configured defaults for sys_lib_dlsearch_path munging.\n: \\${LT_SYS_LIBRARY_PATH=\"$configure_time_lt_sys_library_path\"}\n\n# ### BEGIN LIBTOOL CONFIG\n\n# Assembler program.\nAS=$lt_AS\n\n# DLL creation program.\nDLLTOOL=$lt_DLLTOOL\n\n# Object dumper program.\nOBJDUMP=$lt_OBJDUMP\n\n# Which release of libtool.m4 was used?\nmacro_version=$macro_version\nmacro_revision=$macro_revision\n\n# Whether or not to build shared libraries.\nbuild_libtool_libs=$enable_shared\n\n# Whether or not to build static libraries.\nbuild_old_libs=$enable_static\n\n# What type of objects to build.\npic_mode=$pic_mode\n\n# Whether or not to optimize for fast installation.\nfast_install=$enable_fast_install\n\n# Shared archive member basename,for filename based shared library versioning on AIX.\nshared_archive_member_spec=$shared_archive_member_spec\n\n# Shell to use when invoking shell scripts.\nSHELL=$lt_SHELL\n\n# An echo program that protects backslashes.\nECHO=$lt_ECHO\n\n# The PATH separator for the build system.\nPATH_SEPARATOR=$lt_PATH_SEPARATOR\n\n# The host system.\nhost_alias=$host_alias\nhost=$host\nhost_os=$host_os\n\n# The build system.\nbuild_alias=$build_alias\nbuild=$build\nbuild_os=$build_os\n\n# A sed program that does not truncate output.\nSED=$lt_SED\n\n# Sed that helps us avoid accidentally triggering echo(1) options like -n.\nXsed=\"\\$SED -e 1s/^X//\"\n\n# A grep program that handles long lines.\nGREP=$lt_GREP\n\n# An ERE matcher.\nEGREP=$lt_EGREP\n\n# A literal string matcher.\nFGREP=$lt_FGREP\n\n# A BSD- or MS-compatible name lister.\nNM=$lt_NM\n\n# Whether we need soft or hard links.\nLN_S=$lt_LN_S\n\n# What is the maximum length of a command?\nmax_cmd_len=$max_cmd_len\n\n# Object file suffix (normally \"o\").\nobjext=$ac_objext\n\n# Executable file suffix (normally \"\").\nexeext=$exeext\n\n# whether the shell understands \"unset\".\nlt_unset=$lt_unset\n\n# turn spaces into newlines.\nSP2NL=$lt_lt_SP2NL\n\n# turn newlines into spaces.\nNL2SP=$lt_lt_NL2SP\n\n# convert \\$build file names to \\$host format.\nto_host_file_cmd=$lt_cv_to_host_file_cmd\n\n# convert \\$build files to toolchain format.\nto_tool_file_cmd=$lt_cv_to_tool_file_cmd\n\n# Method to check whether dependent libraries are shared objects.\ndeplibs_check_method=$lt_deplibs_check_method\n\n# Command to use when deplibs_check_method = \"file_magic\".\nfile_magic_cmd=$lt_file_magic_cmd\n\n# How to find potential files when deplibs_check_method = \"file_magic\".\nfile_magic_glob=$lt_file_magic_glob\n\n# Find potential files using nocaseglob when deplibs_check_method = \"file_magic\".\nwant_nocaseglob=$lt_want_nocaseglob\n\n# Command to associate shared and link libraries.\nsharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd\n\n# The archiver.\nAR=$lt_AR\n\n# Flags to create an archive.\nAR_FLAGS=$lt_AR_FLAGS\n\n# How to feed a file listing to the archiver.\narchiver_list_spec=$lt_archiver_list_spec\n\n# A symbol stripping program.\nSTRIP=$lt_STRIP\n\n# Commands used to install an old-style archive.\nRANLIB=$lt_RANLIB\nold_postinstall_cmds=$lt_old_postinstall_cmds\nold_postuninstall_cmds=$lt_old_postuninstall_cmds\n\n# Whether to use a lock for old archive extraction.\nlock_old_archive_extraction=$lock_old_archive_extraction\n\n# A C compiler.\nLTCC=$lt_CC\n\n# LTCC compiler flags.\nLTCFLAGS=$lt_CFLAGS\n\n# Take the output of nm and produce a listing of raw symbols and C names.\nglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe\n\n# Transform the output of nm in a proper C declaration.\nglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl\n\n# Transform the output of nm into a list of symbols to manually relocate.\nglobal_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import\n\n# Transform the output of nm in a C name address pair.\nglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address\n\n# Transform the output of nm in a C name address pair when lib prefix is needed.\nglobal_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix\n\n# The name lister interface.\nnm_interface=$lt_lt_cv_nm_interface\n\n# Specify filename containing input files for \\$NM.\nnm_file_list_spec=$lt_nm_file_list_spec\n\n# The root where to search for dependent libraries,and where our libraries should be installed.\nlt_sysroot=$lt_sysroot\n\n# Command to truncate a binary pipe.\nlt_truncate_bin=$lt_lt_cv_truncate_bin\n\n# The name of the directory that contains temporary libtool files.\nobjdir=$objdir\n\n# Used to examine libraries when file_magic_cmd begins with \"file\".\nMAGIC_CMD=$MAGIC_CMD\n\n# Must we lock files when doing compilation?\nneed_locks=$lt_need_locks\n\n# Manifest tool.\nMANIFEST_TOOL=$lt_MANIFEST_TOOL\n\n# Tool to manipulate archived DWARF debug symbol files on Mac OS X.\nDSYMUTIL=$lt_DSYMUTIL\n\n# Tool to change global to local symbols on Mac OS X.\nNMEDIT=$lt_NMEDIT\n\n# Tool to manipulate fat objects and archives on Mac OS X.\nLIPO=$lt_LIPO\n\n# ldd/readelf like tool for Mach-O binaries on Mac OS X.\nOTOOL=$lt_OTOOL\n\n# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.\nOTOOL64=$lt_OTOOL64\n\n# Old archive suffix (normally \"a\").\nlibext=$libext\n\n# Shared library suffix (normally \".so\").\nshrext_cmds=$lt_shrext_cmds\n\n# The commands to extract the exported symbol list from a shared archive.\nextract_expsyms_cmds=$lt_extract_expsyms_cmds\n\n# Variables whose values should be saved in libtool wrapper scripts and\n# restored at link time.\nvariables_saved_for_relink=$lt_variables_saved_for_relink\n\n# Do we need the \"lib\" prefix for modules?\nneed_lib_prefix=$need_lib_prefix\n\n# Do we need a version for libraries?\nneed_version=$need_version\n\n# Library versioning type.\nversion_type=$version_type\n\n# Shared library runtime path variable.\nrunpath_var=$runpath_var\n\n# Shared library path variable.\nshlibpath_var=$shlibpath_var\n\n# Is shlibpath searched before the hard-coded library search path?\nshlibpath_overrides_runpath=$shlibpath_overrides_runpath\n\n# Format of library name prefix.\nlibname_spec=$lt_libname_spec\n\n# List of archive names.  First name is the real one, the rest are links.\n# The last name is the one that the linker finds with -lNAME\nlibrary_names_spec=$lt_library_names_spec\n\n# The coded name of the library, if different from the real name.\nsoname_spec=$lt_soname_spec\n\n# Permission mode override for installation of shared libraries.\ninstall_override_mode=$lt_install_override_mode\n\n# Command to use after installation of a shared archive.\npostinstall_cmds=$lt_postinstall_cmds\n\n# Command to use after uninstallation of a shared archive.\npostuninstall_cmds=$lt_postuninstall_cmds\n\n# Commands used to finish a libtool library installation in a directory.\nfinish_cmds=$lt_finish_cmds\n\n# As \"finish_cmds\", except a single script fragment to be evaled but\n# not shown.\nfinish_eval=$lt_finish_eval\n\n# Whether we should hardcode library paths into libraries.\nhardcode_into_libs=$hardcode_into_libs\n\n# Compile-time system search path for libraries.\nsys_lib_search_path_spec=$lt_sys_lib_search_path_spec\n\n# Detected run-time system search path for libraries.\nsys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path\n\n# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.\nconfigure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path\n\n# Whether dlopen is supported.\ndlopen_support=$enable_dlopen\n\n# Whether dlopen of programs is supported.\ndlopen_self=$enable_dlopen_self\n\n# Whether dlopen of statically linked programs is supported.\ndlopen_self_static=$enable_dlopen_self_static\n\n# Commands to strip libraries.\nold_striplib=$lt_old_striplib\nstriplib=$lt_striplib\n\n\n# The linker used to build libraries.\nLD=$lt_LD\n\n# How to create reloadable object files.\nreload_flag=$lt_reload_flag\nreload_cmds=$lt_reload_cmds\n\n# Commands used to build an old-style archive.\nold_archive_cmds=$lt_old_archive_cmds\n\n# A language specific compiler.\nCC=$lt_compiler\n\n# Is the compiler the GNU compiler?\nwith_gcc=$GCC\n\n# Compiler flag to turn off builtin functions.\nno_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag\n\n# Additional compiler flags for building library objects.\npic_flag=$lt_lt_prog_compiler_pic\n\n# How to pass a linker flag through the compiler.\nwl=$lt_lt_prog_compiler_wl\n\n# Compiler flag to prevent dynamic linking.\nlink_static_flag=$lt_lt_prog_compiler_static\n\n# Does compiler simultaneously support -c and -o options?\ncompiler_c_o=$lt_lt_cv_prog_compiler_c_o\n\n# Whether or not to add -lc for building shared libraries.\nbuild_libtool_need_lc=$archive_cmds_need_lc\n\n# Whether or not to disallow shared libs when runtime libs are static.\nallow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes\n\n# Compiler flag to allow reflexive dlopens.\nexport_dynamic_flag_spec=$lt_export_dynamic_flag_spec\n\n# Compiler flag to generate shared objects directly from archives.\nwhole_archive_flag_spec=$lt_whole_archive_flag_spec\n\n# Whether the compiler copes with passing no objects directly.\ncompiler_needs_object=$lt_compiler_needs_object\n\n# Create an old-style archive from a shared archive.\nold_archive_from_new_cmds=$lt_old_archive_from_new_cmds\n\n# Create a temporary old-style archive to link instead of a shared archive.\nold_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds\n\n# Commands used to build a shared archive.\narchive_cmds=$lt_archive_cmds\narchive_expsym_cmds=$lt_archive_expsym_cmds\n\n# Commands used to build a loadable module if different from building\n# a shared archive.\nmodule_cmds=$lt_module_cmds\nmodule_expsym_cmds=$lt_module_expsym_cmds\n\n# Whether we are building with GNU ld or not.\nwith_gnu_ld=$lt_with_gnu_ld\n\n# Flag that allows shared libraries with undefined symbols to be built.\nallow_undefined_flag=$lt_allow_undefined_flag\n\n# Flag that enforces no undefined symbols.\nno_undefined_flag=$lt_no_undefined_flag\n\n# Flag to hardcode \\$libdir into a binary during linking.\n# This must work even if \\$libdir does not exist\nhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec\n\n# Whether we need a single \"-rpath\" flag with a separated argument.\nhardcode_libdir_separator=$lt_hardcode_libdir_separator\n\n# Set to \"yes\" if using DIR/libNAME\\$shared_ext during linking hardcodes\n# DIR into the resulting binary.\nhardcode_direct=$hardcode_direct\n\n# Set to \"yes\" if using DIR/libNAME\\$shared_ext during linking hardcodes\n# DIR into the resulting binary and the resulting library dependency is\n# \"absolute\",i.e impossible to change by setting \\$shlibpath_var if the\n# library is relocated.\nhardcode_direct_absolute=$hardcode_direct_absolute\n\n# Set to \"yes\" if using the -LDIR flag during linking hardcodes DIR\n# into the resulting binary.\nhardcode_minus_L=$hardcode_minus_L\n\n# Set to \"yes\" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR\n# into the resulting binary.\nhardcode_shlibpath_var=$hardcode_shlibpath_var\n\n# Set to \"yes\" if building a shared library automatically hardcodes DIR\n# into the library and all subsequent libraries and executables linked\n# against it.\nhardcode_automatic=$hardcode_automatic\n\n# Set to yes if linker adds runtime paths of dependent libraries\n# to runtime path list.\ninherit_rpath=$inherit_rpath\n\n# Whether libtool must link a program against all its dependency libraries.\nlink_all_deplibs=$link_all_deplibs\n\n# Set to \"yes\" if exported symbols are required.\nalways_export_symbols=$always_export_symbols\n\n# The commands to list exported symbols.\nexport_symbols_cmds=$lt_export_symbols_cmds\n\n# Symbols that should not be listed in the preloaded symbols.\nexclude_expsyms=$lt_exclude_expsyms\n\n# Symbols that must always be exported.\ninclude_expsyms=$lt_include_expsyms\n\n# Commands necessary for linking programs (against libraries) with templates.\nprelink_cmds=$lt_prelink_cmds\n\n# Commands necessary for finishing linking programs.\npostlink_cmds=$lt_postlink_cmds\n\n# Specify filename containing input files.\nfile_list_spec=$lt_file_list_spec\n\n# How to hardcode a shared library path into an executable.\nhardcode_action=$hardcode_action\n\n# ### END LIBTOOL CONFIG\n\n_LT_EOF\n\n    cat <<'_LT_EOF' >> \"$cfgfile\"\n\n# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE\n\n# func_munge_path_list VARIABLE PATH\n# -----------------------------------\n# VARIABLE is name of variable containing _space_ separated list of\n# directories to be munged by the contents of PATH, which is string\n# having a format:\n# \"DIR[:DIR]:\"\n#       string \"DIR[ DIR]\" will be prepended to VARIABLE\n# \":DIR[:DIR]\"\n#       string \"DIR[ DIR]\" will be appended to VARIABLE\n# \"DIRP[:DIRP]::[DIRA:]DIRA\"\n#       string \"DIRP[ DIRP]\" will be prepended to VARIABLE and string\n#       \"DIRA[ DIRA]\" will be appended to VARIABLE\n# \"DIR[:DIR]\"\n#       VARIABLE will be replaced by \"DIR[ DIR]\"\nfunc_munge_path_list ()\n{\n    case x$2 in\n    x)\n        ;;\n    *:)\n        eval $1=\\\"`$ECHO $2 | $SED 's/:/ /g'` \\$$1\\\"\n        ;;\n    x:*)\n        eval $1=\\\"\\$$1 `$ECHO $2 | $SED 's/:/ /g'`\\\"\n        ;;\n    *::*)\n        eval $1=\\\"\\$$1\\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\\\"\n        eval $1=\\\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\\ \\$$1\\\"\n        ;;\n    *)\n        eval $1=\\\"`$ECHO $2 | $SED 's/:/ /g'`\\\"\n        ;;\n    esac\n}\n\n\n# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.\nfunc_cc_basename ()\n{\n    for cc_temp in $*\"\"; do\n      case $cc_temp in\n        compile | *[\\\\/]compile | ccache | *[\\\\/]ccache ) ;;\n        distcc | *[\\\\/]distcc | purify | *[\\\\/]purify ) ;;\n        \\-*) ;;\n        *) break;;\n      esac\n    done\n    func_cc_basename_result=`$ECHO \"$cc_temp\" | $SED \"s%.*/%%; s%^$host_alias-%%\"`\n}\n\n\n# ### END FUNCTIONS SHARED WITH CONFIGURE\n\n_LT_EOF\n\n  case $host_os in\n  aix3*)\n    cat <<\\_LT_EOF >> \"$cfgfile\"\n# AIX sometimes has problems with the GCC collect2 program.  For some\n# reason, if we set the COLLECT_NAMES environment variable, the problems\n# vanish in a puff of smoke.\nif test set != \"${COLLECT_NAMES+set}\"; then\n  COLLECT_NAMES=\n  export COLLECT_NAMES\nfi\n_LT_EOF\n    ;;\n  esac\n\n\nltmain=$ac_aux_dir/ltmain.sh\n\n\n  # We use sed instead of cat because bash on DJGPP gets confused if\n  # if finds mixed CR/LF and LF-only lines.  Since sed operates in\n  # text mode, it properly converts lines to CR/LF.  This bash problem\n  # is reportedly fixed, but why not run on old versions too?\n  sed '$q' \"$ltmain\" >> \"$cfgfile\" \\\n     || (rm -f \"$cfgfile\"; exit 1)\n\n   mv -f \"$cfgfile\" \"$ofile\" ||\n    (rm -f \"$ofile\" && cp \"$cfgfile\" \"$ofile\" && rm -f \"$cfgfile\")\n  chmod +x \"$ofile\"\n\n ;;\n\n  esac\ndone # for ac_tag\n\n\nas_fn_exit 0\n_ACEOF\nac_clean_files=$ac_clean_files_save\n\ntest $ac_write_fail = 0 ||\n  as_fn_error $? \"write failure creating $CONFIG_STATUS\" \"$LINENO\" 5\n\n\n# configure is writing to config.log, and then calls config.status.\n# config.status does its own redirection, appending to config.log.\n# Unfortunately, on DOS this fails, as config.log is still kept open\n# by configure, so config.status won't be able to write to it; its\n# output is simply discarded.  So we exec the FD to /dev/null,\n# effectively closing config.log, so it can be properly (re)opened and\n# appended to by config.status.  When coming back to configure, we\n# need to make the FD available again.\nif test \"$no_create\" != yes; then\n  ac_cs_success=:\n  ac_config_status_args=\n  test \"$silent\" = yes &&\n    ac_config_status_args=\"$ac_config_status_args --quiet\"\n  exec 5>/dev/null\n  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false\n  exec 5>>config.log\n  # Use ||, not &&, to avoid exiting from the if with $? = 1, which\n  # would make configure fail if this is the last instruction.\n  $ac_cs_success || as_fn_exit 1\nfi\nif test -n \"$ac_unrecognized_opts\" && test \"$enable_option_checking\" != no; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts\" >&5\n$as_echo \"$as_me: WARNING: unrecognized options: $ac_unrecognized_opts\" >&2;}\nfi\n\n"
  },
  {
    "path": "configure.ac",
    "content": "# IJG auto-configuration source file.\n# Process this file with autoconf to produce a configure script.\n\n#\n# Configure script for IJG libjpeg\n#\n\nAC_INIT([libjpeg], [9.1.0])\n\n# Directory where autotools helper scripts lives.\nAC_CONFIG_AUX_DIR([.])\n\n# Generate configuration neaders.\nAC_CONFIG_HEADERS([jconfig.h:jconfig.cfg])\n\n# Hack: disable autoheader so that it doesn't overwrite our cfg template.\nAUTOHEADER=\"echo autoheader ignored\"\n\n# Check system type\nAC_CANONICAL_TARGET\n\n# Initialize Automake\n# Don't require all the GNU mandated files\nAM_INIT_AUTOMAKE([-Wall -Werror no-dist foreign])\n\n# Make --enable-silent-rules the default.\n# To get verbose build output you may configure\n# with --disable-silent-rules or use \"make V=1\".\nAM_SILENT_RULES([yes])\n\nAC_DEFUN([AX_APPEND_FLAG],\n[dnl\nAC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF\nAS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])\nAS_VAR_SET_IF(FLAGS,[\n  AS_CASE([\" AS_VAR_GET(FLAGS) \"],\n    [*\" $1 \"*], [AC_RUN_LOG([: FLAGS already contains $1])],\n    [\n     AS_VAR_APPEND(FLAGS,[\" $1\"])\n     AC_RUN_LOG([: FLAGS=\"$FLAGS\"])\n    ])\n  ],\n  [\n  AS_VAR_SET(FLAGS,[$1])\n  AC_RUN_LOG([: FLAGS=\"$FLAGS\"])\n  ])\nAS_VAR_POPDEF([FLAGS])dnl\n])dnl AX_APPEND_FLAG\n\nAC_DEFUN([AX_CHECK_COMPILE_FLAG],\n[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF\nAS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl\nAC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [\n  ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS\n  _AC_LANG_PREFIX[]FLAGS=\"$[]_AC_LANG_PREFIX[]FLAGS $4 $1\"\n  AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],\n    [AS_VAR_SET(CACHEVAR,[yes])],\n    [AS_VAR_SET(CACHEVAR,[no])])\n  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])\nAS_VAR_IF(CACHEVAR,yes,\n  [m4_default([$2], :)],\n  [m4_default([$3], :)])\nAS_VAR_POPDEF([CACHEVAR])dnl\n])dnl AX_CHECK_COMPILE_FLAGS\n\n# Add configure option --enable-maintainer-mode which enables\n# dependency checking and generation useful to package maintainers.\n# This is made an option to avoid confusing end users.\nAM_MAINTAINER_MODE\n\n# Check for programs\nAC_PROG_CC\nAC_PROG_CC_STDC\nAC_PROG_CPP\nAC_PROG_INSTALL\nAC_PROG_MAKE_SET\nAC_PROG_LN_S\nAM_PROG_AR\nAM_PROG_AS\n\n# Check if LD supports linker scripts,\n# and define automake conditional HAVE_LD_VERSION_SCRIPT if so.\nAC_ARG_ENABLE([ld-version-script],\n  AS_HELP_STRING([--enable-ld-version-script],\n    [enable linker version script (default is enabled when possible)]),\n    [have_ld_version_script=$enableval], [])\nif test -z \"$have_ld_version_script\"; then\n  AC_MSG_CHECKING([if LD -Wl,--version-script works])\n  save_LDFLAGS=\"$LDFLAGS\"\n  LDFLAGS=\"$LDFLAGS -Wl,--version-script=conftest.map\"\n  cat > conftest.map <<EOF\nVERS_1 {\n        global: sym;\n};\n\nVERS_2 {\n        global: sym;\n} VERS_1;\nEOF\n  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],\n                 [have_ld_version_script=yes], [have_ld_version_script=no])\n  rm -f conftest.map\n  LDFLAGS=\"$save_LDFLAGS\"\n  AC_MSG_RESULT($have_ld_version_script)\nfi\nAM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test \"$have_ld_version_script\" = \"yes\")\n\n# See if compiler supports prototypes.\nAC_MSG_CHECKING([for function prototypes])\nAC_CACHE_VAL([ijg_cv_have_prototypes],\n[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[\nint testfunction (int arg1, int * arg2); /* check prototypes */\nstruct methods_struct {\t\t/* check method-pointer declarations */\n  int (*error_exit) (char *msgtext);\n  int (*trace_message) (char *msgtext);\n  int (*another_method) (void);\n};\nint testfunction (int arg1, int * arg2) /* check definitions */\n{ return arg2[arg1]; }\nint test2function (void)\t/* check void arg list */\n{ return 0; }\n]])],\n          [ijg_cv_have_prototypes=yes],\n          [ijg_cv_have_prototypes=no])])\nAC_MSG_RESULT([$ijg_cv_have_prototypes])\nif test $ijg_cv_have_prototypes = yes; then\n  AC_DEFINE([HAVE_PROTOTYPES],[1],[Compiler supports function prototypes.])\nelse\n  AC_MSG_WARN([Your compiler does not seem to know about function prototypes.\n    Perhaps it needs a special switch to enable ANSI C mode.\n    If so, we recommend running configure like this:\n       ./configure  CC='cc -switch'\n    where -switch is the proper switch.])\nfi\n\n# Check header files\nAC_CHECK_HEADERS([stddef.h stdlib.h locale.h])\nAC_CHECK_HEADER([string.h], [],\n [AC_DEFINE([NEED_BSD_STRINGS], [1],\n            [Compiler has <strings.h> rather than standard <string.h>.])])\n\nAX_CHECK_COMPILE_FLAG([-msse4.2],\n  AC_CHECK_HEADER([immintrin.h],\n    AX_APPEND_FLAG([-DUSE_SSE -msse4.2])))\n\nAX_CHECK_COMPILE_FLAG([-march=armv8-a],\n  AC_CHECK_HEADER([arm_neon.h],\n    AX_APPEND_FLAG([-DUSE_NEON -march=armv8-a]) CCASFLAGS=\"-DUSE_NEON\" ))\n\n# See whether type size_t is defined in any ANSI-standard places;\n# if not, perhaps it is defined in <sys/types.h>.\nAC_MSG_CHECKING([for size_t])\nAC_TRY_COMPILE([\n#ifdef HAVE_STDDEF_H\n#include <stddef.h>\n#endif\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#include <stdio.h>\n#ifdef NEED_BSD_STRINGS\n#include <strings.h>\n#else\n#include <string.h>\n#endif\ntypedef size_t my_size_t;\n],\n      [ my_size_t foovar; ],\n      [ijg_size_t_ok=yes],\n      [ijg_size_t_ok=\"not ANSI, perhaps it is in sys/types.h\"])\nAC_MSG_RESULT([$ijg_size_t_ok])\nif test \"$ijg_size_t_ok\" != yes; then\n  AC_CHECK_HEADER([sys/types.h],\n     [AC_DEFINE([NEED_SYS_TYPES_H], [1],\n                [Need to include <sys/types.h> in order to obtain size_t.])\n      AC_EGREP_CPP([size_t], [#include <sys/types.h>],\n                   [ijg_size_t_ok=\"size_t is in sys/types.h\"],\n                   [ijg_size_t_ok=no])],\n     [ijg_size_t_ok=no])\n  AC_MSG_RESULT([$ijg_size_t_ok])\n  if test \"$ijg_size_t_ok\" = no; then\n    AC_MSG_WARN([Type size_t is not defined in any of the usual places.\n      Try putting '\"typedef unsigned int size_t;\"' in jconfig.h.])\n  fi\nfi\n\n# Check compiler characteristics\nAC_MSG_CHECKING([for type unsigned char])\nAC_TRY_COMPILE([], [ unsigned char un_char; ],\n [AC_MSG_RESULT(yes)\n  AC_DEFINE([HAVE_UNSIGNED_CHAR], [1],\n            [Compiler supports 'unsigned char'.])],\n [AC_MSG_RESULT(no)])\n\nAC_MSG_CHECKING([for type unsigned short])\nAC_TRY_COMPILE([], [ unsigned short un_short; ],\n  [AC_MSG_RESULT(yes)\n   AC_DEFINE([HAVE_UNSIGNED_SHORT], [1],\n             [Compiler supports 'unsigned short'.])],\n  [AC_MSG_RESULT(no)])\n\nAC_MSG_CHECKING([for type void])\nAC_TRY_COMPILE([\n/* Caution: a C++ compiler will insist on valid prototypes */\ntypedef void * void_ptr;\t/* check void * */\n#ifdef HAVE_PROTOTYPES\t\t/* check ptr to function returning void */\ntypedef void (*void_func) (int a, int b);\n#else\ntypedef void (*void_func) ();\n#endif\n\n#ifdef HAVE_PROTOTYPES\t\t/* check void function result */\nvoid test3function (void_ptr arg1, void_func arg2)\n#else\nvoid test3function (arg1, arg2)\n     void_ptr arg1;\n     void_func arg2;\n#endif\n{\n  char * locptr = (char *) arg1; /* check casting to and from void * */\n  arg1 = (void *) locptr;\n  (*arg2) (1, 2);\t\t/* check call of fcn returning void */\n}\n], [ ],\n        [AC_MSG_RESULT(yes)],\n        [AC_MSG_RESULT(no)\n         AC_DEFINE([void], [char],\n                   [Define 'void' as 'char' for archaic compilers\n                    that don't understand it.])])\nAC_C_CONST\n\n# Check for non-broken inline under various spellings\nAC_MSG_CHECKING([for inline])\nijg_cv_inline=\"\"\nAC_TRY_COMPILE([], [} __inline__ int foo() { return 0; }\nint bar() { return foo();], ijg_cv_inline=\"__inline__\",\n[AC_TRY_COMPILE(, [} __inline int foo() { return 0; }\nint bar() { return foo();], ijg_cv_inline=\"__inline\",\n[AC_TRY_COMPILE(, [} inline int foo() { return 0; }\nint bar() { return foo();], ijg_cv_inline=\"inline\")])])\nAC_MSG_RESULT($ijg_cv_inline)\nAC_DEFINE_UNQUOTED([INLINE], [$ijg_cv_inline],\n                   [How to obtain function inlining.])\n\n# We cannot check for bogus warnings, but at least we can check for errors\nAC_MSG_CHECKING([for broken incomplete types])\nAC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ],\n               [],\n               [AC_MSG_RESULT(ok)],\n               [AC_MSG_RESULT(broken)\n                AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1],\n                          [Compiler does not support pointers to unspecified\n                           structures.])])\n\n# Test whether global names are unique to at least 15 chars\nAC_MSG_CHECKING([for short external names])\nAC_TRY_LINK([\nint possibly_duplicate_function () { return 0; }\nint possibly_dupli_function () { return 1; }\n], [],\n            [AC_MSG_RESULT(ok)],\n            [AC_MSG_RESULT(short)\n             AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], [1],\n                       [Linker requires that global names be unique in\n                        first 15 characters.])])\n\n# Run-time checks\nAC_MSG_CHECKING([to see if char is signed])\nAC_TRY_RUN([\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#include <stdio.h>\n#ifdef HAVE_PROTOTYPES\nint is_char_signed (int arg)\n#else\nint is_char_signed (arg)\n     int arg;\n#endif\n{\n  if (arg == 189) {\t\t/* expected result for unsigned char */\n    return 0;\t\t\t/* type char is unsigned */\n  }\n  else if (arg != -67) {\t/* expected result for signed char */\n    printf(\"Hmm, it seems 'char' is not eight bits wide on your machine.\\n\");\n    printf(\"I fear the JPEG software will not work at all.\\n\\n\");\n  }\n  return 1;\t\t\t/* assume char is signed otherwise */\n}\nchar signed_char_check = (char) (-67);\nint main() {\n  exit(is_char_signed((int) signed_char_check));\n}], [AC_MSG_RESULT(no)\n     AC_DEFINE([CHAR_IS_UNSIGNED], [1],\n               [Characters are unsigned])],\n               [AC_MSG_RESULT(yes)],\n[AC_MSG_WARN([Assuming that char is signed on target machine.\n    If it is unsigned, this will be a little bit inefficient.])\n])\n\nAC_MSG_CHECKING([to see if right shift is signed])\nAC_TRY_RUN([\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#include <stdio.h>\n#ifdef HAVE_PROTOTYPES\nint is_shifting_signed (long arg)\n#else\nint is_shifting_signed (arg)\n     long arg;\n#endif\n/* See whether right-shift on a long is signed or not. */\n{\n  long res = arg >> 4;\n\n  if (res == -0x7F7E80CL) {\t/* expected result for signed shift */\n    return 1;\t\t\t/* right shift is signed */\n  }\n  /* see if unsigned-shift hack will fix it. */\n  /* we can't just test exact value since it depends on width of long... */\n  res |= (~0L) << (32-4);\n  if (res == -0x7F7E80CL) {\t/* expected result now? */\n    return 0;\t\t\t/* right shift is unsigned */\n  }\n  printf(\"Right shift isn't acting as I expect it to.\\n\");\n  printf(\"I fear the JPEG software will not work at all.\\n\\n\");\n  return 0;\t\t\t/* try it with unsigned anyway */\n}\nint main() {\n  exit(is_shifting_signed(-0x7F7E80B1L));\n}],\n      [AC_MSG_RESULT(no)\n       AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], [1],\n                 [Broken compiler shifts signed values as an unsigned shift.])],\n       [AC_MSG_RESULT(yes)],\n       [AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])\n\nAC_MSG_CHECKING([to see if fopen accepts b spec])\nAC_TRY_RUN([\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#include <stdio.h>\nint main() {\n  if (fopen(\"conftestdata\", \"wb\") != NULL)\n    exit(0);\n  exit(1);\n}],\n          [AC_MSG_RESULT(yes)],\n          [AC_MSG_RESULT(no)\n           AC_DEFINE([DONT_USE_B_MODE], [1],\n                     [Don't open files in binary mode.])],\n          [AC_MSG_RESULT(Assuming that it does.)])\n\n# Configure libtool\nAC_LIBTOOL_WIN32_DLL\nAC_PROG_LIBTOOL\n\n# Select memory manager depending on user input.\n# If no \"-enable-maxmem\", use jmemnobs\nMEMORYMGR='jmemnobs'\nMAXMEM=\"no\"\nAC_ARG_ENABLE([maxmem],\n[  --enable-maxmem[=N]     enable use of temp files, set max mem usage to N MB],\n[MAXMEM=\"$enableval\"])\ndnl [# support --with-maxmem for backwards compatibility with IJG V5.]\ndnl AC_ARG_WITH(maxmem, , MAXMEM=\"$withval\")\nif test \"x$MAXMEM\" = xyes; then\n  MAXMEM=1\nfi\nif test \"x$MAXMEM\" != xno; then\n  if test -n \"`echo $MAXMEM | sed 's/[[0-9]]//g'`\"; then\n    AC_MSG_ERROR(non-numeric argument to --enable-maxmem)\n  fi\n  DEFAULTMAXMEM=`expr $MAXMEM \\* 1048576`\n  AC_DEFINE_UNQUOTED([DEFAULT_MAX_MEM], [${DEFAULTMAXMEM}],\n                     [Maximum data space library will allocate.])\n  AC_MSG_CHECKING([for 'tmpfile()'])\n  AC_TRY_LINK([#include <stdio.h>], [ FILE * tfile = tmpfile(); ],\n    [AC_MSG_RESULT(yes)\n    MEMORYMGR='jmemansi'],\n    [AC_MSG_RESULT(no)\n    dnl if tmpfile is not present, must use jmemname.\n    MEMORYMGR='jmemname'\n\n    # Test for the need to remove temporary files using a signal handler\n    # (for cjpeg/djpeg)\n    AC_DEFINE([NEED_SIGNAL_CATCHER], [1],\n              [Need signal handler to clean up temporary files.])\n    AC_MSG_CHECKING([for 'mktemp()'])\n    AC_TRY_LINK([], [ char fname[80]; mktemp(fname); ],\n                [AC_MSG_RESULT(yes)],\n                [AC_MSG_RESULT(no)\n                 AC_DEFINE([NO_MKTEMP], [1],\n                           [The mktemp() function is not available.])])])\nfi\nAC_SUBST([MEMORYMGR])\n\n# Extract the library version IDs from jpeglib.h.\nAC_MSG_CHECKING([libjpeg version number])\n[major=`sed -ne 's/^#define JPEG_LIB_VERSION_MAJOR *\\([0-9][0-9]*\\).*$/\\1/p' $srcdir/jpeglib.h`\nminor=`sed -ne 's/^#define JPEG_LIB_VERSION_MINOR *\\([0-9][0-9]*\\).*$/\\1/p' $srcdir/jpeglib.h`]\nAC_SUBST([JPEG_LIB_VERSION],\n         [`expr $major + $minor`:0:$minor])\nAC_MSG_RESULT([$JPEG_LIB_VERSION])\n\nAC_CONFIG_FILES([Makefile])\nAC_OUTPUT\n"
  },
  {
    "path": "depcomp",
    "content": "#! /bin/sh\n# depcomp - compile a program generating dependencies as side-effects\n\nscriptversion=2013-05-30.07; # UTC\n\n# Copyright (C) 1999-2014 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.\n\ncase $1 in\n  '')\n    echo \"$0: No command.  Try '$0 --help' for more information.\" 1>&2\n    exit 1;\n    ;;\n  -h | --h*)\n    cat <<\\EOF\nUsage: depcomp [--help] [--version] PROGRAM [ARGS]\n\nRun PROGRAMS ARGS to compile a file, generating dependencies\nas side-effects.\n\nEnvironment variables:\n  depmode     Dependency tracking mode.\n  source      Source file read by 'PROGRAMS ARGS'.\n  object      Object file output by 'PROGRAMS ARGS'.\n  DEPDIR      directory where to store dependencies.\n  depfile     Dependency file to output.\n  tmpdepfile  Temporary file to use when outputting dependencies.\n  libtool     Whether libtool is used (yes/no).\n\nReport bugs to <bug-automake@gnu.org>.\nEOF\n    exit $?\n    ;;\n  -v | --v*)\n    echo \"depcomp $scriptversion\"\n    exit $?\n    ;;\nesac\n\n# Get the directory component of the given path, and save it in the\n# global variables '$dir'.  Note that this directory component will\n# be either empty or ending with a '/' character.  This is deliberate.\nset_dir_from ()\n{\n  case $1 in\n    */*) dir=`echo \"$1\" | sed -e 's|/[^/]*$|/|'`;;\n      *) dir=;;\n  esac\n}\n\n# Get the suffix-stripped basename of the given path, and save it the\n# global variable '$base'.\nset_base_from ()\n{\n  base=`echo \"$1\" | sed -e 's|^.*/||' -e 's/\\.[^.]*$//'`\n}\n\n# If no dependency file was actually created by the compiler invocation,\n# we still have to create a dummy depfile, to avoid errors with the\n# Makefile \"include basename.Plo\" scheme.\nmake_dummy_depfile ()\n{\n  echo \"#dummy\" > \"$depfile\"\n}\n\n# Factor out some common post-processing of the generated depfile.\n# Requires the auxiliary global variable '$tmpdepfile' to be set.\naix_post_process_depfile ()\n{\n  # If the compiler actually managed to produce a dependency file,\n  # post-process it.\n  if test -f \"$tmpdepfile\"; then\n    # Each line is of the form 'foo.o: dependency.h'.\n    # Do two passes, one to just change these to\n    #   $object: dependency.h\n    # and one to simply output\n    #   dependency.h:\n    # which is needed to avoid the deleted-header problem.\n    { sed -e \"s,^.*\\.[$lower]*:,$object:,\" < \"$tmpdepfile\"\n      sed -e \"s,^.*\\.[$lower]*:[$tab ]*,,\" -e 's,$,:,' < \"$tmpdepfile\"\n    } > \"$depfile\"\n    rm -f \"$tmpdepfile\"\n  else\n    make_dummy_depfile\n  fi\n}\n\n# A tabulation character.\ntab='\t'\n# A newline character.\nnl='\n'\n# Character ranges might be problematic outside the C locale.\n# These definitions help.\nupper=ABCDEFGHIJKLMNOPQRSTUVWXYZ\nlower=abcdefghijklmnopqrstuvwxyz\ndigits=0123456789\nalpha=${upper}${lower}\n\nif test -z \"$depmode\" || test -z \"$source\" || test -z \"$object\"; then\n  echo \"depcomp: Variables source, object and depmode must be set\" 1>&2\n  exit 1\nfi\n\n# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.\ndepfile=${depfile-`echo \"$object\" |\n  sed 's|[^\\\\/]*$|'${DEPDIR-.deps}'/&|;s|\\.\\([^.]*\\)$|.P\\1|;s|Pobj$|Po|'`}\ntmpdepfile=${tmpdepfile-`echo \"$depfile\" | sed 's/\\.\\([^.]*\\)$/.T\\1/'`}\n\nrm -f \"$tmpdepfile\"\n\n# Avoid interferences from the environment.\ngccflag= dashmflag=\n\n# Some modes work just like other modes, but use different flags.  We\n# parameterize here, but still list the modes in the big case below,\n# to make depend.m4 easier to write.  Note that we *cannot* use a case\n# here, because this file can only contain one case statement.\nif test \"$depmode\" = hp; then\n  # HP compiler uses -M and no extra arg.\n  gccflag=-M\n  depmode=gcc\nfi\n\nif test \"$depmode\" = dashXmstdout; then\n  # This is just like dashmstdout with a different argument.\n  dashmflag=-xM\n  depmode=dashmstdout\nfi\n\ncygpath_u=\"cygpath -u -f -\"\nif test \"$depmode\" = msvcmsys; then\n  # This is just like msvisualcpp but w/o cygpath translation.\n  # Just convert the backslash-escaped backslashes to single forward\n  # slashes to satisfy depend.m4\n  cygpath_u='sed s,\\\\\\\\,/,g'\n  depmode=msvisualcpp\nfi\n\nif test \"$depmode\" = msvc7msys; then\n  # This is just like msvc7 but w/o cygpath translation.\n  # Just convert the backslash-escaped backslashes to single forward\n  # slashes to satisfy depend.m4\n  cygpath_u='sed s,\\\\\\\\,/,g'\n  depmode=msvc7\nfi\n\nif test \"$depmode\" = xlc; then\n  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.\n  gccflag=-qmakedep=gcc,-MF\n  depmode=gcc\nfi\n\ncase \"$depmode\" in\ngcc3)\n## gcc 3 implements dependency tracking that does exactly what\n## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like\n## it if -MD -MP comes after the -MF stuff.  Hmm.\n## Unfortunately, FreeBSD c89 acceptance of flags depends upon\n## the command line argument order; so add the flags where they\n## appear in depend2.am.  Note that the slowdown incurred here\n## affects only configure: in makefiles, %FASTDEP% shortcuts this.\n  for arg\n  do\n    case $arg in\n    -c) set fnord \"$@\" -MT \"$object\" -MD -MP -MF \"$tmpdepfile\" \"$arg\" ;;\n    *)  set fnord \"$@\" \"$arg\" ;;\n    esac\n    shift # fnord\n    shift # $arg\n  done\n  \"$@\"\n  stat=$?\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  mv \"$tmpdepfile\" \"$depfile\"\n  ;;\n\ngcc)\n## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.\n## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.\n## (see the conditional assignment to $gccflag above).\n## There are various ways to get dependency output from gcc.  Here's\n## why we pick this rather obscure method:\n## - Don't want to use -MD because we'd like the dependencies to end\n##   up in a subdir.  Having to rename by hand is ugly.\n##   (We might end up doing this anyway to support other compilers.)\n## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like\n##   -MM, not -M (despite what the docs say).  Also, it might not be\n##   supported by the other compilers which use the 'gcc' depmode.\n## - Using -M directly means running the compiler twice (even worse\n##   than renaming).\n  if test -z \"$gccflag\"; then\n    gccflag=-MD,\n  fi\n  \"$@\" -Wp,\"$gccflag$tmpdepfile\"\n  stat=$?\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n  echo \"$object : \\\\\" > \"$depfile\"\n  # The second -e expression handles DOS-style file names with drive\n  # letters.\n  sed -e 's/^[^:]*: / /' \\\n      -e 's/^['$alpha']:\\/[^:]*: / /' < \"$tmpdepfile\" >> \"$depfile\"\n## This next piece of magic avoids the \"deleted header file\" problem.\n## The problem is that when a header file which appears in a .P file\n## is deleted, the dependency causes make to die (because there is\n## typically no way to rebuild the header).  We avoid this by adding\n## dummy dependencies for each header file.  Too bad gcc doesn't do\n## this for us directly.\n## Some versions of gcc put a space before the ':'.  On the theory\n## that the space means something, we add a space to the output as\n## well.  hp depmode also adds that space, but also prefixes the VPATH\n## to the object.  Take care to not repeat it in the output.\n## Some versions of the HPUX 10.20 sed can't process this invocation\n## correctly.  Breaking it into two sed invocations is a workaround.\n  tr ' ' \"$nl\" < \"$tmpdepfile\" \\\n    | sed -e 's/^\\\\$//' -e '/^$/d' -e \"s|.*$object$||\" -e '/:$/d' \\\n    | sed -e 's/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\nhp)\n  # This case exists only to let depend.m4 do its work.  It works by\n  # looking at the text of this script.  This case will never be run,\n  # since it is checked for above.\n  exit 1\n  ;;\n\nsgi)\n  if test \"$libtool\" = yes; then\n    \"$@\" \"-Wp,-MDupdate,$tmpdepfile\"\n  else\n    \"$@\" -MDupdate \"$tmpdepfile\"\n  fi\n  stat=$?\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n\n  if test -f \"$tmpdepfile\"; then  # yes, the sourcefile depend on other files\n    echo \"$object : \\\\\" > \"$depfile\"\n    # Clip off the initial element (the dependent).  Don't try to be\n    # clever and replace this with sed code, as IRIX sed won't handle\n    # lines with more than a fixed number of characters (4096 in\n    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;\n    # the IRIX cc adds comments like '#:fec' to the end of the\n    # dependency line.\n    tr ' ' \"$nl\" < \"$tmpdepfile\" \\\n      | sed -e 's/^.*\\.o://' -e 's/#.*$//' -e '/^$/ d' \\\n      | tr \"$nl\" ' ' >> \"$depfile\"\n    echo >> \"$depfile\"\n    # The second pass generates a dummy entry for each header file.\n    tr ' ' \"$nl\" < \"$tmpdepfile\" \\\n      | sed -e 's/^.*\\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \\\n      >> \"$depfile\"\n  else\n    make_dummy_depfile\n  fi\n  rm -f \"$tmpdepfile\"\n  ;;\n\nxlc)\n  # This case exists only to let depend.m4 do its work.  It works by\n  # looking at the text of this script.  This case will never be run,\n  # since it is checked for above.\n  exit 1\n  ;;\n\naix)\n  # The C for AIX Compiler uses -M and outputs the dependencies\n  # in a .u file.  In older versions, this file always lives in the\n  # current directory.  Also, the AIX compiler puts '$object:' at the\n  # start of each line; $object doesn't have directory information.\n  # Version 6 uses the directory in both cases.\n  set_dir_from \"$object\"\n  set_base_from \"$object\"\n  if test \"$libtool\" = yes; then\n    tmpdepfile1=$dir$base.u\n    tmpdepfile2=$base.u\n    tmpdepfile3=$dir.libs/$base.u\n    \"$@\" -Wc,-M\n  else\n    tmpdepfile1=$dir$base.u\n    tmpdepfile2=$dir$base.u\n    tmpdepfile3=$dir$base.u\n    \"$@\" -M\n  fi\n  stat=$?\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile1\" \"$tmpdepfile2\" \"$tmpdepfile3\"\n    exit $stat\n  fi\n\n  for tmpdepfile in \"$tmpdepfile1\" \"$tmpdepfile2\" \"$tmpdepfile3\"\n  do\n    test -f \"$tmpdepfile\" && break\n  done\n  aix_post_process_depfile\n  ;;\n\ntcc)\n  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26\n  # FIXME: That version still under development at the moment of writing.\n  #        Make that this statement remains true also for stable, released\n  #        versions.\n  # It will wrap lines (doesn't matter whether long or short) with a\n  # trailing '\\', as in:\n  #\n  #   foo.o : \\\n  #    foo.c \\\n  #    foo.h \\\n  #\n  # It will put a trailing '\\' even on the last line, and will use leading\n  # spaces rather than leading tabs (at least since its commit 0394caf7\n  # \"Emit spaces for -MD\").\n  \"$@\" -MD -MF \"$tmpdepfile\"\n  stat=$?\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n  # Each non-empty line is of the form 'foo.o : \\' or ' dep.h \\'.\n  # We have to change lines of the first kind to '$object: \\'.\n  sed -e \"s|.*:|$object :|\" < \"$tmpdepfile\" > \"$depfile\"\n  # And for each line of the second kind, we have to emit a 'dep.h:'\n  # dummy dependency, to avoid the deleted-header problem.\n  sed -n -e 's|^  *\\(.*\\) *\\\\$|\\1:|p' < \"$tmpdepfile\" >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\n## The order of this option in the case statement is important, since the\n## shell code in configure will try each of these formats in the order\n## listed in this file.  A plain '-MD' option would be understood by many\n## compilers, so we must ensure this comes after the gcc and icc options.\npgcc)\n  # Portland's C compiler understands '-MD'.\n  # Will always output deps to 'file.d' where file is the root name of the\n  # source file under compilation, even if file resides in a subdirectory.\n  # The object file name does not affect the name of the '.d' file.\n  # pgcc 10.2 will output\n  #    foo.o: sub/foo.c sub/foo.h\n  # and will wrap long lines using '\\' :\n  #    foo.o: sub/foo.c ... \\\n  #     sub/foo.h ... \\\n  #     ...\n  set_dir_from \"$object\"\n  # Use the source, not the object, to determine the base name, since\n  # that's sadly what pgcc will do too.\n  set_base_from \"$source\"\n  tmpdepfile=$base.d\n\n  # For projects that build the same source file twice into different object\n  # files, the pgcc approach of using the *source* file root name can cause\n  # problems in parallel builds.  Use a locking strategy to avoid stomping on\n  # the same $tmpdepfile.\n  lockdir=$base.d-lock\n  trap \"\n    echo '$0: caught signal, cleaning up...' >&2\n    rmdir '$lockdir'\n    exit 1\n  \" 1 2 13 15\n  numtries=100\n  i=$numtries\n  while test $i -gt 0; do\n    # mkdir is a portable test-and-set.\n    if mkdir \"$lockdir\" 2>/dev/null; then\n      # This process acquired the lock.\n      \"$@\" -MD\n      stat=$?\n      # Release the lock.\n      rmdir \"$lockdir\"\n      break\n    else\n      # If the lock is being held by a different process, wait\n      # until the winning process is done or we timeout.\n      while test -d \"$lockdir\" && test $i -gt 0; do\n        sleep 1\n        i=`expr $i - 1`\n      done\n    fi\n    i=`expr $i - 1`\n  done\n  trap - 1 2 13 15\n  if test $i -le 0; then\n    echo \"$0: failed to acquire lock after $numtries attempts\" >&2\n    echo \"$0: check lockdir '$lockdir'\" >&2\n    exit 1\n  fi\n\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n  # Each line is of the form `foo.o: dependent.h',\n  # or `foo.o: dep1.h dep2.h \\', or ` dep3.h dep4.h \\'.\n  # Do two passes, one to just change these to\n  # `$object: dependent.h' and one to simply `dependent.h:'.\n  sed \"s,^[^:]*:,$object :,\" < \"$tmpdepfile\" > \"$depfile\"\n  # Some versions of the HPUX 10.20 sed can't process this invocation\n  # correctly.  Breaking it into two sed invocations is a workaround.\n  sed 's,^[^:]*: \\(.*\\)$,\\1,;s/^\\\\$//;/^$/d;/:$/d' < \"$tmpdepfile\" \\\n    | sed -e 's/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\nhp2)\n  # The \"hp\" stanza above does not work with aCC (C++) and HP's ia64\n  # compilers, which have integrated preprocessors.  The correct option\n  # to use with these is +Maked; it writes dependencies to a file named\n  # 'foo.d', which lands next to the object file, wherever that\n  # happens to be.\n  # Much of this is similar to the tru64 case; see comments there.\n  set_dir_from  \"$object\"\n  set_base_from \"$object\"\n  if test \"$libtool\" = yes; then\n    tmpdepfile1=$dir$base.d\n    tmpdepfile2=$dir.libs/$base.d\n    \"$@\" -Wc,+Maked\n  else\n    tmpdepfile1=$dir$base.d\n    tmpdepfile2=$dir$base.d\n    \"$@\" +Maked\n  fi\n  stat=$?\n  if test $stat -ne 0; then\n     rm -f \"$tmpdepfile1\" \"$tmpdepfile2\"\n     exit $stat\n  fi\n\n  for tmpdepfile in \"$tmpdepfile1\" \"$tmpdepfile2\"\n  do\n    test -f \"$tmpdepfile\" && break\n  done\n  if test -f \"$tmpdepfile\"; then\n    sed -e \"s,^.*\\.[$lower]*:,$object:,\" \"$tmpdepfile\" > \"$depfile\"\n    # Add 'dependent.h:' lines.\n    sed -ne '2,${\n               s/^ *//\n               s/ \\\\*$//\n               s/$/:/\n               p\n             }' \"$tmpdepfile\" >> \"$depfile\"\n  else\n    make_dummy_depfile\n  fi\n  rm -f \"$tmpdepfile\" \"$tmpdepfile2\"\n  ;;\n\ntru64)\n  # The Tru64 compiler uses -MD to generate dependencies as a side\n  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.\n  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put\n  # dependencies in 'foo.d' instead, so we check for that too.\n  # Subdirectories are respected.\n  set_dir_from  \"$object\"\n  set_base_from \"$object\"\n\n  if test \"$libtool\" = yes; then\n    # Libtool generates 2 separate objects for the 2 libraries.  These\n    # two compilations output dependencies in $dir.libs/$base.o.d and\n    # in $dir$base.o.d.  We have to check for both files, because\n    # one of the two compilations can be disabled.  We should prefer\n    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is\n    # automatically cleaned when .libs/ is deleted, while ignoring\n    # the former would cause a distcleancheck panic.\n    tmpdepfile1=$dir$base.o.d          # libtool 1.5\n    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.\n    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504\n    \"$@\" -Wc,-MD\n  else\n    tmpdepfile1=$dir$base.d\n    tmpdepfile2=$dir$base.d\n    tmpdepfile3=$dir$base.d\n    \"$@\" -MD\n  fi\n\n  stat=$?\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile1\" \"$tmpdepfile2\" \"$tmpdepfile3\"\n    exit $stat\n  fi\n\n  for tmpdepfile in \"$tmpdepfile1\" \"$tmpdepfile2\" \"$tmpdepfile3\"\n  do\n    test -f \"$tmpdepfile\" && break\n  done\n  # Same post-processing that is required for AIX mode.\n  aix_post_process_depfile\n  ;;\n\nmsvc7)\n  if test \"$libtool\" = yes; then\n    showIncludes=-Wc,-showIncludes\n  else\n    showIncludes=-showIncludes\n  fi\n  \"$@\" $showIncludes > \"$tmpdepfile\"\n  stat=$?\n  grep -v '^Note: including file: ' \"$tmpdepfile\"\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n  echo \"$object : \\\\\" > \"$depfile\"\n  # The first sed program below extracts the file names and escapes\n  # backslashes for cygpath.  The second sed program outputs the file\n  # name when reading, but also accumulates all include files in the\n  # hold buffer in order to output them again at the end.  This only\n  # works with sed implementations that can handle large buffers.\n  sed < \"$tmpdepfile\" -n '\n/^Note: including file:  *\\(.*\\)/ {\n  s//\\1/\n  s/\\\\/\\\\\\\\/g\n  p\n}' | $cygpath_u | sort -u | sed -n '\ns/ /\\\\ /g\ns/\\(.*\\)/'\"$tab\"'\\1 \\\\/p\ns/.\\(.*\\) \\\\/\\1:/\nH\n$ {\n  s/.*/'\"$tab\"'/\n  G\n  p\n}' >> \"$depfile\"\n  echo >> \"$depfile\" # make sure the fragment doesn't end with a backslash\n  rm -f \"$tmpdepfile\"\n  ;;\n\nmsvc7msys)\n  # This case exists only to let depend.m4 do its work.  It works by\n  # looking at the text of this script.  This case will never be run,\n  # since it is checked for above.\n  exit 1\n  ;;\n\n#nosideeffect)\n  # This comment above is used by automake to tell side-effect\n  # dependency tracking mechanisms from slower ones.\n\ndashmstdout)\n  # Important note: in order to support this mode, a compiler *must*\n  # always write the preprocessed file to stdout, regardless of -o.\n  \"$@\" || exit $?\n\n  # Remove the call to Libtool.\n  if test \"$libtool\" = yes; then\n    while test \"X$1\" != 'X--mode=compile'; do\n      shift\n    done\n    shift\n  fi\n\n  # Remove '-o $object'.\n  IFS=\" \"\n  for arg\n  do\n    case $arg in\n    -o)\n      shift\n      ;;\n    $object)\n      shift\n      ;;\n    *)\n      set fnord \"$@\" \"$arg\"\n      shift # fnord\n      shift # $arg\n      ;;\n    esac\n  done\n\n  test -z \"$dashmflag\" && dashmflag=-M\n  # Require at least two characters before searching for ':'\n  # in the target name.  This is to cope with DOS-style filenames:\n  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.\n  \"$@\" $dashmflag |\n    sed \"s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |\" > \"$tmpdepfile\"\n  rm -f \"$depfile\"\n  cat < \"$tmpdepfile\" > \"$depfile\"\n  # Some versions of the HPUX 10.20 sed can't process this sed invocation\n  # correctly.  Breaking it into two sed invocations is a workaround.\n  tr ' ' \"$nl\" < \"$tmpdepfile\" \\\n    | sed -e 's/^\\\\$//' -e '/^$/d' -e '/:$/d' \\\n    | sed -e 's/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\ndashXmstdout)\n  # This case only exists to satisfy depend.m4.  It is never actually\n  # run, as this mode is specially recognized in the preamble.\n  exit 1\n  ;;\n\nmakedepend)\n  \"$@\" || exit $?\n  # Remove any Libtool call\n  if test \"$libtool\" = yes; then\n    while test \"X$1\" != 'X--mode=compile'; do\n      shift\n    done\n    shift\n  fi\n  # X makedepend\n  shift\n  cleared=no eat=no\n  for arg\n  do\n    case $cleared in\n    no)\n      set \"\"; shift\n      cleared=yes ;;\n    esac\n    if test $eat = yes; then\n      eat=no\n      continue\n    fi\n    case \"$arg\" in\n    -D*|-I*)\n      set fnord \"$@\" \"$arg\"; shift ;;\n    # Strip any option that makedepend may not understand.  Remove\n    # the object too, otherwise makedepend will parse it as a source file.\n    -arch)\n      eat=yes ;;\n    -*|$object)\n      ;;\n    *)\n      set fnord \"$@\" \"$arg\"; shift ;;\n    esac\n  done\n  obj_suffix=`echo \"$object\" | sed 's/^.*\\././'`\n  touch \"$tmpdepfile\"\n  ${MAKEDEPEND-makedepend} -o\"$obj_suffix\" -f\"$tmpdepfile\" \"$@\"\n  rm -f \"$depfile\"\n  # makedepend may prepend the VPATH from the source file name to the object.\n  # No need to regex-escape $object, excess matching of '.' is harmless.\n  sed \"s|^.*\\($object *:\\)|\\1|\" \"$tmpdepfile\" > \"$depfile\"\n  # Some versions of the HPUX 10.20 sed can't process the last invocation\n  # correctly.  Breaking it into two sed invocations is a workaround.\n  sed '1,2d' \"$tmpdepfile\" \\\n    | tr ' ' \"$nl\" \\\n    | sed -e 's/^\\\\$//' -e '/^$/d' -e '/:$/d' \\\n    | sed -e 's/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\" \"$tmpdepfile\".bak\n  ;;\n\ncpp)\n  # Important note: in order to support this mode, a compiler *must*\n  # always write the preprocessed file to stdout.\n  \"$@\" || exit $?\n\n  # Remove the call to Libtool.\n  if test \"$libtool\" = yes; then\n    while test \"X$1\" != 'X--mode=compile'; do\n      shift\n    done\n    shift\n  fi\n\n  # Remove '-o $object'.\n  IFS=\" \"\n  for arg\n  do\n    case $arg in\n    -o)\n      shift\n      ;;\n    $object)\n      shift\n      ;;\n    *)\n      set fnord \"$@\" \"$arg\"\n      shift # fnord\n      shift # $arg\n      ;;\n    esac\n  done\n\n  \"$@\" -E \\\n    | sed -n -e '/^# [0-9][0-9]* \"\\([^\"]*\\)\".*/ s:: \\1 \\\\:p' \\\n             -e '/^#line [0-9][0-9]* \"\\([^\"]*\\)\".*/ s:: \\1 \\\\:p' \\\n    | sed '$ s: \\\\$::' > \"$tmpdepfile\"\n  rm -f \"$depfile\"\n  echo \"$object : \\\\\" > \"$depfile\"\n  cat < \"$tmpdepfile\" >> \"$depfile\"\n  sed < \"$tmpdepfile\" '/^$/d;s/^ //;s/ \\\\$//;s/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\nmsvisualcpp)\n  # Important note: in order to support this mode, a compiler *must*\n  # always write the preprocessed file to stdout.\n  \"$@\" || exit $?\n\n  # Remove the call to Libtool.\n  if test \"$libtool\" = yes; then\n    while test \"X$1\" != 'X--mode=compile'; do\n      shift\n    done\n    shift\n  fi\n\n  IFS=\" \"\n  for arg\n  do\n    case \"$arg\" in\n    -o)\n      shift\n      ;;\n    $object)\n      shift\n      ;;\n    \"-Gm\"|\"/Gm\"|\"-Gi\"|\"/Gi\"|\"-ZI\"|\"/ZI\")\n        set fnord \"$@\"\n        shift\n        shift\n        ;;\n    *)\n        set fnord \"$@\" \"$arg\"\n        shift\n        shift\n        ;;\n    esac\n  done\n  \"$@\" -E 2>/dev/null |\n  sed -n '/^#line [0-9][0-9]* \"\\([^\"]*\\)\"/ s::\\1:p' | $cygpath_u | sort -u > \"$tmpdepfile\"\n  rm -f \"$depfile\"\n  echo \"$object : \\\\\" > \"$depfile\"\n  sed < \"$tmpdepfile\" -n -e 's% %\\\\ %g' -e '/^\\(.*\\)$/ s::'\"$tab\"'\\1 \\\\:p' >> \"$depfile\"\n  echo \"$tab\" >> \"$depfile\"\n  sed < \"$tmpdepfile\" -n -e 's% %\\\\ %g' -e '/^\\(.*\\)$/ s::\\1\\::p' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\nmsvcmsys)\n  # This case exists only to let depend.m4 do its work.  It works by\n  # looking at the text of this script.  This case will never be run,\n  # since it is checked for above.\n  exit 1\n  ;;\n\nnone)\n  exec \"$@\"\n  ;;\n\n*)\n  echo \"Unknown depmode $depmode\" 1>&2\n  exit 1\n  ;;\nesac\n\nexit 0\n\n# Local Variables:\n# mode: shell-script\n# sh-indentation: 2\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"
  },
  {
    "path": "djpeg.1",
    "content": ".TH DJPEG 1 \"23 November 2013\"\n.SH NAME\ndjpeg \\- decompress a JPEG file to an image file\n.SH SYNOPSIS\n.B djpeg\n[\n.I options\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B djpeg\ndecompresses the named JPEG file, or the standard input if no file is named,\nand produces an image file on the standard output.  PBMPLUS (PPM/PGM), BMP,\nGIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.\n(RLE is supported only if the URT library is available.)\n.SH OPTIONS\nAll switch names may be abbreviated; for example,\n.B \\-grayscale\nmay be written\n.B \\-gray\nor\n.BR \\-gr .\nMost of the \"basic\" switches can be abbreviated to as little as one letter.\nUpper and lower case are equivalent (thus\n.B \\-BMP\nis the same as\n.BR \\-bmp ).\nBritish spellings are also accepted (e.g.,\n.BR \\-greyscale ),\nthough for brevity these are not mentioned below.\n.PP\nThe basic switches are:\n.TP\n.BI \\-colors \" N\"\nReduce image to at most N colors.  This reduces the number of colors used in\nthe output image, so that it can be displayed on a colormapped display or\nstored in a colormapped file format.  For example, if you have an 8-bit\ndisplay, you'd need to reduce to 256 or fewer colors.\n.TP\n.BI \\-quantize \" N\"\nSame as\n.BR \\-colors .\n.B \\-colors\nis the recommended name,\n.B \\-quantize\nis provided only for backwards compatibility.\n.TP\n.B \\-fast\nSelect recommended processing options for fast, low quality output.  (The\ndefault options are chosen for highest quality output.)  Currently, this is\nequivalent to \\fB\\-dct fast \\-nosmooth \\-onepass \\-dither ordered\\fR.\n.TP\n.B \\-grayscale\nForce gray-scale output even if JPEG file is color.  Useful for viewing on\nmonochrome displays; also,\n.B djpeg\nruns noticeably faster in this mode.\n.TP\n.BI \\-scale \" M/N\"\nScale the output image by a factor M/N.  Currently supported scale factors are\nM/N with all M from 1 to 16, where N is the source DCT size, which is 8 for\nbaseline JPEG.  If the /N part is omitted, then M specifies the DCT scaled\nsize to be applied on the given input.  For baseline JPEG this is equivalent\nto M/8 scaling, since the source DCT size for baseline JPEG is 8.\nScaling is handy if the image is larger than your screen; also,\n.B djpeg\nruns much faster when scaling down the output.\n.TP\n.B \\-bmp\nSelect BMP output format (Windows flavor).  8-bit colormapped format is\nemitted if\n.B \\-colors\nor\n.B \\-grayscale\nis specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color\nformat is emitted.\n.TP\n.B \\-gif\nSelect GIF output format.  Since GIF does not support more than 256 colors,\n.B \\-colors 256\nis assumed (unless you specify a smaller number of colors).\n.TP\n.B \\-os2\nSelect BMP output format (OS/2 1.x flavor).  8-bit colormapped format is\nemitted if\n.B \\-colors\nor\n.B \\-grayscale\nis specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color\nformat is emitted.\n.TP\n.B \\-pnm\nSelect PBMPLUS (PPM/PGM) output format (this is the default format).\nPGM is emitted if the JPEG file is gray-scale or if\n.B \\-grayscale\nis specified; otherwise PPM is emitted.\n.TP\n.B \\-rle\nSelect RLE output format.  (Requires URT library.)\n.TP\n.B \\-targa\nSelect Targa output format.  Gray-scale format is emitted if the JPEG file is\ngray-scale or if\n.B \\-grayscale\nis specified; otherwise, colormapped format is emitted if\n.B \\-colors\nis specified; otherwise, 24-bit full-color format is emitted.\n.PP\nSwitches for advanced users:\n.TP\n.B \\-dct int\nUse integer DCT method (default).\n.TP\n.B \\-dct fast\nUse fast integer DCT (less accurate).\n.TP\n.B \\-dct float\nUse floating-point DCT method.\nThe float method is very slightly more accurate than the int method, but is\nmuch slower unless your machine has very fast floating-point hardware.  Also\nnote that results of the floating-point method may vary slightly across\nmachines, while the integer methods should give the same results everywhere.\nThe fast integer method is much less accurate than the other two.\n.TP\n.B \\-dither fs\nUse Floyd-Steinberg dithering in color quantization.\n.TP\n.B \\-dither ordered\nUse ordered dithering in color quantization.\n.TP\n.B \\-dither none\nDo not use dithering in color quantization.\nBy default, Floyd-Steinberg dithering is applied when quantizing colors; this\nis slow but usually produces the best results.  Ordered dither is a compromise\nbetween speed and quality; no dithering is fast but usually looks awful.  Note\nthat these switches have no effect unless color quantization is being done.\nOrdered dither is only available in\n.B \\-onepass\nmode.\n.TP\n.BI \\-map \" file\"\nQuantize to the colors used in the specified image file.  This is useful for\nproducing multiple files with identical color maps, or for forcing a\npredefined set of colors to be used.  The\n.I file\nmust be a GIF or PPM file. This option overrides\n.B \\-colors\nand\n.BR \\-onepass .\n.TP\n.B \\-nosmooth\nDon't use high-quality upsampling.\n.TP\n.B \\-onepass\nUse one-pass instead of two-pass color quantization.  The one-pass method is\nfaster and needs less memory, but it produces a lower-quality image.\n.B \\-onepass\nis ignored unless you also say\n.B \\-colors\n.IR N .\nAlso, the one-pass method is always used for gray-scale output (the two-pass\nmethod is no improvement then).\n.TP\n.BI \\-maxmemory \" N\"\nSet limit for amount of memory to use in processing large images.  Value is\nin thousands of bytes, or millions of bytes if \"M\" is attached to the\nnumber.  For example,\n.B \\-max 4m\nselects 4000000 bytes.  If more space is needed, temporary files will be used.\n.TP\n.BI \\-outfile \" name\"\nSend output image to the named file, not to standard output.\n.TP\n.B \\-verbose\nEnable debug printout.  More\n.BR \\-v 's\ngive more output.  Also, version information is printed at startup.\n.TP\n.B \\-debug\nSame as\n.BR \\-verbose .\n.SH EXAMPLES\n.LP\nThis example decompresses the JPEG file foo.jpg, quantizes it to\n256 colors, and saves the output in 8-bit BMP format in foo.bmp:\n.IP\n.B djpeg \\-colors 256 \\-bmp\n.I foo.jpg\n.B >\n.I foo.bmp\n.SH HINTS\nTo get a quick preview of an image, use the\n.B \\-grayscale\nand/or\n.B \\-scale\nswitches.\n.B \\-grayscale \\-scale 1/8\nis the fastest case.\n.PP\nSeveral options are available that trade off image quality to gain speed.\n.B \\-fast\nturns on the recommended settings.\n.PP\n.B \\-dct fast\nand/or\n.B \\-nosmooth\ngain speed at a small sacrifice in quality.\nWhen producing a color-quantized image,\n.B \\-onepass \\-dither ordered\nis fast but much lower quality than the default behavior.\n.B \\-dither none\nmay give acceptable results in two-pass mode, but is seldom tolerable in\none-pass mode.\n.PP\nIf you are fortunate enough to have very fast floating point hardware,\n\\fB\\-dct float\\fR may be even faster than \\fB\\-dct fast\\fR.  But on most\nmachines \\fB\\-dct float\\fR is slower than \\fB\\-dct int\\fR; in this case it is\nnot worth using, because its theoretical accuracy advantage is too small to be\nsignificant in practice.\n.SH ENVIRONMENT\n.TP\n.B JPEGMEM\nIf this environment variable is set, its value is the default memory limit.\nThe value is specified as described for the\n.B \\-maxmemory\nswitch.\n.B JPEGMEM\noverrides the default value specified when the program was compiled, and\nitself is overridden by an explicit\n.BR \\-maxmemory .\n.SH SEE ALSO\n.BR cjpeg (1),\n.BR jpegtran (1),\n.BR rdjpgcom (1),\n.BR wrjpgcom (1)\n.br\n.BR ppm (5),\n.BR pgm (5)\n.br\nWallace, Gregory K.  \"The JPEG Still Picture Compression Standard\",\nCommunications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.\n.SH AUTHOR\nIndependent JPEG Group\n.SH BUGS\nTo avoid the Unisys LZW patent (now expired),\n.B djpeg\nproduces uncompressed GIF files.  These are larger than they should be, but\nare readable by standard GIF decoders.\n"
  },
  {
    "path": "djpeg.c",
    "content": "/*\n * djpeg.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2009-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a command-line user interface for the JPEG decompressor.\n * It should work on any system with Unix- or MS-DOS-style command lines.\n *\n * Two different command line styles are permitted, depending on the\n * compile-time switch TWO_FILE_COMMANDLINE:\n *\tdjpeg [options]  inputfile outputfile\n *\tdjpeg [options]  [inputfile]\n * In the second style, output is always to standard output, which you'd\n * normally redirect to a file or pipe to some other program.  Input is\n * either from a named file or from standard input (typically redirected).\n * The second style is convenient on Unix but is unhelpful on systems that\n * don't support pipes.  Also, you MUST use the first style if your system\n * doesn't do binary I/O to stdin/stdout.\n * To simplify script writing, the \"-outfile\" switch is provided.  The syntax\n *\tdjpeg [options]  -outfile outputfile  inputfile\n * works regardless of which command line style is used.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n#include \"jversion.h\"\t\t/* for version message */\n\n#include <ctype.h>\t\t/* to declare isprint() */\n\n#ifdef USE_CCOMMAND\t\t/* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>\t\t/* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>\t\t/* Think declares it here */\n#endif\n#endif\n\n\n/* Create the add-on message string table. */\n\n#define JMESSAGE(code,string)\tstring ,\n\nstatic const char * const cdjpeg_message_table[] = {\n#include \"cderror.h\"\n  NULL\n};\n\n\n/*\n * This list defines the known output image formats\n * (not all of which need be supported by a given version).\n * You can change the default output format by defining DEFAULT_FMT;\n * indeed, you had better do so if you undefine PPM_SUPPORTED.\n */\n\ntypedef enum {\n\tFMT_BMP,\t\t/* BMP format (Windows flavor) */\n\tFMT_GIF,\t\t/* GIF format */\n\tFMT_OS2,\t\t/* BMP format (OS/2 flavor) */\n\tFMT_PPM,\t\t/* PPM/PGM (PBMPLUS formats) */\n\tFMT_RLE,\t\t/* RLE format */\n\tFMT_TARGA,\t\t/* Targa format */\n\tFMT_TIFF\t\t/* TIFF format */\n} IMAGE_FORMATS;\n\n#ifndef DEFAULT_FMT\t\t/* so can override from CFLAGS in Makefile */\n#define DEFAULT_FMT\tFMT_PPM\n#endif\n\nstatic IMAGE_FORMATS requested_fmt;\n\n\n/*\n * Argument-parsing code.\n * The switch parser is designed to be useful with DOS-style command line\n * syntax, ie, intermixed switches and file names, where only the switches\n * to the left of a given file name affect processing of that file.\n * The main program in this file doesn't actually use this capability...\n */\n\n\nstatic const char * progname;\t/* program name for error messages */\nstatic char * outfilename;\t/* for -outfile switch */\n\n\nLOCAL(void)\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"usage: %s [switches] \", progname);\n#ifdef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"inputfile outputfile\\n\");\n#else\n  fprintf(stderr, \"[inputfile]\\n\");\n#endif\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -colors N      Reduce image to no more than N colors\\n\");\n  fprintf(stderr, \"  -fast          Fast, low-quality processing\\n\");\n  fprintf(stderr, \"  -grayscale     Force grayscale output\\n\");\n#ifdef IDCT_SCALING_SUPPORTED\n  fprintf(stderr, \"  -scale M/N     Scale output image by fraction M/N, eg, 1/8\\n\");\n#endif\n#ifdef BMP_SUPPORTED\n  fprintf(stderr, \"  -bmp           Select BMP output format (Windows style)%s\\n\",\n\t  (DEFAULT_FMT == FMT_BMP ? \" (default)\" : \"\"));\n#endif\n#ifdef GIF_SUPPORTED\n  fprintf(stderr, \"  -gif           Select GIF output format%s\\n\",\n\t  (DEFAULT_FMT == FMT_GIF ? \" (default)\" : \"\"));\n#endif\n#ifdef BMP_SUPPORTED\n  fprintf(stderr, \"  -os2           Select BMP output format (OS/2 style)%s\\n\",\n\t  (DEFAULT_FMT == FMT_OS2 ? \" (default)\" : \"\"));\n#endif\n#ifdef PPM_SUPPORTED\n  fprintf(stderr, \"  -pnm           Select PBMPLUS (PPM/PGM) output format%s\\n\",\n\t  (DEFAULT_FMT == FMT_PPM ? \" (default)\" : \"\"));\n#endif\n#ifdef RLE_SUPPORTED\n  fprintf(stderr, \"  -rle           Select Utah RLE output format%s\\n\",\n\t  (DEFAULT_FMT == FMT_RLE ? \" (default)\" : \"\"));\n#endif\n#ifdef TARGA_SUPPORTED\n  fprintf(stderr, \"  -targa         Select Targa output format%s\\n\",\n\t  (DEFAULT_FMT == FMT_TARGA ? \" (default)\" : \"\"));\n#endif\n  fprintf(stderr, \"Switches for advanced users:\\n\");\n#ifdef DCT_ISLOW_SUPPORTED\n  fprintf(stderr, \"  -dct int       Use integer DCT method%s\\n\",\n\t  (JDCT_DEFAULT == JDCT_ISLOW ? \" (default)\" : \"\"));\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n  fprintf(stderr, \"  -dct fast      Use fast integer DCT (less accurate)%s\\n\",\n\t  (JDCT_DEFAULT == JDCT_IFAST ? \" (default)\" : \"\"));\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  fprintf(stderr, \"  -dct float     Use floating-point DCT method%s\\n\",\n\t  (JDCT_DEFAULT == JDCT_FLOAT ? \" (default)\" : \"\"));\n#endif\n  fprintf(stderr, \"  -dither fs     Use F-S dithering (default)\\n\");\n  fprintf(stderr, \"  -dither none   Don't use dithering in quantization\\n\");\n  fprintf(stderr, \"  -dither ordered  Use ordered dither (medium speed, quality)\\n\");\n#ifdef QUANT_2PASS_SUPPORTED\n  fprintf(stderr, \"  -map FILE      Map to colors used in named image file\\n\");\n#endif\n  fprintf(stderr, \"  -nosmooth      Don't use high-quality upsampling\\n\");\n#ifdef QUANT_1PASS_SUPPORTED\n  fprintf(stderr, \"  -onepass       Use 1-pass quantization (fast, low quality)\\n\");\n#endif\n  fprintf(stderr, \"  -maxmemory N   Maximum memory to use (in kbytes)\\n\");\n  fprintf(stderr, \"  -outfile name  Specify name for output file\\n\");\n  fprintf(stderr, \"  -verbose  or  -debug   Emit debug output\\n\");\n  exit(EXIT_FAILURE);\n}\n\n\nLOCAL(int)\nparse_switches (j_decompress_ptr cinfo, int argc, char **argv,\n\t\tint last_file_arg_seen, boolean for_real)\n/* Parse optional switches.\n * Returns argv[] index of first file-name argument (== argc if none).\n * Any file names with indexes <= last_file_arg_seen are ignored;\n * they have presumably been processed in a previous iteration.\n * (Pass 0 for last_file_arg_seen on the first or only iteration.)\n * for_real is FALSE on the first (dummy) pass; we may skip any expensive\n * processing.\n */\n{\n  int argn;\n  char * arg;\n\n  /* Set up default JPEG parameters. */\n  requested_fmt = DEFAULT_FMT;\t/* set default output file format */\n  outfilename = NULL;\n  cinfo->err->trace_level = 0;\n\n  /* Scan command line options, adjust parameters */\n\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (*arg != '-') {\n      /* Not a switch, must be a file name argument */\n      if (argn <= last_file_arg_seen) {\n\toutfilename = NULL;\t/* -outfile applies to just one input file */\n\tcontinue;\t\t/* ignore this name if previously processed */\n      }\n      break;\t\t\t/* else done parsing switches */\n    }\n    arg++;\t\t\t/* advance past switch marker character */\n\n    if (keymatch(arg, \"bmp\", 1)) {\n      /* BMP output format. */\n      requested_fmt = FMT_BMP;\n\n    } else if (keymatch(arg, \"colors\", 1) || keymatch(arg, \"colours\", 1) ||\n\t       keymatch(arg, \"quantize\", 1) || keymatch(arg, \"quantise\", 1)) {\n      /* Do color quantization. */\n      int val;\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%d\", &val) != 1)\n\tusage();\n      cinfo->desired_number_of_colors = val;\n      cinfo->quantize_colors = TRUE;\n\n    } else if (keymatch(arg, \"dct\", 2)) {\n      /* Select IDCT algorithm. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (keymatch(argv[argn], \"int\", 1)) {\n\tcinfo->dct_method = JDCT_ISLOW;\n      } else if (keymatch(argv[argn], \"fast\", 2)) {\n\tcinfo->dct_method = JDCT_IFAST;\n      } else if (keymatch(argv[argn], \"float\", 2)) {\n\tcinfo->dct_method = JDCT_FLOAT;\n      } else\n\tusage();\n\n    } else if (keymatch(arg, \"dither\", 2)) {\n      /* Select dithering algorithm. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (keymatch(argv[argn], \"fs\", 2)) {\n\tcinfo->dither_mode = JDITHER_FS;\n      } else if (keymatch(argv[argn], \"none\", 2)) {\n\tcinfo->dither_mode = JDITHER_NONE;\n      } else if (keymatch(argv[argn], \"ordered\", 2)) {\n\tcinfo->dither_mode = JDITHER_ORDERED;\n      } else\n\tusage();\n\n    } else if (keymatch(arg, \"debug\", 1) || keymatch(arg, \"verbose\", 1)) {\n      /* Enable debug printouts. */\n      /* On first -d, print version identification */\n      static boolean printed_version = FALSE;\n\n      if (! printed_version) {\n\tfprintf(stderr, \"Independent JPEG Group's DJPEG, version %s\\n%s\\n\",\n\t\tJVERSION, JCOPYRIGHT);\n\tprinted_version = TRUE;\n      }\n      cinfo->err->trace_level++;\n\n    } else if (keymatch(arg, \"fast\", 1)) {\n      /* Select recommended processing options for quick-and-dirty output. */\n      cinfo->two_pass_quantize = FALSE;\n      cinfo->dither_mode = JDITHER_ORDERED;\n      if (! cinfo->quantize_colors) /* don't override an earlier -colors */\n\tcinfo->desired_number_of_colors = 216;\n      cinfo->dct_method = JDCT_FASTEST;\n      cinfo->do_fancy_upsampling = FALSE;\n\n    } else if (keymatch(arg, \"gif\", 1)) {\n      /* GIF output format. */\n      requested_fmt = FMT_GIF;\n\n    } else if (keymatch(arg, \"grayscale\", 2) || keymatch(arg, \"greyscale\",2)) {\n      /* Force monochrome output. */\n      cinfo->out_color_space = JCS_GRAYSCALE;\n\n    } else if (keymatch(arg, \"map\", 3)) {\n      /* Quantize to a color map taken from an input file. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (for_real) {\t\t/* too expensive to do twice! */\n#ifdef QUANT_2PASS_SUPPORTED\t/* otherwise can't quantize to supplied map */\n\tFILE * mapfile;\n\n\tif ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) {\n\t  fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn]);\n\t  exit(EXIT_FAILURE);\n\t}\n\tread_color_map(cinfo, mapfile);\n\tfclose(mapfile);\n\tcinfo->quantize_colors = TRUE;\n#else\n\tERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n      }\n\n    } else if (keymatch(arg, \"maxmemory\", 3)) {\n      /* Maximum memory in Kb (or Mb with 'm'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n\tusage();\n      if (ch == 'm' || ch == 'M')\n\tlval *= 1000L;\n      cinfo->mem->max_memory_to_use = lval * 1000L;\n\n    } else if (keymatch(arg, \"nosmooth\", 3)) {\n      /* Suppress fancy upsampling. */\n      cinfo->do_fancy_upsampling = FALSE;\n\n    } else if (keymatch(arg, \"onepass\", 3)) {\n      /* Use fast one-pass quantization. */\n      cinfo->two_pass_quantize = FALSE;\n\n    } else if (keymatch(arg, \"os2\", 3)) {\n      /* BMP output format (OS/2 flavor). */\n      requested_fmt = FMT_OS2;\n\n    } else if (keymatch(arg, \"outfile\", 4)) {\n      /* Set output file name. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      outfilename = argv[argn];\t/* save it away for later use */\n\n    } else if (keymatch(arg, \"pnm\", 1) || keymatch(arg, \"ppm\", 1)) {\n      /* PPM/PGM output format. */\n      requested_fmt = FMT_PPM;\n\n    } else if (keymatch(arg, \"rle\", 1)) {\n      /* RLE output format. */\n      requested_fmt = FMT_RLE;\n\n    } else if (keymatch(arg, \"scale\", 1)) {\n      /* Scale the output image by a fraction M/N. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%u/%u\",\n\t\t &cinfo->scale_num, &cinfo->scale_denom) < 1)\n\tusage();\n\n    } else if (keymatch(arg, \"targa\", 1)) {\n      /* Targa output format. */\n      requested_fmt = FMT_TARGA;\n\n    } else {\n      usage();\t\t\t/* bogus switch */\n    }\n  }\n\n  return argn;\t\t\t/* return index of next arg (file name) */\n}\n\n\n/*\n * Marker processor for COM and interesting APPn markers.\n * This replaces the library's built-in processor, which just skips the marker.\n * We want to print out the marker as text, to the extent possible.\n * Note this code relies on a non-suspending data source.\n */\n\nLOCAL(unsigned int)\njpeg_getc (j_decompress_ptr cinfo)\n/* Read next byte */\n{\n  struct jpeg_source_mgr * datasrc = cinfo->src;\n\n  if (datasrc->bytes_in_buffer == 0) {\n    if (! (*datasrc->fill_input_buffer) (cinfo))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n  }\n  datasrc->bytes_in_buffer--;\n  return GETJOCTET(*datasrc->next_input_byte++);\n}\n\n\nMETHODDEF(boolean)\nprint_text_marker (j_decompress_ptr cinfo)\n{\n  boolean traceit = (cinfo->err->trace_level >= 1);\n  INT32 length;\n  unsigned int ch;\n  unsigned int lastch = 0;\n\n  length = jpeg_getc(cinfo) << 8;\n  length += jpeg_getc(cinfo);\n  length -= 2;\t\t\t/* discount the length word itself */\n\n  if (traceit) {\n    if (cinfo->unread_marker == JPEG_COM)\n      fprintf(stderr, \"Comment, length %ld:\\n\", (long) length);\n    else\t\t\t/* assume it is an APPn otherwise */\n      fprintf(stderr, \"APP%d, length %ld:\\n\",\n\t      cinfo->unread_marker - JPEG_APP0, (long) length);\n  }\n\n  while (--length >= 0) {\n    ch = jpeg_getc(cinfo);\n    if (traceit) {\n      /* Emit the character in a readable form.\n       * Nonprintables are converted to \\nnn form,\n       * while \\ is converted to \\\\.\n       * Newlines in CR, CR/LF, or LF form will be printed as one newline.\n       */\n      if (ch == '\\r') {\n\tfprintf(stderr, \"\\n\");\n      } else if (ch == '\\n') {\n\tif (lastch != '\\r')\n\t  fprintf(stderr, \"\\n\");\n      } else if (ch == '\\\\') {\n\tfprintf(stderr, \"\\\\\\\\\");\n      } else if (isprint(ch)) {\n\tputc(ch, stderr);\n      } else {\n\tfprintf(stderr, \"\\\\%03o\", ch);\n      }\n      lastch = ch;\n    }\n  }\n\n  if (traceit)\n    fprintf(stderr, \"\\n\");\n\n  return TRUE;\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  struct jpeg_decompress_struct cinfo;\n  struct jpeg_error_mgr jerr;\n#ifdef PROGRESS_REPORT\n  struct cdjpeg_progress_mgr progress;\n#endif\n  int file_index;\n  djpeg_dest_ptr dest_mgr = NULL;\n  FILE * input_file;\n  FILE * output_file;\n  JDIMENSION num_scanlines;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"djpeg\";\t\t/* in case C library doesn't provide it */\n\n  /* Initialize the JPEG decompression object with default error handling. */\n  cinfo.err = jpeg_std_error(&jerr);\n  jpeg_create_decompress(&cinfo);\n  /* Add some application-specific error messages (from cderror.h) */\n  jerr.addon_message_table = cdjpeg_message_table;\n  jerr.first_addon_message = JMSG_FIRSTADDONCODE;\n  jerr.last_addon_message = JMSG_LASTADDONCODE;\n\n  /* Insert custom marker processor for COM and APP12.\n   * APP12 is used by some digital camera makers for textual info,\n   * so we provide the ability to display it as text.\n   * If you like, additional APPn marker types can be selected for display,\n   * but don't try to override APP0 or APP14 this way (see libjpeg.doc).\n   */\n  jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker);\n  jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker);\n\n  /* Now safe to enable signal catcher. */\n#ifdef NEED_SIGNAL_CATCHER\n  enable_signal_catcher((j_common_ptr) &cinfo);\n#endif\n\n  /* Scan command line to find file names. */\n  /* It is convenient to use just one switch-parsing routine, but the switch\n   * values read here are ignored; we will rescan the switches after opening\n   * the input file.\n   * (Exception: tracing level set here controls verbosity for COM markers\n   * found during jpeg_read_header...)\n   */\n\n  file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);\n\n#ifdef TWO_FILE_COMMANDLINE\n  /* Must have either -outfile switch or explicit output file name */\n  if (outfilename == NULL) {\n    if (file_index != argc-2) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n\t      progname);\n      usage();\n    }\n    outfilename = argv[file_index+1];\n  } else {\n    if (file_index != argc-1) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n\t      progname);\n      usage();\n    }\n  }\n#else\n  /* Unix style: expect zero or one file name */\n  if (file_index < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n#endif /* TWO_FILE_COMMANDLINE */\n\n  /* Open the input file. */\n  if (file_index < argc) {\n    if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[file_index]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n    input_file = read_stdin();\n  }\n\n  /* Open the output file. */\n  if (outfilename != NULL) {\n    if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, outfilename);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default output file is stdout */\n    output_file = write_stdout();\n  }\n\n#ifdef PROGRESS_REPORT\n  start_progress_monitor((j_common_ptr) &cinfo, &progress);\n#endif\n\n  /* Specify data source for decompression */\n  jpeg_stdio_src(&cinfo, input_file);\n\n  /* Read file header, set default decompression parameters */\n  (void) jpeg_read_header(&cinfo, TRUE);\n\n  /* Adjust default decompression parameters by re-parsing the options */\n  file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);\n\n  /* Initialize the output module now to let it override any crucial\n   * option settings (for instance, GIF wants to force color quantization).\n   */\n  switch (requested_fmt) {\n#ifdef BMP_SUPPORTED\n  case FMT_BMP:\n    dest_mgr = jinit_write_bmp(&cinfo, FALSE);\n    break;\n  case FMT_OS2:\n    dest_mgr = jinit_write_bmp(&cinfo, TRUE);\n    break;\n#endif\n#ifdef GIF_SUPPORTED\n  case FMT_GIF:\n    dest_mgr = jinit_write_gif(&cinfo);\n    break;\n#endif\n#ifdef PPM_SUPPORTED\n  case FMT_PPM:\n    dest_mgr = jinit_write_ppm(&cinfo);\n    break;\n#endif\n#ifdef RLE_SUPPORTED\n  case FMT_RLE:\n    dest_mgr = jinit_write_rle(&cinfo);\n    break;\n#endif\n#ifdef TARGA_SUPPORTED\n  case FMT_TARGA:\n    dest_mgr = jinit_write_targa(&cinfo);\n    break;\n#endif\n  default:\n    ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT);\n    break;\n  }\n  dest_mgr->output_file = output_file;\n\n  /* Start decompressor */\n  (void) jpeg_start_decompress(&cinfo);\n\n  /* Write output file header */\n  (*dest_mgr->start_output) (&cinfo, dest_mgr);\n\n  /* Process data */\n  while (cinfo.output_scanline < cinfo.output_height) {\n    num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,\n\t\t\t\t\tdest_mgr->buffer_height);\n    (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);\n  }\n\n#ifdef PROGRESS_REPORT\n  /* Hack: count final pass as done in case finish_output does an extra pass.\n   * The library won't have updated completed_passes.\n   */\n  progress.pub.completed_passes = progress.pub.total_passes;\n#endif\n\n  /* Finish decompression and release memory.\n   * I must do it in this order because output module has allocated memory\n   * of lifespan JPOOL_IMAGE; it needs to finish before releasing memory.\n   */\n  (*dest_mgr->finish_output) (&cinfo, dest_mgr);\n  (void) jpeg_finish_decompress(&cinfo);\n  jpeg_destroy_decompress(&cinfo);\n\n  /* Close files, if we opened them */\n  if (input_file != stdin)\n    fclose(input_file);\n  if (output_file != stdout)\n    fclose(output_file);\n\n#ifdef PROGRESS_REPORT\n  end_progress_monitor((j_common_ptr) &cinfo);\n#endif\n\n  /* All done. */\n  exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);\n  return 0;\t\t\t/* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "example.c",
    "content": "/*\n * example.c\n *\n * This file illustrates how to use the IJG code as a subroutine library\n * to read or write JPEG image files.  You should look at this code in\n * conjunction with the documentation file libjpeg.txt.\n *\n * This code will not do anything useful as-is, but it may be helpful as a\n * skeleton for constructing routines that call the JPEG library.  \n *\n * We present these routines in the same coding style used in the JPEG code\n * (ANSI function definitions, etc); but you are of course free to code your\n * routines in a different style if you prefer.\n */\n\n#include <stdio.h>\n\n/*\n * Include file for users of JPEG library.\n * You will need to have included system headers that define at least\n * the typedefs FILE and size_t before you can include jpeglib.h.\n * (stdio.h is sufficient on ANSI-conforming systems.)\n * You may also wish to include \"jerror.h\".\n */\n\n#include \"jpeglib.h\"\n\n/*\n * <setjmp.h> is used for the optional error recovery mechanism shown in\n * the second part of the example.\n */\n\n#include <setjmp.h>\n\n\n\n/******************** JPEG COMPRESSION SAMPLE INTERFACE *******************/\n\n/* This half of the example shows how to feed data into the JPEG compressor.\n * We present a minimal version that does not worry about refinements such\n * as error recovery (the JPEG code will just exit() if it gets an error).\n */\n\n\n/*\n * IMAGE DATA FORMATS:\n *\n * The standard input image format is a rectangular array of pixels, with\n * each pixel having the same number of \"component\" values (color channels).\n * Each pixel row is an array of JSAMPLEs (which typically are unsigned chars).\n * If you are working with color data, then the color values for each pixel\n * must be adjacent in the row; for example, R,G,B,R,G,B,R,G,B,... for 24-bit\n * RGB color.\n *\n * For this example, we'll assume that this data structure matches the way\n * our application has stored the image in memory, so we can just pass a\n * pointer to our image buffer.  In particular, let's say that the image is\n * RGB color and is described by:\n */\n\nextern JSAMPLE * image_buffer;\t/* Points to large array of R,G,B-order data */\nextern int image_height;\t/* Number of rows in image */\nextern int image_width;\t\t/* Number of columns in image */\n\n\n/*\n * Sample routine for JPEG compression.  We assume that the target file name\n * and a compression quality factor are passed in.\n */\n\nGLOBAL(void)\nwrite_JPEG_file (char * filename, int quality)\n{\n  /* This struct contains the JPEG compression parameters and pointers to\n   * working space (which is allocated as needed by the JPEG library).\n   * It is possible to have several such structures, representing multiple\n   * compression/decompression processes, in existence at once.  We refer\n   * to any one struct (and its associated working data) as a \"JPEG object\".\n   */\n  struct jpeg_compress_struct cinfo;\n  /* This struct represents a JPEG error handler.  It is declared separately\n   * because applications often want to supply a specialized error handler\n   * (see the second half of this file for an example).  But here we just\n   * take the easy way out and use the standard error handler, which will\n   * print a message on stderr and call exit() if compression fails.\n   * Note that this struct must live as long as the main JPEG parameter\n   * struct, to avoid dangling-pointer problems.\n   */\n  struct jpeg_error_mgr jerr;\n  /* More stuff */\n  FILE * outfile;\t\t/* target file */\n  JSAMPROW row_pointer[1];\t/* pointer to JSAMPLE row[s] */\n  int row_stride;\t\t/* physical row width in image buffer */\n\n  /* Step 1: allocate and initialize JPEG compression object */\n\n  /* We have to set up the error handler first, in case the initialization\n   * step fails.  (Unlikely, but it could happen if you are out of memory.)\n   * This routine fills in the contents of struct jerr, and returns jerr's\n   * address which we place into the link field in cinfo.\n   */\n  cinfo.err = jpeg_std_error(&jerr);\n  /* Now we can initialize the JPEG compression object. */\n  jpeg_create_compress(&cinfo);\n\n  /* Step 2: specify data destination (eg, a file) */\n  /* Note: steps 2 and 3 can be done in either order. */\n\n  /* Here we use the library-supplied code to send compressed data to a\n   * stdio stream.  You can also write your own code to do something else.\n   * VERY IMPORTANT: use \"b\" option to fopen() if you are on a machine that\n   * requires it in order to write binary files.\n   */\n  if ((outfile = fopen(filename, \"wb\")) == NULL) {\n    fprintf(stderr, \"can't open %s\\n\", filename);\n    exit(1);\n  }\n  jpeg_stdio_dest(&cinfo, outfile);\n\n  /* Step 3: set parameters for compression */\n\n  /* First we supply a description of the input image.\n   * Four fields of the cinfo struct must be filled in:\n   */\n  cinfo.image_width = image_width; \t/* image width and height, in pixels */\n  cinfo.image_height = image_height;\n  cinfo.input_components = 3;\t\t/* # of color components per pixel */\n  cinfo.in_color_space = JCS_RGB; \t/* colorspace of input image */\n  /* Now use the library's routine to set default compression parameters.\n   * (You must set at least cinfo.in_color_space before calling this,\n   * since the defaults depend on the source color space.)\n   */\n  jpeg_set_defaults(&cinfo);\n  /* Now you can set any non-default parameters you wish to.\n   * Here we just illustrate the use of quality (quantization table) scaling:\n   */\n  jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */);\n\n  /* Step 4: Start compressor */\n\n  /* TRUE ensures that we will write a complete interchange-JPEG file.\n   * Pass TRUE unless you are very sure of what you're doing.\n   */\n  jpeg_start_compress(&cinfo, TRUE);\n\n  /* Step 5: while (scan lines remain to be written) */\n  /*           jpeg_write_scanlines(...); */\n\n  /* Here we use the library's state variable cinfo.next_scanline as the\n   * loop counter, so that we don't have to keep track ourselves.\n   * To keep things simple, we pass one scanline per call; you can pass\n   * more if you wish, though.\n   */\n  row_stride = image_width * 3;\t/* JSAMPLEs per row in image_buffer */\n\n  while (cinfo.next_scanline < cinfo.image_height) {\n    /* jpeg_write_scanlines expects an array of pointers to scanlines.\n     * Here the array is only one element long, but you could pass\n     * more than one scanline at a time if that's more convenient.\n     */\n    row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];\n    (void) jpeg_write_scanlines(&cinfo, row_pointer, 1);\n  }\n\n  /* Step 6: Finish compression */\n\n  jpeg_finish_compress(&cinfo);\n  /* After finish_compress, we can close the output file. */\n  fclose(outfile);\n\n  /* Step 7: release JPEG compression object */\n\n  /* This is an important step since it will release a good deal of memory. */\n  jpeg_destroy_compress(&cinfo);\n\n  /* And we're done! */\n}\n\n\n/*\n * SOME FINE POINTS:\n *\n * In the above loop, we ignored the return value of jpeg_write_scanlines,\n * which is the number of scanlines actually written.  We could get away\n * with this because we were only relying on the value of cinfo.next_scanline,\n * which will be incremented correctly.  If you maintain additional loop\n * variables then you should be careful to increment them properly.\n * Actually, for output to a stdio stream you needn't worry, because\n * then jpeg_write_scanlines will write all the lines passed (or else exit\n * with a fatal error).  Partial writes can only occur if you use a data\n * destination module that can demand suspension of the compressor.\n * (If you don't know what that's for, you don't need it.)\n *\n * If the compressor requires full-image buffers (for entropy-coding\n * optimization or a multi-scan JPEG file), it will create temporary\n * files for anything that doesn't fit within the maximum-memory setting.\n * (Note that temp files are NOT needed if you use the default parameters.)\n * On some systems you may need to set up a signal handler to ensure that\n * temporary files are deleted if the program is interrupted.  See libjpeg.txt.\n *\n * Scanlines MUST be supplied in top-to-bottom order if you want your JPEG\n * files to be compatible with everyone else's.  If you cannot readily read\n * your data in that order, you'll need an intermediate array to hold the\n * image.  See rdtarga.c or rdbmp.c for examples of handling bottom-to-top\n * source data using the JPEG code's internal virtual-array mechanisms.\n */\n\n\n\n/******************** JPEG DECOMPRESSION SAMPLE INTERFACE *******************/\n\n/* This half of the example shows how to read data from the JPEG decompressor.\n * It's a bit more refined than the above, in that we show:\n *   (a) how to modify the JPEG library's standard error-reporting behavior;\n *   (b) how to allocate workspace using the library's memory manager.\n *\n * Just to make this example a little different from the first one, we'll\n * assume that we do not intend to put the whole image into an in-memory\n * buffer, but to send it line-by-line someplace else.  We need a one-\n * scanline-high JSAMPLE array as a work buffer, and we will let the JPEG\n * memory manager allocate it for us.  This approach is actually quite useful\n * because we don't need to remember to deallocate the buffer separately: it\n * will go away automatically when the JPEG object is cleaned up.\n */\n\n\n/*\n * ERROR HANDLING:\n *\n * The JPEG library's standard error handler (jerror.c) is divided into\n * several \"methods\" which you can override individually.  This lets you\n * adjust the behavior without duplicating a lot of code, which you might\n * have to update with each future release.\n *\n * Our example here shows how to override the \"error_exit\" method so that\n * control is returned to the library's caller when a fatal error occurs,\n * rather than calling exit() as the standard error_exit method does.\n *\n * We use C's setjmp/longjmp facility to return control.  This means that the\n * routine which calls the JPEG library must first execute a setjmp() call to\n * establish the return point.  We want the replacement error_exit to do a\n * longjmp().  But we need to make the setjmp buffer accessible to the\n * error_exit routine.  To do this, we make a private extension of the\n * standard JPEG error handler object.  (If we were using C++, we'd say we\n * were making a subclass of the regular error handler.)\n *\n * Here's the extended error handler struct:\n */\n\nstruct my_error_mgr {\n  struct jpeg_error_mgr pub;\t/* \"public\" fields */\n\n  jmp_buf setjmp_buffer;\t/* for return to caller */\n};\n\ntypedef struct my_error_mgr * my_error_ptr;\n\n/*\n * Here's the routine that will replace the standard error_exit method:\n */\n\nMETHODDEF(void)\nmy_error_exit (j_common_ptr cinfo)\n{\n  /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */\n  my_error_ptr myerr = (my_error_ptr) cinfo->err;\n\n  /* Always display the message. */\n  /* We could postpone this until after returning, if we chose. */\n  (*cinfo->err->output_message) (cinfo);\n\n  /* Return control to the setjmp point */\n  longjmp(myerr->setjmp_buffer, 1);\n}\n\n\n/*\n * Sample routine for JPEG decompression.  We assume that the source file name\n * is passed in.  We want to return 1 on success, 0 on error.\n */\n\n\nGLOBAL(int)\nread_JPEG_file (char * filename)\n{\n  /* This struct contains the JPEG decompression parameters and pointers to\n   * working space (which is allocated as needed by the JPEG library).\n   */\n  struct jpeg_decompress_struct cinfo;\n  /* We use our private extension JPEG error handler.\n   * Note that this struct must live as long as the main JPEG parameter\n   * struct, to avoid dangling-pointer problems.\n   */\n  struct my_error_mgr jerr;\n  /* More stuff */\n  FILE * infile;\t\t/* source file */\n  JSAMPARRAY buffer;\t\t/* Output row buffer */\n  int row_stride;\t\t/* physical row width in output buffer */\n\n  /* In this example we want to open the input file before doing anything else,\n   * so that the setjmp() error recovery below can assume the file is open.\n   * VERY IMPORTANT: use \"b\" option to fopen() if you are on a machine that\n   * requires it in order to read binary files.\n   */\n\n  if ((infile = fopen(filename, \"rb\")) == NULL) {\n    fprintf(stderr, \"can't open %s\\n\", filename);\n    return 0;\n  }\n\n  /* Step 1: allocate and initialize JPEG decompression object */\n\n  /* We set up the normal JPEG error routines, then override error_exit. */\n  cinfo.err = jpeg_std_error(&jerr.pub);\n  jerr.pub.error_exit = my_error_exit;\n  /* Establish the setjmp return context for my_error_exit to use. */\n  if (setjmp(jerr.setjmp_buffer)) {\n    /* If we get here, the JPEG code has signaled an error.\n     * We need to clean up the JPEG object, close the input file, and return.\n     */\n    jpeg_destroy_decompress(&cinfo);\n    fclose(infile);\n    return 0;\n  }\n  /* Now we can initialize the JPEG decompression object. */\n  jpeg_create_decompress(&cinfo);\n\n  /* Step 2: specify data source (eg, a file) */\n\n  jpeg_stdio_src(&cinfo, infile);\n\n  /* Step 3: read file parameters with jpeg_read_header() */\n\n  (void) jpeg_read_header(&cinfo, TRUE);\n  /* We can ignore the return value from jpeg_read_header since\n   *   (a) suspension is not possible with the stdio data source, and\n   *   (b) we passed TRUE to reject a tables-only JPEG file as an error.\n   * See libjpeg.txt for more info.\n   */\n\n  /* Step 4: set parameters for decompression */\n\n  /* In this example, we don't need to change any of the defaults set by\n   * jpeg_read_header(), so we do nothing here.\n   */\n\n  /* Step 5: Start decompressor */\n\n  (void) jpeg_start_decompress(&cinfo);\n  /* We can ignore the return value since suspension is not possible\n   * with the stdio data source.\n   */\n\n  /* We may need to do some setup of our own at this point before reading\n   * the data.  After jpeg_start_decompress() we have the correct scaled\n   * output image dimensions available, as well as the output colormap\n   * if we asked for color quantization.\n   * In this example, we need to make an output work buffer of the right size.\n   */ \n  /* JSAMPLEs per row in output buffer */\n  row_stride = cinfo.output_width * cinfo.output_components;\n  /* Make a one-row-high sample array that will go away when done with image */\n  buffer = (*cinfo.mem->alloc_sarray)\n\t\t((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);\n\n  /* Step 6: while (scan lines remain to be read) */\n  /*           jpeg_read_scanlines(...); */\n\n  /* Here we use the library's state variable cinfo.output_scanline as the\n   * loop counter, so that we don't have to keep track ourselves.\n   */\n  while (cinfo.output_scanline < cinfo.output_height) {\n    /* jpeg_read_scanlines expects an array of pointers to scanlines.\n     * Here the array is only one element long, but you could ask for\n     * more than one scanline at a time if that's more convenient.\n     */\n    (void) jpeg_read_scanlines(&cinfo, buffer, 1);\n    /* Assume put_scanline_someplace wants a pointer and sample count. */\n    put_scanline_someplace(buffer[0], row_stride);\n  }\n\n  /* Step 7: Finish decompression */\n\n  (void) jpeg_finish_decompress(&cinfo);\n  /* We can ignore the return value since suspension is not possible\n   * with the stdio data source.\n   */\n\n  /* Step 8: Release JPEG decompression object */\n\n  /* This is an important step since it will release a good deal of memory. */\n  jpeg_destroy_decompress(&cinfo);\n\n  /* After finish_decompress, we can close the input file.\n   * Here we postpone it until after no more JPEG errors are possible,\n   * so as to simplify the setjmp error logic above.  (Actually, I don't\n   * think that jpeg_destroy can do an error exit, but why assume anything...)\n   */\n  fclose(infile);\n\n  /* At this point you may want to check to see whether any corrupt-data\n   * warnings occurred (test whether jerr.pub.num_warnings is nonzero).\n   */\n\n  /* And we're done! */\n  return 1;\n}\n\n\n/*\n * SOME FINE POINTS:\n *\n * In the above code, we ignored the return value of jpeg_read_scanlines,\n * which is the number of scanlines actually read.  We could get away with\n * this because we asked for only one line at a time and we weren't using\n * a suspending data source.  See libjpeg.txt for more info.\n *\n * We cheated a bit by calling alloc_sarray() after jpeg_start_decompress();\n * we should have done it beforehand to ensure that the space would be\n * counted against the JPEG max_memory setting.  In some systems the above\n * code would risk an out-of-memory error.  However, in general we don't\n * know the output image dimensions before jpeg_start_decompress(), unless we\n * call jpeg_calc_output_dimensions().  See libjpeg.txt for more about this.\n *\n * Scanlines are returned in the same order as they appear in the JPEG file,\n * which is standardly top-to-bottom.  If you must emit data bottom-to-top,\n * you can use one of the virtual arrays provided by the JPEG memory manager\n * to invert the data.  See wrbmp.c for an example.\n *\n * As with compression, some operating modes may require temporary files.\n * On some systems you may need to set up a signal handler to ensure that\n * temporary files are deleted if the program is interrupted.  See libjpeg.txt.\n */\n"
  },
  {
    "path": "filelist.txt",
    "content": "IJG JPEG LIBRARY:  FILE LIST\n\nCopyright (C) 1994-2013, Thomas G. Lane, Guido Vollbeding.\nThis file is part of the Independent JPEG Group's software.\nFor conditions of distribution and use, see the accompanying README file.\n\n\nHere is a road map to the files in the IJG JPEG distribution.  The\ndistribution includes the JPEG library proper, plus two application\nprograms (\"cjpeg\" and \"djpeg\") which use the library to convert JPEG\nfiles to and from some other popular image formats.  A third application\n\"jpegtran\" uses the library to do lossless conversion between different\nvariants of JPEG.  There are also two stand-alone applications,\n\"rdjpgcom\" and \"wrjpgcom\".\n\n\nTHE JPEG LIBRARY\n================\n\nInclude files:\n\njpeglib.h\tJPEG library's exported data and function declarations.\njconfig.h\tConfiguration declarations.  Note: this file is not present\n\t\tin the distribution; it is generated during installation.\njmorecfg.h\tAdditional configuration declarations; need not be changed\n\t\tfor a standard installation.\njerror.h\tDeclares JPEG library's error and trace message codes.\njinclude.h\tCentral include file used by all IJG .c files to reference\n\t\tsystem include files.\njpegint.h\tJPEG library's internal data structures.\njdct.h\t\tPrivate declarations for forward & reverse DCT subsystems.\njmemsys.h\tPrivate declarations for memory management subsystem.\njversion.h\tVersion information.\n\nApplications using the library should include jpeglib.h (which in turn\nincludes jconfig.h and jmorecfg.h).  Optionally, jerror.h may be included\nif the application needs to reference individual JPEG error codes.  The\nother include files are intended for internal use and would not normally\nbe included by an application program.  (cjpeg/djpeg/etc do use jinclude.h,\nsince its function is to improve portability of the whole IJG distribution.\nMost other applications will directly include the system include files they\nwant, and hence won't need jinclude.h.)\n\n\nC source code files:\n\nThese files contain most of the functions intended to be called directly by\nan application program:\n\njcapimin.c\tApplication program interface: core routines for compression.\njcapistd.c\tApplication program interface: standard compression.\njdapimin.c\tApplication program interface: core routines for decompression.\njdapistd.c\tApplication program interface: standard decompression.\njcomapi.c\tApplication program interface routines common to compression\n\t\tand decompression.\njcparam.c\tCompression parameter setting helper routines.\njctrans.c\tAPI and library routines for transcoding compression.\njdtrans.c\tAPI and library routines for transcoding decompression.\n\nCompression side of the library:\n\njcinit.c\tInitialization: determines which other modules to use.\njcmaster.c\tMaster control: setup and inter-pass sequencing logic.\njcmainct.c\tMain buffer controller (preprocessor => JPEG compressor).\njcprepct.c\tPreprocessor buffer controller.\njccoefct.c\tBuffer controller for DCT coefficient buffer.\njccolor.c\tColor space conversion.\njcsample.c\tDownsampling.\njcdctmgr.c\tDCT manager (DCT implementation selection & control).\njfdctint.c\tForward DCT using slow-but-accurate integer method.\njfdctfst.c\tForward DCT using faster, less accurate integer method.\njfdctflt.c\tForward DCT using floating-point arithmetic.\njchuff.c\tHuffman entropy coding.\njcarith.c\tArithmetic entropy coding.\njcmarker.c\tJPEG marker writing.\njdatadst.c\tData destination managers for memory and stdio output.\n\nDecompression side of the library:\n\njdmaster.c\tMaster control: determines which other modules to use.\njdinput.c\tInput controller: controls input processing modules.\njdmainct.c\tMain buffer controller (JPEG decompressor => postprocessor).\njdcoefct.c\tBuffer controller for DCT coefficient buffer.\njdpostct.c\tPostprocessor buffer controller.\njdmarker.c\tJPEG marker reading.\njdhuff.c\tHuffman entropy decoding.\njdarith.c\tArithmetic entropy decoding.\njddctmgr.c\tIDCT manager (IDCT implementation selection & control).\njidctint.c\tInverse DCT using slow-but-accurate integer method.\njidctfst.c\tInverse DCT using faster, less accurate integer method.\njidctflt.c\tInverse DCT using floating-point arithmetic.\njdsample.c\tUpsampling.\njdcolor.c\tColor space conversion.\njdmerge.c\tMerged upsampling/color conversion (faster, lower quality).\njquant1.c\tOne-pass color quantization using a fixed-spacing colormap.\njquant2.c\tTwo-pass color quantization using a custom-generated colormap.\n\t\tAlso handles one-pass quantization to an externally given map.\njdatasrc.c\tData source managers for memory and stdio input.\n\nSupport files for both compression and decompression:\n\njaricom.c\tTables for common use in arithmetic entropy encoding and\n\t\tdecoding routines.\njerror.c\tStandard error handling routines (application replaceable).\njmemmgr.c\tSystem-independent (more or less) memory management code.\njutils.c\tMiscellaneous utility routines.\n\njmemmgr.c relies on a system-dependent memory management module.  The IJG\ndistribution includes the following implementations of the system-dependent\nmodule:\n\njmemnobs.c\t\"No backing store\": assumes adequate virtual memory exists.\njmemansi.c\tMakes temporary files with ANSI-standard routine tmpfile().\njmemname.c\tMakes temporary files with program-generated file names.\njmemdos.c\tCustom implementation for MS-DOS (16-bit environment only):\n\t\tcan use extended and expanded memory as well as temp files.\njmemmac.c\tCustom implementation for Apple Macintosh.\n\nExactly one of the system-dependent modules should be configured into an\ninstalled JPEG library (see install.txt for hints about which one to use).\nOn unusual systems you may find it worthwhile to make a special\nsystem-dependent memory manager.\n\n\nNon-C source code files:\n\njmemdosa.asm\t80x86 assembly code support for jmemdos.c; used only in\n\t\tMS-DOS-specific configurations of the JPEG library.\n\n\nCJPEG/DJPEG/JPEGTRAN\n====================\n\nInclude files:\n\ncdjpeg.h\tDeclarations shared by cjpeg/djpeg/jpegtran modules.\ncderror.h\tAdditional error and trace message codes for cjpeg et al.\ntransupp.h\tDeclarations for jpegtran support routines in transupp.c.\n\nC source code files:\n\ncjpeg.c\t\tMain program for cjpeg.\ndjpeg.c\t\tMain program for djpeg.\njpegtran.c\tMain program for jpegtran.\ncdjpeg.c\tUtility routines used by all three programs.\nrdcolmap.c\tCode to read a colormap file for djpeg's \"-map\" switch.\nrdswitch.c\tCode to process some of cjpeg's more complex switches.\n\t\tAlso used by jpegtran.\ntransupp.c\tSupport code for jpegtran: lossless image manipulations.\n\nImage file reader modules for cjpeg:\n\nrdbmp.c\t\tBMP file input.\nrdgif.c\t\tGIF file input (now just a stub).\nrdppm.c\t\tPPM/PGM file input.\nrdrle.c\t\tUtah RLE file input.\nrdtarga.c\tTarga file input.\n\nImage file writer modules for djpeg:\n\nwrbmp.c\t\tBMP file output.\nwrgif.c\t\tGIF file output (a mere shadow of its former self).\nwrppm.c\t\tPPM/PGM file output.\nwrrle.c\t\tUtah RLE file output.\nwrtarga.c\tTarga file output.\n\n\nRDJPGCOM/WRJPGCOM\n=================\n\nC source code files:\n\nrdjpgcom.c\tStand-alone rdjpgcom application.\nwrjpgcom.c\tStand-alone wrjpgcom application.\n\nThese programs do not depend on the IJG library.  They do use\njconfig.h and jinclude.h, only to improve portability.\n\n\nADDITIONAL FILES\n================\n\nDocumentation (see README for a guide to the documentation files):\n\nREADME\t\tMaster documentation file.\n*.txt\t\tOther documentation files.\n*.1\t\tDocumentation in Unix man page format.\nchange.log\tVersion-to-version change highlights.\nexample.c\tSample code for calling JPEG library.\n\nConfiguration/installation files and programs (see install.txt for more info):\n\nconfigure\tUnix shell script to perform automatic configuration.\nconfigure.ac\tSource file for use with Autoconf to generate configure.\nltmain.sh\tSupport scripts for configure (from GNU libtool).\nconfig.guess\nconfig.sub\ndepcomp\nmissing\nar-lib\ncompile\ninstall-sh\tInstall shell script for those Unix systems lacking one.\nMakefile.in\tMakefile input for configure.\nMakefile.am\tSource file for use with Automake to generate Makefile.in.\nckconfig.c\tProgram to generate jconfig.h on non-Unix systems.\njconfig.txt\tTemplate for making jconfig.h by hand.\nmak*.*\t\tSample makefiles for particular systems.\njconfig.*\tSample jconfig.h for particular systems.\nlibjpeg.map\tScript to generate shared library with versioned symbols.\naclocal.m4\tM4 macro definitions for use with Autoconf.\n\nTest files (see install.txt for test procedure):\n\ntest*.*\t\tSource and comparison files for confidence test.\n\t\tThese are binary image files, NOT text files.\n"
  },
  {
    "path": "install-sh",
    "content": "#!/bin/sh\n# install - install a program, script, or datafile\n\nscriptversion=2014-09-12.12; # UTC\n\n# This originates from X11R5 (mit/util/scripts/install.sh), which was\n# later released in X11R6 (xc/config/util/install.sh) with the\n# following copyright and license.\n#\n# Copyright (C) 1994 X Consortium\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to\n# deal in the Software without restriction, including without limitation the\n# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n# sell copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-\n# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n# Except as contained in this notice, the name of the X Consortium shall not\n# be used in advertising or otherwise to promote the sale, use or other deal-\n# ings in this Software without prior written authorization from the X Consor-\n# tium.\n#\n#\n# FSF changes to this file are in the public domain.\n#\n# Calling this script install-sh is preferred over install.sh, to prevent\n# 'make' implicit rules from creating a file called install from it\n# when there is no Makefile.\n#\n# This script is compatible with the BSD install script, but was written\n# from scratch.\n\ntab='\t'\nnl='\n'\nIFS=\" $tab$nl\"\n\n# Set DOITPROG to \"echo\" to test this script.\n\ndoit=${DOITPROG-}\ndoit_exec=${doit:-exec}\n\n# Put in absolute file names if you don't have them in your path;\n# or use environment vars.\n\nchgrpprog=${CHGRPPROG-chgrp}\nchmodprog=${CHMODPROG-chmod}\nchownprog=${CHOWNPROG-chown}\ncmpprog=${CMPPROG-cmp}\ncpprog=${CPPROG-cp}\nmkdirprog=${MKDIRPROG-mkdir}\nmvprog=${MVPROG-mv}\nrmprog=${RMPROG-rm}\nstripprog=${STRIPPROG-strip}\n\nposix_mkdir=\n\n# Desired mode of installed file.\nmode=0755\n\nchgrpcmd=\nchmodcmd=$chmodprog\nchowncmd=\nmvcmd=$mvprog\nrmcmd=\"$rmprog -f\"\nstripcmd=\n\nsrc=\ndst=\ndir_arg=\ndst_arg=\n\ncopy_on_change=false\nis_target_a_directory=possibly\n\nusage=\"\\\nUsage: $0 [OPTION]... [-T] SRCFILE DSTFILE\n   or: $0 [OPTION]... SRCFILES... DIRECTORY\n   or: $0 [OPTION]... -t DIRECTORY SRCFILES...\n   or: $0 [OPTION]... -d DIRECTORIES...\n\nIn the 1st form, copy SRCFILE to DSTFILE.\nIn the 2nd and 3rd, copy all SRCFILES to DIRECTORY.\nIn the 4th, create DIRECTORIES.\n\nOptions:\n     --help     display this help and exit.\n     --version  display version info and exit.\n\n  -c            (ignored)\n  -C            install only if different (preserve the last data modification time)\n  -d            create directories instead of installing files.\n  -g GROUP      $chgrpprog installed files to GROUP.\n  -m MODE       $chmodprog installed files to MODE.\n  -o USER       $chownprog installed files to USER.\n  -s            $stripprog installed files.\n  -t DIRECTORY  install into DIRECTORY.\n  -T            report an error if DSTFILE is a directory.\n\nEnvironment variables override the default commands:\n  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG\n  RMPROG STRIPPROG\n\"\n\nwhile test $# -ne 0; do\n  case $1 in\n    -c) ;;\n\n    -C) copy_on_change=true;;\n\n    -d) dir_arg=true;;\n\n    -g) chgrpcmd=\"$chgrpprog $2\"\n        shift;;\n\n    --help) echo \"$usage\"; exit $?;;\n\n    -m) mode=$2\n        case $mode in\n          *' '* | *\"$tab\"* | *\"$nl\"* | *'*'* | *'?'* | *'['*)\n            echo \"$0: invalid mode: $mode\" >&2\n            exit 1;;\n        esac\n        shift;;\n\n    -o) chowncmd=\"$chownprog $2\"\n        shift;;\n\n    -s) stripcmd=$stripprog;;\n\n    -t)\n        is_target_a_directory=always\n        dst_arg=$2\n        # Protect names problematic for 'test' and other utilities.\n        case $dst_arg in\n          -* | [=\\(\\)!]) dst_arg=./$dst_arg;;\n        esac\n        shift;;\n\n    -T) is_target_a_directory=never;;\n\n    --version) echo \"$0 $scriptversion\"; exit $?;;\n\n    --) shift\n        break;;\n\n    -*) echo \"$0: invalid option: $1\" >&2\n        exit 1;;\n\n    *)  break;;\n  esac\n  shift\ndone\n\n# We allow the use of options -d and -T together, by making -d\n# take the precedence; this is for compatibility with GNU install.\n\nif test -n \"$dir_arg\"; then\n  if test -n \"$dst_arg\"; then\n    echo \"$0: target directory not allowed when installing a directory.\" >&2\n    exit 1\n  fi\nfi\n\nif test $# -ne 0 && test -z \"$dir_arg$dst_arg\"; then\n  # When -d is used, all remaining arguments are directories to create.\n  # When -t is used, the destination is already specified.\n  # Otherwise, the last argument is the destination.  Remove it from $@.\n  for arg\n  do\n    if test -n \"$dst_arg\"; then\n      # $@ is not empty: it contains at least $arg.\n      set fnord \"$@\" \"$dst_arg\"\n      shift # fnord\n    fi\n    shift # arg\n    dst_arg=$arg\n    # Protect names problematic for 'test' and other utilities.\n    case $dst_arg in\n      -* | [=\\(\\)!]) dst_arg=./$dst_arg;;\n    esac\n  done\nfi\n\nif test $# -eq 0; then\n  if test -z \"$dir_arg\"; then\n    echo \"$0: no input file specified.\" >&2\n    exit 1\n  fi\n  # It's OK to call 'install-sh -d' without argument.\n  # This can happen when creating conditional directories.\n  exit 0\nfi\n\nif test -z \"$dir_arg\"; then\n  if test $# -gt 1 || test \"$is_target_a_directory\" = always; then\n    if test ! -d \"$dst_arg\"; then\n      echo \"$0: $dst_arg: Is not a directory.\" >&2\n      exit 1\n    fi\n  fi\nfi\n\nif test -z \"$dir_arg\"; then\n  do_exit='(exit $ret); exit $ret'\n  trap \"ret=129; $do_exit\" 1\n  trap \"ret=130; $do_exit\" 2\n  trap \"ret=141; $do_exit\" 13\n  trap \"ret=143; $do_exit\" 15\n\n  # Set umask so as not to create temps with too-generous modes.\n  # However, 'strip' requires both read and write access to temps.\n  case $mode in\n    # Optimize common cases.\n    *644) cp_umask=133;;\n    *755) cp_umask=22;;\n\n    *[0-7])\n      if test -z \"$stripcmd\"; then\n        u_plus_rw=\n      else\n        u_plus_rw='% 200'\n      fi\n      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;\n    *)\n      if test -z \"$stripcmd\"; then\n        u_plus_rw=\n      else\n        u_plus_rw=,u+rw\n      fi\n      cp_umask=$mode$u_plus_rw;;\n  esac\nfi\n\nfor src\ndo\n  # Protect names problematic for 'test' and other utilities.\n  case $src in\n    -* | [=\\(\\)!]) src=./$src;;\n  esac\n\n  if test -n \"$dir_arg\"; then\n    dst=$src\n    dstdir=$dst\n    test -d \"$dstdir\"\n    dstdir_status=$?\n  else\n\n    # Waiting for this to be detected by the \"$cpprog $src $dsttmp\" command\n    # might cause directories to be created, which would be especially bad\n    # if $src (and thus $dsttmp) contains '*'.\n    if test ! -f \"$src\" && test ! -d \"$src\"; then\n      echo \"$0: $src does not exist.\" >&2\n      exit 1\n    fi\n\n    if test -z \"$dst_arg\"; then\n      echo \"$0: no destination specified.\" >&2\n      exit 1\n    fi\n    dst=$dst_arg\n\n    # If destination is a directory, append the input filename; won't work\n    # if double slashes aren't ignored.\n    if test -d \"$dst\"; then\n      if test \"$is_target_a_directory\" = never; then\n        echo \"$0: $dst_arg: Is a directory\" >&2\n        exit 1\n      fi\n      dstdir=$dst\n      dst=$dstdir/`basename \"$src\"`\n      dstdir_status=0\n    else\n      dstdir=`dirname \"$dst\"`\n      test -d \"$dstdir\"\n      dstdir_status=$?\n    fi\n  fi\n\n  obsolete_mkdir_used=false\n\n  if test $dstdir_status != 0; then\n    case $posix_mkdir in\n      '')\n        # Create intermediate dirs using mode 755 as modified by the umask.\n        # This is like FreeBSD 'install' as of 1997-10-28.\n        umask=`umask`\n        case $stripcmd.$umask in\n          # Optimize common cases.\n          *[2367][2367]) mkdir_umask=$umask;;\n          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;\n\n          *[0-7])\n            mkdir_umask=`expr $umask + 22 \\\n              - $umask % 100 % 40 + $umask % 20 \\\n              - $umask % 10 % 4 + $umask % 2\n            `;;\n          *) mkdir_umask=$umask,go-w;;\n        esac\n\n        # With -d, create the new directory with the user-specified mode.\n        # Otherwise, rely on $mkdir_umask.\n        if test -n \"$dir_arg\"; then\n          mkdir_mode=-m$mode\n        else\n          mkdir_mode=\n        fi\n\n        posix_mkdir=false\n        case $umask in\n          *[123567][0-7][0-7])\n            # POSIX mkdir -p sets u+wx bits regardless of umask, which\n            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.\n            ;;\n          *)\n            # $RANDOM is not portable (e.g. dash);  use it when possible to\n            # lower collision chance\n            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$\n            trap 'ret=$?; rmdir \"$tmpdir/a/b\" \"$tmpdir/a\" \"$tmpdir\" 2>/dev/null; exit $ret' 0\n\n            # As \"mkdir -p\" follows symlinks and we work in /tmp possibly;  so\n            # create the $tmpdir first (and fail if unsuccessful) to make sure\n            # that nobody tries to guess the $tmpdir name.\n            if (umask $mkdir_umask &&\n                $mkdirprog $mkdir_mode \"$tmpdir\" &&\n                exec $mkdirprog $mkdir_mode -p -- \"$tmpdir/a/b\") >/dev/null 2>&1\n            then\n              if test -z \"$dir_arg\" || {\n                   # Check for POSIX incompatibilities with -m.\n                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or\n                   # other-writable bit of parent directory when it shouldn't.\n                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.\n                   test_tmpdir=\"$tmpdir/a\"\n                   ls_ld_tmpdir=`ls -ld \"$test_tmpdir\"`\n                   case $ls_ld_tmpdir in\n                     d????-?r-*) different_mode=700;;\n                     d????-?--*) different_mode=755;;\n                     *) false;;\n                   esac &&\n                   $mkdirprog -m$different_mode -p -- \"$test_tmpdir\" && {\n                     ls_ld_tmpdir_1=`ls -ld \"$test_tmpdir\"`\n                     test \"$ls_ld_tmpdir\" = \"$ls_ld_tmpdir_1\"\n                   }\n                 }\n              then posix_mkdir=:\n              fi\n              rmdir \"$tmpdir/a/b\" \"$tmpdir/a\" \"$tmpdir\"\n            else\n              # Remove any dirs left behind by ancient mkdir implementations.\n              rmdir ./$mkdir_mode ./-p ./-- \"$tmpdir\" 2>/dev/null\n            fi\n            trap '' 0;;\n        esac;;\n    esac\n\n    if\n      $posix_mkdir && (\n        umask $mkdir_umask &&\n        $doit_exec $mkdirprog $mkdir_mode -p -- \"$dstdir\"\n      )\n    then :\n    else\n\n      # The umask is ridiculous, or mkdir does not conform to POSIX,\n      # or it failed possibly due to a race condition.  Create the\n      # directory the slow way, step by step, checking for races as we go.\n\n      case $dstdir in\n        /*) prefix='/';;\n        [-=\\(\\)!]*) prefix='./';;\n        *)  prefix='';;\n      esac\n\n      oIFS=$IFS\n      IFS=/\n      set -f\n      set fnord $dstdir\n      shift\n      set +f\n      IFS=$oIFS\n\n      prefixes=\n\n      for d\n      do\n        test X\"$d\" = X && continue\n\n        prefix=$prefix$d\n        if test -d \"$prefix\"; then\n          prefixes=\n        else\n          if $posix_mkdir; then\n            (umask=$mkdir_umask &&\n             $doit_exec $mkdirprog $mkdir_mode -p -- \"$dstdir\") && break\n            # Don't fail if two instances are running concurrently.\n            test -d \"$prefix\" || exit 1\n          else\n            case $prefix in\n              *\\'*) qprefix=`echo \"$prefix\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;;\n              *) qprefix=$prefix;;\n            esac\n            prefixes=\"$prefixes '$qprefix'\"\n          fi\n        fi\n        prefix=$prefix/\n      done\n\n      if test -n \"$prefixes\"; then\n        # Don't fail if two instances are running concurrently.\n        (umask $mkdir_umask &&\n         eval \"\\$doit_exec \\$mkdirprog $prefixes\") ||\n          test -d \"$dstdir\" || exit 1\n        obsolete_mkdir_used=true\n      fi\n    fi\n  fi\n\n  if test -n \"$dir_arg\"; then\n    { test -z \"$chowncmd\" || $doit $chowncmd \"$dst\"; } &&\n    { test -z \"$chgrpcmd\" || $doit $chgrpcmd \"$dst\"; } &&\n    { test \"$obsolete_mkdir_used$chowncmd$chgrpcmd\" = false ||\n      test -z \"$chmodcmd\" || $doit $chmodcmd $mode \"$dst\"; } || exit 1\n  else\n\n    # Make a couple of temp file names in the proper directory.\n    dsttmp=$dstdir/_inst.$$_\n    rmtmp=$dstdir/_rm.$$_\n\n    # Trap to clean up those temp files at exit.\n    trap 'ret=$?; rm -f \"$dsttmp\" \"$rmtmp\" && exit $ret' 0\n\n    # Copy the file name to the temp name.\n    (umask $cp_umask && $doit_exec $cpprog \"$src\" \"$dsttmp\") &&\n\n    # and set any options; do chmod last to preserve setuid bits.\n    #\n    # If any of these fail, we abort the whole thing.  If we want to\n    # ignore errors from any of these, just make sure not to ignore\n    # errors from the above \"$doit $cpprog $src $dsttmp\" command.\n    #\n    { test -z \"$chowncmd\" || $doit $chowncmd \"$dsttmp\"; } &&\n    { test -z \"$chgrpcmd\" || $doit $chgrpcmd \"$dsttmp\"; } &&\n    { test -z \"$stripcmd\" || $doit $stripcmd \"$dsttmp\"; } &&\n    { test -z \"$chmodcmd\" || $doit $chmodcmd $mode \"$dsttmp\"; } &&\n\n    # If -C, don't bother to copy if it wouldn't change the file.\n    if $copy_on_change &&\n       old=`LC_ALL=C ls -dlL \"$dst\"     2>/dev/null` &&\n       new=`LC_ALL=C ls -dlL \"$dsttmp\"  2>/dev/null` &&\n       set -f &&\n       set X $old && old=:$2:$4:$5:$6 &&\n       set X $new && new=:$2:$4:$5:$6 &&\n       set +f &&\n       test \"$old\" = \"$new\" &&\n       $cmpprog \"$dst\" \"$dsttmp\" >/dev/null 2>&1\n    then\n      rm -f \"$dsttmp\"\n    else\n      # Rename the file to the real destination.\n      $doit $mvcmd -f \"$dsttmp\" \"$dst\" 2>/dev/null ||\n\n      # The rename failed, perhaps because mv can't rename something else\n      # to itself, or perhaps because mv is so ancient that it does not\n      # support -f.\n      {\n        # Now remove or move aside any old file at destination location.\n        # We try this two ways since rm can't unlink itself on some\n        # systems and the destination file might be busy for other\n        # reasons.  In this case, the final cleanup might fail but the new\n        # file should still install successfully.\n        {\n          test ! -f \"$dst\" ||\n          $doit $rmcmd -f \"$dst\" 2>/dev/null ||\n          { $doit $mvcmd -f \"$dst\" \"$rmtmp\" 2>/dev/null &&\n            { $doit $rmcmd -f \"$rmtmp\" 2>/dev/null; :; }\n          } ||\n          { echo \"$0: cannot unlink or rename $dst\" >&2\n            (exit 1); exit 1\n          }\n        } &&\n\n        # Now rename the file to the real destination.\n        $doit $mvcmd \"$dsttmp\" \"$dst\"\n      }\n    fi || exit 1\n\n    trap '' 0\n  fi\ndone\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"
  },
  {
    "path": "install.txt",
    "content": "INSTALLATION INSTRUCTIONS for the Independent JPEG Group's JPEG software\n\nCopyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding.\nThis file is part of the Independent JPEG Group's software.\nFor conditions of distribution and use, see the accompanying README file.\n\n\nThis file explains how to configure and install the IJG software.  We have\ntried to make this software extremely portable and flexible, so that it can be\nadapted to almost any environment.  The downside of this decision is that the\ninstallation process is complicated.  We have provided shortcuts to simplify\nthe task on common systems.  But in any case, you will need at least a little\nfamiliarity with C programming and program build procedures for your system.\n\nIf you are only using this software as part of a larger program, the larger\nprogram's installation procedure may take care of configuring the IJG code.\nFor example, Ghostscript's installation script will configure the IJG code.\nYou don't need to read this file if you just want to compile Ghostscript.\n\nIf you are on a Unix machine, you may not need to read this file at all.\nTry doing\n\t./configure\n\tmake\n\tmake test\nIf that doesn't complain, do\n\tmake install\n(better do \"make -n install\" first to see if the makefile will put the files\nwhere you want them).  Read further if you run into snags or want to customize\nthe code for your system.\n\n\nTABLE OF CONTENTS\n-----------------\n\nBefore you start\nConfiguring the software:\n\tusing the automatic \"configure\" script\n\tusing one of the supplied jconfig and makefile files\n\tby hand\nBuilding the software\nTesting the software\nInstalling the software\nOptional stuff\nOptimization\nHints for specific systems\n\n\nBEFORE YOU START\n================\n\nBefore installing the software you must unpack the distributed source code.\nSince you are reading this file, you have probably already succeeded in this\ntask.  However, there is a potential for error if you needed to convert the\nfiles to the local standard text file format (for example, if you are on\nMS-DOS you may have converted LF end-of-line to CR/LF).  You must apply\nsuch conversion to all the files EXCEPT those whose names begin with \"test\".\nThe test files contain binary data; if you change them in any way then the\nself-test will give bad results.\n\nPlease check the last section of this file to see if there are hints for the\nspecific machine or compiler you are using.\n\n\nCONFIGURING THE SOFTWARE\n========================\n\nTo configure the IJG code for your system, you need to create two files:\n  * jconfig.h: contains values for system-dependent #define symbols.\n  * Makefile: controls the compilation process.\n(On a non-Unix machine, you may create \"project files\" or some other\nsubstitute for a Makefile.  jconfig.h is needed in any environment.)\n\nWe provide three different ways to generate these files:\n  * On a Unix system, you can just run the \"configure\" script.\n  * We provide sample jconfig files and makefiles for popular machines;\n    if your machine matches one of the samples, just copy the right sample\n    files to jconfig.h and Makefile.\n  * If all else fails, read the instructions below and make your own files.\n\n\nConfiguring the software using the automatic \"configure\" script\n---------------------------------------------------------------\n\nIf you are on a Unix machine, you can just type\n\t./configure\nand let the configure script construct appropriate configuration files.\nIf you're using \"csh\" on an old version of System V, you might need to type\n\tsh configure\ninstead to prevent csh from trying to execute configure itself.\nExpect configure to run for a few minutes, particularly on slower machines;\nit works by compiling a series of test programs.\n\nConfigure was created with GNU Autoconf and it follows the usual conventions\nfor GNU configure scripts.  It makes a few assumptions that you may want to\noverride.  You can do this by providing optional switches to configure:\n\n* Configure will build both static and shared libraries, if possible.\nIf you want to build libjpeg only as a static library, say\n\t./configure --disable-shared\nIf you want to build libjpeg only as a shared library, say\n\t./configure --disable-static\nConfigure uses GNU libtool to take care of system-dependent shared library\nbuilding methods.\n\n* Configure will use gcc (GNU C compiler) if it's available, otherwise cc.\nTo force a particular compiler to be selected, use the CC option, for example\n\t./configure CC='cc'\nThe same method can be used to include any unusual compiler switches.\nFor example, on HP-UX you probably want to say\n\t./configure CC='cc -Aa'\nto get HP's compiler to run in ANSI mode.\n\n* The default CFLAGS setting is \"-g\" for non-gcc compilers, \"-g -O2\" for gcc.\nYou can override this by saying, for example,\n\t./configure CFLAGS='-O2'\nif you want to compile without debugging support.\n\n* Configure will set up the makefile so that \"make install\" will install files\ninto /usr/local/bin, /usr/local/man, etc.  You can specify an installation\nprefix other than \"/usr/local\" by giving configure the option \"--prefix=PATH\".\n\n* If you don't have a lot of swap space, you may need to enable the IJG\nsoftware's internal virtual memory mechanism.  To do this, give the option\n\"--enable-maxmem=N\" where N is the default maxmemory limit in megabytes.\nThis is discussed in more detail under \"Selecting a memory manager\", below.\nYou probably don't need to worry about this on reasonably-sized Unix machines,\nunless you plan to process very large images.\n\nConfigure has some other features that are useful if you are cross-compiling\nor working in a network of multiple machine types; but if you need those\nfeatures, you probably already know how to use them.\n\n\nConfiguring the software using one of the supplied jconfig and makefile files\n-----------------------------------------------------------------------------\n\nIf you have one of these systems, you can just use the provided configuration\nfiles:\n\nMakefile\tjconfig file\tSystem and/or compiler\n\nmakefile.manx\tjconfig.manx\tAmiga, Manx Aztec C\nmakefile.sas\tjconfig.sas\tAmiga, SAS C\nmakeproj.mac\tjconfig.mac\tApple Macintosh, Metrowerks CodeWarrior\nmak*jpeg.st\tjconfig.st\tAtari ST/STE/TT, Pure C or Turbo C\nmakefile.bcc\tjconfig.bcc\tMS-DOS or OS/2, Borland C\nmakefile.dj\tjconfig.dj\tMS-DOS, DJGPP (Delorie's port of GNU C)\nmakefile.mc6\tjconfig.mc6\tMS-DOS, Microsoft C (16-bit only)\nmakefile.wat\tjconfig.wat\tMS-DOS, OS/2, or Windows NT, Watcom C\nmakefile.vc\tjconfig.vc\tWindows NT/95, MS Visual C++\nmake*.vc6\tjconfig.vc\tWindows NT/95, MS Visual C++ 6\nmake*.v10\tjconfig.vc\tWindows NT/95, MS Visual C++ 2010 (v10)\nmakefile.mms\tjconfig.vms\tDigital VMS, with MMS software\nmakefile.vms\tjconfig.vms\tDigital VMS, without MMS software\n\nCopy the proper jconfig file to jconfig.h and the makefile to Makefile (or\nwhatever your system uses as the standard makefile name).  For more info see\nthe appropriate system-specific hints section near the end of this file.\n\n\nConfiguring the software by hand\n--------------------------------\n\nFirst, generate a jconfig.h file.  If you are moderately familiar with C,\nthe comments in jconfig.txt should be enough information to do this; just\ncopy jconfig.txt to jconfig.h and edit it appropriately.  Otherwise, you may\nprefer to use the ckconfig.c program.  You will need to compile and execute\nckconfig.c by hand --- we hope you know at least enough to do that.\nckconfig.c may not compile the first try (in fact, the whole idea is for it\nto fail if anything is going to).  If you get compile errors, fix them by\nediting ckconfig.c according to the directions given in ckconfig.c.  Once\nyou get it to run, it will write a suitable jconfig.h file, and will also\nprint out some advice about which makefile to use.\n\nYou may also want to look at the canned jconfig files, if there is one for a\nsystem similar to yours.\n\nSecond, select a makefile and copy it to Makefile (or whatever your system\nuses as the standard makefile name).  The most generic makefiles we provide\nare\n\tmakefile.ansi:\tif your C compiler supports function prototypes\n\tmakefile.unix:\tif not.\n(You have function prototypes if ckconfig.c put \"#define HAVE_PROTOTYPES\"\nin jconfig.h.)  You may want to start from one of the other makefiles if\nthere is one for a system similar to yours.\n\nLook over the selected Makefile and adjust options as needed.  In particular\nyou may want to change the CC and CFLAGS definitions.  For instance, if you\nare using GCC, set CC=gcc.  If you had to use any compiler switches to get\nckconfig.c to work, make sure the same switches are in CFLAGS.\n\nIf you are on a system that doesn't use makefiles, you'll need to set up\nproject files (or whatever you do use) to compile all the source files and\nlink them into executable files cjpeg, djpeg, jpegtran, rdjpgcom, and wrjpgcom.\nSee the file lists in any of the makefiles to find out which files go into\neach program.  Note that the provided makefiles all make a \"library\" file\nlibjpeg first, but you don't have to do that if you don't want to; the file\nlists identify which source files are actually needed for compression,\ndecompression, or both.  As a last resort, you can make a batch script that\njust compiles everything and links it all together; makefile.vms is an example\nof this (it's for VMS systems that have no make-like utility).\n\nHere are comments about some specific configuration decisions you'll\nneed to make:\n\nCommand line style\n------------------\n\nThese programs can use a Unix-like command line style which supports\nredirection and piping, like this:\n\tcjpeg inputfile >outputfile\n\tcjpeg <inputfile >outputfile\n\tsource program | cjpeg >outputfile\nThe simpler \"two file\" command line style is just\n\tcjpeg inputfile outputfile\nYou may prefer the two-file style, particularly if you don't have pipes.\n\nYou MUST use two-file style on any system that doesn't cope well with binary\ndata fed through stdin/stdout; this is true for some MS-DOS compilers, for\nexample.  If you're not on a Unix system, it's safest to assume you need\ntwo-file style.  (But if your compiler provides either the Posix-standard\nfdopen() library routine or a Microsoft-compatible setmode() routine, you\ncan safely use the Unix command line style, by defining USE_FDOPEN or\nUSE_SETMODE respectively.)\n\nTo use the two-file style, make jconfig.h say \"#define TWO_FILE_COMMANDLINE\".\n\nSelecting a memory manager\n--------------------------\n\nThe IJG code is capable of working on images that are too big to fit in main\nmemory; data is swapped out to temporary files as necessary.  However, the\ncode to do this is rather system-dependent.  We provide five different\nmemory managers:\n\n* jmemansi.c\tThis version uses the ANSI-standard library routine tmpfile(),\n\t\twhich not all non-ANSI systems have.  On some systems\n\t\ttmpfile() may put the temporary file in a non-optimal\n\t\tlocation; if you don't like what it does, use jmemname.c.\n\n* jmemname.c\tThis version creates named temporary files.  For anything\n\t\texcept a Unix machine, you'll need to configure the\n\t\tselect_file_name() routine appropriately; see the comments\n\t\tnear the head of jmemname.c.  If you use this version, define\n\t\tNEED_SIGNAL_CATCHER in jconfig.h to make sure the temp files\n\t\tare removed if the program is aborted.\n\n* jmemnobs.c\t(That stands for No Backing Store :-).)  This will compile on\n\t\talmost any system, but it assumes you have enough main memory\n\t\tor virtual memory to hold the biggest images you work with.\n\n* jmemdos.c\tThis should be used with most 16-bit MS-DOS compilers.\n\t\tSee the system-specific notes about MS-DOS for more info.\n\t\tIMPORTANT: if you use this, define USE_MSDOS_MEMMGR in\n\t\tjconfig.h, and include the assembly file jmemdosa.asm in the\n\t\tprograms.  The supplied makefiles and jconfig files for\n\t\t16-bit MS-DOS compilers already do both.\n\n* jmemmac.c\tCustom version for Apple Macintosh; see the system-specific\n\t\tnotes for Macintosh for more info.\n\nTo use a particular memory manager, change the SYSDEPMEM variable in your\nmakefile to equal the corresponding object file name (for example, jmemansi.o\nor jmemansi.obj for jmemansi.c).\n\nIf you have plenty of (real or virtual) main memory, just use jmemnobs.c.\n\"Plenty\" means about ten bytes for every pixel in the largest images\nyou plan to process, so a lot of systems don't meet this criterion.\nIf yours doesn't, try jmemansi.c first.  If that doesn't compile, you'll have\nto use jmemname.c; be sure to adjust select_file_name() for local conditions.\nYou may also need to change unlink() to remove() in close_backing_store().\n\nExcept with jmemnobs.c or jmemmac.c, you need to adjust the DEFAULT_MAX_MEM\nsetting to a reasonable value for your system (either by adding a #define for\nDEFAULT_MAX_MEM to jconfig.h, or by adding a -D switch to the Makefile).\nThis value limits the amount of data space the program will attempt to\nallocate.  Code and static data space isn't counted, so the actual memory\nneeds for cjpeg or djpeg are typically 100 to 150Kb more than the max-memory\nsetting.  Larger max-memory settings reduce the amount of I/O needed to\nprocess a large image, but too large a value can result in \"insufficient\nmemory\" failures.  On most Unix machines (and other systems with virtual\nmemory), just set DEFAULT_MAX_MEM to several million and forget it.  At the\nother end of the spectrum, for MS-DOS machines you probably can't go much\nabove 300K to 400K.  (On MS-DOS the value refers to conventional memory only.\nExtended/expanded memory is handled separately by jmemdos.c.)\n\n\nBUILDING THE SOFTWARE\n=====================\n\nNow you should be able to compile the software.  Just say \"make\" (or\nwhatever's necessary to start the compilation).  Have a cup of coffee.\n\nHere are some things that could go wrong:\n\nIf your compiler complains about undefined structures, you should be able to\nshut it up by putting \"#define INCOMPLETE_TYPES_BROKEN\" in jconfig.h.\n\nIf you have trouble with missing system include files or inclusion of the\nwrong ones, read jinclude.h.  This shouldn't happen if you used configure\nor ckconfig.c to set up jconfig.h.\n\nThere are a fair number of routines that do not use all of their parameters;\nsome compilers will issue warnings about this, which you can ignore.  There\nare also a few configuration checks that may give \"unreachable code\" warnings.\nAny other warning deserves investigation.\n\nIf you don't have a getenv() library routine, define NO_GETENV.\n\nAlso see the system-specific hints, below.\n\n\nTESTING THE SOFTWARE\n====================\n\nAs a quick test of functionality we've included a small sample image in\nseveral forms:\n\ttestorig.jpg\tStarting point for the djpeg tests.\n\ttestimg.ppm\tThe output of djpeg testorig.jpg\n\ttestimg.bmp\tThe output of djpeg -bmp -colors 256 testorig.jpg\n\ttestimg.jpg\tThe output of cjpeg testimg.ppm\n\ttestprog.jpg\tProgressive-mode equivalent of testorig.jpg.\n\ttestimgp.jpg\tThe output of cjpeg -progressive -optimize testimg.ppm\n(The first- and second-generation .jpg files aren't identical since the\ndefault compression parameters are lossy.)  If you can generate duplicates\nof the testimg* files then you probably have working programs.\n\nWith most of the makefiles, \"make test\" will perform the necessary\ncomparisons.\n\nIf you're using a makefile that doesn't provide the test option, run djpeg\nand cjpeg by hand and compare the output files to testimg* with whatever\nbinary file comparison tool you have.  The files should be bit-for-bit\nidentical.\n\nIf the programs complain \"MAX_ALLOC_CHUNK is wrong, please fix\", then you\nneed to reduce MAX_ALLOC_CHUNK to a value that fits in type size_t.\nTry adding \"#define MAX_ALLOC_CHUNK 65520L\" to jconfig.h.  A less likely\nconfiguration error is \"ALIGN_TYPE is wrong, please fix\": defining ALIGN_TYPE\nas long should take care of that one.\n\nIf the cjpeg test run fails with \"Missing Huffman code table entry\", it's a\ngood bet that you needed to define RIGHT_SHIFT_IS_UNSIGNED.  Go back to the\nconfiguration step and run ckconfig.c.  (This is a good plan for any other\ntest failure, too.)\n\nIf you are using Unix (one-file) command line style on a non-Unix system,\nit's a good idea to check that binary I/O through stdin/stdout actually\nworks.  You should get the same results from \"djpeg <testorig.jpg >out.ppm\"\nas from \"djpeg -outfile out.ppm testorig.jpg\".  Note that the makefiles all\nuse the latter style and therefore do not exercise stdin/stdout!  If this\ncheck fails, try recompiling with USE_SETMODE or USE_FDOPEN defined.\nIf it still doesn't work, better use two-file style.\n\nIf you chose a memory manager other than jmemnobs.c, you should test that\ntemporary-file usage works.  Try \"djpeg -bmp -colors 256 -max 0 testorig.jpg\"\nand make sure its output matches testimg.bmp.  If you have any really large\nimages handy, try compressing them with -optimize and/or decompressing with\n-colors 256 to make sure your DEFAULT_MAX_MEM setting is not too large.\n\nNOTE: this is far from an exhaustive test of the JPEG software; some modules,\nsuch as 1-pass color quantization, are not exercised at all.  It's just a\nquick test to give you some confidence that you haven't missed something\nmajor.\n\n\nINSTALLING THE SOFTWARE\n=======================\n\nOnce you're done with the above steps, you can install the software by\ncopying the executable files (cjpeg, djpeg, jpegtran, rdjpgcom, and wrjpgcom)\nto wherever you normally install programs.  On Unix systems, you'll also want\nto put the man pages (cjpeg.1, djpeg.1, jpegtran.1, rdjpgcom.1, wrjpgcom.1)\nin the man-page directory.  The pre-fab makefiles don't support this step\nsince there's such a wide variety of installation procedures on different\nsystems.\n\nIf you generated a Makefile with the \"configure\" script, you can just say\n\tmake install\nto install the programs and their man pages into the standard places.\n(You'll probably need to be root to do this.)  We recommend first saying\n\tmake -n install\nto see where configure thought the files should go.  You may need to edit\nthe Makefile, particularly if your system's conventions for man page\nfilenames don't match what configure expects.\n\nIf you want to install the IJG library itself, for use in compiling other\nprograms besides ours, then you need to put the four include files\n\tjpeglib.h jerror.h jconfig.h jmorecfg.h\ninto your include-file directory, and put the library file libjpeg.a\n(extension may vary depending on system) wherever library files go.\nIf you generated a Makefile with \"configure\", it will do what it thinks\nis the right thing if you say\n\tmake install-lib\n\n\nOPTIONAL STUFF\n==============\n\nProgress monitor:\n\nIf you like, you can #define PROGRESS_REPORT (in jconfig.h) to enable display\nof percent-done progress reports.  The routine provided in cdjpeg.c merely\nprints percentages to stderr, but you can customize it to do something\nfancier.\n\nUtah RLE file format support:\n\nWe distribute the software with support for RLE image files (Utah Raster\nToolkit format) disabled, because the RLE support won't compile without the\nUtah library.  If you have URT version 3.1 or later, you can enable RLE\nsupport as follows:\n\t1.  #define RLE_SUPPORTED in jconfig.h.\n\t2.  Add a -I option to CFLAGS in the Makefile for the directory\n\t    containing the URT .h files (typically the \"include\"\n\t    subdirectory of the URT distribution).\n\t3.  Add -L... -lrle to LDLIBS in the Makefile, where ... specifies\n\t    the directory containing the URT \"librle.a\" file (typically the\n\t    \"lib\" subdirectory of the URT distribution).\n\nSupport for 9-bit to 12-bit deep pixel data:\n\nThe IJG code currently allows 8, 9, 10, 11, or 12 bits sample data precision.\n(For color, this means 8 to 12 bits per channel, of course.)  If you need to\nwork with deeper than 8-bit data, you can compile the IJG code for 9-bit to\n12-bit operation.\nTo do so:\n  1. In jmorecfg.h, define BITS_IN_JSAMPLE as 9, 10, 11, or 12 rather than 8.\n  2. In jconfig.h, undefine BMP_SUPPORTED, RLE_SUPPORTED, and TARGA_SUPPORTED,\n     because the code for those formats doesn't handle deeper than 8-bit data\n     and won't even compile.  (The PPM code does work, as explained below.\n     The GIF code works too; it scales 8-bit GIF data to and from 12-bit\n     depth automatically.)\n  3. Compile.  Don't expect \"make test\" to pass, since the supplied test\n     files are for 8-bit data.\n\nCurrently, 9-bit to 12-bit support does not work on 16-bit-int machines.\n\nRun-time selection and conversion of data precision are currently not\nsupported and may be added later.\nException:  The transcoding part (jpegtran) supports all settings in a\nsingle instance, since it operates on the level of DCT coefficients and\nnot sample values.\n\nThe PPM reader (rdppm.c) can read deeper than 8-bit data from either\ntext-format or binary-format PPM and PGM files.  Binary-format PPM/PGM files\nwhich have a maxval greater than 255 are assumed to use 2 bytes per sample,\nMSB first (big-endian order).  As of early 1995, 2-byte binary format is not\nofficially supported by the PBMPLUS library, but it is expected that a\nfuture release of PBMPLUS will support it.  Note that the PPM reader will\nread files of any maxval regardless of the BITS_IN_JSAMPLE setting; incoming\ndata is automatically rescaled to maxval=MAXJSAMPLE as appropriate for the\ncjpeg bit depth.\n\nThe PPM writer (wrppm.c) will normally write 2-byte binary PPM or PGM\nformat, maxval=MAXJSAMPLE, when compiled with BITS_IN_JSAMPLE>8.  Since this\nformat is not yet widely supported, you can disable it by compiling wrppm.c\nwith PPM_NORAWWORD defined; then the data is scaled down to 8 bits to make a\nstandard 1-byte/sample PPM or PGM file.  (Yes, this means still another copy\nof djpeg to keep around.  But hopefully you won't need it for very long.\nPoskanzer's supposed to get that new PBMPLUS release out Real Soon Now.)\n\nOf course, if you are working with 9-bit to 12-bit data, you probably have\nit stored in some other, nonstandard format.  In that case you'll probably\nwant to write your own I/O modules to read and write your format.\n\nNote:\nThe standard Huffman tables are only valid for 8-bit data precision.  If\nyou selected more than 8-bit data precision, cjpeg uses arithmetic coding\nby default.  The Huffman encoder normally uses entropy optimization to\ncompute usable tables for higher precision.  Otherwise, you'll have to\nsupply different default Huffman tables.\n\nRemoving code:\n\nIf you need to make a smaller version of the JPEG software, some optional\nfunctions can be removed at compile time.  See the xxx_SUPPORTED #defines in\njconfig.h and jmorecfg.h.  If at all possible, we recommend that you leave in\ndecoder support for all valid JPEG files, to ensure that you can read anyone's\noutput.  Taking out support for image file formats that you don't use is the\nmost painless way to make the programs smaller.  Another possibility is to\nremove some of the DCT methods: in particular, the \"IFAST\" method may not be\nenough faster than the others to be worth keeping on your machine.  (If you\ndo remove ISLOW or IFAST, be sure to redefine JDCT_DEFAULT or JDCT_FASTEST\nto a supported method, by adding a #define in jconfig.h.)\n\n\nOPTIMIZATION\n============\n\nUnless you own a Cray, you'll probably be interested in making the JPEG\nsoftware go as fast as possible.  This section covers some machine-dependent\noptimizations you may want to try.  We suggest that before trying any of\nthis, you first get the basic installation to pass the self-test step.\nRepeat the self-test after any optimization to make sure that you haven't\nbroken anything.\n\nThe integer DCT routines perform a lot of multiplications.  These\nmultiplications must yield 32-bit results, but none of their input values\nare more than 16 bits wide.  On many machines, notably the 680x0 and 80x86\nCPUs, a 16x16=>32 bit multiply instruction is faster than a full 32x32=>32\nbit multiply.  Unfortunately there is no portable way to specify such a\nmultiplication in C, but some compilers can generate one when you use the\nright combination of casts.  See the MULTIPLYxxx macro definitions in\njdct.h.  If your compiler makes \"int\" be 32 bits and \"short\" be 16 bits,\ndefining SHORTxSHORT_32 is fairly likely to work.  When experimenting with\nalternate definitions, be sure to test not only whether the code still works\n(use the self-test), but also whether it is actually faster --- on some\ncompilers, alternate definitions may compute the right answer, yet be slower\nthan the default.  Timing cjpeg on a large PGM (grayscale) input file is the\nbest way to check this, as the DCT will be the largest fraction of the runtime\nin that mode.  (Note: some of the distributed compiler-specific jconfig files\nalready contain #define switches to select appropriate MULTIPLYxxx\ndefinitions.)\n\nIf your machine has sufficiently fast floating point hardware, you may find\nthat the float DCT method is faster than the integer DCT methods, even\nafter tweaking the integer multiply macros.  In that case you may want to\nmake the float DCT be the default method.  (The only objection to this is\nthat float DCT results may vary slightly across machines.)  To do that, add\n\"#define JDCT_DEFAULT JDCT_FLOAT\" to jconfig.h.  Even if you don't change\nthe default, you should redefine JDCT_FASTEST, which is the method selected\nby djpeg's -fast switch.  Don't forget to update the documentation files\n(usage.txt and/or cjpeg.1, djpeg.1) to agree with what you've done.\n\nIf access to \"short\" arrays is slow on your machine, it may be a win to\ndefine type JCOEF as int rather than short.  This will cost a good deal of\nmemory though, particularly in some multi-pass modes, so don't do it unless\nyou have memory to burn and short is REALLY slow.\n\nIf your compiler can compile function calls in-line, make sure the INLINE\nmacro in jmorecfg.h is defined as the keyword that marks a function\ninline-able.  Some compilers have a switch that tells the compiler to inline\nany function it thinks is profitable (e.g., -finline-functions for gcc).\nEnabling such a switch is likely to make the compiled code bigger but faster.\n\nIn general, it's worth trying the maximum optimization level of your compiler,\nand experimenting with any optional optimizations such as loop unrolling.\n(Unfortunately, far too many compilers have optimizer bugs ... be prepared to\nback off if the code fails self-test.)  If you do any experimentation along\nthese lines, please report the optimal settings to jpeg-info@jpegclub.org so\nwe can mention them in future releases.  Be sure to specify your machine and\ncompiler version.\n\n\nHINTS FOR SPECIFIC SYSTEMS\n==========================\n\nWe welcome reports on changes needed for systems not mentioned here.  Submit\n'em to jpeg-info@jpegclub.org.  Also, if configure or ckconfig.c is wrong\nabout how to configure the JPEG software for your system, please let us know.\n\n\nAcorn RISC OS:\n\n(Thanks to Simon Middleton for these hints on compiling with Desktop C.)\nAfter renaming the files according to Acorn conventions, take a copy of\nmakefile.ansi, change all occurrences of 'libjpeg.a' to 'libjpeg.o' and\nchange these definitions as indicated:\n\nCFLAGS= -throwback -IC: -Wn\nLDLIBS=C:o.Stubs\nSYSDEPMEM=jmemansi.o\nLN=Link\nAR=LibFile -c -o\n\nAlso add a new line '.c.o:; $(cc) $< $(cflags) -c -o $@'.  Remove the\nlines '$(RM) libjpeg.o' and '$(AR2) libjpeg.o' and the 'jconfig.h'\ndependency section.\n\nCopy jconfig.txt to jconfig.h.  Edit jconfig.h to define TWO_FILE_COMMANDLINE\nand CHAR_IS_UNSIGNED.\n\nRun the makefile using !AMU not !Make.  If you want to use the 'clean' and\n'test' makefile entries then you will have to fiddle with the syntax a bit\nand rename the test files.\n\n\nAmiga:\n\nSAS C 6.50 reportedly is too buggy to compile the IJG code properly.\nA patch to update to 6.51 is available from SAS or AmiNet FTP sites.\n\nThe supplied config files are set up to use jmemname.c as the memory\nmanager, with temporary files being created on the device named by\n\"JPEGTMP:\".\n\n\nAtari ST/STE/TT:\n\nCopy the project files makcjpeg.st, makdjpeg.st, maktjpeg.st, and makljpeg.st\nto cjpeg.prj, djpeg.prj, jpegtran.prj, and libjpeg.prj respectively.  The\nproject files should work as-is with Pure C.  For Turbo C, change library\nfilenames \"pc...\" to \"tc...\" in each project file.  Note that libjpeg.prj\nselects jmemansi.c as the recommended memory manager.  You'll probably want to\nadjust the DEFAULT_MAX_MEM setting --- you want it to be a couple hundred K\nless than your normal free memory.  Put \"#define DEFAULT_MAX_MEM nnnn\" into\njconfig.h to do this.\n\nTo use the 68881/68882 coprocessor for the floating point DCT, add the\ncompiler option \"-8\" to the project files and replace pcfltlib.lib with\npc881lib.lib in cjpeg.prj and djpeg.prj.  Or if you don't have a\ncoprocessor, you may prefer to remove the float DCT code by undefining\nDCT_FLOAT_SUPPORTED in jmorecfg.h (since without a coprocessor, the float\ncode will be too slow to be useful).  In that case, you can delete\npcfltlib.lib from the project files.\n\nNote that you must make libjpeg.lib before making cjpeg.ttp, djpeg.ttp,\nor jpegtran.ttp.  You'll have to perform the self-test by hand.\n\nWe haven't bothered to include project files for rdjpgcom and wrjpgcom.\nThose source files should just be compiled by themselves; they don't\ndepend on the JPEG library.  You can use the default.prj project file\nof the Pure C distribution to make the programs.\n\nThere is a bug in some older versions of the Turbo C library which causes the\nspace used by temporary files created with \"tmpfile()\" not to be freed after\nan abnormal program exit.  If you check your disk afterwards, you will find\ncluster chains that are allocated but not used by a file.  This should not\nhappen in cjpeg/djpeg/jpegtran, since we enable a signal catcher to explicitly\nclose temp files before exiting.  But if you use the JPEG library with your\nown code, be sure to supply a signal catcher, or else use a different\nsystem-dependent memory manager.\n\n\nCray:\n\nShould you be so fortunate as to be running JPEG on a Cray YMP, there is a\ncompiler bug in old versions of Cray's Standard C (prior to 3.1).  If you\nstill have an old compiler, you'll need to insert a line reading\n\"#pragma novector\" just before the loop\t\n    for (i = 1; i <= (int) htbl->bits[l]; i++)\n      huffsize[p++] = (char) l;\nin fix_huff_tbl (in V5beta1, line 204 of jchuff.c and line 176 of jdhuff.c).\n[This bug may or may not still occur with the current IJG code, but it's\nprobably a dead issue anyway...]\n\n\nHP-UX:\n\nIf you have HP-UX 7.05 or later with the \"software development\" C compiler,\nyou should run the compiler in ANSI mode.  If using the configure script,\nsay\n\t./configure CC='cc -Aa'\n(or -Ae if you prefer).  If configuring by hand, use makefile.ansi and add\n\"-Aa\" to the CFLAGS line in the makefile.\n\nIf you have a pre-7.05 system, or if you are using the non-ANSI C compiler\ndelivered with a minimum HP-UX system, then you must use makefile.unix\n(and do NOT add -Aa); or just run configure without the CC option.\n\nOn HP 9000 series 800 machines, the HP C compiler is buggy in revisions prior\nto A.08.07.  If you get complaints about \"not a typedef name\", you'll have to\nuse makefile.unix, or run configure without the CC option.\n\n\nMacintosh, generic comments:\n\nThe supplied user-interface files (cjpeg.c, djpeg.c, etc) are set up to\nprovide a Unix-style command line interface.  You can use this interface on\nthe Mac by means of the ccommand() library routine provided by Metrowerks\nCodeWarrior or Think C.  This is only appropriate for testing the library,\nhowever; to make a user-friendly equivalent of cjpeg/djpeg you'd really want\nto develop a Mac-style user interface.  There isn't a complete example\navailable at the moment, but there are some helpful starting points:\n1. Sam Bushell's free \"To JPEG\" applet provides drag-and-drop conversion to\nJPEG under System 7 and later.  This only illustrates how to use the\ncompression half of the library, but it does a very nice job of that part.\nThe CodeWarrior source code is available from http://www.pobox.com/~jsam.\n2. Jim Brunner prepared a Mac-style user interface for both compression and\ndecompression.  Unfortunately, it hasn't been updated since IJG v4, and\nthe library's API has changed considerably since then.  Still it may be of\nsome help, particularly as a guide to compiling the IJG code under Think C.\nJim's code is available from the Info-Mac archives, at sumex-aim.stanford.edu\nor mirrors thereof; see file /info-mac/dev/src/jpeg-convert-c.hqx.\n\njmemmac.c is the recommended memory manager back end for Macintosh.  It uses\nNewPtr/DisposePtr instead of malloc/free, and has a Mac-specific\nimplementation of jpeg_mem_available().  It also creates temporary files that\nfollow Mac conventions.  (That part of the code relies on System-7-or-later OS\nfunctions.  See the comments in jmemmac.c if you need to run it on System 6.)\nNOTE that USE_MAC_MEMMGR must be defined in jconfig.h to use jmemmac.c.\n\nYou can also use jmemnobs.c, if you don't care about handling images larger\nthan available memory.  If you use any memory manager back end other than\njmemmac.c, we recommend replacing \"malloc\" and \"free\" by \"NewPtr\" and\n\"DisposePtr\", because Mac C libraries often have peculiar implementations of\nmalloc/free.  (For instance, free() may not return the freed space to the\nMac Memory Manager.  This is undesirable for the IJG code because jmemmgr.c\nalready clumps space requests.)\n\n\nMacintosh, Metrowerks CodeWarrior:\n\nThe Unix-command-line-style interface can be used by defining USE_CCOMMAND.\nYou'll also need to define TWO_FILE_COMMANDLINE to avoid stdin/stdout.\nThis means that when using the cjpeg/djpeg programs, you'll have to type the\ninput and output file names in the \"Arguments\" text-edit box, rather than\nusing the file radio buttons.  (Perhaps USE_FDOPEN or USE_SETMODE would\neliminate the problem, but I haven't heard from anyone who's tried it.)\n\nOn 680x0 Macs, Metrowerks defines type \"double\" as a 10-byte IEEE extended\nfloat.  jmemmgr.c won't like this: it wants sizeof(ALIGN_TYPE) to be a power\nof 2.  Add \"#define ALIGN_TYPE long\" to jconfig.h to eliminate the complaint.\n\nThe supplied configuration file jconfig.mac can be used for your jconfig.h;\nit includes all the recommended symbol definitions.  If you have AppleScript\ninstalled, you can run the supplied script makeproj.mac to create CodeWarrior\nproject files for the library and the testbed applications, then build the\nlibrary and applications.  (Thanks to Dan Sears and Don Agro for this nifty\nhack, which saves us from trying to maintain CodeWarrior project files as part\nof the IJG distribution...)\n\n\nMacintosh, Think C:\n\nThe documentation in Jim Brunner's \"JPEG Convert\" source code (see above)\nincludes detailed build instructions for Think C; it's probably somewhat\nout of date for the current release, but may be helpful.\n\nIf you want to build the minimal command line version, proceed as follows.\nYou'll have to prepare project files for the programs; we don't include any\nin the distribution since they are not text files.  Use the file lists in\nany of the supplied makefiles as a guide.  Also add the ANSI and Unix C\nlibraries in a separate segment.  You may need to divide the JPEG files into\nmore than one segment; we recommend dividing compression and decompression\nmodules.  Define USE_CCOMMAND in jconfig.h so that the ccommand() routine is\ncalled.  You must also define TWO_FILE_COMMANDLINE because stdin/stdout\ndon't handle binary data correctly.\n\nOn 680x0 Macs, Think C defines type \"double\" as a 12-byte IEEE extended float.\njmemmgr.c won't like this: it wants sizeof(ALIGN_TYPE) to be a power of 2.\nAdd \"#define ALIGN_TYPE long\" to jconfig.h to eliminate the complaint.\n\njconfig.mac should work as a jconfig.h configuration file for Think C,\nbut the makeproj.mac AppleScript script is specific to CodeWarrior.  Sorry.\n\n\nMIPS R3000:\n\nMIPS's cc version 1.31 has a rather nasty optimization bug.  Don't use -O\nif you have that compiler version.  (Use \"cc -V\" to check the version.)\nNote that the R3000 chip is found in workstations from DEC and others.\n\n\nMS-DOS, generic comments for 16-bit compilers:\n\nThe IJG code is designed to work well in 80x86 \"small\" or \"medium\" memory\nmodels (i.e., data pointers are 16 bits unless explicitly declared \"far\";\ncode pointers can be either size).  You may be able to use small model to\ncompile cjpeg or djpeg by itself, but you will probably have to use medium\nmodel for any larger application.  This won't make much difference in\nperformance.  You *will* take a noticeable performance hit if you use a\nlarge-data memory model, and you should avoid \"huge\" model if at all\npossible.  Be sure that NEED_FAR_POINTERS is defined in jconfig.h if you use\na small-data memory model; be sure it is NOT defined if you use a large-data\nmodel.  (The supplied makefiles and jconfig files for Borland and Microsoft C\ncompile in medium model and define NEED_FAR_POINTERS.)\n\nThe DOS-specific memory manager, jmemdos.c, should be used if possible.\nIt needs some assembly-code routines which are in jmemdosa.asm; make sure\nyour makefile assembles that file and includes it in the library.  If you\ndon't have a suitable assembler, you can get pre-assembled object files for\njmemdosa by FTP from ftp.uu.net:/graphics/jpeg/jdosaobj.zip.  (DOS-oriented\ndistributions of the IJG source code often include these object files.)\n\nWhen using jmemdos.c, jconfig.h must define USE_MSDOS_MEMMGR and must set\nMAX_ALLOC_CHUNK to less than 64K (65520L is a typical value).  If your\nC library's far-heap malloc() can't allocate blocks that large, reduce\nMAX_ALLOC_CHUNK to whatever it can handle.\n\nIf you can't use jmemdos.c for some reason --- for example, because you\ndon't have an assembler to assemble jmemdosa.asm --- you'll have to fall\nback to jmemansi.c or jmemname.c.  You'll probably still need to set\nMAX_ALLOC_CHUNK in jconfig.h, because most DOS C libraries won't malloc()\nmore than 64K at a time.  IMPORTANT: if you use jmemansi.c or jmemname.c,\nyou will have to compile in a large-data memory model in order to get the\nright stdio library.  Too bad.\n\nwrjpgcom needs to be compiled in large model, because it malloc()s a 64KB\nwork area to hold the comment text.  If your C library's malloc can't\nhandle that, reduce MAX_COM_LENGTH as necessary in wrjpgcom.c.\n\nMost MS-DOS compilers treat stdin/stdout as text files, so you must use\ntwo-file command line style.  But if your compiler has either fdopen() or\nsetmode(), you can use one-file style if you like.  To do this, define\nUSE_SETMODE or USE_FDOPEN so that stdin/stdout will be set to binary mode.\n(USE_SETMODE seems to work with more DOS compilers than USE_FDOPEN.)  You\nshould test that I/O through stdin/stdout produces the same results as I/O\nto explicitly named files... the \"make test\" procedures in the supplied\nmakefiles do NOT use stdin/stdout.\n\n\nMS-DOS, generic comments for 32-bit compilers:\n\nNone of the above comments about memory models apply if you are using a\n32-bit flat-memory-space environment, such as DJGPP or Watcom C.  (And you\nshould use one if you have it, as performance will be much better than\n8086-compatible code!)  For flat-memory-space compilers, do NOT define\nNEED_FAR_POINTERS, and do NOT use jmemdos.c.  Use jmemnobs.c if the\nenvironment supplies adequate virtual memory, otherwise use jmemansi.c or\njmemname.c.\n\nYou'll still need to be careful about binary I/O through stdin/stdout.\nSee the last paragraph of the previous section.\n\n\nMS-DOS, Borland C:\n\nBe sure to convert all the source files to DOS text format (CR/LF newlines).\nAlthough Borland C will often work OK with unmodified Unix (LF newlines)\nsource files, sometimes it will give bogus compile errors.\n\"Illegal character '#'\" is the most common such error.  (This is true with\nBorland C 3.1, but perhaps is fixed in newer releases.)\n\nIf you want one-file command line style, just undefine TWO_FILE_COMMANDLINE.\njconfig.bcc already includes #define USE_SETMODE to make this work.\n(fdopen does not work correctly.)\n\n\nMS-DOS, Microsoft C:\n\nmakefile.mc6 works with Microsoft C, DOS Visual C++, etc.  It should only\nbe used if you want to build a 16-bit (small or medium memory model) program.\n\nIf you want one-file command line style, just undefine TWO_FILE_COMMANDLINE.\njconfig.mc6 already includes #define USE_SETMODE to make this work.\n(fdopen does not work correctly.)\n\nNote that this makefile assumes that the working copy of itself is called\n\"makefile\".  If you want to call it something else, say \"makefile.mak\",\nbe sure to adjust the dependency line that reads \"$(RFILE) : makefile\".\nOtherwise the make will fail because it doesn't know how to create \"makefile\".\nWorse, some releases of Microsoft's make utilities give an incorrect error\nmessage in this situation.\n\nOld versions of MS C fail with an \"out of macro expansion space\" error\nbecause they can't cope with the macro TRACEMS8 (defined in jerror.h).\nIf this happens to you, the easiest solution is to change TRACEMS8 to\nexpand to nothing.  You'll lose the ability to dump out JPEG coefficient\ntables with djpeg -debug -debug, but at least you can compile.\n\nOriginal MS C 6.0 is very buggy; it compiles incorrect code unless you turn\noff optimization entirely (remove -O from CFLAGS).  6.00A is better, but it\nstill generates bad code if you enable loop optimizations (-Ol or -Ox).\n\nMS C 8.0 crashes when compiling jquant1.c with optimization switch /Oo ...\nwhich is on by default.  To work around this bug, compile that one file\nwith /Oo-.\n\n\nMicrosoft Windows (all versions), generic comments:\n\nSome Windows system include files define typedef boolean as \"unsigned char\".\nThe IJG code also defines typedef boolean, but we make it an \"enum\" by default.\nThis doesn't affect the IJG programs because we don't import those Windows\ninclude files.  But if you use the JPEG library in your own program, and some\nof your program's files import one definition of boolean while some import the\nother, you can get all sorts of mysterious problems.  A good preventive step\nis to make the IJG library use \"unsigned char\" for boolean.  To do that,\nadd something like this to your jconfig.h file:\n\t/* Define \"boolean\" as unsigned char, not enum, per Windows custom */\n\t#ifndef __RPCNDR_H__\t/* don't conflict if rpcndr.h already read */\n\ttypedef unsigned char boolean;\n\t#endif\n\t#ifndef FALSE\t\t/* in case these macros already exist */\n\t#define FALSE\t0\t/* values of boolean */\n\t#endif\n\t#ifndef TRUE\n\t#define TRUE\t1\n\t#endif\n\t#define HAVE_BOOLEAN\t/* prevent jmorecfg.h from redefining it */\n(This is already in jconfig.vc, by the way.)\n\nwindef.h contains the declarations\n\t#define far\n\t#define FAR far\nSince jmorecfg.h tries to define FAR as empty, you may get a compiler\nwarning if you include both jpeglib.h and windef.h (which windows.h\nincludes).  To suppress the warning, you can put \"#ifndef FAR\"/\"#endif\"\naround the line \"#define FAR\" in jmorecfg.h.\n(Something like this is already in jmorecfg.h, by the way.)\n\nWhen using the library in a Windows application, you will almost certainly\nwant to modify or replace the error handler module jerror.c, since our\ndefault error handler does a couple of inappropriate things:\n  1. it tries to write error and warning messages on stderr;\n  2. in event of a fatal error, it exits by calling exit().\n\nA simple stopgap solution for problem 1 is to replace the line\n\tfprintf(stderr, \"%s\\n\", buffer);\n(in output_message in jerror.c) with\n\tMessageBox(GetActiveWindow(),buffer,\"JPEG Error\",MB_OK|MB_ICONERROR);\nIt's highly recommended that you at least do that much, since otherwise\nerror messages will disappear into nowhere.  (Beginning with IJG v6b, this\ncode is already present in jerror.c; just define USE_WINDOWS_MESSAGEBOX in\njconfig.h to enable it.)\n\nThe proper solution for problem 2 is to return control to your calling\napplication after a library error.  This can be done with the setjmp/longjmp\ntechnique discussed in libjpeg.txt and illustrated in example.c.  (NOTE:\nsome older Windows C compilers provide versions of setjmp/longjmp that\ndon't actually work under Windows.  You may need to use the Windows system\nfunctions Catch and Throw instead.)\n\nThe recommended memory manager under Windows is jmemnobs.c; in other words,\nlet Windows do any virtual memory management needed.  You should NOT use\njmemdos.c nor jmemdosa.asm under Windows.\n\nFor Windows 3.1, we recommend compiling in medium or large memory model;\nfor newer Windows versions, use a 32-bit flat memory model.  (See the MS-DOS\nsections above for more info about memory models.)  In the 16-bit memory\nmodels only, you'll need to put\n\t#define MAX_ALLOC_CHUNK 65520L\t/* Maximum request to malloc() */\ninto jconfig.h to limit allocation chunks to 64Kb.  (Without that, you'd\nhave to use huge memory model, which slows things down unnecessarily.)\njmemnobs.c works without modification in large or flat memory models, but to\nuse medium model, you need to modify its jpeg_get_large and jpeg_free_large\nroutines to allocate far memory.  In any case, you might like to replace\nits calls to malloc and free with direct calls on Windows memory allocation\nfunctions.\n\nYou may also want to modify jdatasrc.c and jdatadst.c to use Windows file\noperations rather than fread/fwrite.  This is only necessary if your C\ncompiler doesn't provide a competent implementation of C stdio functions.\n\nYou might want to tweak the RGB_xxx macros in jmorecfg.h so that the library\nwill accept or deliver color pixels in BGR sample order, not RGB; BGR order\nis usually more convenient under Windows.  Note that this change will break\nthe sample applications cjpeg/djpeg, but the library itself works fine.\n\n\nMany people want to convert the IJG library into a DLL.  This is reasonably\nstraightforward, but watch out for the following:\n\n  1. Don't try to compile as a DLL in small or medium memory model; use\nlarge model, or even better, 32-bit flat model.  Many places in the IJG code\nassume the address of a local variable is an ordinary (not FAR) pointer;\nthat isn't true in a medium-model DLL.\n\n  2. Microsoft C cannot pass file pointers between applications and DLLs.\n(See Microsoft Knowledge Base, PSS ID Number Q50336.)  So jdatasrc.c and\njdatadst.c don't work if you open a file in your application and then pass\nthe pointer to the DLL.  One workaround is to make jdatasrc.c/jdatadst.c\npart of your main application rather than part of the DLL.\n\n  3. You'll probably need to modify the macros GLOBAL() and EXTERN() to\nattach suitable linkage keywords to the exported routine names.  Similarly,\nyou'll want to modify METHODDEF() and JMETHOD() to ensure function pointers\nare declared in a way that lets application routines be called back through\nthe function pointers.  These macros are in jmorecfg.h.  Typical definitions\nfor a 16-bit DLL are:\n\t#define GLOBAL(type)\t\ttype _far _pascal _loadds _export\n\t#define EXTERN(type)\t\textern type _far _pascal _loadds\n\t#define METHODDEF(type)\t\tstatic type _far _pascal\n\t#define JMETHOD(type,methodname,arglist)  \\\n\t\ttype (_far _pascal *methodname) arglist\nFor a 32-bit DLL you may want something like\n\t#define GLOBAL(type)\t\t__declspec(dllexport) type\n\t#define EXTERN(type)\t\textern __declspec(dllexport) type\nAlthough not all the GLOBAL routines are actually intended to be called by\nthe application, the performance cost of making them all DLL entry points is\nnegligible.\n\nThe unmodified IJG library presents a very C-specific application interface,\nso the resulting DLL is only usable from C or C++ applications.  There has\nbeen some talk of writing wrapper code that would present a simpler interface\nusable from other languages, such as Visual Basic.  This is on our to-do list\nbut hasn't been very high priority --- any volunteers out there?\n\n\nMicrosoft Windows, Borland C:\n\nThe provided jconfig.bcc should work OK in a 32-bit Windows environment,\nbut you'll need to tweak it in a 16-bit environment (you'd need to define\nNEED_FAR_POINTERS and MAX_ALLOC_CHUNK).  Beware that makefile.bcc will need\nalteration if you want to use it for Windows --- in particular, you should\nuse jmemnobs.c not jmemdos.c under Windows.\n\nBorland C++ 4.5 fails with an internal compiler error when trying to compile\njdmerge.c in 32-bit mode.  If enough people complain, perhaps Borland will fix\nit.  In the meantime, the simplest known workaround is to add a redundant\ndefinition of the variable range_limit in h2v1_merged_upsample(), at the head\nof the block that handles odd image width (about line 268 in v6 jdmerge.c):\n  /* If image width is odd, do the last output column separately */\n  if (cinfo->output_width & 1) {\n    register JSAMPLE * range_limit = cinfo->sample_range_limit; /* ADD THIS */\n    cb = GETJSAMPLE(*inptr1);\nPretty bizarre, especially since the very similar routine h2v2_merged_upsample\ndoesn't trigger the bug.\nRecent reports suggest that this bug does not occur with \"bcc32a\" (the\nPentium-optimized version of the compiler).\n\nAnother report from a user of Borland C 4.5 was that incorrect code (leading\nto a color shift in processed images) was produced if any of the following\noptimization switch combinations were used: \n\t-Ot -Og\n\t-Ot -Op\n\t-Ot -Om\nSo try backing off on optimization if you see such a problem.  (Are there\nseveral different releases all numbered \"4.5\"??)\n\n\nMicrosoft Windows, Microsoft Visual C++:\n\njconfig.vc should work OK with any Microsoft compiler for a 32-bit memory\nmodel.  makefile.vc is intended for command-line use.  (If you are using\nthe Developer Studio environment, you may prefer the DevStudio project\nfiles; see below.)\n\nIJG JPEG 7 adds extern \"C\" to jpeglib.h.  This avoids the need to put\nextern \"C\" { ... } around #include \"jpeglib.h\" in your C++ application.\nYou can also force VC++ to treat the library as C++ code by renaming\nall the *.c files to *.cpp (and adjusting the makefile to match).\nIn this case you also need to define the symbol DONT_USE_EXTERN_C in\nthe configuration to prevent jpeglib.h from using extern \"C\".\n\n\nMicrosoft Windows, Microsoft Visual C++ 6 Developer Studio:\n\nWe include makefiles that should work as project files in DevStudio 6.0 or\nlater.  There is a library makefile that builds the IJG library as a static\nWin32 library, and application makefiles that build the sample applications\nas Win32 console applications.  (Even if you only want the library, we\nrecommend building the applications so that you can run the self-test.)\n\nTo use:\n1. Open the command prompt, change to the main directory and execute the\n   command line\n\tNMAKE /f makefile.vc  setup-vc6\n   This will move jconfig.vc to jconfig.h and makefiles to project files.\n   (Note that the renaming is critical!)\n2. Open the workspace file jpeg.dsw, build the library project.\n   (If you are using DevStudio more recent than 6.0, you'll probably\n   get a message saying that the project files are being updated.)\n3. Open the workspace file apps.dsw, build the application projects.\n4. To perform the self-test, execute the command line\n\tNMAKE /f makefile.vc  test-build\n5. Move the application .exe files from `app`\\Release to an\n   appropriate location on your path.\n\n\nMicrosoft Windows, Microsoft Visual C++ 2010 Developer Studio (v10):\n\nWe include makefiles that should work as project files in Visual Studio\n2010 or later.  There is a library makefile that builds the IJG library\nas a static Win32 library, and application makefiles that build the sample\napplications as Win32 console applications.  (Even if you only want the\nlibrary, we recommend building the applications so that you can run the\nself-test.)\n\nTo use:\n1. Open the command prompt, change to the main directory and execute the\n   command line\n\tNMAKE /f makefile.vc  setup-v10\n   This will move jconfig.vc to jconfig.h and makefiles to project files.\n   (Note that the renaming is critical!)\n2. Open the solution file jpeg.sln, build the library project.\n   (If you are using Visual Studio more recent than 2010 (v10), you'll\n   probably get a message saying that the project files are being updated.)\n3. Open the solution file apps.sln, build the application projects.\n4. To perform the self-test, execute the command line\n\tNMAKE /f makefile.vc  test-build\n5. Move the application .exe files from `app`\\Release to an\n   appropriate location on your path.\n\nNote:\nThere seems to be an optimization bug in the compiler which causes the\nself-test to fail with the color quantization option.\nWe have disabled optimization for the file jquant2.c in the library\nproject file which causes the self-test to pass properly.\n\n\nOS/2, Borland C++:\n\nWatch out for optimization bugs in older Borland compilers; you may need\nto back off the optimization switch settings.  See the comments in\nmakefile.bcc.\n\n\nSGI:\n\nOn some SGI systems, you may need to set \"AR2= ar -ts\" in the Makefile.\nIf you are using configure, you can do this by saying\n\t./configure RANLIB='ar -ts'\nThis change is not needed on all SGIs.  Use it only if the make fails at the\nstage of linking the completed programs.\n\nOn the MIPS R4000 architecture (Indy, etc.), the compiler option \"-mips2\"\nreportedly speeds up the float DCT method substantially, enough to make it\nfaster than the default int method (but still slower than the fast int\nmethod).  If you use -mips2, you may want to alter the default DCT method to\nbe float.  To do this, put \"#define JDCT_DEFAULT JDCT_FLOAT\" in jconfig.h.\n\n\nVMS:\n\nOn an Alpha/VMS system with MMS, be sure to use the \"/Marco=Alpha=1\"\nqualifier with MMS when building the JPEG package.\n\nVAX/VMS v5.5-1 may have problems with the test step of the build procedure\nreporting differences when it compares the original and test images.  If the\nerror points to the last block of the files, it is most likely bogus and may\nbe safely ignored.  It seems to be because the files are Stream_LF and\nBackup/Compare has difficulty with the (presumably) null padded files.\nThis problem was not observed on VAX/VMS v6.1 or AXP/VMS v6.1.\n"
  },
  {
    "path": "jaricom.c",
    "content": "/*\n * jaricom.c\n *\n * Developed 1997-2011 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains probability estimation tables for common use in\n * arithmetic entropy encoding and decoding routines.\n *\n * This data represents Table D.3 in the JPEG spec (D.2 in the draft),\n * ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81, and Table 24\n * in the JBIG spec, ISO/IEC IS 11544 and CCITT Recommendation ITU-T T.82.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n/* The following #define specifies the packing of the four components\n * into the compact INT32 representation.\n * Note that this formula must match the actual arithmetic encoder\n * and decoder implementation.  The implementation has to be changed\n * if this formula is changed.\n * The current organization is leaned on Markus Kuhn's JBIG\n * implementation (jbig_tab.c).\n */\n\n#define V(i,a,b,c,d) (((INT32)a << 16) | ((INT32)c << 8) | ((INT32)d << 7) | b)\n\nconst INT32 jpeg_aritab[113+1] = {\n/*\n * Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS\n */\n  V(   0, 0x5a1d,   1,   1, 1 ),\n  V(   1, 0x2586,  14,   2, 0 ),\n  V(   2, 0x1114,  16,   3, 0 ),\n  V(   3, 0x080b,  18,   4, 0 ),\n  V(   4, 0x03d8,  20,   5, 0 ),\n  V(   5, 0x01da,  23,   6, 0 ),\n  V(   6, 0x00e5,  25,   7, 0 ),\n  V(   7, 0x006f,  28,   8, 0 ),\n  V(   8, 0x0036,  30,   9, 0 ),\n  V(   9, 0x001a,  33,  10, 0 ),\n  V(  10, 0x000d,  35,  11, 0 ),\n  V(  11, 0x0006,   9,  12, 0 ),\n  V(  12, 0x0003,  10,  13, 0 ),\n  V(  13, 0x0001,  12,  13, 0 ),\n  V(  14, 0x5a7f,  15,  15, 1 ),\n  V(  15, 0x3f25,  36,  16, 0 ),\n  V(  16, 0x2cf2,  38,  17, 0 ),\n  V(  17, 0x207c,  39,  18, 0 ),\n  V(  18, 0x17b9,  40,  19, 0 ),\n  V(  19, 0x1182,  42,  20, 0 ),\n  V(  20, 0x0cef,  43,  21, 0 ),\n  V(  21, 0x09a1,  45,  22, 0 ),\n  V(  22, 0x072f,  46,  23, 0 ),\n  V(  23, 0x055c,  48,  24, 0 ),\n  V(  24, 0x0406,  49,  25, 0 ),\n  V(  25, 0x0303,  51,  26, 0 ),\n  V(  26, 0x0240,  52,  27, 0 ),\n  V(  27, 0x01b1,  54,  28, 0 ),\n  V(  28, 0x0144,  56,  29, 0 ),\n  V(  29, 0x00f5,  57,  30, 0 ),\n  V(  30, 0x00b7,  59,  31, 0 ),\n  V(  31, 0x008a,  60,  32, 0 ),\n  V(  32, 0x0068,  62,  33, 0 ),\n  V(  33, 0x004e,  63,  34, 0 ),\n  V(  34, 0x003b,  32,  35, 0 ),\n  V(  35, 0x002c,  33,   9, 0 ),\n  V(  36, 0x5ae1,  37,  37, 1 ),\n  V(  37, 0x484c,  64,  38, 0 ),\n  V(  38, 0x3a0d,  65,  39, 0 ),\n  V(  39, 0x2ef1,  67,  40, 0 ),\n  V(  40, 0x261f,  68,  41, 0 ),\n  V(  41, 0x1f33,  69,  42, 0 ),\n  V(  42, 0x19a8,  70,  43, 0 ),\n  V(  43, 0x1518,  72,  44, 0 ),\n  V(  44, 0x1177,  73,  45, 0 ),\n  V(  45, 0x0e74,  74,  46, 0 ),\n  V(  46, 0x0bfb,  75,  47, 0 ),\n  V(  47, 0x09f8,  77,  48, 0 ),\n  V(  48, 0x0861,  78,  49, 0 ),\n  V(  49, 0x0706,  79,  50, 0 ),\n  V(  50, 0x05cd,  48,  51, 0 ),\n  V(  51, 0x04de,  50,  52, 0 ),\n  V(  52, 0x040f,  50,  53, 0 ),\n  V(  53, 0x0363,  51,  54, 0 ),\n  V(  54, 0x02d4,  52,  55, 0 ),\n  V(  55, 0x025c,  53,  56, 0 ),\n  V(  56, 0x01f8,  54,  57, 0 ),\n  V(  57, 0x01a4,  55,  58, 0 ),\n  V(  58, 0x0160,  56,  59, 0 ),\n  V(  59, 0x0125,  57,  60, 0 ),\n  V(  60, 0x00f6,  58,  61, 0 ),\n  V(  61, 0x00cb,  59,  62, 0 ),\n  V(  62, 0x00ab,  61,  63, 0 ),\n  V(  63, 0x008f,  61,  32, 0 ),\n  V(  64, 0x5b12,  65,  65, 1 ),\n  V(  65, 0x4d04,  80,  66, 0 ),\n  V(  66, 0x412c,  81,  67, 0 ),\n  V(  67, 0x37d8,  82,  68, 0 ),\n  V(  68, 0x2fe8,  83,  69, 0 ),\n  V(  69, 0x293c,  84,  70, 0 ),\n  V(  70, 0x2379,  86,  71, 0 ),\n  V(  71, 0x1edf,  87,  72, 0 ),\n  V(  72, 0x1aa9,  87,  73, 0 ),\n  V(  73, 0x174e,  72,  74, 0 ),\n  V(  74, 0x1424,  72,  75, 0 ),\n  V(  75, 0x119c,  74,  76, 0 ),\n  V(  76, 0x0f6b,  74,  77, 0 ),\n  V(  77, 0x0d51,  75,  78, 0 ),\n  V(  78, 0x0bb6,  77,  79, 0 ),\n  V(  79, 0x0a40,  77,  48, 0 ),\n  V(  80, 0x5832,  80,  81, 1 ),\n  V(  81, 0x4d1c,  88,  82, 0 ),\n  V(  82, 0x438e,  89,  83, 0 ),\n  V(  83, 0x3bdd,  90,  84, 0 ),\n  V(  84, 0x34ee,  91,  85, 0 ),\n  V(  85, 0x2eae,  92,  86, 0 ),\n  V(  86, 0x299a,  93,  87, 0 ),\n  V(  87, 0x2516,  86,  71, 0 ),\n  V(  88, 0x5570,  88,  89, 1 ),\n  V(  89, 0x4ca9,  95,  90, 0 ),\n  V(  90, 0x44d9,  96,  91, 0 ),\n  V(  91, 0x3e22,  97,  92, 0 ),\n  V(  92, 0x3824,  99,  93, 0 ),\n  V(  93, 0x32b4,  99,  94, 0 ),\n  V(  94, 0x2e17,  93,  86, 0 ),\n  V(  95, 0x56a8,  95,  96, 1 ),\n  V(  96, 0x4f46, 101,  97, 0 ),\n  V(  97, 0x47e5, 102,  98, 0 ),\n  V(  98, 0x41cf, 103,  99, 0 ),\n  V(  99, 0x3c3d, 104, 100, 0 ),\n  V( 100, 0x375e,  99,  93, 0 ),\n  V( 101, 0x5231, 105, 102, 0 ),\n  V( 102, 0x4c0f, 106, 103, 0 ),\n  V( 103, 0x4639, 107, 104, 0 ),\n  V( 104, 0x415e, 103,  99, 0 ),\n  V( 105, 0x5627, 105, 106, 1 ),\n  V( 106, 0x50e7, 108, 107, 0 ),\n  V( 107, 0x4b85, 109, 103, 0 ),\n  V( 108, 0x5597, 110, 109, 0 ),\n  V( 109, 0x504f, 111, 107, 0 ),\n  V( 110, 0x5a10, 110, 111, 1 ),\n  V( 111, 0x5522, 112, 109, 0 ),\n  V( 112, 0x59eb, 112, 111, 1 ),\n/*\n * This last entry is used for fixed probability estimate of 0.5\n * as suggested in Section 10.3 Table 5 of ITU-T Rec. T.851.\n */\n  V( 113, 0x5a1d, 113, 113, 0 )\n};\n"
  },
  {
    "path": "jcapimin.c",
    "content": "/*\n * jcapimin.c\n *\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * Modified 2003-2010 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains application interface code for the compression half\n * of the JPEG library.  These are the \"minimum\" API routines that may be\n * needed in either the normal full-compression case or the transcoding-only\n * case.\n *\n * Most of the routines intended to be called directly by an application\n * are in this file or in jcapistd.c.  But also see jcparam.c for\n * parameter-setup helper routines, jcomapi.c for routines shared by\n * compression and decompression, and jctrans.c for the transcoding case.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Initialization of a JPEG compression object.\n * The error manager must already be set up (in case memory manager fails).\n */\n\nGLOBAL(void)\njpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)\n{\n  int i;\n\n  /* Guard against version mismatches between library and caller. */\n  cinfo->mem = NULL;\t\t/* so jpeg_destroy knows mem mgr not called */\n  if (version != JPEG_LIB_VERSION)\n    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);\n  if (structsize != SIZEOF(struct jpeg_compress_struct))\n    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, \n\t     (int) SIZEOF(struct jpeg_compress_struct), (int) structsize);\n\n  /* For debugging purposes, we zero the whole master structure.\n   * But the application has already set the err pointer, and may have set\n   * client_data, so we have to save and restore those fields.\n   * Note: if application hasn't set client_data, tools like Purify may\n   * complain here.\n   */\n  {\n    struct jpeg_error_mgr * err = cinfo->err;\n    void * client_data = cinfo->client_data; /* ignore Purify complaint here */\n    MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct));\n    cinfo->err = err;\n    cinfo->client_data = client_data;\n  }\n  cinfo->is_decompressor = FALSE;\n\n  /* Initialize a memory manager instance for this object */\n  jinit_memory_mgr((j_common_ptr) cinfo);\n\n  /* Zero out pointers to permanent structures. */\n  cinfo->progress = NULL;\n  cinfo->dest = NULL;\n\n  cinfo->comp_info = NULL;\n\n  for (i = 0; i < NUM_QUANT_TBLS; i++) {\n    cinfo->quant_tbl_ptrs[i] = NULL;\n    cinfo->q_scale_factor[i] = 100;\n  }\n\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    cinfo->dc_huff_tbl_ptrs[i] = NULL;\n    cinfo->ac_huff_tbl_ptrs[i] = NULL;\n  }\n\n  /* Must do it here for emit_dqt in case jpeg_write_tables is used */\n  cinfo->block_size = DCTSIZE;\n  cinfo->natural_order = jpeg_natural_order;\n  cinfo->lim_Se = DCTSIZE2-1;\n\n  cinfo->script_space = NULL;\n\n  cinfo->input_gamma = 1.0;\t/* in case application forgets */\n\n  /* OK, I'm ready */\n  cinfo->global_state = CSTATE_START;\n}\n\n\n/*\n * Destruction of a JPEG compression object\n */\n\nGLOBAL(void)\njpeg_destroy_compress (j_compress_ptr cinfo)\n{\n  jpeg_destroy((j_common_ptr) cinfo); /* use common routine */\n}\n\n\n/*\n * Abort processing of a JPEG compression operation,\n * but don't destroy the object itself.\n */\n\nGLOBAL(void)\njpeg_abort_compress (j_compress_ptr cinfo)\n{\n  jpeg_abort((j_common_ptr) cinfo); /* use common routine */\n}\n\n\n/*\n * Forcibly suppress or un-suppress all quantization and Huffman tables.\n * Marks all currently defined tables as already written (if suppress)\n * or not written (if !suppress).  This will control whether they get emitted\n * by a subsequent jpeg_start_compress call.\n *\n * This routine is exported for use by applications that want to produce\n * abbreviated JPEG datastreams.  It logically belongs in jcparam.c, but\n * since it is called by jpeg_start_compress, we put it here --- otherwise\n * jcparam.o would be linked whether the application used it or not.\n */\n\nGLOBAL(void)\njpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress)\n{\n  int i;\n  JQUANT_TBL * qtbl;\n  JHUFF_TBL * htbl;\n\n  for (i = 0; i < NUM_QUANT_TBLS; i++) {\n    if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)\n      qtbl->sent_table = suppress;\n  }\n\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL)\n      htbl->sent_table = suppress;\n    if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL)\n      htbl->sent_table = suppress;\n  }\n}\n\n\n/*\n * Finish JPEG compression.\n *\n * If a multipass operating mode was selected, this may do a great deal of\n * work including most of the actual output.\n */\n\nGLOBAL(void)\njpeg_finish_compress (j_compress_ptr cinfo)\n{\n  JDIMENSION iMCU_row;\n\n  if (cinfo->global_state == CSTATE_SCANNING ||\n      cinfo->global_state == CSTATE_RAW_OK) {\n    /* Terminate first pass */\n    if (cinfo->next_scanline < cinfo->image_height)\n      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);\n    (*cinfo->master->finish_pass) (cinfo);\n  } else if (cinfo->global_state != CSTATE_WRCOEFS)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  /* Perform any remaining passes */\n  while (! cinfo->master->is_last_pass) {\n    (*cinfo->master->prepare_for_pass) (cinfo);\n    for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {\n      if (cinfo->progress != NULL) {\n\tcinfo->progress->pass_counter = (long) iMCU_row;\n\tcinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;\n\t(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n      }\n      /* We bypass the main controller and invoke coef controller directly;\n       * all work is being done from the coefficient buffer.\n       */\n      if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL))\n\tERREXIT(cinfo, JERR_CANT_SUSPEND);\n    }\n    (*cinfo->master->finish_pass) (cinfo);\n  }\n  /* Write EOI, do final cleanup */\n  (*cinfo->marker->write_file_trailer) (cinfo);\n  (*cinfo->dest->term_destination) (cinfo);\n  /* We can use jpeg_abort to release memory and reset global_state */\n  jpeg_abort((j_common_ptr) cinfo);\n}\n\n\n/*\n * Write a special marker.\n * This is only recommended for writing COM or APPn markers.\n * Must be called after jpeg_start_compress() and before\n * first call to jpeg_write_scanlines() or jpeg_write_raw_data().\n */\n\nGLOBAL(void)\njpeg_write_marker (j_compress_ptr cinfo, int marker,\n\t\t   const JOCTET *dataptr, unsigned int datalen)\n{\n  JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val));\n\n  if (cinfo->next_scanline != 0 ||\n      (cinfo->global_state != CSTATE_SCANNING &&\n       cinfo->global_state != CSTATE_RAW_OK &&\n       cinfo->global_state != CSTATE_WRCOEFS))\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);\n  write_marker_byte = cinfo->marker->write_marker_byte;\t/* copy for speed */\n  while (datalen--) {\n    (*write_marker_byte) (cinfo, *dataptr);\n    dataptr++;\n  }\n}\n\n/* Same, but piecemeal. */\n\nGLOBAL(void)\njpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen)\n{\n  if (cinfo->next_scanline != 0 ||\n      (cinfo->global_state != CSTATE_SCANNING &&\n       cinfo->global_state != CSTATE_RAW_OK &&\n       cinfo->global_state != CSTATE_WRCOEFS))\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);\n}\n\nGLOBAL(void)\njpeg_write_m_byte (j_compress_ptr cinfo, int val)\n{\n  (*cinfo->marker->write_marker_byte) (cinfo, val);\n}\n\n\n/*\n * Alternate compression function: just write an abbreviated table file.\n * Before calling this, all parameters and a data destination must be set up.\n *\n * To produce a pair of files containing abbreviated tables and abbreviated\n * image data, one would proceed as follows:\n *\n *\t\tinitialize JPEG object\n *\t\tset JPEG parameters\n *\t\tset destination to table file\n *\t\tjpeg_write_tables(cinfo);\n *\t\tset destination to image file\n *\t\tjpeg_start_compress(cinfo, FALSE);\n *\t\twrite data...\n *\t\tjpeg_finish_compress(cinfo);\n *\n * jpeg_write_tables has the side effect of marking all tables written\n * (same as jpeg_suppress_tables(..., TRUE)).  Thus a subsequent start_compress\n * will not re-emit the tables unless it is passed write_all_tables=TRUE.\n */\n\nGLOBAL(void)\njpeg_write_tables (j_compress_ptr cinfo)\n{\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* (Re)initialize error mgr and destination modules */\n  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);\n  (*cinfo->dest->init_destination) (cinfo);\n  /* Initialize the marker writer ... bit of a crock to do it here. */\n  jinit_marker_writer(cinfo);\n  /* Write them tables! */\n  (*cinfo->marker->write_tables_only) (cinfo);\n  /* And clean up. */\n  (*cinfo->dest->term_destination) (cinfo);\n  /*\n   * In library releases up through v6a, we called jpeg_abort() here to free\n   * any working memory allocated by the destination manager and marker\n   * writer.  Some applications had a problem with that: they allocated space\n   * of their own from the library memory manager, and didn't want it to go\n   * away during write_tables.  So now we do nothing.  This will cause a\n   * memory leak if an app calls write_tables repeatedly without doing a full\n   * compression cycle or otherwise resetting the JPEG object.  However, that\n   * seems less bad than unexpectedly freeing memory in the normal case.\n   * An app that prefers the old behavior can call jpeg_abort for itself after\n   * each call to jpeg_write_tables().\n   */\n}\n"
  },
  {
    "path": "jcapistd.c",
    "content": "/*\n * jcapistd.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains application interface code for the compression half\n * of the JPEG library.  These are the \"standard\" API routines that are\n * used in the normal full-compression case.  They are not used by a\n * transcoding-only application.  Note that if an application links in\n * jpeg_start_compress, it will end up linking in the entire compressor.\n * We thus must separate this file from jcapimin.c to avoid linking the\n * whole compression library into a transcoder.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Compression initialization.\n * Before calling this, all parameters and a data destination must be set up.\n *\n * We require a write_all_tables parameter as a failsafe check when writing\n * multiple datastreams from the same compression object.  Since prior runs\n * will have left all the tables marked sent_table=TRUE, a subsequent run\n * would emit an abbreviated stream (no tables) by default.  This may be what\n * is wanted, but for safety's sake it should not be the default behavior:\n * programmers should have to make a deliberate choice to emit abbreviated\n * images.  Therefore the documentation and examples should encourage people\n * to pass write_all_tables=TRUE; then it will take active thought to do the\n * wrong thing.\n */\n\nGLOBAL(void)\njpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)\n{\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  if (write_all_tables)\n    jpeg_suppress_tables(cinfo, FALSE);\t/* mark all tables to be written */\n\n  /* (Re)initialize error mgr and destination modules */\n  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);\n  (*cinfo->dest->init_destination) (cinfo);\n  /* Perform master selection of active modules */\n  jinit_compress_master(cinfo);\n  /* Set up for the first pass */\n  (*cinfo->master->prepare_for_pass) (cinfo);\n  /* Ready for application to drive first pass through jpeg_write_scanlines\n   * or jpeg_write_raw_data.\n   */\n  cinfo->next_scanline = 0;\n  cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING);\n}\n\n\n/*\n * Write some scanlines of data to the JPEG compressor.\n *\n * The return value will be the number of lines actually written.\n * This should be less than the supplied num_lines only in case that\n * the data destination module has requested suspension of the compressor,\n * or if more than image_height scanlines are passed in.\n *\n * Note: we warn about excess calls to jpeg_write_scanlines() since\n * this likely signals an application programmer error.  However,\n * excess scanlines passed in the last valid call are *silently* ignored,\n * so that the application need not adjust num_lines for end-of-image\n * when using a multiple-scanline buffer.\n */\n\nGLOBAL(JDIMENSION)\njpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,\n\t\t      JDIMENSION num_lines)\n{\n  JDIMENSION row_ctr, rows_left;\n\n  if (cinfo->global_state != CSTATE_SCANNING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  if (cinfo->next_scanline >= cinfo->image_height)\n    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);\n\n  /* Call progress monitor hook if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->pass_counter = (long) cinfo->next_scanline;\n    cinfo->progress->pass_limit = (long) cinfo->image_height;\n    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n  }\n\n  /* Give master control module another chance if this is first call to\n   * jpeg_write_scanlines.  This lets output of the frame/scan headers be\n   * delayed so that application can write COM, etc, markers between\n   * jpeg_start_compress and jpeg_write_scanlines.\n   */\n  if (cinfo->master->call_pass_startup)\n    (*cinfo->master->pass_startup) (cinfo);\n\n  /* Ignore any extra scanlines at bottom of image. */\n  rows_left = cinfo->image_height - cinfo->next_scanline;\n  if (num_lines > rows_left)\n    num_lines = rows_left;\n\n  row_ctr = 0;\n  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);\n  cinfo->next_scanline += row_ctr;\n  return row_ctr;\n}\n\n\n/*\n * Alternate entry point to write raw data.\n * Processes exactly one iMCU row per call, unless suspended.\n */\n\nGLOBAL(JDIMENSION)\njpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,\n\t\t     JDIMENSION num_lines)\n{\n  JDIMENSION lines_per_iMCU_row;\n\n  if (cinfo->global_state != CSTATE_RAW_OK)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  if (cinfo->next_scanline >= cinfo->image_height) {\n    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);\n    return 0;\n  }\n\n  /* Call progress monitor hook if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->pass_counter = (long) cinfo->next_scanline;\n    cinfo->progress->pass_limit = (long) cinfo->image_height;\n    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n  }\n\n  /* Give master control module another chance if this is first call to\n   * jpeg_write_raw_data.  This lets output of the frame/scan headers be\n   * delayed so that application can write COM, etc, markers between\n   * jpeg_start_compress and jpeg_write_raw_data.\n   */\n  if (cinfo->master->call_pass_startup)\n    (*cinfo->master->pass_startup) (cinfo);\n\n  /* Verify that at least one iMCU row has been passed. */\n  lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_v_scaled_size;\n  if (num_lines < lines_per_iMCU_row)\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* Directly compress the row. */\n  if (! (*cinfo->coef->compress_data) (cinfo, data)) {\n    /* If compressor did not consume the whole row, suspend processing. */\n    return 0;\n  }\n\n  /* OK, we processed one iMCU row. */\n  cinfo->next_scanline += lines_per_iMCU_row;\n  return lines_per_iMCU_row;\n}\n"
  },
  {
    "path": "jcarith.c",
    "content": "/*\n * jcarith.c\n *\n * Developed 1997-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains portable arithmetic entropy encoding routines for JPEG\n * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).\n *\n * Both sequential and progressive modes are supported in this single module.\n *\n * Suspension is not currently supported in this module.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Expanded entropy encoder object for arithmetic encoding. */\n\ntypedef struct {\n  struct jpeg_entropy_encoder pub; /* public fields */\n\n  INT32 c; /* C register, base of coding interval, layout as in sec. D.1.3 */\n  INT32 a;               /* A register, normalized size of coding interval */\n  INT32 sc;        /* counter for stacked 0xFF values which might overflow */\n  INT32 zc;          /* counter for pending 0x00 output values which might *\n                          * be discarded at the end (\"Pacman\" termination) */\n  int ct;  /* bit shift counter, determines when next byte will be written */\n  int buffer;                /* buffer for most recent output byte != 0xFF */\n\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n  int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */\n\n  unsigned int restarts_to_go;\t/* MCUs left in this restart interval */\n  int next_restart_num;\t\t/* next restart number to write (0-7) */\n\n  /* Pointers to statistics areas (these workspaces have image lifespan) */\n  unsigned char * dc_stats[NUM_ARITH_TBLS];\n  unsigned char * ac_stats[NUM_ARITH_TBLS];\n\n  /* Statistics bin for coding with fixed probability 0.5 */\n  unsigned char fixed_bin[4];\n} arith_entropy_encoder;\n\ntypedef arith_entropy_encoder * arith_entropy_ptr;\n\n/* The following two definitions specify the allocation chunk size\n * for the statistics area.\n * According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least\n * 49 statistics bins for DC, and 245 statistics bins for AC coding.\n *\n * We use a compact representation with 1 byte per statistics bin,\n * thus the numbers directly represent byte sizes.\n * This 1 byte per statistics bin contains the meaning of the MPS\n * (more probable symbol) in the highest bit (mask 0x80), and the\n * index into the probability estimation state machine table\n * in the lower bits (mask 0x7F).\n */\n\n#define DC_STAT_BINS 64\n#define AC_STAT_BINS 256\n\n/* NOTE: Uncomment the following #define if you want to use the\n * given formula for calculating the AC conditioning parameter Kx\n * for spectral selection progressive coding in section G.1.3.2\n * of the spec (Kx = Kmin + SRL (8 + Se - Kmin) 4).\n * Although the spec and P&M authors claim that this \"has proven\n * to give good results for 8 bit precision samples\", I'm not\n * convinced yet that this is really beneficial.\n * Early tests gave only very marginal compression enhancements\n * (a few - around 5 or so - bytes even for very large files),\n * which would turn out rather negative if we'd suppress the\n * DAC (Define Arithmetic Conditioning) marker segments for\n * the default parameters in the future.\n * Note that currently the marker writing module emits 12-byte\n * DAC segments for a full-component scan in a color image.\n * This is not worth worrying about IMHO. However, since the\n * spec defines the default values to be used if the tables\n * are omitted (unlike Huffman tables, which are required\n * anyway), one might optimize this behaviour in the future,\n * and then it would be disadvantageous to use custom tables if\n * they don't provide sufficient gain to exceed the DAC size.\n *\n * On the other hand, I'd consider it as a reasonable result\n * that the conditioning has no significant influence on the\n * compression performance. This means that the basic\n * statistical model is already rather stable.\n *\n * Thus, at the moment, we use the default conditioning values\n * anyway, and do not use the custom formula.\n *\n#define CALCULATE_SPECTRAL_CONDITIONING\n */\n\n/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.\n * We assume that int right shift is unsigned if INT32 right shift is,\n * which should be safe.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define ISHIFT_TEMPS\tint ishift_temp;\n#define IRIGHT_SHIFT(x,shft)  \\\n\t((ishift_temp = (x)) < 0 ? \\\n\t (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \\\n\t (ishift_temp >> (shft)))\n#else\n#define ISHIFT_TEMPS\n#define IRIGHT_SHIFT(x,shft)\t((x) >> (shft))\n#endif\n\n\nLOCAL(void)\nemit_byte (int val, j_compress_ptr cinfo)\n/* Write next output byte; we do not support suspension in this module. */\n{\n  struct jpeg_destination_mgr * dest = cinfo->dest;\n\n  *dest->next_output_byte++ = (JOCTET) val;\n  if (--dest->free_in_buffer == 0)\n    if (! (*dest->empty_output_buffer) (cinfo))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n}\n\n\n/*\n * Finish up at the end of an arithmetic-compressed scan.\n */\n\nMETHODDEF(void)\nfinish_pass (j_compress_ptr cinfo)\n{\n  arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;\n  INT32 temp;\n\n  /* Section D.1.8: Termination of encoding */\n\n  /* Find the e->c in the coding interval with the largest\n   * number of trailing zero bits */\n  if ((temp = (e->a - 1 + e->c) & 0xFFFF0000L) < e->c)\n    e->c = temp + 0x8000L;\n  else\n    e->c = temp;\n  /* Send remaining bytes to output */\n  e->c <<= e->ct;\n  if (e->c & 0xF8000000L) {\n    /* One final overflow has to be handled */\n    if (e->buffer >= 0) {\n      if (e->zc)\n\tdo emit_byte(0x00, cinfo);\n\twhile (--e->zc);\n      emit_byte(e->buffer + 1, cinfo);\n      if (e->buffer + 1 == 0xFF)\n\temit_byte(0x00, cinfo);\n    }\n    e->zc += e->sc;  /* carry-over converts stacked 0xFF bytes to 0x00 */\n    e->sc = 0;\n  } else {\n    if (e->buffer == 0)\n      ++e->zc;\n    else if (e->buffer >= 0) {\n      if (e->zc)\n\tdo emit_byte(0x00, cinfo);\n\twhile (--e->zc);\n      emit_byte(e->buffer, cinfo);\n    }\n    if (e->sc) {\n      if (e->zc)\n\tdo emit_byte(0x00, cinfo);\n\twhile (--e->zc);\n      do {\n\temit_byte(0xFF, cinfo);\n\temit_byte(0x00, cinfo);\n      } while (--e->sc);\n    }\n  }\n  /* Output final bytes only if they are not 0x00 */\n  if (e->c & 0x7FFF800L) {\n    if (e->zc)  /* output final pending zero bytes */\n      do emit_byte(0x00, cinfo);\n      while (--e->zc);\n    emit_byte((e->c >> 19) & 0xFF, cinfo);\n    if (((e->c >> 19) & 0xFF) == 0xFF)\n      emit_byte(0x00, cinfo);\n    if (e->c & 0x7F800L) {\n      emit_byte((e->c >> 11) & 0xFF, cinfo);\n      if (((e->c >> 11) & 0xFF) == 0xFF)\n\temit_byte(0x00, cinfo);\n    }\n  }\n}\n\n\n/*\n * The core arithmetic encoding routine (common in JPEG and JBIG).\n * This needs to go as fast as possible.\n * Machine-dependent optimization facilities\n * are not utilized in this portable implementation.\n * However, this code should be fairly efficient and\n * may be a good base for further optimizations anyway.\n *\n * Parameter 'val' to be encoded may be 0 or 1 (binary decision).\n *\n * Note: I've added full \"Pacman\" termination support to the\n * byte output routines, which is equivalent to the optional\n * Discard_final_zeros procedure (Figure D.15) in the spec.\n * Thus, we always produce the shortest possible output\n * stream compliant to the spec (no trailing zero bytes,\n * except for FF stuffing).\n *\n * I've also introduced a new scheme for accessing\n * the probability estimation state machine table,\n * derived from Markus Kuhn's JBIG implementation.\n */\n\nLOCAL(void)\narith_encode (j_compress_ptr cinfo, unsigned char *st, int val) \n{\n  register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;\n  register unsigned char nl, nm;\n  register INT32 qe, temp;\n  register int sv;\n\n  /* Fetch values from our compact representation of Table D.3(D.2):\n   * Qe values and probability estimation state machine\n   */\n  sv = *st;\n  qe = jpeg_aritab[sv & 0x7F];\t/* => Qe_Value */\n  nl = qe & 0xFF; qe >>= 8;\t/* Next_Index_LPS + Switch_MPS */\n  nm = qe & 0xFF; qe >>= 8;\t/* Next_Index_MPS */\n\n  /* Encode & estimation procedures per sections D.1.4 & D.1.5 */\n  e->a -= qe;\n  if (val != (sv >> 7)) {\n    /* Encode the less probable symbol */\n    if (e->a >= qe) {\n      /* If the interval size (qe) for the less probable symbol (LPS)\n       * is larger than the interval size for the MPS, then exchange\n       * the two symbols for coding efficiency, otherwise code the LPS\n       * as usual: */\n      e->c += e->a;\n      e->a = qe;\n    }\n    *st = (sv & 0x80) ^ nl;\t/* Estimate_after_LPS */\n  } else {\n    /* Encode the more probable symbol */\n    if (e->a >= 0x8000L)\n      return;  /* A >= 0x8000 -> ready, no renormalization required */\n    if (e->a < qe) {\n      /* If the interval size (qe) for the less probable symbol (LPS)\n       * is larger than the interval size for the MPS, then exchange\n       * the two symbols for coding efficiency: */\n      e->c += e->a;\n      e->a = qe;\n    }\n    *st = (sv & 0x80) ^ nm;\t/* Estimate_after_MPS */\n  }\n\n  /* Renormalization & data output per section D.1.6 */\n  do {\n    e->a <<= 1;\n    e->c <<= 1;\n    if (--e->ct == 0) {\n      /* Another byte is ready for output */\n      temp = e->c >> 19;\n      if (temp > 0xFF) {\n\t/* Handle overflow over all stacked 0xFF bytes */\n\tif (e->buffer >= 0) {\n\t  if (e->zc)\n\t    do emit_byte(0x00, cinfo);\n\t    while (--e->zc);\n\t  emit_byte(e->buffer + 1, cinfo);\n\t  if (e->buffer + 1 == 0xFF)\n\t    emit_byte(0x00, cinfo);\n\t}\n\te->zc += e->sc;  /* carry-over converts stacked 0xFF bytes to 0x00 */\n\te->sc = 0;\n\t/* Note: The 3 spacer bits in the C register guarantee\n\t * that the new buffer byte can't be 0xFF here\n\t * (see page 160 in the P&M JPEG book). */\n\te->buffer = temp & 0xFF;  /* new output byte, might overflow later */\n      } else if (temp == 0xFF) {\n\t++e->sc;  /* stack 0xFF byte (which might overflow later) */\n      } else {\n\t/* Output all stacked 0xFF bytes, they will not overflow any more */\n\tif (e->buffer == 0)\n\t  ++e->zc;\n\telse if (e->buffer >= 0) {\n\t  if (e->zc)\n\t    do emit_byte(0x00, cinfo);\n\t    while (--e->zc);\n\t  emit_byte(e->buffer, cinfo);\n\t}\n\tif (e->sc) {\n\t  if (e->zc)\n\t    do emit_byte(0x00, cinfo);\n\t    while (--e->zc);\n\t  do {\n\t    emit_byte(0xFF, cinfo);\n\t    emit_byte(0x00, cinfo);\n\t  } while (--e->sc);\n\t}\n\te->buffer = temp & 0xFF;  /* new output byte (can still overflow) */\n      }\n      e->c &= 0x7FFFFL;\n      e->ct += 8;\n    }\n  } while (e->a < 0x8000L);\n}\n\n\n/*\n * Emit a restart marker & resynchronize predictions.\n */\n\nLOCAL(void)\nemit_restart (j_compress_ptr cinfo, int restart_num)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  int ci;\n  jpeg_component_info * compptr;\n\n  finish_pass(cinfo);\n\n  emit_byte(0xFF, cinfo);\n  emit_byte(JPEG_RST0 + restart_num, cinfo);\n\n  /* Re-initialize statistics areas */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* DC needs no table for refinement scan */\n    if (cinfo->Ss == 0 && cinfo->Ah == 0) {\n      MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);\n      /* Reset DC predictions to 0 */\n      entropy->last_dc_val[ci] = 0;\n      entropy->dc_context[ci] = 0;\n    }\n    /* AC needs no table when not present */\n    if (cinfo->Se) {\n      MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);\n    }\n  }\n\n  /* Reset arithmetic encoding variables */\n  entropy->c = 0;\n  entropy->a = 0x10000L;\n  entropy->sc = 0;\n  entropy->zc = 0;\n  entropy->ct = 11;\n  entropy->buffer = -1;  /* empty */\n}\n\n\n/*\n * MCU encoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  unsigned char *st;\n  int blkn, ci, tbl;\n  int v, v2, m;\n  ISHIFT_TEMPS\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    ci = cinfo->MCU_membership[blkn];\n    tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;\n\n    /* Compute the DC value after the required point transform by Al.\n     * This is simply an arithmetic right shift.\n     */\n    m = IRIGHT_SHIFT((int) (MCU_data[blkn][0][0]), cinfo->Al);\n\n    /* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */\n\n    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */\n    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];\n\n    /* Figure F.4: Encode_DC_DIFF */\n    if ((v = m - entropy->last_dc_val[ci]) == 0) {\n      arith_encode(cinfo, st, 0);\n      entropy->dc_context[ci] = 0;\t/* zero diff category */\n    } else {\n      entropy->last_dc_val[ci] = m;\n      arith_encode(cinfo, st, 1);\n      /* Figure F.6: Encoding nonzero value v */\n      /* Figure F.7: Encoding the sign of v */\n      if (v > 0) {\n\tarith_encode(cinfo, st + 1, 0);\t/* Table F.4: SS = S0 + 1 */\n\tst += 2;\t\t\t/* Table F.4: SP = S0 + 2 */\n\tentropy->dc_context[ci] = 4;\t/* small positive diff category */\n      } else {\n\tv = -v;\n\tarith_encode(cinfo, st + 1, 1);\t/* Table F.4: SS = S0 + 1 */\n\tst += 3;\t\t\t/* Table F.4: SN = S0 + 3 */\n\tentropy->dc_context[ci] = 8;\t/* small negative diff category */\n      }\n      /* Figure F.8: Encoding the magnitude category of v */\n      m = 0;\n      if (v -= 1) {\n\tarith_encode(cinfo, st, 1);\n\tm = 1;\n\tv2 = v;\n\tst = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */\n\twhile (v2 >>= 1) {\n\t  arith_encode(cinfo, st, 1);\n\t  m <<= 1;\n\t  st += 1;\n\t}\n      }\n      arith_encode(cinfo, st, 0);\n      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */\n      if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))\n\tentropy->dc_context[ci] = 0;\t/* zero diff category */\n      else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))\n\tentropy->dc_context[ci] += 8;\t/* large diff category */\n      /* Figure F.9: Encoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n\tarith_encode(cinfo, st, (m & v) ? 1 : 0);\n    }\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  const int * natural_order;\n  JBLOCKROW block;\n  unsigned char *st;\n  int tbl, k, ke;\n  int v, v2, m;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  natural_order = cinfo->natural_order;\n\n  /* Encode the MCU data block */\n  block = MCU_data[0];\n  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;\n\n  /* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */\n\n  /* Establish EOB (end-of-block) index */\n  ke = cinfo->Se;\n  do {\n    /* We must apply the point transform by Al.  For AC coefficients this\n     * is an integer division with rounding towards 0.  To do this portably\n     * in C, we shift after obtaining the absolute value.\n     */\n    if ((v = (*block)[natural_order[ke]]) >= 0) {\n      if (v >>= cinfo->Al) break;\n    } else {\n      v = -v;\n      if (v >>= cinfo->Al) break;\n    }\n  } while (--ke);\n\n  /* Figure F.5: Encode_AC_Coefficients */\n  for (k = cinfo->Ss - 1; k < ke;) {\n    st = entropy->ac_stats[tbl] + 3 * k;\n    arith_encode(cinfo, st, 0);\t\t/* EOB decision */\n    for (;;) {\n      if ((v = (*block)[natural_order[++k]]) >= 0) {\n\tif (v >>= cinfo->Al) {\n\t  arith_encode(cinfo, st + 1, 1);\n\t  arith_encode(cinfo, entropy->fixed_bin, 0);\n\t  break;\n\t}\n      } else {\n\tv = -v;\n\tif (v >>= cinfo->Al) {\n\t  arith_encode(cinfo, st + 1, 1);\n\t  arith_encode(cinfo, entropy->fixed_bin, 1);\n\t  break;\n\t}\n      }\n      arith_encode(cinfo, st + 1, 0);\n      st += 3;\n    }\n    st += 2;\n    /* Figure F.8: Encoding the magnitude category of v */\n    m = 0;\n    if (v -= 1) {\n      arith_encode(cinfo, st, 1);\n      m = 1;\n      v2 = v;\n      if (v2 >>= 1) {\n\tarith_encode(cinfo, st, 1);\n\tm <<= 1;\n\tst = entropy->ac_stats[tbl] +\n\t     (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);\n\twhile (v2 >>= 1) {\n\t  arith_encode(cinfo, st, 1);\n\t  m <<= 1;\n\t  st += 1;\n\t}\n      }\n    }\n    arith_encode(cinfo, st, 0);\n    /* Figure F.9: Encoding the magnitude bit pattern of v */\n    st += 14;\n    while (m >>= 1)\n      arith_encode(cinfo, st, (m & v) ? 1 : 0);\n  }\n  /* Encode EOB decision only if k < cinfo->Se */\n  if (k < cinfo->Se) {\n    st = entropy->ac_stats[tbl] + 3 * k;\n    arith_encode(cinfo, st, 1);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for DC successive approximation refinement scan.\n * Note: we assume such scans can be multi-component,\n * although the spec is not very clear on the point.\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  unsigned char *st;\n  int Al, blkn;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  st = entropy->fixed_bin;\t/* use fixed probability estimation */\n  Al = cinfo->Al;\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    /* We simply emit the Al'th bit of the DC coefficient value. */\n    arith_encode(cinfo, st, (MCU_data[blkn][0][0] >> Al) & 1);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  const int * natural_order;\n  JBLOCKROW block;\n  unsigned char *st;\n  int tbl, k, ke, kex;\n  int v;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  natural_order = cinfo->natural_order;\n\n  /* Encode the MCU data block */\n  block = MCU_data[0];\n  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;\n\n  /* Section G.1.3.3: Encoding of AC coefficients */\n\n  /* Establish EOB (end-of-block) index */\n  ke = cinfo->Se;\n  do {\n    /* We must apply the point transform by Al.  For AC coefficients this\n     * is an integer division with rounding towards 0.  To do this portably\n     * in C, we shift after obtaining the absolute value.\n     */\n    if ((v = (*block)[natural_order[ke]]) >= 0) {\n      if (v >>= cinfo->Al) break;\n    } else {\n      v = -v;\n      if (v >>= cinfo->Al) break;\n    }\n  } while (--ke);\n\n  /* Establish EOBx (previous stage end-of-block) index */\n  for (kex = ke; kex > 0; kex--)\n    if ((v = (*block)[natural_order[kex]]) >= 0) {\n      if (v >>= cinfo->Ah) break;\n    } else {\n      v = -v;\n      if (v >>= cinfo->Ah) break;\n    }\n\n  /* Figure G.10: Encode_AC_Coefficients_SA */\n  for (k = cinfo->Ss - 1; k < ke;) {\n    st = entropy->ac_stats[tbl] + 3 * k;\n    if (k >= kex)\n      arith_encode(cinfo, st, 0);\t/* EOB decision */\n    for (;;) {\n      if ((v = (*block)[natural_order[++k]]) >= 0) {\n\tif (v >>= cinfo->Al) {\n\t  if (v >> 1)\t\t\t/* previously nonzero coef */\n\t    arith_encode(cinfo, st + 2, (v & 1));\n\t  else {\t\t\t/* newly nonzero coef */\n\t    arith_encode(cinfo, st + 1, 1);\n\t    arith_encode(cinfo, entropy->fixed_bin, 0);\n\t  }\n\t  break;\n\t}\n      } else {\n\tv = -v;\n\tif (v >>= cinfo->Al) {\n\t  if (v >> 1)\t\t\t/* previously nonzero coef */\n\t    arith_encode(cinfo, st + 2, (v & 1));\n\t  else {\t\t\t/* newly nonzero coef */\n\t    arith_encode(cinfo, st + 1, 1);\n\t    arith_encode(cinfo, entropy->fixed_bin, 1);\n\t  }\n\t  break;\n\t}\n      }\n      arith_encode(cinfo, st + 1, 0);\n      st += 3;\n    }\n  }\n  /* Encode EOB decision only if k < cinfo->Se */\n  if (k < cinfo->Se) {\n    st = entropy->ac_stats[tbl] + 3 * k;\n    arith_encode(cinfo, st, 1);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Encode and output one MCU's worth of arithmetic-compressed coefficients.\n */\n\nMETHODDEF(boolean)\nencode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  const int * natural_order;\n  JBLOCKROW block;\n  unsigned char *st;\n  int tbl, k, ke;\n  int v, v2, m;\n  int blkn, ci;\n  jpeg_component_info * compptr;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  natural_order = cinfo->natural_order;\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n\n    /* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */\n\n    tbl = compptr->dc_tbl_no;\n\n    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */\n    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];\n\n    /* Figure F.4: Encode_DC_DIFF */\n    if ((v = (*block)[0] - entropy->last_dc_val[ci]) == 0) {\n      arith_encode(cinfo, st, 0);\n      entropy->dc_context[ci] = 0;\t/* zero diff category */\n    } else {\n      entropy->last_dc_val[ci] = (*block)[0];\n      arith_encode(cinfo, st, 1);\n      /* Figure F.6: Encoding nonzero value v */\n      /* Figure F.7: Encoding the sign of v */\n      if (v > 0) {\n\tarith_encode(cinfo, st + 1, 0);\t/* Table F.4: SS = S0 + 1 */\n\tst += 2;\t\t\t/* Table F.4: SP = S0 + 2 */\n\tentropy->dc_context[ci] = 4;\t/* small positive diff category */\n      } else {\n\tv = -v;\n\tarith_encode(cinfo, st + 1, 1);\t/* Table F.4: SS = S0 + 1 */\n\tst += 3;\t\t\t/* Table F.4: SN = S0 + 3 */\n\tentropy->dc_context[ci] = 8;\t/* small negative diff category */\n      }\n      /* Figure F.8: Encoding the magnitude category of v */\n      m = 0;\n      if (v -= 1) {\n\tarith_encode(cinfo, st, 1);\n\tm = 1;\n\tv2 = v;\n\tst = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */\n\twhile (v2 >>= 1) {\n\t  arith_encode(cinfo, st, 1);\n\t  m <<= 1;\n\t  st += 1;\n\t}\n      }\n      arith_encode(cinfo, st, 0);\n      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */\n      if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))\n\tentropy->dc_context[ci] = 0;\t/* zero diff category */\n      else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))\n\tentropy->dc_context[ci] += 8;\t/* large diff category */\n      /* Figure F.9: Encoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n\tarith_encode(cinfo, st, (m & v) ? 1 : 0);\n    }\n\n    /* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */\n\n    if ((ke = cinfo->lim_Se) == 0) continue;\n    tbl = compptr->ac_tbl_no;\n\n    /* Establish EOB (end-of-block) index */\n    do {\n      if ((*block)[natural_order[ke]]) break;\n    } while (--ke);\n\n    /* Figure F.5: Encode_AC_Coefficients */\n    for (k = 0; k < ke;) {\n      st = entropy->ac_stats[tbl] + 3 * k;\n      arith_encode(cinfo, st, 0);\t/* EOB decision */\n      while ((v = (*block)[natural_order[++k]]) == 0) {\n\tarith_encode(cinfo, st + 1, 0);\n\tst += 3;\n      }\n      arith_encode(cinfo, st + 1, 1);\n      /* Figure F.6: Encoding nonzero value v */\n      /* Figure F.7: Encoding the sign of v */\n      if (v > 0) {\n\tarith_encode(cinfo, entropy->fixed_bin, 0);\n      } else {\n\tv = -v;\n\tarith_encode(cinfo, entropy->fixed_bin, 1);\n      }\n      st += 2;\n      /* Figure F.8: Encoding the magnitude category of v */\n      m = 0;\n      if (v -= 1) {\n\tarith_encode(cinfo, st, 1);\n\tm = 1;\n\tv2 = v;\n\tif (v2 >>= 1) {\n\t  arith_encode(cinfo, st, 1);\n\t  m <<= 1;\n\t  st = entropy->ac_stats[tbl] +\n\t       (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);\n\t  while (v2 >>= 1) {\n\t    arith_encode(cinfo, st, 1);\n\t    m <<= 1;\n\t    st += 1;\n\t  }\n\t}\n      }\n      arith_encode(cinfo, st, 0);\n      /* Figure F.9: Encoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n\tarith_encode(cinfo, st, (m & v) ? 1 : 0);\n    }\n    /* Encode EOB decision only if k < cinfo->lim_Se */\n    if (k < cinfo->lim_Se) {\n      st = entropy->ac_stats[tbl] + 3 * k;\n      arith_encode(cinfo, st, 1);\n    }\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Initialize for an arithmetic-compressed scan.\n */\n\nMETHODDEF(void)\nstart_pass (j_compress_ptr cinfo, boolean gather_statistics)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  int ci, tbl;\n  jpeg_component_info * compptr;\n\n  if (gather_statistics)\n    /* Make sure to avoid that in the master control logic!\n     * We are fully adaptive here and need no extra\n     * statistics gathering pass!\n     */\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n\n  /* We assume jcmaster.c already validated the progressive scan parameters. */\n\n  /* Select execution routines */\n  if (cinfo->progressive_mode) {\n    if (cinfo->Ah == 0) {\n      if (cinfo->Ss == 0)\n\tentropy->pub.encode_mcu = encode_mcu_DC_first;\n      else\n\tentropy->pub.encode_mcu = encode_mcu_AC_first;\n    } else {\n      if (cinfo->Ss == 0)\n\tentropy->pub.encode_mcu = encode_mcu_DC_refine;\n      else\n\tentropy->pub.encode_mcu = encode_mcu_AC_refine;\n    }\n  } else\n    entropy->pub.encode_mcu = encode_mcu;\n\n  /* Allocate & initialize requested statistics areas */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* DC needs no table for refinement scan */\n    if (cinfo->Ss == 0 && cinfo->Ah == 0) {\n      tbl = compptr->dc_tbl_no;\n      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)\n\tERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);\n      if (entropy->dc_stats[tbl] == NULL)\n\tentropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)\n\t  ((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS);\n      MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);\n      /* Initialize DC predictions to 0 */\n      entropy->last_dc_val[ci] = 0;\n      entropy->dc_context[ci] = 0;\n    }\n    /* AC needs no table when not present */\n    if (cinfo->Se) {\n      tbl = compptr->ac_tbl_no;\n      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)\n\tERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);\n      if (entropy->ac_stats[tbl] == NULL)\n\tentropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)\n\t  ((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS);\n      MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);\n#ifdef CALCULATE_SPECTRAL_CONDITIONING\n      if (cinfo->progressive_mode)\n\t/* Section G.1.3.2: Set appropriate arithmetic conditioning value Kx */\n\tcinfo->arith_ac_K[tbl] = cinfo->Ss + ((8 + cinfo->Se - cinfo->Ss) >> 4);\n#endif\n    }\n  }\n\n  /* Initialize arithmetic encoding variables */\n  entropy->c = 0;\n  entropy->a = 0x10000L;\n  entropy->sc = 0;\n  entropy->zc = 0;\n  entropy->ct = 11;\n  entropy->buffer = -1;  /* empty */\n\n  /* Initialize restart stuff */\n  entropy->restarts_to_go = cinfo->restart_interval;\n  entropy->next_restart_num = 0;\n}\n\n\n/*\n * Module initialization routine for arithmetic entropy encoding.\n */\n\nGLOBAL(void)\njinit_arith_encoder (j_compress_ptr cinfo)\n{\n  arith_entropy_ptr entropy;\n  int i;\n\n  entropy = (arith_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(arith_entropy_encoder));\n  cinfo->entropy = &entropy->pub;\n  entropy->pub.start_pass = start_pass;\n  entropy->pub.finish_pass = finish_pass;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_ARITH_TBLS; i++) {\n    entropy->dc_stats[i] = NULL;\n    entropy->ac_stats[i] = NULL;\n  }\n\n  /* Initialize index for fixed probability estimation */\n  entropy->fixed_bin[0] = 113;\n}\n"
  },
  {
    "path": "jccoefct.c",
    "content": "/*\n * jccoefct.c\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * Modified 2003-2011 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the coefficient buffer controller for compression.\n * This controller is the top level of the JPEG compressor proper.\n * The coefficient buffer lies between forward-DCT and entropy encoding steps.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* We use a full-image coefficient buffer when doing Huffman optimization,\n * and also for writing multiple-scan JPEG files.  In all cases, the DCT\n * step is run during the first pass, and subsequent passes need only read\n * the buffered coefficients.\n */\n#ifdef ENTROPY_OPT_SUPPORTED\n#define FULL_COEF_BUFFER_SUPPORTED\n#else\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n#define FULL_COEF_BUFFER_SUPPORTED\n#endif\n#endif\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_c_coef_controller pub; /* public fields */\n\n  JDIMENSION iMCU_row_num;\t/* iMCU row # within image */\n  JDIMENSION mcu_ctr;\t\t/* counts MCUs processed in current row */\n  int MCU_vert_offset;\t\t/* counts MCU rows within iMCU row */\n  int MCU_rows_per_iMCU_row;\t/* number of such rows needed */\n\n  /* For single-pass compression, it's sufficient to buffer just one MCU\n   * (although this may prove a bit slow in practice).  We allocate a\n   * workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each\n   * MCU constructed and sent.  (On 80x86, the workspace is FAR even though\n   * it's not really very big; this is to keep the module interfaces unchanged\n   * when a large coefficient buffer is necessary.)\n   * In multi-pass modes, this array points to the current MCU's blocks\n   * within the virtual arrays.\n   */\n  JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];\n\n  /* In multi-pass modes, we need a virtual block array for each component. */\n  jvirt_barray_ptr whole_image[MAX_COMPONENTS];\n} my_coef_controller;\n\ntypedef my_coef_controller * my_coef_ptr;\n\n\n/* Forward declarations */\nMETHODDEF(boolean) compress_data\n    JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));\n#ifdef FULL_COEF_BUFFER_SUPPORTED\nMETHODDEF(boolean) compress_first_pass\n    JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));\nMETHODDEF(boolean) compress_output\n    JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));\n#endif\n\n\nLOCAL(void)\nstart_iMCU_row (j_compress_ptr cinfo)\n/* Reset within-iMCU-row counters for a new row */\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  /* In an interleaved scan, an MCU row is the same as an iMCU row.\n   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.\n   * But at the bottom of the image, process only what's left.\n   */\n  if (cinfo->comps_in_scan > 1) {\n    coef->MCU_rows_per_iMCU_row = 1;\n  } else {\n    if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;\n    else\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;\n  }\n\n  coef->mcu_ctr = 0;\n  coef->MCU_vert_offset = 0;\n}\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  coef->iMCU_row_num = 0;\n  start_iMCU_row(cinfo);\n\n  switch (pass_mode) {\n  case JBUF_PASS_THRU:\n    if (coef->whole_image[0] != NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    coef->pub.compress_data = compress_data;\n    break;\n#ifdef FULL_COEF_BUFFER_SUPPORTED\n  case JBUF_SAVE_AND_PASS:\n    if (coef->whole_image[0] == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    coef->pub.compress_data = compress_first_pass;\n    break;\n  case JBUF_CRANK_DEST:\n    if (coef->whole_image[0] == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    coef->pub.compress_data = compress_output;\n    break;\n#endif\n  default:\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    break;\n  }\n}\n\n\n/*\n * Process some data in the single-pass case.\n * We process the equivalent of one fully interleaved MCU row (\"iMCU\" row)\n * per call, ie, v_samp_factor block rows for each component in the image.\n * Returns TRUE if the iMCU row is completed, FALSE if suspended.\n *\n * NB: input_buf contains a plane for each component in image,\n * which we index according to the component's SOF position.\n */\n\nMETHODDEF(boolean)\ncompress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;\t/* index of current MCU within row */\n  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  int blkn, bi, ci, yindex, yoffset, blockcnt;\n  JDIMENSION ypos, xpos;\n  jpeg_component_info *compptr;\n  forward_DCT_ptr forward_DCT;\n\n  /* Loop to write as much as one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;\n\t MCU_col_num++) {\n      /* Determine where data comes from in input_buf and do the DCT thing.\n       * Each call on forward_DCT processes a horizontal row of DCT blocks\n       * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks\n       * sequentially.  Dummy blocks at the right or bottom edge are filled in\n       * specially.  The data in them does not matter for image reconstruction,\n       * so we fill them with values that will encode to the smallest amount of\n       * data, viz: all zeroes in the AC entries, DC entries equal to previous\n       * block's DC value.  (Thanks to Thomas Kinsman for this idea.)\n       */\n      blkn = 0;\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n\tcompptr = cinfo->cur_comp_info[ci];\n\tforward_DCT = cinfo->fdct->forward_DCT[compptr->component_index];\n\tblockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width\n\t\t\t\t\t\t: compptr->last_col_width;\n\txpos = MCU_col_num * compptr->MCU_sample_width;\n\typos = yoffset * compptr->DCT_v_scaled_size;\n\t/* ypos == (yoffset+yindex) * DCTSIZE */\n\tfor (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n\t  if (coef->iMCU_row_num < last_iMCU_row ||\n\t      yoffset+yindex < compptr->last_row_height) {\n\t    (*forward_DCT) (cinfo, compptr,\n\t\t\t    input_buf[compptr->component_index],\n\t\t\t    coef->MCU_buffer[blkn],\n\t\t\t    ypos, xpos, (JDIMENSION) blockcnt);\n\t    if (blockcnt < compptr->MCU_width) {\n\t      /* Create some dummy blocks at the right edge of the image. */\n\t      FMEMZERO((void FAR *) coef->MCU_buffer[blkn + blockcnt],\n\t\t       (compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK));\n\t      for (bi = blockcnt; bi < compptr->MCU_width; bi++) {\n\t\tcoef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];\n\t      }\n\t    }\n\t  } else {\n\t    /* Create a row of dummy blocks at the bottom of the image. */\n\t    FMEMZERO((void FAR *) coef->MCU_buffer[blkn],\n\t\t     compptr->MCU_width * SIZEOF(JBLOCK));\n\t    for (bi = 0; bi < compptr->MCU_width; bi++) {\n\t      coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];\n\t    }\n\t  }\n\t  blkn += compptr->MCU_width;\n\t  ypos += compptr->DCT_v_scaled_size;\n\t}\n      }\n      /* Try to write the MCU.  In event of a suspension failure, we will\n       * re-DCT the MCU on restart (a bit inefficient, could be fixed...)\n       */\n      if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {\n\t/* Suspension forced; update state counters and exit */\n\tcoef->MCU_vert_offset = yoffset;\n\tcoef->mcu_ctr = MCU_col_num;\n\treturn FALSE;\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->mcu_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  coef->iMCU_row_num++;\n  start_iMCU_row(cinfo);\n  return TRUE;\n}\n\n\n#ifdef FULL_COEF_BUFFER_SUPPORTED\n\n/*\n * Process some data in the first pass of a multi-pass case.\n * We process the equivalent of one fully interleaved MCU row (\"iMCU\" row)\n * per call, ie, v_samp_factor block rows for each component in the image.\n * This amount of data is read from the source buffer, DCT'd and quantized,\n * and saved into the virtual arrays.  We also generate suitable dummy blocks\n * as needed at the right and lower edges.  (The dummy blocks are constructed\n * in the virtual arrays, which have been padded appropriately.)  This makes\n * it possible for subsequent passes not to worry about real vs. dummy blocks.\n *\n * We must also emit the data to the entropy encoder.  This is conveniently\n * done by calling compress_output() after we've loaded the current strip\n * of the virtual arrays.\n *\n * NB: input_buf contains a plane for each component in image.  All\n * components are DCT'd and loaded into the virtual arrays in this pass.\n * However, it may be that only a subset of the components are emitted to\n * the entropy encoder during this first pass; be careful about looking\n * at the scan-dependent variables (MCU dimensions, etc).\n */\n\nMETHODDEF(boolean)\ncompress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  JDIMENSION blocks_across, MCUs_across, MCUindex;\n  int bi, ci, h_samp_factor, block_row, block_rows, ndummy;\n  JCOEF lastDC;\n  jpeg_component_info *compptr;\n  JBLOCKARRAY buffer;\n  JBLOCKROW thisblockrow, lastblockrow;\n  forward_DCT_ptr forward_DCT;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Align the virtual buffer for this component. */\n    buffer = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[ci],\n       coef->iMCU_row_num * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, TRUE);\n    /* Count non-dummy DCT block rows in this iMCU row. */\n    if (coef->iMCU_row_num < last_iMCU_row)\n      block_rows = compptr->v_samp_factor;\n    else {\n      /* NB: can't use last_row_height here, since may not be set! */\n      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n      if (block_rows == 0) block_rows = compptr->v_samp_factor;\n    }\n    blocks_across = compptr->width_in_blocks;\n    h_samp_factor = compptr->h_samp_factor;\n    /* Count number of dummy blocks to be added at the right margin. */\n    ndummy = (int) (blocks_across % h_samp_factor);\n    if (ndummy > 0)\n      ndummy = h_samp_factor - ndummy;\n    forward_DCT = cinfo->fdct->forward_DCT[ci];\n    /* Perform DCT for all non-dummy blocks in this iMCU row.  Each call\n     * on forward_DCT processes a complete horizontal row of DCT blocks.\n     */\n    for (block_row = 0; block_row < block_rows; block_row++) {\n      thisblockrow = buffer[block_row];\n      (*forward_DCT) (cinfo, compptr, input_buf[ci], thisblockrow,\n\t\t      (JDIMENSION) (block_row * compptr->DCT_v_scaled_size),\n\t\t      (JDIMENSION) 0, blocks_across);\n      if (ndummy > 0) {\n\t/* Create dummy blocks at the right edge of the image. */\n\tthisblockrow += blocks_across; /* => first dummy block */\n\tFMEMZERO((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK));\n\tlastDC = thisblockrow[-1][0];\n\tfor (bi = 0; bi < ndummy; bi++) {\n\t  thisblockrow[bi][0] = lastDC;\n\t}\n      }\n    }\n    /* If at end of image, create dummy block rows as needed.\n     * The tricky part here is that within each MCU, we want the DC values\n     * of the dummy blocks to match the last real block's DC value.\n     * This squeezes a few more bytes out of the resulting file...\n     */\n    if (coef->iMCU_row_num == last_iMCU_row) {\n      blocks_across += ndummy;\t/* include lower right corner */\n      MCUs_across = blocks_across / h_samp_factor;\n      for (block_row = block_rows; block_row < compptr->v_samp_factor;\n\t   block_row++) {\n\tthisblockrow = buffer[block_row];\n\tlastblockrow = buffer[block_row-1];\n\tFMEMZERO((void FAR *) thisblockrow,\n\t\t (size_t) (blocks_across * SIZEOF(JBLOCK)));\n\tfor (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {\n\t  lastDC = lastblockrow[h_samp_factor-1][0];\n\t  for (bi = 0; bi < h_samp_factor; bi++) {\n\t    thisblockrow[bi][0] = lastDC;\n\t  }\n\t  thisblockrow += h_samp_factor; /* advance to next MCU in row */\n\t  lastblockrow += h_samp_factor;\n\t}\n      }\n    }\n  }\n  /* NB: compress_output will increment iMCU_row_num if successful.\n   * A suspension return will result in redoing all the work above next time.\n   */\n\n  /* Emit data to the entropy encoder, sharing code with subsequent passes */\n  return compress_output(cinfo, input_buf);\n}\n\n\n/*\n * Process some data in subsequent passes of a multi-pass case.\n * We process the equivalent of one fully interleaved MCU row (\"iMCU\" row)\n * per call, ie, v_samp_factor block rows for each component in the scan.\n * The data is obtained from the virtual arrays and fed to the entropy coder.\n * Returns TRUE if the iMCU row is completed, FALSE if suspended.\n *\n * NB: input_buf is ignored; it is likely to be a NULL pointer.\n */\n\nMETHODDEF(boolean)\ncompress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;\t/* index of current MCU within row */\n  int blkn, ci, xindex, yindex, yoffset;\n  JDIMENSION start_col;\n  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];\n  JBLOCKROW buffer_ptr;\n  jpeg_component_info *compptr;\n\n  /* Align the virtual buffers for the components used in this scan.\n   * NB: during first pass, this is safe only because the buffers will\n   * already be aligned properly, so jmemmgr.c won't need to do any I/O.\n   */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    buffer[ci] = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],\n       coef->iMCU_row_num * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, FALSE);\n  }\n\n  /* Loop to process one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;\n\t MCU_col_num++) {\n      /* Construct list of pointers to DCT blocks belonging to this MCU */\n      blkn = 0;\t\t\t/* index of current DCT block within MCU */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n\tcompptr = cinfo->cur_comp_info[ci];\n\tstart_col = MCU_col_num * compptr->MCU_width;\n\tfor (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n\t  buffer_ptr = buffer[ci][yindex+yoffset] + start_col;\n\t  for (xindex = 0; xindex < compptr->MCU_width; xindex++) {\n\t    coef->MCU_buffer[blkn++] = buffer_ptr++;\n\t  }\n\t}\n      }\n      /* Try to write the MCU. */\n      if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {\n\t/* Suspension forced; update state counters and exit */\n\tcoef->MCU_vert_offset = yoffset;\n\tcoef->mcu_ctr = MCU_col_num;\n\treturn FALSE;\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->mcu_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  coef->iMCU_row_num++;\n  start_iMCU_row(cinfo);\n  return TRUE;\n}\n\n#endif /* FULL_COEF_BUFFER_SUPPORTED */\n\n\n/*\n * Initialize coefficient buffer controller.\n */\n\nGLOBAL(void)\njinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)\n{\n  my_coef_ptr coef;\n\n  coef = (my_coef_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_coef_controller));\n  cinfo->coef = (struct jpeg_c_coef_controller *) coef;\n  coef->pub.start_pass = start_pass_coef;\n\n  /* Create the coefficient buffer. */\n  if (need_full_buffer) {\n#ifdef FULL_COEF_BUFFER_SUPPORTED\n    /* Allocate a full-image virtual array for each component, */\n    /* padded to a multiple of samp_factor DCT blocks in each direction. */\n    int ci;\n    jpeg_component_info *compptr;\n\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n\t (JDIMENSION) jround_up((long) compptr->width_in_blocks,\n\t\t\t\t(long) compptr->h_samp_factor),\n\t (JDIMENSION) jround_up((long) compptr->height_in_blocks,\n\t\t\t\t(long) compptr->v_samp_factor),\n\t (JDIMENSION) compptr->v_samp_factor);\n    }\n#else\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n#endif\n  } else {\n    /* We only need a single-MCU buffer. */\n    JBLOCKROW buffer;\n    int i;\n\n    buffer = (JBLOCKROW)\n      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));\n    for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {\n      coef->MCU_buffer[i] = buffer + i;\n    }\n    coef->whole_image[0] = NULL; /* flag for no virtual arrays */\n  }\n}\n"
  },
  {
    "path": "jccolor.c",
    "content": "/*\n * jccolor.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * Modified 2011-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains input colorspace conversion routines.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_color_converter pub; /* public fields */\n\n  /* Private state for RGB->YCC conversion */\n  INT32 * rgb_ycc_tab;\t\t/* => table for RGB to YCbCr conversion */\n} my_color_converter;\n\ntypedef my_color_converter * my_cconvert_ptr;\n\n\n/**************** RGB -> YCbCr conversion: most common case **************/\n\n/*\n * YCbCr is defined per Recommendation ITU-R BT.601-7 (03/2011),\n * previously known as Recommendation CCIR 601-1, except that Cb and Cr\n * are normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.\n * sRGB (standard RGB color space) is defined per IEC 61966-2-1:1999.\n * sYCC (standard luma-chroma-chroma color space with extended gamut)\n * is defined per IEC 61966-2-1:1999 Amendment A1:2003 Annex F.\n * bg-sRGB and bg-sYCC (big gamut standard color spaces)\n * are defined per IEC 61966-2-1:1999 Amendment A1:2003 Annex G.\n * Note that the derived conversion coefficients given in some of these\n * documents are imprecise.  The general conversion equations are\n *\tY  = Kr * R + (1 - Kr - Kb) * G + Kb * B\n *\tCb = 0.5 * (B - Y) / (1 - Kb)\n *\tCr = 0.5 * (R - Y) / (1 - Kr)\n * With Kr = 0.299 and Kb = 0.114 (derived according to SMPTE RP 177-1993\n * from the 1953 FCC NTSC primaries and CIE Illuminant C),\n * the conversion equations to be implemented are therefore\n *\tY  =  0.299 * R + 0.587 * G + 0.114 * B\n *\tCb = -0.168735892 * R - 0.331264108 * G + 0.5 * B + CENTERJSAMPLE\n *\tCr =  0.5 * R - 0.418687589 * G - 0.081312411 * B + CENTERJSAMPLE\n * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,\n * rather than CENTERJSAMPLE, for Cb and Cr.  This gave equal positive and\n * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)\n * were not represented exactly.  Now we sacrifice exact representation of\n * maximum red and maximum blue in order to get exact grayscales.\n *\n * To avoid floating-point arithmetic, we represent the fractional constants\n * as integers scaled up by 2^16 (about 4 digits precision); we have to divide\n * the products by 2^16, with appropriate rounding, to get the correct answer.\n *\n * For even more speed, we avoid doing any multiplications in the inner loop\n * by precalculating the constants times R,G,B for all possible values.\n * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);\n * for 9-bit to 12-bit samples it is still acceptable.  It's not very\n * reasonable for 16-bit samples, but if you want lossless storage you\n * shouldn't be changing colorspace anyway.\n * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included\n * in the tables to save adding them separately in the inner loop.\n */\n\n#define SCALEBITS\t16\t/* speediest right-shift on some machines */\n#define CBCR_OFFSET\t((INT32) CENTERJSAMPLE << SCALEBITS)\n#define ONE_HALF\t((INT32) 1 << (SCALEBITS-1))\n#define FIX(x)\t\t((INT32) ((x) * (1L<<SCALEBITS) + 0.5))\n\n/* We allocate one big table and divide it up into eight parts, instead of\n * doing eight alloc_small requests.  This lets us use a single table base\n * address, which can be held in a register in the inner loops on many\n * machines (more than can hold all eight addresses, anyway).\n */\n\n#define R_Y_OFF\t\t0\t\t\t/* offset to R => Y section */\n#define G_Y_OFF\t\t(1*(MAXJSAMPLE+1))\t/* offset to G => Y section */\n#define B_Y_OFF\t\t(2*(MAXJSAMPLE+1))\t/* etc. */\n#define R_CB_OFF\t(3*(MAXJSAMPLE+1))\n#define G_CB_OFF\t(4*(MAXJSAMPLE+1))\n#define B_CB_OFF\t(5*(MAXJSAMPLE+1))\n#define R_CR_OFF\tB_CB_OFF\t\t/* B=>Cb, R=>Cr are the same */\n#define G_CR_OFF\t(6*(MAXJSAMPLE+1))\n#define B_CR_OFF\t(7*(MAXJSAMPLE+1))\n#define TABLE_SIZE\t(8*(MAXJSAMPLE+1))\n\n\n/*\n * Initialize for RGB->YCC colorspace conversion.\n */\n\nMETHODDEF(void)\nrgb_ycc_start (j_compress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  INT32 * rgb_ycc_tab;\n  INT32 i;\n\n  /* Allocate and fill in the conversion tables. */\n  cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(TABLE_SIZE * SIZEOF(INT32)));\n\n  for (i = 0; i <= MAXJSAMPLE; i++) {\n    rgb_ycc_tab[i+R_Y_OFF] = FIX(0.299) * i;\n    rgb_ycc_tab[i+G_Y_OFF] = FIX(0.587) * i;\n    rgb_ycc_tab[i+B_Y_OFF] = FIX(0.114) * i   + ONE_HALF;\n    rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.168735892)) * i;\n    rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.331264108)) * i;\n    /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.\n     * This ensures that the maximum output will round to MAXJSAMPLE\n     * not MAXJSAMPLE+1, and thus that we don't have to range-limit.\n     */\n    rgb_ycc_tab[i+B_CB_OFF] = FIX(0.5) * i    + CBCR_OFFSET + ONE_HALF-1;\n/*  B=>Cb and R=>Cr tables are the same\n    rgb_ycc_tab[i+R_CR_OFF] = FIX(0.5) * i    + CBCR_OFFSET + ONE_HALF-1;\n*/\n    rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.418687589)) * i;\n    rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.081312411)) * i;\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n *\n * Note that we change from the application's interleaved-pixel format\n * to our internal noninterleaved, one-plane-per-component format.\n * The input buffer is therefore three times as wide as the output buffer.\n *\n * A starting row offset is provided only for the output buffer.  The caller\n * can easily adjust the passed input_buf value to accommodate any row\n * offset required on that side.\n */\n\nMETHODDEF(void)\nrgb_ycc_convert (j_compress_ptr cinfo,\n\t\t JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t\t JDIMENSION output_row, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register INT32 * ctab = cconvert->rgb_ycc_tab;\n  register int r, g, b;\n  register JSAMPROW inptr;\n  register JSAMPROW outptr0, outptr1, outptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr0 = output_buf[0][output_row];\n    outptr1 = output_buf[1][output_row];\n    outptr2 = output_buf[2][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      r = GETJSAMPLE(inptr[RGB_RED]);\n      g = GETJSAMPLE(inptr[RGB_GREEN]);\n      b = GETJSAMPLE(inptr[RGB_BLUE]);\n      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations\n       * must be too; we do not need an explicit range-limiting operation.\n       * Hence the value being shifted is never negative, and we don't\n       * need the general RIGHT_SHIFT macro.\n       */\n      /* Y */\n      outptr0[col] = (JSAMPLE)\n\t\t((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n\t\t >> SCALEBITS);\n      /* Cb */\n      outptr1[col] = (JSAMPLE)\n\t\t((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])\n\t\t >> SCALEBITS);\n      /* Cr */\n      outptr2[col] = (JSAMPLE)\n\t\t((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])\n\t\t >> SCALEBITS);\n      inptr += RGB_PIXELSIZE;\n    }\n  }\n}\n\n\n/**************** Cases other than RGB -> YCbCr **************/\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles RGB->grayscale conversion, which is the same\n * as the RGB->Y portion of RGB->YCbCr.\n * We assume rgb_ycc_start has been called (we only use the Y tables).\n */\n\nMETHODDEF(void)\nrgb_gray_convert (j_compress_ptr cinfo,\n\t\t  JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t\t  JDIMENSION output_row, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register INT32 * ctab = cconvert->rgb_ycc_tab;\n  register int r, g, b;\n  register JSAMPROW inptr;\n  register JSAMPROW outptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr = output_buf[0][output_row++];\n    for (col = 0; col < num_cols; col++) {\n      r = GETJSAMPLE(inptr[RGB_RED]);\n      g = GETJSAMPLE(inptr[RGB_GREEN]);\n      b = GETJSAMPLE(inptr[RGB_BLUE]);\n      /* Y */\n      outptr[col] = (JSAMPLE)\n\t\t((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n\t\t >> SCALEBITS);\n      inptr += RGB_PIXELSIZE;\n    }\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles Adobe-style CMYK->YCCK conversion,\n * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same\n * conversion as above, while passing K (black) unchanged.\n * We assume rgb_ycc_start has been called.\n */\n\nMETHODDEF(void)\ncmyk_ycck_convert (j_compress_ptr cinfo,\n\t\t   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t\t   JDIMENSION output_row, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register INT32 * ctab = cconvert->rgb_ycc_tab;\n  register int r, g, b;\n  register JSAMPROW inptr;\n  register JSAMPROW outptr0, outptr1, outptr2, outptr3;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr0 = output_buf[0][output_row];\n    outptr1 = output_buf[1][output_row];\n    outptr2 = output_buf[2][output_row];\n    outptr3 = output_buf[3][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);\n      g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);\n      b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);\n      /* K passes through as-is */\n      outptr3[col] = inptr[3];\t/* don't need GETJSAMPLE here */\n      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations\n       * must be too; we do not need an explicit range-limiting operation.\n       * Hence the value being shifted is never negative, and we don't\n       * need the general RIGHT_SHIFT macro.\n       */\n      /* Y */\n      outptr0[col] = (JSAMPLE)\n\t\t((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n\t\t >> SCALEBITS);\n      /* Cb */\n      outptr1[col] = (JSAMPLE)\n\t\t((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])\n\t\t >> SCALEBITS);\n      /* Cr */\n      outptr2[col] = (JSAMPLE)\n\t\t((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])\n\t\t >> SCALEBITS);\n      inptr += 4;\n    }\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * [R,G,B] to [R-G,G,B-G] conversion with modulo calculation\n * (forward reversible color transform).\n * This can be seen as an adaption of the general RGB->YCbCr\n * conversion equation with Kr = Kb = 0, while replacing the\n * normalization by modulo calculation.\n */\n\nMETHODDEF(void)\nrgb_rgb1_convert (j_compress_ptr cinfo,\n\t\t  JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t\t  JDIMENSION output_row, int num_rows)\n{\n  register int r, g, b;\n  register JSAMPROW inptr;\n  register JSAMPROW outptr0, outptr1, outptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr0 = output_buf[0][output_row];\n    outptr1 = output_buf[1][output_row];\n    outptr2 = output_buf[2][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      r = GETJSAMPLE(inptr[RGB_RED]);\n      g = GETJSAMPLE(inptr[RGB_GREEN]);\n      b = GETJSAMPLE(inptr[RGB_BLUE]);\n      /* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD\n       * (modulo) operator is equivalent to the bitmask operator AND.\n       */\n      outptr0[col] = (JSAMPLE) ((r - g + CENTERJSAMPLE) & MAXJSAMPLE);\n      outptr1[col] = (JSAMPLE) g;\n      outptr2[col] = (JSAMPLE) ((b - g + CENTERJSAMPLE) & MAXJSAMPLE);\n      inptr += RGB_PIXELSIZE;\n    }\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles grayscale output with no conversion.\n * The source can be either plain grayscale or YCC (since Y == gray).\n */\n\nMETHODDEF(void)\ngrayscale_convert (j_compress_ptr cinfo,\n\t\t   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t\t   JDIMENSION output_row, int num_rows)\n{\n  int instride = cinfo->input_components;\n  register JSAMPROW inptr;\n  register JSAMPROW outptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr = output_buf[0][output_row++];\n    for (col = 0; col < num_cols; col++) {\n      outptr[col] = inptr[0];\t/* don't need GETJSAMPLE() here */\n      inptr += instride;\n    }\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * No colorspace conversion, but change from interleaved\n * to separate-planes representation.\n */\n\nMETHODDEF(void)\nrgb_convert (j_compress_ptr cinfo,\n\t     JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t     JDIMENSION output_row, int num_rows)\n{\n  register JSAMPROW inptr;\n  register JSAMPROW outptr0, outptr1, outptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr0 = output_buf[0][output_row];\n    outptr1 = output_buf[1][output_row];\n    outptr2 = output_buf[2][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      /* We can dispense with GETJSAMPLE() here */\n      outptr0[col] = inptr[RGB_RED];\n      outptr1[col] = inptr[RGB_GREEN];\n      outptr2[col] = inptr[RGB_BLUE];\n      inptr += RGB_PIXELSIZE;\n    }\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles multi-component colorspaces without conversion.\n * We assume input_components == num_components.\n */\n\nMETHODDEF(void)\nnull_convert (j_compress_ptr cinfo,\n\t      JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t      JDIMENSION output_row, int num_rows)\n{\n  int ci;\n  register int nc = cinfo->num_components;\n  register JSAMPROW inptr;\n  register JSAMPROW outptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    /* It seems fastest to make a separate pass for each component. */\n    for (ci = 0; ci < nc; ci++) {\n      inptr = input_buf[0] + ci;\n      outptr = output_buf[ci][output_row];\n      for (col = 0; col < num_cols; col++) {\n\t*outptr++ = *inptr;\t/* don't need GETJSAMPLE() here */\n\tinptr += nc;\n      }\n    }\n    input_buf++;\n    output_row++;\n  }\n}\n\n\n/*\n * Empty method for start_pass.\n */\n\nMETHODDEF(void)\nnull_method (j_compress_ptr cinfo)\n{\n  /* no work needed */\n}\n\n\n/*\n * Module initialization routine for input colorspace conversion.\n */\n\nGLOBAL(void)\njinit_color_converter (j_compress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert;\n\n  cconvert = (my_cconvert_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_color_converter));\n  cinfo->cconvert = &cconvert->pub;\n  /* set start_pass to null method until we find out differently */\n  cconvert->pub.start_pass = null_method;\n\n  /* Make sure input_components agrees with in_color_space */\n  switch (cinfo->in_color_space) {\n  case JCS_GRAYSCALE:\n    if (cinfo->input_components != 1)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n\n  case JCS_RGB:\n  case JCS_BG_RGB:\n    if (cinfo->input_components != RGB_PIXELSIZE)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n\n  case JCS_YCbCr:\n  case JCS_BG_YCC:\n    if (cinfo->input_components != 3)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n\n  case JCS_CMYK:\n  case JCS_YCCK:\n    if (cinfo->input_components != 4)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n\n  default:\t\t\t/* JCS_UNKNOWN can be anything */\n    if (cinfo->input_components < 1)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n  }\n\n  /* Support color transform only for RGB colorspaces */\n  if (cinfo->color_transform &&\n      cinfo->jpeg_color_space != JCS_RGB &&\n      cinfo->jpeg_color_space != JCS_BG_RGB)\n    ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n\n  /* Check num_components, set conversion method based on requested space */\n  switch (cinfo->jpeg_color_space) {\n  case JCS_GRAYSCALE:\n    if (cinfo->num_components != 1)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    switch (cinfo->in_color_space) {\n    case JCS_GRAYSCALE:\n    case JCS_YCbCr:\n    case JCS_BG_YCC:\n      cconvert->pub.color_convert = grayscale_convert;\n      break;\n    case JCS_RGB:\n      cconvert->pub.start_pass = rgb_ycc_start;\n      cconvert->pub.color_convert = rgb_gray_convert;\n      break;\n    default:\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    }\n    break;\n\n  case JCS_RGB:\n  case JCS_BG_RGB:\n    if (cinfo->num_components != 3)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    if (cinfo->in_color_space == cinfo->jpeg_color_space) {\n      switch (cinfo->color_transform) {\n      case JCT_NONE:\n\tcconvert->pub.color_convert = rgb_convert;\n\tbreak;\n      case JCT_SUBTRACT_GREEN:\n\tcconvert->pub.color_convert = rgb_rgb1_convert;\n\tbreak;\n      default:\n\tERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n      }\n    } else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_YCbCr:\n    if (cinfo->num_components != 3)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    switch (cinfo->in_color_space) {\n    case JCS_RGB:\n      cconvert->pub.start_pass = rgb_ycc_start;\n      cconvert->pub.color_convert = rgb_ycc_convert;\n      break;\n    case JCS_YCbCr:\n      cconvert->pub.color_convert = null_convert;\n      break;\n    default:\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    }\n    break;\n\n  case JCS_BG_YCC:\n    if (cinfo->num_components != 3)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    switch (cinfo->in_color_space) {\n    case JCS_RGB:\n      /* For conversion from normal RGB input to BG_YCC representation,\n       * the Cb/Cr values are first computed as usual, and then\n       * quantized further after DCT processing by a factor of\n       * 2 in reference to the nominal quantization factor.\n       */\n      /* need quantization scale by factor of 2 after DCT */\n      cinfo->comp_info[1].component_needed = TRUE;\n      cinfo->comp_info[2].component_needed = TRUE;\n      /* compute normal YCC first */\n      cconvert->pub.start_pass = rgb_ycc_start;\n      cconvert->pub.color_convert = rgb_ycc_convert;\n      break;\n    case JCS_YCbCr:\n      /* need quantization scale by factor of 2 after DCT */\n      cinfo->comp_info[1].component_needed = TRUE;\n      cinfo->comp_info[2].component_needed = TRUE;\n      /*FALLTHROUGH*/\n    case JCS_BG_YCC:\n      /* Pass through for BG_YCC input */\n      cconvert->pub.color_convert = null_convert;\n      break;\n    default:\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    }\n    break;\n\n  case JCS_CMYK:\n    if (cinfo->num_components != 4)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    if (cinfo->in_color_space == JCS_CMYK)\n      cconvert->pub.color_convert = null_convert;\n    else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_YCCK:\n    if (cinfo->num_components != 4)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    switch (cinfo->in_color_space) {\n    case JCS_CMYK:\n      cconvert->pub.start_pass = rgb_ycc_start;\n      cconvert->pub.color_convert = cmyk_ycck_convert;\n      break;\n    case JCS_YCCK:\n      cconvert->pub.color_convert = null_convert;\n      break;\n    default:\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    }\n    break;\n\n  default:\t\t\t/* allow null conversion of JCS_UNKNOWN */\n    if (cinfo->jpeg_color_space != cinfo->in_color_space ||\n\tcinfo->num_components != cinfo->input_components)\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    cconvert->pub.color_convert = null_convert;\n    break;\n  }\n}\n"
  },
  {
    "path": "jcdctmgr.c",
    "content": "/*\n * jcdctmgr.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2003-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the forward-DCT management logic.\n * This code selects a particular DCT implementation to be used,\n * and it performs related housekeeping chores including coefficient\n * quantization.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n\n/* Private subobject for this module */\n\ntypedef struct {\n  struct jpeg_forward_dct pub;\t/* public fields */\n\n  /* Pointer to the DCT routine actually in use */\n  forward_DCT_method_ptr do_dct[MAX_COMPONENTS];\n\n#ifdef DCT_FLOAT_SUPPORTED\n  /* Same as above for the floating-point case. */\n  float_DCT_method_ptr do_float_dct[MAX_COMPONENTS];\n#endif\n} my_fdct_controller;\n\ntypedef my_fdct_controller * my_fdct_ptr;\n\n\n/* The allocated post-DCT divisor tables -- big enough for any\n * supported variant and not identical to the quant table entries,\n * because of scaling (especially for an unnormalized DCT) --\n * are pointed to by dct_table in the per-component comp_info\n * structures.  Each table is given in normal array order.\n */\n\ntypedef union {\n  DCTELEM int_array[DCTSIZE2];\n#ifdef DCT_FLOAT_SUPPORTED\n  FAST_FLOAT float_array[DCTSIZE2];\n#endif\n} divisor_table;\n\n\n/* The current scaled-DCT routines require ISLOW-style divisor tables,\n * so be sure to compile that code if either ISLOW or SCALING is requested.\n */\n#ifdef DCT_ISLOW_SUPPORTED\n#define PROVIDE_ISLOW_TABLES\n#else\n#ifdef DCT_SCALING_SUPPORTED\n#define PROVIDE_ISLOW_TABLES\n#endif\n#endif\n\n\n/*\n * Perform forward DCT on one or more blocks of a component.\n *\n * The input samples are taken from the sample_data[] array starting at\n * position start_row/start_col, and moving to the right for any additional\n * blocks. The quantized coefficients are returned in coef_blocks[].\n */\n\nMETHODDEF(void)\nforward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t     JSAMPARRAY sample_data, JBLOCKROW coef_blocks,\n\t     JDIMENSION start_row, JDIMENSION start_col,\n\t     JDIMENSION num_blocks)\n/* This version is used for integer DCT implementations. */\n{\n  /* This routine is heavily used, so it's worth coding it tightly. */\n  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;\n  forward_DCT_method_ptr do_dct = fdct->do_dct[compptr->component_index];\n  DCTELEM * divisors = (DCTELEM *) compptr->dct_table;\n  DCTELEM workspace[DCTSIZE2];\t/* work area for FDCT subroutine */\n  JDIMENSION bi;\n\n  sample_data += start_row;\t/* fold in the vertical offset once */\n\n  for (bi = 0; bi < num_blocks; bi++, start_col += compptr->DCT_h_scaled_size) {\n    /* Perform the DCT */\n    (*do_dct) (workspace, sample_data, start_col);\n\n    /* Quantize/descale the coefficients, and store into coef_blocks[] */\n    { register DCTELEM temp, qval;\n      register int i;\n      register JCOEFPTR output_ptr = coef_blocks[bi];\n\n      for (i = 0; i < DCTSIZE2; i++) {\n\tqval = divisors[i];\n\ttemp = workspace[i];\n\t/* Divide the coefficient value by qval, ensuring proper rounding.\n\t * Since C does not specify the direction of rounding for negative\n\t * quotients, we have to force the dividend positive for portability.\n\t *\n\t * In most files, at least half of the output values will be zero\n\t * (at default quantization settings, more like three-quarters...)\n\t * so we should ensure that this case is fast.  On many machines,\n\t * a comparison is enough cheaper than a divide to make a special test\n\t * a win.  Since both inputs will be nonnegative, we need only test\n\t * for a < b to discover whether a/b is 0.\n\t * If your machine's division is fast enough, define FAST_DIVIDE.\n\t */\n#ifdef FAST_DIVIDE\n#define DIVIDE_BY(a,b)\ta /= b\n#else\n#define DIVIDE_BY(a,b)\tif (a >= b) a /= b; else a = 0\n#endif\n\tif (temp < 0) {\n\t  temp = -temp;\n\t  temp += qval>>1;\t/* for rounding */\n\t  DIVIDE_BY(temp, qval);\n\t  temp = -temp;\n\t} else {\n\t  temp += qval>>1;\t/* for rounding */\n\t  DIVIDE_BY(temp, qval);\n\t}\n\toutput_ptr[i] = (JCOEF) temp;\n      }\n    }\n  }\n}\n\n\n#ifdef DCT_FLOAT_SUPPORTED\n\nMETHODDEF(void)\nforward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t   JSAMPARRAY sample_data, JBLOCKROW coef_blocks,\n\t\t   JDIMENSION start_row, JDIMENSION start_col,\n\t\t   JDIMENSION num_blocks)\n/* This version is used for floating-point DCT implementations. */\n{\n  /* This routine is heavily used, so it's worth coding it tightly. */\n  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;\n  float_DCT_method_ptr do_dct = fdct->do_float_dct[compptr->component_index];\n  FAST_FLOAT * divisors = (FAST_FLOAT *) compptr->dct_table;\n  FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */\n  JDIMENSION bi;\n\n  sample_data += start_row;\t/* fold in the vertical offset once */\n\n  for (bi = 0; bi < num_blocks; bi++, start_col += compptr->DCT_h_scaled_size) {\n    /* Perform the DCT */\n    (*do_dct) (workspace, sample_data, start_col);\n\n    /* Quantize/descale the coefficients, and store into coef_blocks[] */\n    { register FAST_FLOAT temp;\n      register int i;\n      register JCOEFPTR output_ptr = coef_blocks[bi];\n\n      for (i = 0; i < DCTSIZE2; i++) {\n\t/* Apply the quantization and scaling factor */\n\ttemp = workspace[i] * divisors[i];\n\t/* Round to nearest integer.\n\t * Since C does not specify the direction of rounding for negative\n\t * quotients, we have to force the dividend positive for portability.\n\t * The maximum coefficient size is +-16K (for 12-bit data), so this\n\t * code should work for either 16-bit or 32-bit ints.\n\t */\n\toutput_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);\n      }\n    }\n  }\n}\n\n#endif /* DCT_FLOAT_SUPPORTED */\n\n\n/*\n * Initialize for a processing pass.\n * Verify that all referenced Q-tables are present, and set up\n * the divisor table for each one.\n * In the current implementation, DCT of all components is done during\n * the first pass, even if only some components will be output in the\n * first scan.  Hence all components should be examined here.\n */\n\nMETHODDEF(void)\nstart_pass_fdctmgr (j_compress_ptr cinfo)\n{\n  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;\n  int ci, qtblno, i;\n  jpeg_component_info *compptr;\n  int method = 0;\n  JQUANT_TBL * qtbl;\n  DCTELEM * dtbl;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Select the proper DCT routine for this component's scaling */\n    switch ((compptr->DCT_h_scaled_size << 8) + compptr->DCT_v_scaled_size) {\n#ifdef DCT_SCALING_SUPPORTED\n    case ((1 << 8) + 1):\n      fdct->do_dct[ci] = jpeg_fdct_1x1;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((2 << 8) + 2):\n      fdct->do_dct[ci] = jpeg_fdct_2x2;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((3 << 8) + 3):\n      fdct->do_dct[ci] = jpeg_fdct_3x3;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((4 << 8) + 4):\n      fdct->do_dct[ci] = jpeg_fdct_4x4;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((5 << 8) + 5):\n      fdct->do_dct[ci] = jpeg_fdct_5x5;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((6 << 8) + 6):\n      fdct->do_dct[ci] = jpeg_fdct_6x6;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((7 << 8) + 7):\n      fdct->do_dct[ci] = jpeg_fdct_7x7;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((9 << 8) + 9):\n      fdct->do_dct[ci] = jpeg_fdct_9x9;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((10 << 8) + 10):\n      fdct->do_dct[ci] = jpeg_fdct_10x10;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((11 << 8) + 11):\n      fdct->do_dct[ci] = jpeg_fdct_11x11;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((12 << 8) + 12):\n      fdct->do_dct[ci] = jpeg_fdct_12x12;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((13 << 8) + 13):\n      fdct->do_dct[ci] = jpeg_fdct_13x13;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((14 << 8) + 14):\n      fdct->do_dct[ci] = jpeg_fdct_14x14;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((15 << 8) + 15):\n      fdct->do_dct[ci] = jpeg_fdct_15x15;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((16 << 8) + 16):\n      fdct->do_dct[ci] = jpeg_fdct_16x16;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((16 << 8) + 8):\n      fdct->do_dct[ci] = jpeg_fdct_16x8;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((14 << 8) + 7):\n      fdct->do_dct[ci] = jpeg_fdct_14x7;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((12 << 8) + 6):\n      fdct->do_dct[ci] = jpeg_fdct_12x6;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((10 << 8) + 5):\n      fdct->do_dct[ci] = jpeg_fdct_10x5;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((8 << 8) + 4):\n      fdct->do_dct[ci] = jpeg_fdct_8x4;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((6 << 8) + 3):\n      fdct->do_dct[ci] = jpeg_fdct_6x3;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((4 << 8) + 2):\n      fdct->do_dct[ci] = jpeg_fdct_4x2;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((2 << 8) + 1):\n      fdct->do_dct[ci] = jpeg_fdct_2x1;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((8 << 8) + 16):\n      fdct->do_dct[ci] = jpeg_fdct_8x16;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((7 << 8) + 14):\n      fdct->do_dct[ci] = jpeg_fdct_7x14;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((6 << 8) + 12):\n      fdct->do_dct[ci] = jpeg_fdct_6x12;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((5 << 8) + 10):\n      fdct->do_dct[ci] = jpeg_fdct_5x10;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((4 << 8) + 8):\n      fdct->do_dct[ci] = jpeg_fdct_4x8;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((3 << 8) + 6):\n      fdct->do_dct[ci] = jpeg_fdct_3x6;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((2 << 8) + 4):\n      fdct->do_dct[ci] = jpeg_fdct_2x4;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n    case ((1 << 8) + 2):\n      fdct->do_dct[ci] = jpeg_fdct_1x2;\n      method = JDCT_ISLOW;\t/* jfdctint uses islow-style table */\n      break;\n#endif\n    case ((DCTSIZE << 8) + DCTSIZE):\n      switch (cinfo->dct_method) {\n#ifdef DCT_ISLOW_SUPPORTED\n      case JDCT_ISLOW:\n\tfdct->do_dct[ci] = jpeg_fdct_islow;\n\tmethod = JDCT_ISLOW;\n\tbreak;\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n      case JDCT_IFAST:\n\tfdct->do_dct[ci] = jpeg_fdct_ifast;\n\tmethod = JDCT_IFAST;\n\tbreak;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n      case JDCT_FLOAT:\n\tfdct->do_float_dct[ci] = jpeg_fdct_float;\n\tmethod = JDCT_FLOAT;\n\tbreak;\n#endif\n      default:\n\tERREXIT(cinfo, JERR_NOT_COMPILED);\n\tbreak;\n      }\n      break;\n    default:\n      ERREXIT2(cinfo, JERR_BAD_DCTSIZE,\n\t       compptr->DCT_h_scaled_size, compptr->DCT_v_scaled_size);\n      break;\n    }\n    qtblno = compptr->quant_tbl_no;\n    /* Make sure specified quantization table is present */\n    if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||\n\tcinfo->quant_tbl_ptrs[qtblno] == NULL)\n      ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);\n    qtbl = cinfo->quant_tbl_ptrs[qtblno];\n    /* Create divisor table from quant table */\n    switch (method) {\n#ifdef PROVIDE_ISLOW_TABLES\n    case JDCT_ISLOW:\n      /* For LL&M IDCT method, divisors are equal to raw quantization\n       * coefficients multiplied by 8 (to counteract scaling).\n       */\n      dtbl = (DCTELEM *) compptr->dct_table;\n      for (i = 0; i < DCTSIZE2; i++) {\n\tdtbl[i] =\n\t  ((DCTELEM) qtbl->quantval[i]) << (compptr->component_needed ? 4 : 3);\n      }\n      fdct->pub.forward_DCT[ci] = forward_DCT;\n      break;\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n    case JDCT_IFAST:\n      {\n\t/* For AA&N IDCT method, divisors are equal to quantization\n\t * coefficients scaled by scalefactor[row]*scalefactor[col], where\n\t *   scalefactor[0] = 1\n\t *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n\t * We apply a further scale factor of 8.\n\t */\n#define CONST_BITS 14\n\tstatic const INT16 aanscales[DCTSIZE2] = {\n\t  /* precomputed values scaled up by 14 bits */\n\t  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,\n\t  22725, 31521, 29692, 26722, 22725, 17855, 12299,  6270,\n\t  21407, 29692, 27969, 25172, 21407, 16819, 11585,  5906,\n\t  19266, 26722, 25172, 22654, 19266, 15137, 10426,  5315,\n\t  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,\n\t  12873, 17855, 16819, 15137, 12873, 10114,  6967,  3552,\n\t   8867, 12299, 11585, 10426,  8867,  6967,  4799,  2446,\n\t   4520,  6270,  5906,  5315,  4520,  3552,  2446,  1247\n\t};\n\tSHIFT_TEMPS\n\n\tdtbl = (DCTELEM *) compptr->dct_table;\n\tfor (i = 0; i < DCTSIZE2; i++) {\n\t  dtbl[i] = (DCTELEM)\n\t    DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],\n\t\t\t\t  (INT32) aanscales[i]),\n\t\t    compptr->component_needed ? CONST_BITS-4 : CONST_BITS-3);\n\t}\n      }\n      fdct->pub.forward_DCT[ci] = forward_DCT;\n      break;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n    case JDCT_FLOAT:\n      {\n\t/* For float AA&N IDCT method, divisors are equal to quantization\n\t * coefficients scaled by scalefactor[row]*scalefactor[col], where\n\t *   scalefactor[0] = 1\n\t *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n\t * We apply a further scale factor of 8.\n\t * What's actually stored is 1/divisor so that the inner loop can\n\t * use a multiplication rather than a division.\n\t */\n\tFAST_FLOAT * fdtbl = (FAST_FLOAT *) compptr->dct_table;\n\tint row, col;\n\tstatic const double aanscalefactor[DCTSIZE] = {\n\t  1.0, 1.387039845, 1.306562965, 1.175875602,\n\t  1.0, 0.785694958, 0.541196100, 0.275899379\n\t};\n\n\ti = 0;\n\tfor (row = 0; row < DCTSIZE; row++) {\n\t  for (col = 0; col < DCTSIZE; col++) {\n\t    fdtbl[i] = (FAST_FLOAT)\n\t      (1.0 / ((double) qtbl->quantval[i] *\n\t\t      aanscalefactor[row] * aanscalefactor[col] *\n\t\t      (compptr->component_needed ? 16.0 : 8.0)));\n\t    i++;\n\t  }\n\t}\n      }\n      fdct->pub.forward_DCT[ci] = forward_DCT_float;\n      break;\n#endif\n    default:\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n      break;\n    }\n  }\n}\n\n\n/*\n * Initialize FDCT manager.\n */\n\nGLOBAL(void)\njinit_forward_dct (j_compress_ptr cinfo)\n{\n  my_fdct_ptr fdct;\n  int ci;\n  jpeg_component_info *compptr;\n\n  fdct = (my_fdct_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_fdct_controller));\n  cinfo->fdct = &fdct->pub;\n  fdct->pub.start_pass = start_pass_fdctmgr;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Allocate a divisor table for each component */\n    compptr->dct_table =\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(divisor_table));\n  }\n}\n"
  },
  {
    "path": "jchuff.c",
    "content": "/*\n * jchuff.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2006-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains Huffman entropy encoding routines.\n * Both sequential and progressive modes are supported in this single module.\n *\n * Much of the complexity here has to do with supporting output suspension.\n * If the data destination module demands suspension, we want to be able to\n * back up to the start of the current MCU.  To do this, we copy state\n * variables into local working storage, and update them back to the\n * permanent JPEG objects only upon successful completion of an MCU.\n *\n * We do not support output suspension for the progressive JPEG mode, since\n * the library currently does not allow multiple-scan files to be written\n * with output suspension.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n#ifdef USE_SSE\n\n#include <stdint.h>\n#include <immintrin.h>\n\n#elif defined USE_NEON\n\n#include <arm_neon.h>\n\ntypedef struct {\n  uint64_t EOB;\n  uint64_t Z_MASK;\n} two_ret;\n\nuint64_t AC_first_util_64(const short *block, const int *natural_order, short *t0, short *t1, int al);\nuint64_t AC_first_util_16(const short *block, const int *natural_order, short *t0, short *t1, int al);\ntwo_ret AC_refine_util_64(const short *block, const int *natural_order, short *res, int Al);\n\n#endif\n\n/* The legal range of a DCT coefficient is\n *  -1024 .. +1023  for 8-bit data;\n * -16384 .. +16383 for 12-bit data.\n * Hence the magnitude should always fit in 10 or 14 bits respectively.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define MAX_COEF_BITS 10\n#else\n#define MAX_COEF_BITS 14\n#endif\n\n/* Derived data constructed for each Huffman table */\n\ntypedef struct {\n  unsigned int ehufco[256];\t/* code for each symbol */\n  char ehufsi[256];\t\t/* length of code for each symbol */\n  /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */\n} c_derived_tbl;\n\n\n/* Expanded entropy encoder object for Huffman encoding.\n *\n * The savable_state subrecord contains fields that change within an MCU,\n * but must not be updated permanently until we complete the MCU.\n */\n\ntypedef struct {\n  INT32 put_buffer;\t\t/* current bit-accumulation buffer */\n  int put_bits;\t\t\t/* # of bits now in it */\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n} savable_state;\n\n/* This macro is to work around compilers with missing or broken\n * structure assignment.  You'll need to fix this code if you have\n * such a compiler and you change MAX_COMPS_IN_SCAN.\n */\n\n#ifndef NO_STRUCT_ASSIGN\n#define ASSIGN_STATE(dest,src)  ((dest) = (src))\n#else\n#if MAX_COMPS_IN_SCAN == 4\n#define ASSIGN_STATE(dest,src)  \\\n\t((dest).put_buffer = (src).put_buffer, \\\n\t (dest).put_bits = (src).put_bits, \\\n\t (dest).last_dc_val[0] = (src).last_dc_val[0], \\\n\t (dest).last_dc_val[1] = (src).last_dc_val[1], \\\n\t (dest).last_dc_val[2] = (src).last_dc_val[2], \\\n\t (dest).last_dc_val[3] = (src).last_dc_val[3])\n#endif\n#endif\n\n\ntypedef struct {\n  struct jpeg_entropy_encoder pub; /* public fields */\n\n  savable_state saved;\t\t/* Bit buffer & DC state at start of MCU */\n\n  /* These fields are NOT loaded into local working state. */\n  unsigned int restarts_to_go;\t/* MCUs left in this restart interval */\n  int next_restart_num;\t\t/* next restart number to write (0-7) */\n\n  /* Pointers to derived tables (these workspaces have image lifespan) */\n  c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];\n  c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];\n\n  /* Statistics tables for optimization */\n  long * dc_count_ptrs[NUM_HUFF_TBLS];\n  long * ac_count_ptrs[NUM_HUFF_TBLS];\n\n  /* Following fields used only in progressive mode */\n\n  /* Mode flag: TRUE for optimization, FALSE for actual data output */\n  boolean gather_statistics;\n\n  /* next_output_byte/free_in_buffer are local copies of cinfo->dest fields.\n   */\n  JOCTET * next_output_byte;\t/* => next byte to write in buffer */\n  size_t free_in_buffer;\t/* # of byte spaces remaining in buffer */\n  j_compress_ptr cinfo;\t\t/* link to cinfo (needed for dump_buffer) */\n\n  /* Coding status for AC components */\n  int ac_tbl_no;\t\t/* the table number of the single component */\n  unsigned int EOBRUN;\t\t/* run length of EOBs */\n  unsigned int BE;\t\t/* # of buffered correction bits before MCU */\n  char * bit_buffer;\t\t/* buffer for correction bits (1 per char) */\n  /* packing correction bits tightly would save some space but cost time... */\n} huff_entropy_encoder;\n\ntypedef huff_entropy_encoder * huff_entropy_ptr;\n\n/* Working state while writing an MCU (sequential mode).\n * This struct contains all the fields that are needed by subroutines.\n */\n\ntypedef struct {\n  JOCTET * next_output_byte;\t/* => next byte to write in buffer */\n  size_t free_in_buffer;\t/* # of byte spaces remaining in buffer */\n  savable_state cur;\t\t/* Current bit buffer & DC state */\n  j_compress_ptr cinfo;\t\t/* dump_buffer needs access to this */\n} working_state;\n\n/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit\n * buffer can hold.  Larger sizes may slightly improve compression, but\n * 1000 is already well into the realm of overkill.\n * The minimum safe size is 64 bits.\n */\n\n#define MAX_CORR_BITS  1000\t/* Max # of correction bits I can buffer */\n\n/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.\n * We assume that int right shift is unsigned if INT32 right shift is,\n * which should be safe.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define ISHIFT_TEMPS\tint ishift_temp;\n#define IRIGHT_SHIFT(x,shft)  \\\n\t((ishift_temp = (x)) < 0 ? \\\n\t (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \\\n\t (ishift_temp >> (shft)))\n#else\n#define ISHIFT_TEMPS\n#define IRIGHT_SHIFT(x,shft)\t((x) >> (shft))\n#endif\n\n\n/*\n * Compute the derived values for a Huffman table.\n * This routine also performs some validation checks on the table.\n */\n\nLOCAL(void)\njpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,\n\t\t\t c_derived_tbl ** pdtbl)\n{\n  JHUFF_TBL *htbl;\n  c_derived_tbl *dtbl;\n  int p, i, l, lastp, si, maxsymbol;\n  char huffsize[257];\n  unsigned int huffcode[257];\n  unsigned int code;\n\n  /* Note that huffsize[] and huffcode[] are filled in code-length order,\n   * paralleling the order of the symbols themselves in htbl->huffval[].\n   */\n\n  /* Find the input Huffman table */\n  if (tblno < 0 || tblno >= NUM_HUFF_TBLS)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);\n  htbl =\n    isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];\n  if (htbl == NULL)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);\n\n  /* Allocate a workspace if we haven't already done so. */\n  if (*pdtbl == NULL)\n    *pdtbl = (c_derived_tbl *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(c_derived_tbl));\n  dtbl = *pdtbl;\n\n  /* Figure C.1: make table of Huffman code length for each symbol */\n\n  p = 0;\n  for (l = 1; l <= 16; l++) {\n    i = (int) htbl->bits[l];\n    if (i < 0 || p + i > 256)\t/* protect against table overrun */\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    while (i--)\n      huffsize[p++] = (char) l;\n  }\n  huffsize[p] = 0;\n  lastp = p;\n\n  /* Figure C.2: generate the codes themselves */\n  /* We also validate that the counts represent a legal Huffman code tree. */\n\n  code = 0;\n  si = huffsize[0];\n  p = 0;\n  while (huffsize[p]) {\n    while (((int) huffsize[p]) == si) {\n      huffcode[p++] = code;\n      code++;\n    }\n    /* code is now 1 more than the last code used for codelength si; but\n     * it must still fit in si bits, since no code is allowed to be all ones.\n     */\n    if (((INT32) code) >= (((INT32) 1) << si))\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    code <<= 1;\n    si++;\n  }\n\n  /* Figure C.3: generate encoding tables */\n  /* These are code and size indexed by symbol value */\n\n  /* Set all codeless symbols to have code length 0;\n   * this lets us detect duplicate VAL entries here, and later\n   * allows emit_bits to detect any attempt to emit such symbols.\n   */\n  MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi));\n\n  /* This is also a convenient place to check for out-of-range\n   * and duplicated VAL entries.  We allow 0..255 for AC symbols\n   * but only 0..15 for DC.  (We could constrain them further\n   * based on data depth and mode, but this seems enough.)\n   */\n  maxsymbol = isDC ? 15 : 255;\n\n  for (p = 0; p < lastp; p++) {\n    i = htbl->huffval[p];\n    if (i < 0 || i > maxsymbol || dtbl->ehufsi[i])\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    dtbl->ehufco[i] = huffcode[p];\n    dtbl->ehufsi[i] = huffsize[p];\n  }\n}\n\n\n/* Outputting bytes to the file.\n * NB: these must be called only when actually outputting,\n * that is, entropy->gather_statistics == FALSE.\n */\n\n/* Emit a byte, taking 'action' if must suspend. */\n#define emit_byte_s(state,val,action)  \\\n\t{ *(state)->next_output_byte++ = (JOCTET) (val);  \\\n\t  if (--(state)->free_in_buffer == 0)  \\\n\t    if (! dump_buffer_s(state))  \\\n\t      { action; } }\n\n/* Emit a byte */\n#define emit_byte_e(entropy,val)  \\\n\t{ *(entropy)->next_output_byte++ = (JOCTET) (val);  \\\n\t  if (--(entropy)->free_in_buffer == 0)  \\\n\t    dump_buffer_e(entropy); }\n\n\nLOCAL(boolean)\ndump_buffer_s (working_state * state)\n/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */\n{\n  struct jpeg_destination_mgr * dest = state->cinfo->dest;\n\n  if (! (*dest->empty_output_buffer) (state->cinfo))\n    return FALSE;\n  /* After a successful buffer dump, must reset buffer pointers */\n  state->next_output_byte = dest->next_output_byte;\n  state->free_in_buffer = dest->free_in_buffer;\n  return TRUE;\n}\n\n\nLOCAL(void)\ndump_buffer_e (huff_entropy_ptr entropy)\n/* Empty the output buffer; we do not support suspension in this case. */\n{\n  struct jpeg_destination_mgr * dest = entropy->cinfo->dest;\n\n  if (! (*dest->empty_output_buffer) (entropy->cinfo))\n    ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND);\n  /* After a successful buffer dump, must reset buffer pointers */\n  entropy->next_output_byte = dest->next_output_byte;\n  entropy->free_in_buffer = dest->free_in_buffer;\n}\n\n\n/* Outputting bits to the file */\n\n/* Only the right 24 bits of put_buffer are used; the valid bits are\n * left-justified in this part.  At most 16 bits can be passed to emit_bits\n * in one call, and we never retain more than 7 bits in put_buffer\n * between calls, so 24 bits are sufficient.\n */\n\nINLINE\nLOCAL(boolean)\nemit_bits_s (working_state * state, unsigned int code, int size)\n/* Emit some bits; return TRUE if successful, FALSE if must suspend */\n{\n  /* This routine is heavily used, so it's worth coding tightly. */\n  register INT32 put_buffer;\n  register int put_bits;\n\n  /* if size is 0, caller used an invalid Huffman table entry */\n  if (size == 0)\n    ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE);\n\n  /* mask off any extra bits in code */\n  put_buffer = ((INT32) code) & ((((INT32) 1) << size) - 1);\n\n  /* new number of bits in buffer */\n  put_bits = size + state->cur.put_bits;\n\n  put_buffer <<= 24 - put_bits; /* align incoming bits */\n\n  /* and merge with old buffer contents */\n  put_buffer |= state->cur.put_buffer;\n\n  while (put_bits >= 8) {\n    int c = (int) ((put_buffer >> 16) & 0xFF);\n\n    emit_byte_s(state, c, return FALSE);\n    if (c == 0xFF) {\t\t/* need to stuff a zero byte? */\n      emit_byte_s(state, 0, return FALSE);\n    }\n    put_buffer <<= 8;\n    put_bits -= 8;\n  }\n\n  state->cur.put_buffer = put_buffer; /* update state variables */\n  state->cur.put_bits = put_bits;\n\n  return TRUE;\n}\n\n\nINLINE\nLOCAL(void)\nemit_bits_e (huff_entropy_ptr entropy, unsigned int code, int size)\n/* Emit some bits, unless we are in gather mode */\n{\n  /* This routine is heavily used, so it's worth coding tightly. */\n  register INT32 put_buffer;\n  register int put_bits;\n\n  /* if size is 0, caller used an invalid Huffman table entry */\n  if (size == 0)\n    ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);\n\n  if (entropy->gather_statistics)\n    return;\t\t\t/* do nothing if we're only getting stats */\n\n  /* mask off any extra bits in code */\n  put_buffer = ((INT32) code) & ((((INT32) 1) << size) - 1);\n\n  /* new number of bits in buffer */\n  put_bits = size + entropy->saved.put_bits;\n\n  put_buffer <<= 24 - put_bits; /* align incoming bits */\n\n  /* and merge with old buffer contents */\n  put_buffer |= entropy->saved.put_buffer;\n\n  while (put_bits >= 8) {\n    int c = (int) ((put_buffer >> 16) & 0xFF);\n\n    emit_byte_e(entropy, c);\n    if (c == 0xFF) {\t\t/* need to stuff a zero byte? */\n      emit_byte_e(entropy, 0);\n    }\n    put_buffer <<= 8;\n    put_bits -= 8;\n  }\n\n  entropy->saved.put_buffer = put_buffer; /* update variables */\n  entropy->saved.put_bits = put_bits;\n}\n\n\nLOCAL(boolean)\nflush_bits_s (working_state * state)\n{\n  if (! emit_bits_s(state, 0x7F, 7)) /* fill any partial byte with ones */\n    return FALSE;\n  state->cur.put_buffer = 0;\t     /* and reset bit-buffer to empty */\n  state->cur.put_bits = 0;\n  return TRUE;\n}\n\n\nLOCAL(void)\nflush_bits_e (huff_entropy_ptr entropy)\n{\n  emit_bits_e(entropy, 0x7F, 7); /* fill any partial byte with ones */\n  entropy->saved.put_buffer = 0; /* and reset bit-buffer to empty */\n  entropy->saved.put_bits = 0;\n}\n\n\n/*\n * Emit (or just count) a Huffman symbol.\n */\n\nINLINE\nLOCAL(void)\nemit_dc_symbol (huff_entropy_ptr entropy, int tbl_no, int symbol)\n{\n  if (entropy->gather_statistics)\n    entropy->dc_count_ptrs[tbl_no][symbol]++;\n  else {\n    c_derived_tbl * tbl = entropy->dc_derived_tbls[tbl_no];\n    emit_bits_e(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);\n  }\n}\n\n\nINLINE\nLOCAL(void)\nemit_ac_symbol (huff_entropy_ptr entropy, int tbl_no, int symbol)\n{\n  if (entropy->gather_statistics)\n    entropy->ac_count_ptrs[tbl_no][symbol]++;\n  else {\n    c_derived_tbl * tbl = entropy->ac_derived_tbls[tbl_no];\n    emit_bits_e(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);\n  }\n}\n\n\n/*\n * Emit bits from a correction bit buffer.\n */\n\nLOCAL(void)\nemit_buffered_bits (huff_entropy_ptr entropy, char * bufstart,\n\t\t    unsigned int nbits)\n{\n  if (entropy->gather_statistics)\n    return;\t\t\t/* no real work */\n\n  while (nbits > 0) {\n    emit_bits_e(entropy, (unsigned int) (*bufstart), 1);\n    bufstart++;\n    nbits--;\n  }\n}\n\n\n/*\n * Emit any pending EOBRUN symbol.\n */\n\nLOCAL(void)\nemit_eobrun (huff_entropy_ptr entropy)\n{\n  register int temp, nbits;\n\n  if (entropy->EOBRUN > 0) {\t/* if there is any pending EOBRUN */\n    temp = entropy->EOBRUN;\n    nbits = 0;\n    while ((temp >>= 1))\n      nbits++;\n    /* safety check: shouldn't happen given limited correction-bit buffer */\n    if (nbits > 14)\n      ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);\n\n    emit_ac_symbol(entropy, entropy->ac_tbl_no, nbits << 4);\n    if (nbits)\n      emit_bits_e(entropy, entropy->EOBRUN, nbits);\n\n    entropy->EOBRUN = 0;\n\n    /* Emit any buffered correction bits */\n    emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE);\n    entropy->BE = 0;\n  }\n}\n\n\n/*\n * Emit a restart marker & resynchronize predictions.\n */\n\nLOCAL(boolean)\nemit_restart_s (working_state * state, int restart_num)\n{\n  int ci;\n\n  if (! flush_bits_s(state))\n    return FALSE;\n\n  emit_byte_s(state, 0xFF, return FALSE);\n  emit_byte_s(state, JPEG_RST0 + restart_num, return FALSE);\n\n  /* Re-initialize DC predictions to 0 */\n  for (ci = 0; ci < state->cinfo->comps_in_scan; ci++)\n    state->cur.last_dc_val[ci] = 0;\n\n  /* The restart counter is not updated until we successfully write the MCU. */\n\n  return TRUE;\n}\n\n\nLOCAL(void)\nemit_restart_e (huff_entropy_ptr entropy, int restart_num)\n{\n  int ci;\n\n  emit_eobrun(entropy);\n\n  if (! entropy->gather_statistics) {\n    flush_bits_e(entropy);\n    emit_byte_e(entropy, 0xFF);\n    emit_byte_e(entropy, JPEG_RST0 + restart_num);\n  }\n\n  if (entropy->cinfo->Ss == 0) {\n    /* Re-initialize DC predictions to 0 */\n    for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++)\n      entropy->saved.last_dc_val[ci] = 0;\n  } else {\n    /* Re-initialize all AC-related fields to 0 */\n    entropy->EOBRUN = 0;\n    entropy->BE = 0;\n  }\n}\n\n\n/*\n * MCU encoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  register int temp, temp2;\n  register int nbits;\n  int blkn, ci, tbl;\n  ISHIFT_TEMPS\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval)\n    if (entropy->restarts_to_go == 0)\n      emit_restart_e(entropy, entropy->next_restart_num);\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    ci = cinfo->MCU_membership[blkn];\n    tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;\n\n    /* Compute the DC value after the required point transform by Al.\n     * This is simply an arithmetic right shift.\n     */\n    temp = IRIGHT_SHIFT((int) (MCU_data[blkn][0][0]), cinfo->Al);\n\n    /* DC differences are figured on the point-transformed values. */\n    temp2 = temp - entropy->saved.last_dc_val[ci];\n    entropy->saved.last_dc_val[ci] = temp;\n\n    /* Encode the DC coefficient difference per section G.1.2.1 */\n    temp = temp2;\n    if (temp < 0) {\n      temp = -temp;\t\t/* temp is abs value of input */\n      /* For a negative input, want temp2 = bitwise complement of abs(input) */\n      /* This code assumes we are on a two's complement machine */\n      temp2--;\n    }\n\n    /* Find the number of bits needed for the magnitude of the coefficient */\n    nbits = 0;\n    while (temp) {\n      nbits++;\n      temp >>= 1;\n    }\n    /* Check for out-of-range coefficient values.\n     * Since we're encoding a difference, the range limit is twice as much.\n     */\n    if (nbits > MAX_COEF_BITS+1)\n      ERREXIT(cinfo, JERR_BAD_DCT_COEF);\n\n    /* Count/emit the Huffman-coded symbol for the number of bits */\n    emit_dc_symbol(entropy, tbl, nbits);\n\n    /* Emit that number of bits of the value, if positive, */\n    /* or the complement of its magnitude, if negative. */\n    if (nbits)\t\t\t/* emit_bits rejects calls with size 0 */\n      emit_bits_e(entropy, (unsigned int) temp2, nbits);\n  }\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  const int * natural_order;\n  JBLOCKROW block;\n  int temp, temp2;\n  int nbits;\n  int r, k;\n  int Se, Al;\n  short t1[DCTSIZE2];\n  short t2[DCTSIZE2];\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval)\n    if (entropy->restarts_to_go == 0)\n      emit_restart_e(entropy, entropy->next_restart_num);\n\n  Se = cinfo->Se;\n  Al = cinfo->Al;\n  natural_order = cinfo->natural_order;\n\n  /* Encode the MCU data block */\n  block = MCU_data[0];\n  /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */\n  r = 0;\t\t\t/* r = run length of zeros */\n\n#ifdef USE_NEON\n  uint64_t zero_mask;\n  if (Se >= 48) {\n\n    zero_mask = AC_first_util_64(*block, natural_order, t1, t2, Al);\n\n  } else {\n\n  int16x8_t zero = vdupq_n_s16(0);\n  int16x8_t al_neon = vdupq_n_s16(-Al);\n\n#endif\n\n  for (k = cinfo->Ss; k < Se;) {\n\n#ifdef USE_NEON\n\n    int16x8_t x0 = zero;\n    int16x8_t x1 = zero;\n\n    x1 = vsetq_lane_s16((*block)[natural_order[k+0]], x1, 0);  // Load 8 16-bit values sequentially\n    x0 = vsetq_lane_s16((*block)[natural_order[k+1]], x0, 1);  // Interleave the loads to compensate for latency\n    x1 = vsetq_lane_s16((*block)[natural_order[k+2]], x1, 2);\n    x0 = vsetq_lane_s16((*block)[natural_order[k+3]], x0, 3);\n    x1 = vsetq_lane_s16((*block)[natural_order[k+4]], x1, 4);\n    x0 = vsetq_lane_s16((*block)[natural_order[k+5]], x0, 5);\n    x1 = vsetq_lane_s16((*block)[natural_order[k+6]], x1, 6);\n    x0 = vsetq_lane_s16((*block)[natural_order[k+7]], x0, 7);\n    int16x8_t x = vorrq_s16(x1, x0);\n\n    uint16x8_t is_positive = vcgezq_s16(x);\n    x = vabsq_s16(x);          // Get absolute value of 16-bit integers\n    x = vshlq_s16(x, al_neon); // >> 16-bit integers by Al bits\n\n    int16x8_t n = vmvnq_s16(x);\n\n    n = vbslq_s16(is_positive, x, n);\n\n    vst1q_s16(&t1[k], x); // Store\n    vst1q_s16(&t2[k], n); // Store\n\n#elif defined USE_SSE\n\n    __m128i x0 = _mm_setzero_si128();\n    __m128i x1 = _mm_cvtsi32_si128((*block)[natural_order[k+0]]);\n    x0 = _mm_insert_epi16(x0, (*block)[natural_order[k+4]], 4);\n    x1 = _mm_insert_epi16(x1, (*block)[natural_order[k+1]], 1);\n    x0 = _mm_insert_epi16(x0, (*block)[natural_order[k+5]], 5);\n    x1 = _mm_insert_epi16(x1, (*block)[natural_order[k+2]], 2);\n    x0 = _mm_insert_epi16(x0, (*block)[natural_order[k+6]], 6);\n    x1 = _mm_insert_epi16(x1, (*block)[natural_order[k+3]], 3);\n    x0 = _mm_insert_epi16(x0, (*block)[natural_order[k+7]], 7);\n\n    __m128i x = _mm_xor_si128(x0, x1);\n    __m128i neg = _mm_cmpgt_epi16(_mm_setzero_si128(), x);\n    x = _mm_abs_epi16(x);\n    x = _mm_srli_epi16(x, Al);\n    __m128i n = _mm_andnot_si128(x, neg);\n    n = _mm_xor_si128(n, _mm_andnot_si128(neg, x));\n\n    _mm_storeu_si128((__m128i*)&t1[k], x);\n    _mm_storeu_si128((__m128i*)&t2[k], n);\n\n#endif\n\n    k += 8;\n    k &= -8;\n  }\n\n  for (; k <= Se; k++) {\n    temp = (*block)[natural_order[k]];\n    if (temp < 0) {\n      temp = -temp;             /* temp is abs value of input */\n      temp >>= Al;              /* apply the point transform */\n      temp2 = ~temp;\n    } else {\n      temp >>= Al;              /* apply the point transform */\n      temp2 = temp;\n    }\n    t1[k] = temp;\n    t2[k] = temp2;\n  }\n\n#ifdef USE_NEON\n  }\n#endif\n\n  for (k = cinfo->Ss; k <= Se;) {\n\n#ifdef USE_NEON\n    if (Se >= 48) {\n      uint64_t kk =__builtin_clzl(zero_mask << k);\n      r += kk;\n      k += kk;\n      if (k>Se) {\n        int tail = k - (Se + 1);\n        k -= tail;\n        r -= tail;\n        break;\n      }\n    } else\n#endif\n    {\n      uint64_t tt, *t = (uint64_t*)&t1[k];\n      if ( (tt = *t) == 0) while ( (tt = *++t) == 0);\n      int skip = __builtin_ctzl(tt)/16 + ((int64_t)t - (int64_t)&t1[k])/2;\n      k += skip;\n      r += skip;\n      if (k > Se) break;\n    }\n\n    temp = t1[k];\n    temp2 = t2[k];\n\n    /* Emit any pending EOBRUN */\n    if (entropy->EOBRUN > 0)\n      emit_eobrun(entropy);\n    /* if run length > 15, must emit special run-length-16 codes (0xF0) */\n    while (r > 15) {\n      emit_ac_symbol(entropy, entropy->ac_tbl_no, 0xF0);\n      r -= 16;\n    }\n\n    /* Find the number of bits needed for the magnitude of the coefficient */\n    nbits = 32 - __builtin_clz(temp);\n    /* Check for out-of-range coefficient values */\n    if (nbits > MAX_COEF_BITS)\n      ERREXIT(cinfo, JERR_BAD_DCT_COEF);\n\n    /* Count/emit Huffman symbol for run length / number of bits */\n    emit_ac_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits);\n\n    /* Emit that number of bits of the value, if positive, */\n    /* or the complement of its magnitude, if negative. */\n    emit_bits_e(entropy, (unsigned int) temp2, nbits);\n\n    r = 0;\t\t\t/* reset zero run length */\n    k++;\n  }\n\n  if (r > 0) {\t\t\t/* If there are trailing zeroes, */\n    entropy->EOBRUN++;\t\t/* count an EOB */\n    if (entropy->EOBRUN == 0x7FFF)\n      emit_eobrun(entropy);\t/* force it out to avoid overflow */\n  }\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for DC successive approximation refinement scan.\n * Note: we assume such scans can be multi-component,\n * although the spec is not very clear on the point.\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int Al, blkn;\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval)\n    if (entropy->restarts_to_go == 0)\n      emit_restart_e(entropy, entropy->next_restart_num);\n\n  Al = cinfo->Al;\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    /* We simply emit the Al'th bit of the DC coefficient value. */\n    emit_bits_e(entropy, (unsigned int) (MCU_data[blkn][0][0] >> Al), 1);\n  }\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  const int * natural_order;\n  JBLOCKROW block;\n  int temp;\n  int r, k, j;\n  int Se, Al;\n  int EOB;\n  char *BR_buffer;\n  unsigned int BR;\n  short absvalues[DCTSIZE2];\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval)\n    if (entropy->restarts_to_go == 0)\n      emit_restart_e(entropy, entropy->next_restart_num);\n\n  Se = cinfo->Se;\n  Al = cinfo->Al;\n  natural_order = cinfo->natural_order;\n\n  /* Encode the MCU data block */\n  block = MCU_data[0];\n\n  /* It is convenient to make a pre-pass to determine the transformed\n   * coefficients' absolute values and the EOB position.\n   */\n\n  EOB = 0;\n\n  uint64_t zero_mask;\n\n#ifdef USE_NEON\n  if (Se >= 48) {\n\n    two_ret ret  = AC_refine_util_64(*block, natural_order, absvalues, Al);\n    EOB = ret.EOB;\n    zero_mask = ret.Z_MASK;\n\n  } else {\n\n  int16x8_t one = vdupq_n_s16(1);\n  int16x8_t zero = vdupq_n_s16(0);\n  int16x8_t al_neon = vdupq_n_s16(-Al);\n\n#endif\n\n  for (k = cinfo->Ss; k < Se;) {\n\n#ifdef USE_NEON\n\n    int16x8_t x0 = zero;\n    int16x8_t x1 = zero;\n\n    x1 = vsetq_lane_s16((*block)[natural_order[k+0]], x1, 0);\n    x0 = vsetq_lane_s16((*block)[natural_order[k+1]], x0, 1);\n    x1 = vsetq_lane_s16((*block)[natural_order[k+2]], x1, 2);\n    x0 = vsetq_lane_s16((*block)[natural_order[k+3]], x0, 3);\n    x1 = vsetq_lane_s16((*block)[natural_order[k+4]], x1, 4);\n    x0 = vsetq_lane_s16((*block)[natural_order[k+5]], x0, 5);\n    x1 = vsetq_lane_s16((*block)[natural_order[k+6]], x1, 6);\n    x0 = vsetq_lane_s16((*block)[natural_order[k+7]], x0, 7);\n\n    int16x8_t x = vorrq_s16(x1, x0);\n    x = vabsq_s16(x);\n    x = vshlq_s16(x, al_neon);\n\n    vst1q_s16(&absvalues[k], x);\n\n    uint8x16_t is_one = vreinterpretq_u8_u16(vceqq_s16(x, one));\n    is_one = vuzp1q_u8(is_one, is_one);\n\n    uint64_t idx = vgetq_lane_u64(vreinterpretq_u64_u8(is_one), 0);\n    EOB = idx ? k + 8 - __builtin_clzl(idx)/8 : EOB;\n\n#elif defined USE_SSE\n\n    __m128i x1 = _mm_setzero_si128();\n    __m128i x0 = _mm_cvtsi32_si128((*block)[natural_order[k+0]]);\n    x1 = _mm_insert_epi16(x1, (*block)[natural_order[k+4]], 4);\n    x0 = _mm_insert_epi16(x0, (*block)[natural_order[k+1]], 1);\n    x1 = _mm_insert_epi16(x1, (*block)[natural_order[k+5]], 5);\n    x0 = _mm_insert_epi16(x0, (*block)[natural_order[k+2]], 2);\n    x1 = _mm_insert_epi16(x1, (*block)[natural_order[k+6]], 6);\n    x0 = _mm_insert_epi16(x0, (*block)[natural_order[k+3]], 3);\n    x1 = _mm_insert_epi16(x1, (*block)[natural_order[k+7]], 7);\n\n    __m128i x = _mm_xor_si128(x1, x0);\n    x = _mm_abs_epi16(x);\n    x = _mm_srli_epi16(x, Al);\n    _mm_storeu_si128((__m128i*)&absvalues[k], x);\n    x = _mm_cmpeq_epi16(x, _mm_set1_epi16(1));\n    unsigned int idx = _mm_movemask_epi8(x);\n\n    EOB = idx? k + 16 - __builtin_clz(idx)/2 : EOB;\n\n#endif\n\n    k += 8;\n    k &= -8;\n  }\n\n  /* We should not get to this loop */\n  for (; k <= Se; k++) {\n    temp = (*block)[natural_order[k]];\n    /* We must apply the point transform by Al.  For AC coefficients this\n     * is an integer division with rounding towards 0.  To do this portably\n     * in C, we shift after obtaining the absolute value.\n     */\n    if (temp < 0)\n      temp = -temp;             /* temp is abs value of input */\n    temp >>= Al;                /* apply the point transform */\n    absvalues[k] = temp;        /* save abs value for main pass */\n    if (temp == 1)\n      EOB = k;                  /* EOB = index of last newly-nonzero coef */\n  }\n\n#ifdef USE_NEON\n  }\n#endif\n\n  /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */\n  r = 0;\t\t\t/* r = run length of zeros */\n  BR = 0;\t\t\t/* BR = count of buffered bits added now */\n  BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */\n\n  for (k = cinfo->Ss; k <= Se;) {\n\n#ifdef USE_NEON\n    if (Se >= 48) {\n      uint64_t kk =__builtin_clzl(zero_mask << k);\n      r += kk;\n      k += kk;\n      if (k>Se) {\n        int tail = k - (Se + 1);\n        k -= tail;\n        r -= tail;\n        break;\n      }\n    } else\n#endif\n    {\n      uint64_t tt, *t = (uint64_t*)&absvalues[k];\n      if ( (tt = *t) == 0) while ( (tt = *++t) == 0);\n      int skip = __builtin_ctzl(tt)/16 + ((int64_t)t - (int64_t)&absvalues[k])/2;\n      k += skip;\n      r += skip;\n      if (k > Se) break;\n    }\n\n    temp = absvalues[k];\n\n    /* Emit any required ZRLs, but not if they can be folded into EOB */\n    while (r > 15 && k <= EOB) {\n      /* emit any pending EOBRUN and the BE correction bits */\n      emit_eobrun(entropy);\n      /* Emit ZRL */\n      emit_ac_symbol(entropy, entropy->ac_tbl_no, 0xF0);\n      r -= 16;\n      /* Emit buffered correction bits that must be associated with ZRL */\n      emit_buffered_bits(entropy, BR_buffer, BR);\n      BR_buffer = entropy->bit_buffer; /* BE bits are gone now */\n      BR = 0;\n    }\n\n    /* If the coef was previously nonzero, it only needs a correction bit.\n     * NOTE: a straight translation of the spec's figure G.7 would suggest\n     * that we also need to test r > 15.  But if r > 15, we can only get here\n     * if k > EOB, which implies that this coefficient is not 1.\n     */\n    if (temp > 1) {\n      /* The correction bit is the next bit of the absolute value. */\n      BR_buffer[BR++] = (char) (temp & 1);\n      k++;\n      continue;\n    }\n\n    /* Emit any pending EOBRUN and the BE correction bits */\n    emit_eobrun(entropy);\n\n    /* Count/emit Huffman symbol for run length / number of bits */\n    emit_ac_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1);\n\n    /* Emit output bit for newly-nonzero coef */\n    temp = ((*block)[natural_order[k]] < 0) ? 0 : 1;\n    emit_bits_e(entropy, (unsigned int) temp, 1);\n\n    /* Emit buffered correction bits that must be associated with this code */\n    emit_buffered_bits(entropy, BR_buffer, BR);\n    BR_buffer = entropy->bit_buffer; /* BE bits are gone now */\n    BR = 0;\n    r = 0;\t\t\t/* reset zero run length */\n    k++;\n  }\n\n  if (r > 0 || BR > 0) {\t/* If there are trailing zeroes, */\n    entropy->EOBRUN++;\t\t/* count an EOB */\n    entropy->BE += BR;\t\t/* concat my correction bits to older ones */\n    /* We force out the EOB if we risk either:\n     * 1. overflow of the EOB counter;\n     * 2. overflow of the correction bit buffer during the next MCU.\n     */\n    if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1))\n      emit_eobrun(entropy);\n  }\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/* Encode a single block's worth of coefficients */\n\nLOCAL(boolean)\nencode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,\n\t\t  c_derived_tbl *dctbl, c_derived_tbl *actbl)\n{\n  register int temp, temp2;\n  register int nbits;\n  register int r, k;\n  int Se = state->cinfo->lim_Se;\n  const int * natural_order = state->cinfo->natural_order;\n\n  /* Encode the DC coefficient difference per section F.1.2.1 */\n\n  temp = temp2 = block[0] - last_dc_val;\n\n  if (temp < 0) {\n    temp = -temp;\t\t/* temp is abs value of input */\n    /* For a negative input, want temp2 = bitwise complement of abs(input) */\n    /* This code assumes we are on a two's complement machine */\n    temp2--;\n  }\n\n  /* Find the number of bits needed for the magnitude of the coefficient */\n  nbits = 0;\n  while (temp) {\n    nbits++;\n    temp >>= 1;\n  }\n  /* Check for out-of-range coefficient values.\n   * Since we're encoding a difference, the range limit is twice as much.\n   */\n  if (nbits > MAX_COEF_BITS+1)\n    ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);\n\n  /* Emit the Huffman-coded symbol for the number of bits */\n  if (! emit_bits_s(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits]))\n    return FALSE;\n\n  /* Emit that number of bits of the value, if positive, */\n  /* or the complement of its magnitude, if negative. */\n  if (nbits)\t\t\t/* emit_bits rejects calls with size 0 */\n    if (! emit_bits_s(state, (unsigned int) temp2, nbits))\n      return FALSE;\n\n  /* Encode the AC coefficients per section F.1.2.2 */\n\n  r = 0;\t\t\t/* r = run length of zeros */\n\n  for (k = 1; k <= Se; k++) {\n    if ((temp2 = block[natural_order[k]]) == 0) {\n      r++;\n    } else {\n      /* if run length > 15, must emit special run-length-16 codes (0xF0) */\n      while (r > 15) {\n\tif (! emit_bits_s(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0]))\n\t  return FALSE;\n\tr -= 16;\n      }\n\n      temp = temp2;\n      if (temp < 0) {\n\ttemp = -temp;\t\t/* temp is abs value of input */\n\t/* This code assumes we are on a two's complement machine */\n\ttemp2--;\n      }\n\n      /* Find the number of bits needed for the magnitude of the coefficient */\n      nbits = 1;\t\t/* there must be at least one 1 bit */\n      while ((temp >>= 1))\n\tnbits++;\n      /* Check for out-of-range coefficient values */\n      if (nbits > MAX_COEF_BITS)\n\tERREXIT(state->cinfo, JERR_BAD_DCT_COEF);\n\n      /* Emit Huffman symbol for run length / number of bits */\n      temp = (r << 4) + nbits;\n      if (! emit_bits_s(state, actbl->ehufco[temp], actbl->ehufsi[temp]))\n\treturn FALSE;\n\n      /* Emit that number of bits of the value, if positive, */\n      /* or the complement of its magnitude, if negative. */\n      if (! emit_bits_s(state, (unsigned int) temp2, nbits))\n\treturn FALSE;\n\n      r = 0;\n    }\n  }\n\n  /* If the last coef(s) were zero, emit an end-of-block code */\n  if (r > 0)\n    if (! emit_bits_s(state, actbl->ehufco[0], actbl->ehufsi[0]))\n      return FALSE;\n\n  return TRUE;\n}\n\n\n/*\n * Encode and output one MCU's worth of Huffman-compressed coefficients.\n */\n\nMETHODDEF(boolean)\nencode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  working_state state;\n  int blkn, ci;\n  jpeg_component_info * compptr;\n\n  /* Load up working state */\n  state.next_output_byte = cinfo->dest->next_output_byte;\n  state.free_in_buffer = cinfo->dest->free_in_buffer;\n  ASSIGN_STATE(state.cur, entropy->saved);\n  state.cinfo = cinfo;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! emit_restart_s(&state, entropy->next_restart_num))\n\treturn FALSE;\n  }\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n    if (! encode_one_block(&state,\n\t\t\t   MCU_data[blkn][0], state.cur.last_dc_val[ci],\n\t\t\t   entropy->dc_derived_tbls[compptr->dc_tbl_no],\n\t\t\t   entropy->ac_derived_tbls[compptr->ac_tbl_no]))\n      return FALSE;\n    /* Update last_dc_val */\n    state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];\n  }\n\n  /* Completed MCU, so update state */\n  cinfo->dest->next_output_byte = state.next_output_byte;\n  cinfo->dest->free_in_buffer = state.free_in_buffer;\n  ASSIGN_STATE(entropy->saved, state.cur);\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Finish up at the end of a Huffman-compressed scan.\n */\n\nMETHODDEF(void)\nfinish_pass_huff (j_compress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  working_state state;\n\n  if (cinfo->progressive_mode) {\n    entropy->next_output_byte = cinfo->dest->next_output_byte;\n    entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n    /* Flush out any buffered data */\n    emit_eobrun(entropy);\n    flush_bits_e(entropy);\n\n    cinfo->dest->next_output_byte = entropy->next_output_byte;\n    cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n  } else {\n    /* Load up working state ... flush_bits needs it */\n    state.next_output_byte = cinfo->dest->next_output_byte;\n    state.free_in_buffer = cinfo->dest->free_in_buffer;\n    ASSIGN_STATE(state.cur, entropy->saved);\n    state.cinfo = cinfo;\n\n    /* Flush out the last data */\n    if (! flush_bits_s(&state))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n\n    /* Update state */\n    cinfo->dest->next_output_byte = state.next_output_byte;\n    cinfo->dest->free_in_buffer = state.free_in_buffer;\n    ASSIGN_STATE(entropy->saved, state.cur);\n  }\n}\n\n\n/*\n * Huffman coding optimization.\n *\n * We first scan the supplied data and count the number of uses of each symbol\n * that is to be Huffman-coded. (This process MUST agree with the code above.)\n * Then we build a Huffman coding tree for the observed counts.\n * Symbols which are not needed at all for the particular image are not\n * assigned any code, which saves space in the DHT marker as well as in\n * the compressed data.\n */\n\n\n/* Process a single block's worth of coefficients */\n\nLOCAL(void)\nhtest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,\n\t\t long dc_counts[], long ac_counts[])\n{\n  register int temp;\n  register int nbits;\n  register int r, k;\n  int Se = cinfo->lim_Se;\n  const int * natural_order = cinfo->natural_order;\n\n  /* Encode the DC coefficient difference per section F.1.2.1 */\n\n  temp = block[0] - last_dc_val;\n  if (temp < 0)\n    temp = -temp;\n\n  /* Find the number of bits needed for the magnitude of the coefficient */\n  nbits = 0;\n  while (temp) {\n    nbits++;\n    temp >>= 1;\n  }\n  /* Check for out-of-range coefficient values.\n   * Since we're encoding a difference, the range limit is twice as much.\n   */\n  if (nbits > MAX_COEF_BITS+1)\n    ERREXIT(cinfo, JERR_BAD_DCT_COEF);\n\n  /* Count the Huffman symbol for the number of bits */\n  dc_counts[nbits]++;\n\n  /* Encode the AC coefficients per section F.1.2.2 */\n\n  r = 0;\t\t\t/* r = run length of zeros */\n\n  for (k = 1; k <= Se; k++) {\n    if ((temp = block[natural_order[k]]) == 0) {\n      r++;\n    } else {\n      /* if run length > 15, must emit special run-length-16 codes (0xF0) */\n      while (r > 15) {\n\tac_counts[0xF0]++;\n\tr -= 16;\n      }\n\n      /* Find the number of bits needed for the magnitude of the coefficient */\n      if (temp < 0)\n\ttemp = -temp;\n\n      /* Find the number of bits needed for the magnitude of the coefficient */\n      nbits = 1;\t\t/* there must be at least one 1 bit */\n      while ((temp >>= 1))\n\tnbits++;\n      /* Check for out-of-range coefficient values */\n      if (nbits > MAX_COEF_BITS)\n\tERREXIT(cinfo, JERR_BAD_DCT_COEF);\n\n      /* Count Huffman symbol for run length / number of bits */\n      ac_counts[(r << 4) + nbits]++;\n\n      r = 0;\n    }\n  }\n\n  /* If the last coef(s) were zero, emit an end-of-block code */\n  if (r > 0)\n    ac_counts[0]++;\n}\n\n\n/*\n * Trial-encode one MCU's worth of Huffman-compressed coefficients.\n * No data is actually output, so no suspension return is possible.\n */\n\nMETHODDEF(boolean)\nencode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int blkn, ci;\n  jpeg_component_info * compptr;\n\n  /* Take care of restart intervals if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      /* Re-initialize DC predictions to 0 */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++)\n\tentropy->saved.last_dc_val[ci] = 0;\n      /* Update restart state */\n      entropy->restarts_to_go = cinfo->restart_interval;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n    htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci],\n\t\t    entropy->dc_count_ptrs[compptr->dc_tbl_no],\n\t\t    entropy->ac_count_ptrs[compptr->ac_tbl_no]);\n    entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0];\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Generate the best Huffman code table for the given counts, fill htbl.\n *\n * The JPEG standard requires that no symbol be assigned a codeword of all\n * one bits (so that padding bits added at the end of a compressed segment\n * can't look like a valid code).  Because of the canonical ordering of\n * codewords, this just means that there must be an unused slot in the\n * longest codeword length category.  Section K.2 of the JPEG spec suggests\n * reserving such a slot by pretending that symbol 256 is a valid symbol\n * with count 1.  In theory that's not optimal; giving it count zero but\n * including it in the symbol set anyway should give a better Huffman code.\n * But the theoretically better code actually seems to come out worse in\n * practice, because it produces more all-ones bytes (which incur stuffed\n * zero bytes in the final file).  In any case the difference is tiny.\n *\n * The JPEG standard requires Huffman codes to be no more than 16 bits long.\n * If some symbols have a very small but nonzero probability, the Huffman tree\n * must be adjusted to meet the code length restriction.  We currently use\n * the adjustment method suggested in JPEG section K.2.  This method is *not*\n * optimal; it may not choose the best possible limited-length code.  But\n * typically only very-low-frequency symbols will be given less-than-optimal\n * lengths, so the code is almost optimal.  Experimental comparisons against\n * an optimal limited-length-code algorithm indicate that the difference is\n * microscopic --- usually less than a hundredth of a percent of total size.\n * So the extra complexity of an optimal algorithm doesn't seem worthwhile.\n */\n\nLOCAL(void)\njpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])\n{\n#define MAX_CLEN 32\t\t/* assumed maximum initial code length */\n  UINT8 bits[MAX_CLEN+1];\t/* bits[k] = # of symbols with code length k */\n  int codesize[257];\t\t/* codesize[k] = code length of symbol k */\n  int others[257];\t\t/* next symbol in current branch of tree */\n  int c1, c2;\n  int p, i, j;\n  long v;\n\n  /* This algorithm is explained in section K.2 of the JPEG standard */\n\n  MEMZERO(bits, SIZEOF(bits));\n  MEMZERO(codesize, SIZEOF(codesize));\n  for (i = 0; i < 257; i++)\n    others[i] = -1;\t\t/* init links to empty */\n\n  freq[256] = 1;\t\t/* make sure 256 has a nonzero count */\n  /* Including the pseudo-symbol 256 in the Huffman procedure guarantees\n   * that no real symbol is given code-value of all ones, because 256\n   * will be placed last in the largest codeword category.\n   */\n\n  /* Huffman's basic algorithm to assign optimal code lengths to symbols */\n\n  for (;;) {\n    /* Find the smallest nonzero frequency, set c1 = its symbol */\n    /* In case of ties, take the larger symbol number */\n    c1 = -1;\n    v = 1000000000L;\n    for (i = 0; i <= 256; i++) {\n      if (freq[i] && freq[i] <= v) {\n\tv = freq[i];\n\tc1 = i;\n      }\n    }\n\n    /* Find the next smallest nonzero frequency, set c2 = its symbol */\n    /* In case of ties, take the larger symbol number */\n    c2 = -1;\n    v = 1000000000L;\n    for (i = 0; i <= 256; i++) {\n      if (freq[i] && freq[i] <= v && i != c1) {\n\tv = freq[i];\n\tc2 = i;\n      }\n    }\n\n    /* Done if we've merged everything into one frequency */\n    if (c2 < 0)\n      break;\n\n    /* Else merge the two counts/trees */\n    freq[c1] += freq[c2];\n    freq[c2] = 0;\n\n    /* Increment the codesize of everything in c1's tree branch */\n    codesize[c1]++;\n    while (others[c1] >= 0) {\n      c1 = others[c1];\n      codesize[c1]++;\n    }\n\n    others[c1] = c2;\t\t/* chain c2 onto c1's tree branch */\n\n    /* Increment the codesize of everything in c2's tree branch */\n    codesize[c2]++;\n    while (others[c2] >= 0) {\n      c2 = others[c2];\n      codesize[c2]++;\n    }\n  }\n\n  /* Now count the number of symbols of each code length */\n  for (i = 0; i <= 256; i++) {\n    if (codesize[i]) {\n      /* The JPEG standard seems to think that this can't happen, */\n      /* but I'm paranoid... */\n      if (codesize[i] > MAX_CLEN)\n\tERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);\n\n      bits[codesize[i]]++;\n    }\n  }\n\n  /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure\n   * Huffman procedure assigned any such lengths, we must adjust the coding.\n   * Here is what the JPEG spec says about how this next bit works:\n   * Since symbols are paired for the longest Huffman code, the symbols are\n   * removed from this length category two at a time.  The prefix for the pair\n   * (which is one bit shorter) is allocated to one of the pair; then,\n   * skipping the BITS entry for that prefix length, a code word from the next\n   * shortest nonzero BITS entry is converted into a prefix for two code words\n   * one bit longer.\n   */\n\n  for (i = MAX_CLEN; i > 16; i--) {\n    while (bits[i] > 0) {\n      j = i - 2;\t\t/* find length of new prefix to be used */\n      while (bits[j] == 0)\n\tj--;\n\n      bits[i] -= 2;\t\t/* remove two symbols */\n      bits[i-1]++;\t\t/* one goes in this length */\n      bits[j+1] += 2;\t\t/* two new symbols in this length */\n      bits[j]--;\t\t/* symbol of this length is now a prefix */\n    }\n  }\n\n  /* Remove the count for the pseudo-symbol 256 from the largest codelength */\n  while (bits[i] == 0)\t\t/* find largest codelength still in use */\n    i--;\n  bits[i]--;\n\n  /* Return final symbol counts (only for lengths 0..16) */\n  MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));\n\n  /* Return a list of the symbols sorted by code length */\n  /* It's not real clear to me why we don't need to consider the codelength\n   * changes made above, but the JPEG spec seems to think this works.\n   */\n  p = 0;\n  for (i = 1; i <= MAX_CLEN; i++) {\n    for (j = 0; j <= 255; j++) {\n      if (codesize[j] == i) {\n\thtbl->huffval[p] = (UINT8) j;\n\tp++;\n      }\n    }\n  }\n\n  /* Set sent_table FALSE so updated table will be written to JPEG file. */\n  htbl->sent_table = FALSE;\n}\n\n\n/*\n * Finish up a statistics-gathering pass and create the new Huffman tables.\n */\n\nMETHODDEF(void)\nfinish_pass_gather (j_compress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int ci, tbl;\n  jpeg_component_info * compptr;\n  JHUFF_TBL **htblptr;\n  boolean did_dc[NUM_HUFF_TBLS];\n  boolean did_ac[NUM_HUFF_TBLS];\n\n  /* It's important not to apply jpeg_gen_optimal_table more than once\n   * per table, because it clobbers the input frequency counts!\n   */\n  if (cinfo->progressive_mode)\n    /* Flush out buffered data (all we care about is counting the EOB symbol) */\n    emit_eobrun(entropy);\n\n  MEMZERO(did_dc, SIZEOF(did_dc));\n  MEMZERO(did_ac, SIZEOF(did_ac));\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* DC needs no table for refinement scan */\n    if (cinfo->Ss == 0 && cinfo->Ah == 0) {\n      tbl = compptr->dc_tbl_no;\n      if (! did_dc[tbl]) {\n\thtblptr = & cinfo->dc_huff_tbl_ptrs[tbl];\n\tif (*htblptr == NULL)\n\t  *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n\tjpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[tbl]);\n\tdid_dc[tbl] = TRUE;\n      }\n    }\n    /* AC needs no table when not present */\n    if (cinfo->Se) {\n      tbl = compptr->ac_tbl_no;\n      if (! did_ac[tbl]) {\n\thtblptr = & cinfo->ac_huff_tbl_ptrs[tbl];\n\tif (*htblptr == NULL)\n\t  *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n\tjpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[tbl]);\n\tdid_ac[tbl] = TRUE;\n      }\n    }\n  }\n}\n\n\n/*\n * Initialize for a Huffman-compressed scan.\n * If gather_statistics is TRUE, we do not output anything during the scan,\n * just count the Huffman symbols used and generate Huffman code tables.\n */\n\nMETHODDEF(void)\nstart_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int ci, tbl;\n  jpeg_component_info * compptr;\n\n  if (gather_statistics)\n    entropy->pub.finish_pass = finish_pass_gather;\n  else\n    entropy->pub.finish_pass = finish_pass_huff;\n\n  if (cinfo->progressive_mode) {\n    entropy->cinfo = cinfo;\n    entropy->gather_statistics = gather_statistics;\n\n    /* We assume jcmaster.c already validated the scan parameters. */\n\n    /* Select execution routine */\n    if (cinfo->Ah == 0) {\n      if (cinfo->Ss == 0)\n\tentropy->pub.encode_mcu = encode_mcu_DC_first;\n      else\n\tentropy->pub.encode_mcu = encode_mcu_AC_first;\n    } else {\n      if (cinfo->Ss == 0)\n\tentropy->pub.encode_mcu = encode_mcu_DC_refine;\n      else {\n\tentropy->pub.encode_mcu = encode_mcu_AC_refine;\n\t/* AC refinement needs a correction bit buffer */\n\tif (entropy->bit_buffer == NULL)\n\t  entropy->bit_buffer = (char *)\n\t    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t\tMAX_CORR_BITS * SIZEOF(char));\n      }\n    }\n\n    /* Initialize AC stuff */\n    entropy->ac_tbl_no = cinfo->cur_comp_info[0]->ac_tbl_no;\n    entropy->EOBRUN = 0;\n    entropy->BE = 0;\n  } else {\n    if (gather_statistics)\n      entropy->pub.encode_mcu = encode_mcu_gather;\n    else\n      entropy->pub.encode_mcu = encode_mcu_huff;\n  }\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* DC needs no table for refinement scan */\n    if (cinfo->Ss == 0 && cinfo->Ah == 0) {\n      tbl = compptr->dc_tbl_no;\n      if (gather_statistics) {\n\t/* Check for invalid table index */\n\t/* (make_c_derived_tbl does this in the other path) */\n\tif (tbl < 0 || tbl >= NUM_HUFF_TBLS)\n\t  ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);\n\t/* Allocate and zero the statistics tables */\n\t/* Note that jpeg_gen_optimal_table expects 257 entries in each table! */\n\tif (entropy->dc_count_ptrs[tbl] == NULL)\n\t  entropy->dc_count_ptrs[tbl] = (long *)\n\t    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t\t257 * SIZEOF(long));\n\tMEMZERO(entropy->dc_count_ptrs[tbl], 257 * SIZEOF(long));\n      } else {\n\t/* Compute derived values for Huffman tables */\n\t/* We may do this more than once for a table, but it's not expensive */\n\tjpeg_make_c_derived_tbl(cinfo, TRUE, tbl,\n\t\t\t\t& entropy->dc_derived_tbls[tbl]);\n      }\n      /* Initialize DC predictions to 0 */\n      entropy->saved.last_dc_val[ci] = 0;\n    }\n    /* AC needs no table when not present */\n    if (cinfo->Se) {\n      tbl = compptr->ac_tbl_no;\n      if (gather_statistics) {\n\tif (tbl < 0 || tbl >= NUM_HUFF_TBLS)\n\t  ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);\n\tif (entropy->ac_count_ptrs[tbl] == NULL)\n\t  entropy->ac_count_ptrs[tbl] = (long *)\n\t    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t\t257 * SIZEOF(long));\n\tMEMZERO(entropy->ac_count_ptrs[tbl], 257 * SIZEOF(long));\n      } else {\n\tjpeg_make_c_derived_tbl(cinfo, FALSE, tbl,\n\t\t\t\t& entropy->ac_derived_tbls[tbl]);\n      }\n    }\n  }\n\n  /* Initialize bit buffer to empty */\n  entropy->saved.put_buffer = 0;\n  entropy->saved.put_bits = 0;\n\n  /* Initialize restart stuff */\n  entropy->restarts_to_go = cinfo->restart_interval;\n  entropy->next_restart_num = 0;\n}\n\n\n/*\n * Module initialization routine for Huffman entropy encoding.\n */\n\nGLOBAL(void)\njinit_huff_encoder (j_compress_ptr cinfo)\n{\n  huff_entropy_ptr entropy;\n  int i;\n\n  entropy = (huff_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(huff_entropy_encoder));\n  cinfo->entropy = &entropy->pub;\n  entropy->pub.start_pass = start_pass_huff;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;\n    entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL;\n  }\n\n  if (cinfo->progressive_mode)\n    entropy->bit_buffer = NULL;\t/* needed only in AC refinement scan */\n}\n"
  },
  {
    "path": "jchuff_util_armv8.S",
    "content": "#ifdef USE_NEON\n\n#if !defined(__APPLE__)\n\n#define ENTRY(name) \\\n.globl name; \\\n.hidden name; \\\n.type name, @function; \\\nname:\n\n#define ENDPROC(name) \\\n.size name, .-name\n\n#else\n\n#define ENTRY(name) \\\n.globl _ ## name; \\\n.private_extern _ ## name; \\\n_ ## name:\n\n#define ENDPROC(name)\n\n#endif\n\n.align\t3\n.shuf_mask:\n.byte\t60, 52, 44, 36, 28, 20, 12, 4\n\n\n###############################################################################\n# {uint64_t EOB, uint64_t Z_MASK} AC_refine_util_64(short *block, int *natural_order, short *res, int al);\n\nENTRY(AC_refine_util_64)\n\n    # Load and deintreleave the block\n    ld2 {v0.16b - v1.16b}, [x0], 32\n    ld2 {v16.16b - v17.16b}, [x0], 32\n    ld2 {v18.16b - v19.16b}, [x0], 32\n    ld2 {v20.16b - v21.16b}, [x0]\n\n    mov v4.16b, v1.16b\n    mov v5.16b, v17.16b\n    mov v6.16b, v19.16b\n    mov v7.16b, v21.16b\n    mov v1.16b, v16.16b\n    mov v2.16b, v18.16b\n    mov v3.16b, v20.16b\n    # Load the order\n    ld4 {v16.16b - v19.16b}, [x1], 64\n    ld4 {v17.16b - v20.16b}, [x1], 64\n    ld4 {v18.16b - v21.16b}, [x1], 64\n    ld4 {v19.16b - v22.16b}, [x1]\n    # Table lookup, LSB and MSB independently\n    tbl v20.16b, {v0.16b - v3.16b}, v16.16b\n    tbl v16.16b, {v4.16b - v7.16b}, v16.16b\n    tbl v21.16b, {v0.16b - v3.16b}, v17.16b\n    tbl v17.16b, {v4.16b - v7.16b}, v17.16b\n    tbl v22.16b, {v0.16b - v3.16b}, v18.16b\n    tbl v18.16b, {v4.16b - v7.16b}, v18.16b\n    tbl v23.16b, {v0.16b - v3.16b}, v19.16b\n    tbl v19.16b, {v4.16b - v7.16b}, v19.16b\n    # Interleave MSB and LSB back\n    zip1 v0.16b, v20.16b, v16.16b\n    zip2 v1.16b, v20.16b, v16.16b\n    zip1 v2.16b, v21.16b, v17.16b\n    zip2 v3.16b, v21.16b, v17.16b\n    zip1 v4.16b, v22.16b, v18.16b\n    zip2 v5.16b, v22.16b, v18.16b\n    zip1 v6.16b, v23.16b, v19.16b\n    zip2 v7.16b, v23.16b, v19.16b\n    # -Al\n    neg w3, w3\n    dup v16.8h, w3\n    # Absolute then shift by Al\n    abs v0.8h, v0.8h\n    sshl v0.8h, v0.8h, v16.8h\n    abs v1.8h, v1.8h\n    sshl v1.8h, v1.8h, v16.8h\n    abs v2.8h, v2.8h\n    sshl v2.8h, v2.8h, v16.8h\n    abs v3.8h, v3.8h\n    sshl v3.8h, v3.8h, v16.8h\n    abs v4.8h, v4.8h\n    sshl v4.8h, v4.8h, v16.8h\n    abs v5.8h, v5.8h\n    sshl v5.8h, v5.8h, v16.8h\n    abs v6.8h, v6.8h\n    sshl v6.8h, v6.8h, v16.8h\n    abs v7.8h, v7.8h\n    sshl v7.8h, v7.8h, v16.8h\n    # Store\n    st1 {v0.16b - v3.16b}, [x2], 64\n    st1 {v4.16b - v7.16b}, [x2]\n    # Constant 1\n    movi v16.8h, 0x1\n    # Compare with 0 for zero mask\n    cmeq v17.8h, v0.8h, #0\n    cmeq v18.8h, v1.8h, #0\n    cmeq v19.8h, v2.8h, #0\n    cmeq v20.8h, v3.8h, #0\n    cmeq v21.8h, v4.8h, #0\n    cmeq v22.8h, v5.8h, #0\n    cmeq v23.8h, v6.8h, #0\n    cmeq v24.8h, v7.8h, #0\n    # Compare with 1 for EOB mask\n    cmeq v0.8h, v0.8h, v16.8h\n    cmeq v1.8h, v1.8h, v16.8h\n    cmeq v2.8h, v2.8h, v16.8h\n    cmeq v3.8h, v3.8h, v16.8h\n    cmeq v4.8h, v4.8h, v16.8h\n    cmeq v5.8h, v5.8h, v16.8h\n    cmeq v6.8h, v6.8h, v16.8h\n    cmeq v7.8h, v7.8h, v16.8h\n    # For both masks -> keep only one byte for each comparison\n    uzp1 v0.16b, v0.16b, v1.16b\n    uzp1 v1.16b, v2.16b, v3.16b\n    uzp1 v2.16b, v4.16b, v5.16b\n    uzp1 v3.16b, v6.16b, v7.16b\n\n    uzp1 v17.16b, v17.16b, v18.16b\n    uzp1 v18.16b, v19.16b, v20.16b\n    uzp1 v19.16b, v21.16b, v22.16b\n    uzp1 v20.16b, v23.16b, v24.16b\n    # Shift left and insert (int16) to get a single bit from even to odd bytes\n    sli v0.8h, v0.8h, 15\n    sli v1.8h, v1.8h, 15\n    sli v2.8h, v2.8h, 15\n    sli v3.8h, v3.8h, 15\n\n    sli v17.8h, v17.8h, 15\n    sli v18.8h, v18.8h, 15\n    sli v19.8h, v19.8h, 15\n    sli v20.8h, v20.8h, 15\n    # Shift right and insert (int32) to get two bits from off to even indices\n    sri v0.4s, v0.4s, 18\n    sri v1.4s, v1.4s, 18\n    sri v2.4s, v2.4s, 18\n    sri v3.4s, v3.4s, 18\n\n    sri v17.4s, v17.4s, 18\n    sri v18.4s, v18.4s, 18\n    sri v19.4s, v19.4s, 18\n    sri v20.4s, v20.4s, 18\n    # Regular shift right to align the 4 bits at the bottom of each int64\n    ushr v0.2d, v0.2d, 12\n    ushr v1.2d, v1.2d, 12\n    ushr v2.2d, v2.2d, 12\n    ushr v3.2d, v3.2d, 12\n\n    ushr v17.2d, v17.2d, 12\n    ushr v18.2d, v18.2d, 12\n    ushr v19.2d, v19.2d, 12\n    ushr v20.2d, v20.2d, 12\n    # Shift left and insert (int64) to combine all 8 bits into one byte\n    sli v0.2d, v0.2d, 36\n    sli v1.2d, v1.2d, 36\n    sli v2.2d, v2.2d, 36\n    sli v3.2d, v3.2d, 36\n\n    sli v17.2d, v17.2d, 36\n    sli v18.2d, v18.2d, 36\n    sli v19.2d, v19.2d, 36\n    sli v20.2d, v20.2d, 36\n    # Combine all the byte mask insto a bit 64-bit mask for EOB and zero masks\n    ldr d4, .shuf_mask\n    tbl v5.8b, {v0.16b - v3.16b}, v4.8b\n    tbl v6.8b, {v17.16b - v20.16b}, v4.8b\n    # Extract lanes\n    mov x0, v5.d[0]\n    mov x1, v6.d[0]\n    # Compute EOB\n    rbit x0, x0\n    clz x0, x0\n    mov x2, 64\n    sub x0, x2, x0\n    # Not of zero mask (so 1 bits indecates non-zeroes)\n    mvn x1, x1\n    ret\n\nENDPROC(AC_refine_util_64)\n\n###############################################################################\n# uint64_t AC_first_util_64(short *block, int *natural_order, short *t0, short *t1, int al);\nENTRY(AC_first_util_64)\n\n    # Load the block\n    ld2 {v0.16b - v1.16b}, [x0], 32\n    ld2 {v16.16b - v17.16b}, [x0], 32\n    ld2 {v18.16b - v19.16b}, [x0], 32\n    ld2 {v20.16b - v21.16b}, [x0]\n\n    mov v4.16b, v1.16b\n    mov v5.16b, v17.16b\n    mov v6.16b, v19.16b\n    mov v7.16b, v21.16b\n    mov v1.16b, v16.16b\n    mov v2.16b, v18.16b\n    mov v3.16b, v20.16b\n\n    # Load the order\n    ld4 {v16.16b - v19.16b}, [x1], 64\n    ld4 {v17.16b - v20.16b}, [x1], 64\n    ld4 {v18.16b - v21.16b}, [x1], 64\n    ld4 {v19.16b - v22.16b}, [x1]\n    # Table lookup, LSB and MSB independently\n    tbl v20.16b, {v0.16b - v3.16b}, v16.16b\n    tbl v16.16b, {v4.16b - v7.16b}, v16.16b\n    tbl v21.16b, {v0.16b - v3.16b}, v17.16b\n    tbl v17.16b, {v4.16b - v7.16b}, v17.16b\n    tbl v22.16b, {v0.16b - v3.16b}, v18.16b\n    tbl v18.16b, {v4.16b - v7.16b}, v18.16b\n    tbl v23.16b, {v0.16b - v3.16b}, v19.16b\n    tbl v19.16b, {v4.16b - v7.16b}, v19.16b\n    # Interleave MSB and LSB back\n    zip1 v0.16b, v20.16b, v16.16b\n    zip2 v1.16b, v20.16b, v16.16b\n    zip1 v2.16b, v21.16b, v17.16b\n    zip2 v3.16b, v21.16b, v17.16b\n    zip1 v4.16b, v22.16b, v18.16b\n    zip2 v5.16b, v22.16b, v18.16b\n    zip1 v6.16b, v23.16b, v19.16b\n    zip2 v7.16b, v23.16b, v19.16b\n    # -Al\n    neg w4, w4\n    dup v24.8h, w4\n    # Compare with 0 to get negative mask\n    cmge v16.8h, v0.8h, #0\n    # Absolute value and shift by Al\n    abs v0.8h, v0.8h\n    sshl v0.8h, v0.8h, v24.8h\n    cmge v17.8h, v1.8h, #0\n    abs v1.8h, v1.8h\n    sshl v1.8h, v1.8h, v24.8h\n    cmge v18.8h, v2.8h, #0\n    abs v2.8h, v2.8h\n    sshl v2.8h, v2.8h, v24.8h\n    cmge v19.8h, v3.8h, #0\n    abs v3.8h, v3.8h\n    sshl v3.8h, v3.8h, v24.8h\n    cmge v20.8h, v4.8h, #0\n    abs v4.8h, v4.8h\n    sshl v4.8h, v4.8h, v24.8h\n    cmge v21.8h, v5.8h, #0\n    abs v5.8h, v5.8h\n    sshl v5.8h, v5.8h, v24.8h\n    cmge v22.8h, v6.8h, #0\n    abs v6.8h, v6.8h\n    sshl v6.8h, v6.8h, v24.8h\n    cmge v23.8h, v7.8h, #0\n    abs v7.8h, v7.8h\n    sshl v7.8h, v7.8h, v24.8h\n    # ~\n    mvn v24.16b, v0.16b\n    mvn v25.16b, v1.16b\n    mvn v26.16b, v2.16b\n    mvn v27.16b, v3.16b\n    mvn v28.16b, v4.16b\n    mvn v29.16b, v5.16b\n    mvn v30.16b, v6.16b\n    mvn v31.16b, v7.16b\n    # Select\n    bsl v16.16b, v0.16b, v24.16b\n    bsl v17.16b, v1.16b, v25.16b\n    bsl v18.16b, v2.16b, v26.16b\n    bsl v19.16b, v3.16b, v27.16b\n    bsl v20.16b, v4.16b, v28.16b\n    bsl v21.16b, v5.16b, v29.16b\n    bsl v22.16b, v6.16b, v30.16b\n    bsl v23.16b, v7.16b, v31.16b\n    # Store t1\n    st1 {v0.16b - v3.16b}, [x2], 64\n    st1 {v4.16b - v7.16b}, [x2]\n    # Store t2\n    st1 {v16.16b - v19.16b}, [x3], 64\n    st1 {v20.16b - v23.16b}, [x3]\n    # Compute zero mask like before\n    cmeq v17.8h, v0.8h, #0\n    cmeq v18.8h, v1.8h, #0\n    cmeq v19.8h, v2.8h, #0\n    cmeq v20.8h, v3.8h, #0\n    cmeq v21.8h, v4.8h, #0\n    cmeq v22.8h, v5.8h, #0\n    cmeq v23.8h, v6.8h, #0\n    cmeq v24.8h, v7.8h, #0\n\n    uzp1 v17.16b, v17.16b, v18.16b\n    uzp1 v18.16b, v19.16b, v20.16b\n    uzp1 v19.16b, v21.16b, v22.16b\n    uzp1 v20.16b, v23.16b, v24.16b\n\n    sli v17.8h, v17.8h, 15\n    sli v18.8h, v18.8h, 15\n    sli v19.8h, v19.8h, 15\n    sli v20.8h, v20.8h, 15\n\n    sri v17.4s, v17.4s, 18\n    sri v18.4s, v18.4s, 18\n    sri v19.4s, v19.4s, 18\n    sri v20.4s, v20.4s, 18\n\n    ushr v17.2d, v17.2d, 12\n    ushr v18.2d, v18.2d, 12\n    ushr v19.2d, v19.2d, 12\n    ushr v20.2d, v20.2d, 12\n\n    sli v17.2d, v17.2d, 36\n    sli v18.2d, v18.2d, 36\n    sli v19.2d, v19.2d, 36\n    sli v20.2d, v20.2d, 36\n\n    ldr d4, .shuf_mask\n    tbl v6.8b, {v17.16b - v20.16b}, v4.8b\n\n    mov x0, v6.d[0]\n    mvn x0, x0\n    ret\n\nENDPROC(AC_first_util_64)\n\n#endif\n"
  },
  {
    "path": "jcinit.c",
    "content": "/*\n * jcinit.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2003-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains initialization logic for the JPEG compressor.\n * This routine is in charge of selecting the modules to be executed and\n * making an initialization call to each one.\n *\n * Logically, this code belongs in jcmaster.c.  It's split out because\n * linking this routine implies linking the entire compression library.\n * For a transcoding-only application, we want to be able to use jcmaster.c\n * without linking in the whole library.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Master selection of compression modules.\n * This is done once at the start of processing an image.  We determine\n * which modules will be used and give them appropriate initialization calls.\n */\n\nGLOBAL(void)\njinit_compress_master (j_compress_ptr cinfo)\n{\n  long samplesperrow;\n  JDIMENSION jd_samplesperrow;\n\n  /* For now, precision must match compiled-in value... */\n  if (cinfo->data_precision != BITS_IN_JSAMPLE)\n    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);\n\n  /* Sanity check on image dimensions */\n  if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||\n      cinfo->input_components <= 0)\n    ERREXIT(cinfo, JERR_EMPTY_IMAGE);\n\n  /* Width of an input scanline must be representable as JDIMENSION. */\n  samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components;\n  jd_samplesperrow = (JDIMENSION) samplesperrow;\n  if ((long) jd_samplesperrow != samplesperrow)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n\n  /* Initialize master control (includes parameter checking/processing) */\n  jinit_c_master_control(cinfo, FALSE /* full compression */);\n\n  /* Preprocessing */\n  if (! cinfo->raw_data_in) {\n    jinit_color_converter(cinfo);\n    jinit_downsampler(cinfo);\n    jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);\n  }\n  /* Forward DCT */\n  jinit_forward_dct(cinfo);\n  /* Entropy encoding: either Huffman or arithmetic coding. */\n  if (cinfo->arith_code)\n    jinit_arith_encoder(cinfo);\n  else {\n    jinit_huff_encoder(cinfo);\n  }\n\n  /* Need a full-image coefficient buffer in any multi-pass mode. */\n  jinit_c_coef_controller(cinfo,\n\t\t(boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));\n  jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);\n\n  jinit_marker_writer(cinfo);\n\n  /* We can now tell the memory manager to allocate virtual arrays. */\n  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);\n\n  /* Write the datastream header (SOI) immediately.\n   * Frame and scan headers are postponed till later.\n   * This lets application insert special markers after the SOI.\n   */\n  (*cinfo->marker->write_file_header) (cinfo);\n}\n"
  },
  {
    "path": "jcmainct.c",
    "content": "/*\n * jcmainct.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2003-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the main buffer controller for compression.\n * The main buffer lies between the pre-processor and the JPEG\n * compressor proper; it holds downsampled data in the JPEG colorspace.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Note: currently, there is no operating mode in which a full-image buffer\n * is needed at this step.  If there were, that mode could not be used with\n * \"raw data\" input, since this module is bypassed in that case.  However,\n * we've left the code here for possible use in special applications.\n */\n#undef FULL_MAIN_BUFFER_SUPPORTED\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_c_main_controller pub; /* public fields */\n\n  JDIMENSION cur_iMCU_row;\t/* number of current iMCU row */\n  JDIMENSION rowgroup_ctr;\t/* counts row groups received in iMCU row */\n  boolean suspended;\t\t/* remember if we suspended output */\n  J_BUF_MODE pass_mode;\t\t/* current operating mode */\n\n  /* If using just a strip buffer, this points to the entire set of buffers\n   * (we allocate one for each component).  In the full-image case, this\n   * points to the currently accessible strips of the virtual arrays.\n   */\n  JSAMPARRAY buffer[MAX_COMPONENTS];\n\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\n  /* If using full-image storage, this array holds pointers to virtual-array\n   * control blocks for each component.  Unused if not full-image storage.\n   */\n  jvirt_sarray_ptr whole_image[MAX_COMPONENTS];\n#endif\n} my_main_controller;\n\ntypedef my_main_controller * my_main_ptr;\n\n\n/* Forward declarations */\nMETHODDEF(void) process_data_simple_main\n\tJPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,\n\t     JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\nMETHODDEF(void) process_data_buffer_main\n\tJPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,\n\t     JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));\n#endif\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_main_ptr mainp = (my_main_ptr) cinfo->main;\n\n  /* Do nothing in raw-data mode. */\n  if (cinfo->raw_data_in)\n    return;\n\n  mainp->cur_iMCU_row = 0;\t/* initialize counters */\n  mainp->rowgroup_ctr = 0;\n  mainp->suspended = FALSE;\n  mainp->pass_mode = pass_mode;\t/* save mode for use by process_data */\n\n  switch (pass_mode) {\n  case JBUF_PASS_THRU:\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\n    if (mainp->whole_image[0] != NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n#endif\n    mainp->pub.process_data = process_data_simple_main;\n    break;\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\n  case JBUF_SAVE_SOURCE:\n  case JBUF_CRANK_DEST:\n  case JBUF_SAVE_AND_PASS:\n    if (mainp->whole_image[0] == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    mainp->pub.process_data = process_data_buffer_main;\n    break;\n#endif\n  default:\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    break;\n  }\n}\n\n\n/*\n * Process some data.\n * This routine handles the simple pass-through mode,\n * where we have only a strip buffer.\n */\n\nMETHODDEF(void)\nprocess_data_simple_main (j_compress_ptr cinfo,\n\t\t\t  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n\t\t\t  JDIMENSION in_rows_avail)\n{\n  my_main_ptr mainp = (my_main_ptr) cinfo->main;\n\n  while (mainp->cur_iMCU_row < cinfo->total_iMCU_rows) {\n    /* Read input data if we haven't filled the main buffer yet */\n    if (mainp->rowgroup_ctr < (JDIMENSION) cinfo->min_DCT_v_scaled_size)\n      (*cinfo->prep->pre_process_data) (cinfo,\n\t\t\t\t\tinput_buf, in_row_ctr, in_rows_avail,\n\t\t\t\t\tmainp->buffer, &mainp->rowgroup_ctr,\n\t\t\t\t\t(JDIMENSION) cinfo->min_DCT_v_scaled_size);\n\n    /* If we don't have a full iMCU row buffered, return to application for\n     * more data.  Note that preprocessor will always pad to fill the iMCU row\n     * at the bottom of the image.\n     */\n    if (mainp->rowgroup_ctr != (JDIMENSION) cinfo->min_DCT_v_scaled_size)\n      return;\n\n    /* Send the completed row to the compressor */\n    if (! (*cinfo->coef->compress_data) (cinfo, mainp->buffer)) {\n      /* If compressor did not consume the whole row, then we must need to\n       * suspend processing and return to the application.  In this situation\n       * we pretend we didn't yet consume the last input row; otherwise, if\n       * it happened to be the last row of the image, the application would\n       * think we were done.\n       */\n      if (! mainp->suspended) {\n\t(*in_row_ctr)--;\n\tmainp->suspended = TRUE;\n      }\n      return;\n    }\n    /* We did finish the row.  Undo our little suspension hack if a previous\n     * call suspended; then mark the main buffer empty.\n     */\n    if (mainp->suspended) {\n      (*in_row_ctr)++;\n      mainp->suspended = FALSE;\n    }\n    mainp->rowgroup_ctr = 0;\n    mainp->cur_iMCU_row++;\n  }\n}\n\n\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\n\n/*\n * Process some data.\n * This routine handles all of the modes that use a full-size buffer.\n */\n\nMETHODDEF(void)\nprocess_data_buffer_main (j_compress_ptr cinfo,\n\t\t\t  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n\t\t\t  JDIMENSION in_rows_avail)\n{\n  my_main_ptr mainp = (my_main_ptr) cinfo->main;\n  int ci;\n  jpeg_component_info *compptr;\n  boolean writing = (mainp->pass_mode != JBUF_CRANK_DEST);\n\n  while (mainp->cur_iMCU_row < cinfo->total_iMCU_rows) {\n    /* Realign the virtual buffers if at the start of an iMCU row. */\n    if (mainp->rowgroup_ctr == 0) {\n      for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t   ci++, compptr++) {\n\tmainp->buffer[ci] = (*cinfo->mem->access_virt_sarray)\n\t  ((j_common_ptr) cinfo, mainp->whole_image[ci], mainp->cur_iMCU_row *\n\t   ((JDIMENSION) (compptr->v_samp_factor * cinfo->min_DCT_v_scaled_size)),\n\t   (JDIMENSION) (compptr->v_samp_factor * cinfo->min_DCT_v_scaled_size),\n\t   writing);\n      }\n      /* In a read pass, pretend we just read some source data. */\n      if (! writing) {\n\t*in_row_ctr += (JDIMENSION)\n\t  (cinfo->max_v_samp_factor * cinfo->min_DCT_v_scaled_size);\n\tmainp->rowgroup_ctr = (JDIMENSION) cinfo->min_DCT_v_scaled_size;\n      }\n    }\n\n    /* If a write pass, read input data until the current iMCU row is full. */\n    /* Note: preprocessor will pad if necessary to fill the last iMCU row. */\n    if (writing) {\n      (*cinfo->prep->pre_process_data) (cinfo,\n\t\t\t\t\tinput_buf, in_row_ctr, in_rows_avail,\n\t\t\t\t\tmainp->buffer, &mainp->rowgroup_ctr,\n\t\t\t\t\t(JDIMENSION) cinfo->min_DCT_v_scaled_size);\n      /* Return to application if we need more data to fill the iMCU row. */\n      if (mainp->rowgroup_ctr < (JDIMENSION) cinfo->min_DCT_v_scaled_size)\n\treturn;\n    }\n\n    /* Emit data, unless this is a sink-only pass. */\n    if (mainp->pass_mode != JBUF_SAVE_SOURCE) {\n      if (! (*cinfo->coef->compress_data) (cinfo, mainp->buffer)) {\n\t/* If compressor did not consume the whole row, then we must need to\n\t * suspend processing and return to the application.  In this situation\n\t * we pretend we didn't yet consume the last input row; otherwise, if\n\t * it happened to be the last row of the image, the application would\n\t * think we were done.\n\t */\n\tif (! mainp->suspended) {\n\t  (*in_row_ctr)--;\n\t  mainp->suspended = TRUE;\n\t}\n\treturn;\n      }\n      /* We did finish the row.  Undo our little suspension hack if a previous\n       * call suspended; then mark the main buffer empty.\n       */\n      if (mainp->suspended) {\n\t(*in_row_ctr)++;\n\tmainp->suspended = FALSE;\n      }\n    }\n\n    /* If get here, we are done with this iMCU row.  Mark buffer empty. */\n    mainp->rowgroup_ctr = 0;\n    mainp->cur_iMCU_row++;\n  }\n}\n\n#endif /* FULL_MAIN_BUFFER_SUPPORTED */\n\n\n/*\n * Initialize main buffer controller.\n */\n\nGLOBAL(void)\njinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)\n{\n  my_main_ptr mainp;\n  int ci;\n  jpeg_component_info *compptr;\n\n  mainp = (my_main_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_main_controller));\n  cinfo->main = &mainp->pub;\n  mainp->pub.start_pass = start_pass_main;\n\n  /* We don't need to create a buffer in raw-data mode. */\n  if (cinfo->raw_data_in)\n    return;\n\n  /* Create the buffer.  It holds downsampled data, so each component\n   * may be of a different size.\n   */\n  if (need_full_buffer) {\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\n    /* Allocate a full-image virtual array for each component */\n    /* Note we pad the bottom to a multiple of the iMCU height */\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      mainp->whole_image[ci] = (*cinfo->mem->request_virt_sarray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n\t compptr->width_in_blocks * ((JDIMENSION) compptr->DCT_h_scaled_size),\n\t ((JDIMENSION) jround_up((long) compptr->height_in_blocks,\n\t\t\t\t (long) compptr->v_samp_factor)) *\n\t ((JDIMENSION) cinfo->min_DCT_v_scaled_size),\n\t (JDIMENSION) (compptr->v_samp_factor * compptr->DCT_v_scaled_size));\n    }\n#else\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n#endif\n  } else {\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\n    mainp->whole_image[0] = NULL; /* flag for no virtual arrays */\n#endif\n    /* Allocate a strip buffer for each component */\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      mainp->buffer[ci] = (*cinfo->mem->alloc_sarray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t compptr->width_in_blocks * ((JDIMENSION) compptr->DCT_h_scaled_size),\n\t (JDIMENSION) (compptr->v_samp_factor * compptr->DCT_v_scaled_size));\n    }\n  }\n}\n"
  },
  {
    "path": "jcmarker.c",
    "content": "/*\n * jcmarker.c\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2003-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to write JPEG datastream markers.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\ntypedef enum {\t\t\t/* JPEG marker codes */\n  M_SOF0  = 0xc0,\n  M_SOF1  = 0xc1,\n  M_SOF2  = 0xc2,\n  M_SOF3  = 0xc3,\n\n  M_SOF5  = 0xc5,\n  M_SOF6  = 0xc6,\n  M_SOF7  = 0xc7,\n\n  M_JPG   = 0xc8,\n  M_SOF9  = 0xc9,\n  M_SOF10 = 0xca,\n  M_SOF11 = 0xcb,\n\n  M_SOF13 = 0xcd,\n  M_SOF14 = 0xce,\n  M_SOF15 = 0xcf,\n\n  M_DHT   = 0xc4,\n\n  M_DAC   = 0xcc,\n\n  M_RST0  = 0xd0,\n  M_RST1  = 0xd1,\n  M_RST2  = 0xd2,\n  M_RST3  = 0xd3,\n  M_RST4  = 0xd4,\n  M_RST5  = 0xd5,\n  M_RST6  = 0xd6,\n  M_RST7  = 0xd7,\n\n  M_SOI   = 0xd8,\n  M_EOI   = 0xd9,\n  M_SOS   = 0xda,\n  M_DQT   = 0xdb,\n  M_DNL   = 0xdc,\n  M_DRI   = 0xdd,\n  M_DHP   = 0xde,\n  M_EXP   = 0xdf,\n\n  M_APP0  = 0xe0,\n  M_APP1  = 0xe1,\n  M_APP2  = 0xe2,\n  M_APP3  = 0xe3,\n  M_APP4  = 0xe4,\n  M_APP5  = 0xe5,\n  M_APP6  = 0xe6,\n  M_APP7  = 0xe7,\n  M_APP8  = 0xe8,\n  M_APP9  = 0xe9,\n  M_APP10 = 0xea,\n  M_APP11 = 0xeb,\n  M_APP12 = 0xec,\n  M_APP13 = 0xed,\n  M_APP14 = 0xee,\n  M_APP15 = 0xef,\n\n  M_JPG0  = 0xf0,\n  M_JPG8  = 0xf8,\n  M_JPG13 = 0xfd,\n  M_COM   = 0xfe,\n\n  M_TEM   = 0x01,\n\n  M_ERROR = 0x100\n} JPEG_MARKER;\n\n\n/* Private state */\n\ntypedef struct {\n  struct jpeg_marker_writer pub; /* public fields */\n\n  unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */\n} my_marker_writer;\n\ntypedef my_marker_writer * my_marker_ptr;\n\n\n/*\n * Basic output routines.\n *\n * Note that we do not support suspension while writing a marker.\n * Therefore, an application using suspension must ensure that there is\n * enough buffer space for the initial markers (typ. 600-700 bytes) before\n * calling jpeg_start_compress, and enough space to write the trailing EOI\n * (a few bytes) before calling jpeg_finish_compress.  Multipass compression\n * modes are not supported at all with suspension, so those two are the only\n * points where markers will be written.\n */\n\nLOCAL(void)\nemit_byte (j_compress_ptr cinfo, int val)\n/* Emit a byte */\n{\n  struct jpeg_destination_mgr * dest = cinfo->dest;\n\n  *(dest->next_output_byte)++ = (JOCTET) val;\n  if (--dest->free_in_buffer == 0) {\n    if (! (*dest->empty_output_buffer) (cinfo))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n  }\n}\n\n\nLOCAL(void)\nemit_marker (j_compress_ptr cinfo, JPEG_MARKER mark)\n/* Emit a marker code */\n{\n  emit_byte(cinfo, 0xFF);\n  emit_byte(cinfo, (int) mark);\n}\n\n\nLOCAL(void)\nemit_2bytes (j_compress_ptr cinfo, int value)\n/* Emit a 2-byte integer; these are always MSB first in JPEG files */\n{\n  emit_byte(cinfo, (value >> 8) & 0xFF);\n  emit_byte(cinfo, value & 0xFF);\n}\n\n\n/*\n * Routines to write specific marker types.\n */\n\nLOCAL(int)\nemit_dqt (j_compress_ptr cinfo, int index)\n/* Emit a DQT marker */\n/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */\n{\n  JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index];\n  int prec;\n  int i;\n\n  if (qtbl == NULL)\n    ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);\n\n  prec = 0;\n  for (i = 0; i <= cinfo->lim_Se; i++) {\n    if (qtbl->quantval[cinfo->natural_order[i]] > 255)\n      prec = 1;\n  }\n\n  if (! qtbl->sent_table) {\n    emit_marker(cinfo, M_DQT);\n\n    emit_2bytes(cinfo,\n      prec ? cinfo->lim_Se * 2 + 2 + 1 + 2 : cinfo->lim_Se + 1 + 1 + 2);\n\n    emit_byte(cinfo, index + (prec<<4));\n\n    for (i = 0; i <= cinfo->lim_Se; i++) {\n      /* The table entries must be emitted in zigzag order. */\n      unsigned int qval = qtbl->quantval[cinfo->natural_order[i]];\n      if (prec)\n\temit_byte(cinfo, (int) (qval >> 8));\n      emit_byte(cinfo, (int) (qval & 0xFF));\n    }\n\n    qtbl->sent_table = TRUE;\n  }\n\n  return prec;\n}\n\n\nLOCAL(void)\nemit_dht (j_compress_ptr cinfo, int index, boolean is_ac)\n/* Emit a DHT marker */\n{\n  JHUFF_TBL * htbl;\n  int length, i;\n  \n  if (is_ac) {\n    htbl = cinfo->ac_huff_tbl_ptrs[index];\n    index += 0x10;\t\t/* output index has AC bit set */\n  } else {\n    htbl = cinfo->dc_huff_tbl_ptrs[index];\n  }\n\n  if (htbl == NULL)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);\n  \n  if (! htbl->sent_table) {\n    emit_marker(cinfo, M_DHT);\n    \n    length = 0;\n    for (i = 1; i <= 16; i++)\n      length += htbl->bits[i];\n    \n    emit_2bytes(cinfo, length + 2 + 1 + 16);\n    emit_byte(cinfo, index);\n    \n    for (i = 1; i <= 16; i++)\n      emit_byte(cinfo, htbl->bits[i]);\n    \n    for (i = 0; i < length; i++)\n      emit_byte(cinfo, htbl->huffval[i]);\n    \n    htbl->sent_table = TRUE;\n  }\n}\n\n\nLOCAL(void)\nemit_dac (j_compress_ptr cinfo)\n/* Emit a DAC marker */\n/* Since the useful info is so small, we want to emit all the tables in */\n/* one DAC marker.  Therefore this routine does its own scan of the table. */\n{\n#ifdef C_ARITH_CODING_SUPPORTED\n  char dc_in_use[NUM_ARITH_TBLS];\n  char ac_in_use[NUM_ARITH_TBLS];\n  int length, i;\n  jpeg_component_info *compptr;\n\n  for (i = 0; i < NUM_ARITH_TBLS; i++)\n    dc_in_use[i] = ac_in_use[i] = 0;\n\n  for (i = 0; i < cinfo->comps_in_scan; i++) {\n    compptr = cinfo->cur_comp_info[i];\n    /* DC needs no table for refinement scan */\n    if (cinfo->Ss == 0 && cinfo->Ah == 0)\n      dc_in_use[compptr->dc_tbl_no] = 1;\n    /* AC needs no table when not present */\n    if (cinfo->Se)\n      ac_in_use[compptr->ac_tbl_no] = 1;\n  }\n\n  length = 0;\n  for (i = 0; i < NUM_ARITH_TBLS; i++)\n    length += dc_in_use[i] + ac_in_use[i];\n\n  if (length) {\n    emit_marker(cinfo, M_DAC);\n\n    emit_2bytes(cinfo, length*2 + 2);\n\n    for (i = 0; i < NUM_ARITH_TBLS; i++) {\n      if (dc_in_use[i]) {\n\temit_byte(cinfo, i);\n\temit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));\n      }\n      if (ac_in_use[i]) {\n\temit_byte(cinfo, i + 0x10);\n\temit_byte(cinfo, cinfo->arith_ac_K[i]);\n      }\n    }\n  }\n#endif /* C_ARITH_CODING_SUPPORTED */\n}\n\n\nLOCAL(void)\nemit_dri (j_compress_ptr cinfo)\n/* Emit a DRI marker */\n{\n  emit_marker(cinfo, M_DRI);\n  \n  emit_2bytes(cinfo, 4);\t/* fixed length */\n\n  emit_2bytes(cinfo, (int) cinfo->restart_interval);\n}\n\n\nLOCAL(void)\nemit_lse_ict (j_compress_ptr cinfo)\n/* Emit an LSE inverse color transform specification marker */\n{\n  /* Support only 1 transform */\n  if (cinfo->color_transform != JCT_SUBTRACT_GREEN ||\n      cinfo->num_components < 3)\n    ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n\n  emit_marker(cinfo, M_JPG8);\n  \n  emit_2bytes(cinfo, 24);\t/* fixed length */\n\n  emit_byte(cinfo, 0x0D);\t/* ID inverse transform specification */\n  emit_2bytes(cinfo, MAXJSAMPLE);\t/* MAXTRANS */\n  emit_byte(cinfo, 3);\t\t/* Nt=3 */\n  emit_byte(cinfo, cinfo->comp_info[1].component_id);\n  emit_byte(cinfo, cinfo->comp_info[0].component_id);\n  emit_byte(cinfo, cinfo->comp_info[2].component_id);\n  emit_byte(cinfo, 0x80);\t/* F1: CENTER1=1, NORM1=0 */\n  emit_2bytes(cinfo, 0);\t/* A(1,1)=0 */\n  emit_2bytes(cinfo, 0);\t/* A(1,2)=0 */\n  emit_byte(cinfo, 0);\t\t/* F2: CENTER2=0, NORM2=0 */\n  emit_2bytes(cinfo, 1);\t/* A(2,1)=1 */\n  emit_2bytes(cinfo, 0);\t/* A(2,2)=0 */\n  emit_byte(cinfo, 0);\t\t/* F3: CENTER3=0, NORM3=0 */\n  emit_2bytes(cinfo, 1);\t/* A(3,1)=1 */\n  emit_2bytes(cinfo, 0);\t/* A(3,2)=0 */\n}\n\n\nLOCAL(void)\nemit_sof (j_compress_ptr cinfo, JPEG_MARKER code)\n/* Emit a SOF marker */\n{\n  int ci;\n  jpeg_component_info *compptr;\n  \n  emit_marker(cinfo, code);\n  \n  emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */\n\n  /* Make sure image isn't bigger than SOF field can handle */\n  if ((long) cinfo->jpeg_height > 65535L ||\n      (long) cinfo->jpeg_width > 65535L)\n    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535);\n\n  emit_byte(cinfo, cinfo->data_precision);\n  emit_2bytes(cinfo, (int) cinfo->jpeg_height);\n  emit_2bytes(cinfo, (int) cinfo->jpeg_width);\n\n  emit_byte(cinfo, cinfo->num_components);\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    emit_byte(cinfo, compptr->component_id);\n    emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor);\n    emit_byte(cinfo, compptr->quant_tbl_no);\n  }\n}\n\n\nLOCAL(void)\nemit_sos (j_compress_ptr cinfo)\n/* Emit a SOS marker */\n{\n  int i, td, ta;\n  jpeg_component_info *compptr;\n  \n  emit_marker(cinfo, M_SOS);\n  \n  emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */\n  \n  emit_byte(cinfo, cinfo->comps_in_scan);\n  \n  for (i = 0; i < cinfo->comps_in_scan; i++) {\n    compptr = cinfo->cur_comp_info[i];\n    emit_byte(cinfo, compptr->component_id);\n\n    /* We emit 0 for unused field(s); this is recommended by the P&M text\n     * but does not seem to be specified in the standard.\n     */\n\n    /* DC needs no table for refinement scan */\n    td = cinfo->Ss == 0 && cinfo->Ah == 0 ? compptr->dc_tbl_no : 0;\n    /* AC needs no table when not present */\n    ta = cinfo->Se ? compptr->ac_tbl_no : 0;\n\n    emit_byte(cinfo, (td << 4) + ta);\n  }\n\n  emit_byte(cinfo, cinfo->Ss);\n  emit_byte(cinfo, cinfo->Se);\n  emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);\n}\n\n\nLOCAL(void)\nemit_pseudo_sos (j_compress_ptr cinfo)\n/* Emit a pseudo SOS marker */\n{\n  emit_marker(cinfo, M_SOS);\n  \n  emit_2bytes(cinfo, 2 + 1 + 3); /* length */\n  \n  emit_byte(cinfo, 0); /* Ns */\n\n  emit_byte(cinfo, 0); /* Ss */\n  emit_byte(cinfo, cinfo->block_size * cinfo->block_size - 1); /* Se */\n  emit_byte(cinfo, 0); /* Ah/Al */\n}\n\n\nLOCAL(void)\nemit_jfif_app0 (j_compress_ptr cinfo)\n/* Emit a JFIF-compliant APP0 marker */\n{\n  /*\n   * Length of APP0 block\t(2 bytes)\n   * Block ID\t\t\t(4 bytes - ASCII \"JFIF\")\n   * Zero byte\t\t\t(1 byte to terminate the ID string)\n   * Version Major, Minor\t(2 bytes - major first)\n   * Units\t\t\t(1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)\n   * Xdpu\t\t\t(2 bytes - dots per unit horizontal)\n   * Ydpu\t\t\t(2 bytes - dots per unit vertical)\n   * Thumbnail X size\t\t(1 byte)\n   * Thumbnail Y size\t\t(1 byte)\n   */\n  \n  emit_marker(cinfo, M_APP0);\n  \n  emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */\n\n  emit_byte(cinfo, 0x4A);\t/* Identifier: ASCII \"JFIF\" */\n  emit_byte(cinfo, 0x46);\n  emit_byte(cinfo, 0x49);\n  emit_byte(cinfo, 0x46);\n  emit_byte(cinfo, 0);\n  emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */\n  emit_byte(cinfo, cinfo->JFIF_minor_version);\n  emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */\n  emit_2bytes(cinfo, (int) cinfo->X_density);\n  emit_2bytes(cinfo, (int) cinfo->Y_density);\n  emit_byte(cinfo, 0);\t\t/* No thumbnail image */\n  emit_byte(cinfo, 0);\n}\n\n\nLOCAL(void)\nemit_adobe_app14 (j_compress_ptr cinfo)\n/* Emit an Adobe APP14 marker */\n{\n  /*\n   * Length of APP14 block\t(2 bytes)\n   * Block ID\t\t\t(5 bytes - ASCII \"Adobe\")\n   * Version Number\t\t(2 bytes - currently 100)\n   * Flags0\t\t\t(2 bytes - currently 0)\n   * Flags1\t\t\t(2 bytes - currently 0)\n   * Color transform\t\t(1 byte)\n   *\n   * Although Adobe TN 5116 mentions Version = 101, all the Adobe files\n   * now in circulation seem to use Version = 100, so that's what we write.\n   *\n   * We write the color transform byte as 1 if the JPEG color space is\n   * YCbCr, 2 if it's YCCK, 0 otherwise.  Adobe's definition has to do with\n   * whether the encoder performed a transformation, which is pretty useless.\n   */\n  \n  emit_marker(cinfo, M_APP14);\n  \n  emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */\n\n  emit_byte(cinfo, 0x41);\t/* Identifier: ASCII \"Adobe\" */\n  emit_byte(cinfo, 0x64);\n  emit_byte(cinfo, 0x6F);\n  emit_byte(cinfo, 0x62);\n  emit_byte(cinfo, 0x65);\n  emit_2bytes(cinfo, 100);\t/* Version */\n  emit_2bytes(cinfo, 0);\t/* Flags0 */\n  emit_2bytes(cinfo, 0);\t/* Flags1 */\n  switch (cinfo->jpeg_color_space) {\n  case JCS_YCbCr:\n    emit_byte(cinfo, 1);\t/* Color transform = 1 */\n    break;\n  case JCS_YCCK:\n    emit_byte(cinfo, 2);\t/* Color transform = 2 */\n    break;\n  default:\n    emit_byte(cinfo, 0);\t/* Color transform = 0 */\n    break;\n  }\n}\n\n\n/*\n * These routines allow writing an arbitrary marker with parameters.\n * The only intended use is to emit COM or APPn markers after calling\n * write_file_header and before calling write_frame_header.\n * Other uses are not guaranteed to produce desirable results.\n * Counting the parameter bytes properly is the caller's responsibility.\n */\n\nMETHODDEF(void)\nwrite_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen)\n/* Emit an arbitrary marker header */\n{\n  if (datalen > (unsigned int) 65533)\t\t/* safety check */\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  emit_marker(cinfo, (JPEG_MARKER) marker);\n\n  emit_2bytes(cinfo, (int) (datalen + 2));\t/* total length */\n}\n\nMETHODDEF(void)\nwrite_marker_byte (j_compress_ptr cinfo, int val)\n/* Emit one byte of marker parameters following write_marker_header */\n{\n  emit_byte(cinfo, val);\n}\n\n\n/*\n * Write datastream header.\n * This consists of an SOI and optional APPn markers.\n * We recommend use of the JFIF marker, but not the Adobe marker,\n * when using YCbCr or grayscale data.  The JFIF marker is also used\n * for other standard JPEG colorspaces.  The Adobe marker is helpful\n * to distinguish RGB, CMYK, and YCCK colorspaces.\n * Note that an application can write additional header markers after\n * jpeg_start_compress returns.\n */\n\nMETHODDEF(void)\nwrite_file_header (j_compress_ptr cinfo)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n\n  emit_marker(cinfo, M_SOI);\t/* first the SOI */\n\n  /* SOI is defined to reset restart interval to 0 */\n  marker->last_restart_interval = 0;\n\n  if (cinfo->write_JFIF_header)\t/* next an optional JFIF APP0 */\n    emit_jfif_app0(cinfo);\n  if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */\n    emit_adobe_app14(cinfo);\n}\n\n\n/*\n * Write frame header.\n * This consists of DQT and SOFn markers,\n * a conditional LSE marker and a conditional pseudo SOS marker.\n * Note that we do not emit the SOF until we have emitted the DQT(s).\n * This avoids compatibility problems with incorrect implementations that\n * try to error-check the quant table numbers as soon as they see the SOF.\n */\n\nMETHODDEF(void)\nwrite_frame_header (j_compress_ptr cinfo)\n{\n  int ci, prec;\n  boolean is_baseline;\n  jpeg_component_info *compptr;\n  \n  /* Emit DQT for each quantization table.\n   * Note that emit_dqt() suppresses any duplicate tables.\n   */\n  prec = 0;\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    prec += emit_dqt(cinfo, compptr->quant_tbl_no);\n  }\n  /* now prec is nonzero iff there are any 16-bit quant tables. */\n\n  /* Check for a non-baseline specification.\n   * Note we assume that Huffman table numbers won't be changed later.\n   */\n  if (cinfo->arith_code || cinfo->progressive_mode ||\n      cinfo->data_precision != 8 || cinfo->block_size != DCTSIZE) {\n    is_baseline = FALSE;\n  } else {\n    is_baseline = TRUE;\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)\n\tis_baseline = FALSE;\n    }\n    if (prec && is_baseline) {\n      is_baseline = FALSE;\n      /* If it's baseline except for quantizer size, warn the user */\n      TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);\n    }\n  }\n\n  /* Emit the proper SOF marker */\n  if (cinfo->arith_code) {\n    if (cinfo->progressive_mode)\n      emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */\n    else\n      emit_sof(cinfo, M_SOF9);  /* SOF code for sequential arithmetic */\n  } else {\n    if (cinfo->progressive_mode)\n      emit_sof(cinfo, M_SOF2);\t/* SOF code for progressive Huffman */\n    else if (is_baseline)\n      emit_sof(cinfo, M_SOF0);\t/* SOF code for baseline implementation */\n    else\n      emit_sof(cinfo, M_SOF1);\t/* SOF code for non-baseline Huffman file */\n  }\n\n  /* Check to emit LSE inverse color transform specification marker */\n  if (cinfo->color_transform)\n    emit_lse_ict(cinfo);\n\n  /* Check to emit pseudo SOS marker */\n  if (cinfo->progressive_mode && cinfo->block_size != DCTSIZE)\n    emit_pseudo_sos(cinfo);\n}\n\n\n/*\n * Write scan header.\n * This consists of DHT or DAC markers, optional DRI, and SOS.\n * Compressed data will be written following the SOS.\n */\n\nMETHODDEF(void)\nwrite_scan_header (j_compress_ptr cinfo)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n  int i;\n  jpeg_component_info *compptr;\n\n  if (cinfo->arith_code) {\n    /* Emit arith conditioning info.  We may have some duplication\n     * if the file has multiple scans, but it's so small it's hardly\n     * worth worrying about.\n     */\n    emit_dac(cinfo);\n  } else {\n    /* Emit Huffman tables.\n     * Note that emit_dht() suppresses any duplicate tables.\n     */\n    for (i = 0; i < cinfo->comps_in_scan; i++) {\n      compptr = cinfo->cur_comp_info[i];\n      /* DC needs no table for refinement scan */\n      if (cinfo->Ss == 0 && cinfo->Ah == 0)\n\temit_dht(cinfo, compptr->dc_tbl_no, FALSE);\n      /* AC needs no table when not present */\n      if (cinfo->Se)\n\temit_dht(cinfo, compptr->ac_tbl_no, TRUE);\n    }\n  }\n\n  /* Emit DRI if required --- note that DRI value could change for each scan.\n   * We avoid wasting space with unnecessary DRIs, however.\n   */\n  if (cinfo->restart_interval != marker->last_restart_interval) {\n    emit_dri(cinfo);\n    marker->last_restart_interval = cinfo->restart_interval;\n  }\n\n  emit_sos(cinfo);\n}\n\n\n/*\n * Write datastream trailer.\n */\n\nMETHODDEF(void)\nwrite_file_trailer (j_compress_ptr cinfo)\n{\n  emit_marker(cinfo, M_EOI);\n}\n\n\n/*\n * Write an abbreviated table-specification datastream.\n * This consists of SOI, DQT and DHT tables, and EOI.\n * Any table that is defined and not marked sent_table = TRUE will be\n * emitted.  Note that all tables will be marked sent_table = TRUE at exit.\n */\n\nMETHODDEF(void)\nwrite_tables_only (j_compress_ptr cinfo)\n{\n  int i;\n\n  emit_marker(cinfo, M_SOI);\n\n  for (i = 0; i < NUM_QUANT_TBLS; i++) {\n    if (cinfo->quant_tbl_ptrs[i] != NULL)\n      (void) emit_dqt(cinfo, i);\n  }\n\n  if (! cinfo->arith_code) {\n    for (i = 0; i < NUM_HUFF_TBLS; i++) {\n      if (cinfo->dc_huff_tbl_ptrs[i] != NULL)\n\temit_dht(cinfo, i, FALSE);\n      if (cinfo->ac_huff_tbl_ptrs[i] != NULL)\n\temit_dht(cinfo, i, TRUE);\n    }\n  }\n\n  emit_marker(cinfo, M_EOI);\n}\n\n\n/*\n * Initialize the marker writer module.\n */\n\nGLOBAL(void)\njinit_marker_writer (j_compress_ptr cinfo)\n{\n  my_marker_ptr marker;\n\n  /* Create the subobject */\n  marker = (my_marker_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_marker_writer));\n  cinfo->marker = &marker->pub;\n  /* Initialize method pointers */\n  marker->pub.write_file_header = write_file_header;\n  marker->pub.write_frame_header = write_frame_header;\n  marker->pub.write_scan_header = write_scan_header;\n  marker->pub.write_file_trailer = write_file_trailer;\n  marker->pub.write_tables_only = write_tables_only;\n  marker->pub.write_marker_header = write_marker_header;\n  marker->pub.write_marker_byte = write_marker_byte;\n  /* Initialize private state */\n  marker->last_restart_interval = 0;\n}\n"
  },
  {
    "path": "jcmaster.c",
    "content": "/*\n * jcmaster.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2003-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains master control logic for the JPEG compressor.\n * These routines are concerned with parameter validation, initial setup,\n * and inter-pass control (determining the number of passes and the work \n * to be done in each pass).\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Private state */\n\ntypedef enum {\n\tmain_pass,\t\t/* input data, also do first output step */\n\thuff_opt_pass,\t\t/* Huffman code optimization pass */\n\toutput_pass\t\t/* data output pass */\n} c_pass_type;\n\ntypedef struct {\n  struct jpeg_comp_master pub;\t/* public fields */\n\n  c_pass_type pass_type;\t/* the type of the current pass */\n\n  int pass_number;\t\t/* # of passes completed */\n  int total_passes;\t\t/* total # of passes needed */\n\n  int scan_number;\t\t/* current index in scan_info[] */\n} my_comp_master;\n\ntypedef my_comp_master * my_master_ptr;\n\n\n/*\n * Support routines that do various essential calculations.\n */\n\n/*\n * Compute JPEG image dimensions and related values.\n * NOTE: this is exported for possible use by application.\n * Hence it mustn't do anything that can't be done twice.\n */\n\nGLOBAL(void)\njpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)\n/* Do computations that are needed before master selection phase */\n{\n#ifdef DCT_SCALING_SUPPORTED\n\n  /* Sanity check on input image dimensions to prevent overflow in\n   * following calculation.\n   * We do check jpeg_width and jpeg_height in initial_setup below,\n   * but image_width and image_height can come from arbitrary data,\n   * and we need some space for multiplication by block_size.\n   */\n  if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))\n    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);\n\n  /* Compute actual JPEG image dimensions and DCT scaling choices. */\n  if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/1 scaling */\n    cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;\n    cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;\n    cinfo->min_DCT_h_scaled_size = 1;\n    cinfo->min_DCT_v_scaled_size = 1;\n  } else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/2 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);\n    cinfo->min_DCT_h_scaled_size = 2;\n    cinfo->min_DCT_v_scaled_size = 2;\n  } else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/3 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);\n    cinfo->min_DCT_h_scaled_size = 3;\n    cinfo->min_DCT_v_scaled_size = 3;\n  } else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/4 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);\n    cinfo->min_DCT_h_scaled_size = 4;\n    cinfo->min_DCT_v_scaled_size = 4;\n  } else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/5 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);\n    cinfo->min_DCT_h_scaled_size = 5;\n    cinfo->min_DCT_v_scaled_size = 5;\n  } else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/6 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);\n    cinfo->min_DCT_h_scaled_size = 6;\n    cinfo->min_DCT_v_scaled_size = 6;\n  } else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/7 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);\n    cinfo->min_DCT_h_scaled_size = 7;\n    cinfo->min_DCT_v_scaled_size = 7;\n  } else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/8 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);\n    cinfo->min_DCT_h_scaled_size = 8;\n    cinfo->min_DCT_v_scaled_size = 8;\n  } else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/9 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);\n    cinfo->min_DCT_h_scaled_size = 9;\n    cinfo->min_DCT_v_scaled_size = 9;\n  } else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/10 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);\n    cinfo->min_DCT_h_scaled_size = 10;\n    cinfo->min_DCT_v_scaled_size = 10;\n  } else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/11 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);\n    cinfo->min_DCT_h_scaled_size = 11;\n    cinfo->min_DCT_v_scaled_size = 11;\n  } else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/12 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);\n    cinfo->min_DCT_h_scaled_size = 12;\n    cinfo->min_DCT_v_scaled_size = 12;\n  } else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/13 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);\n    cinfo->min_DCT_h_scaled_size = 13;\n    cinfo->min_DCT_v_scaled_size = 13;\n  } else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/14 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);\n    cinfo->min_DCT_h_scaled_size = 14;\n    cinfo->min_DCT_v_scaled_size = 14;\n  } else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {\n    /* Provide block_size/15 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);\n    cinfo->min_DCT_h_scaled_size = 15;\n    cinfo->min_DCT_v_scaled_size = 15;\n  } else {\n    /* Provide block_size/16 scaling */\n    cinfo->jpeg_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);\n    cinfo->jpeg_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);\n    cinfo->min_DCT_h_scaled_size = 16;\n    cinfo->min_DCT_v_scaled_size = 16;\n  }\n\n#else /* !DCT_SCALING_SUPPORTED */\n\n  /* Hardwire it to \"no scaling\" */\n  cinfo->jpeg_width = cinfo->image_width;\n  cinfo->jpeg_height = cinfo->image_height;\n  cinfo->min_DCT_h_scaled_size = DCTSIZE;\n  cinfo->min_DCT_v_scaled_size = DCTSIZE;\n\n#endif /* DCT_SCALING_SUPPORTED */\n}\n\n\nLOCAL(void)\njpeg_calc_trans_dimensions (j_compress_ptr cinfo)\n{\n  if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)\n    ERREXIT2(cinfo, JERR_BAD_DCTSIZE,\n\t     cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);\n\n  cinfo->block_size = cinfo->min_DCT_h_scaled_size;\n}\n\n\nLOCAL(void)\ninitial_setup (j_compress_ptr cinfo, boolean transcode_only)\n/* Do computations that are needed before master selection phase */\n{\n  int ci, ssize;\n  jpeg_component_info *compptr;\n\n  if (transcode_only)\n    jpeg_calc_trans_dimensions(cinfo);\n  else\n    jpeg_calc_jpeg_dimensions(cinfo);\n\n  /* Sanity check on block_size */\n  if (cinfo->block_size < 1 || cinfo->block_size > 16)\n    ERREXIT2(cinfo, JERR_BAD_DCTSIZE, cinfo->block_size, cinfo->block_size);\n\n  /* Derive natural_order from block_size */\n  switch (cinfo->block_size) {\n  case 2: cinfo->natural_order = jpeg_natural_order2; break;\n  case 3: cinfo->natural_order = jpeg_natural_order3; break;\n  case 4: cinfo->natural_order = jpeg_natural_order4; break;\n  case 5: cinfo->natural_order = jpeg_natural_order5; break;\n  case 6: cinfo->natural_order = jpeg_natural_order6; break;\n  case 7: cinfo->natural_order = jpeg_natural_order7; break;\n  default: cinfo->natural_order = jpeg_natural_order; break;\n  }\n\n  /* Derive lim_Se from block_size */\n  cinfo->lim_Se = cinfo->block_size < DCTSIZE ?\n    cinfo->block_size * cinfo->block_size - 1 : DCTSIZE2-1;\n\n  /* Sanity check on image dimensions */\n  if (cinfo->jpeg_height <= 0 || cinfo->jpeg_width <= 0 ||\n      cinfo->num_components <= 0)\n    ERREXIT(cinfo, JERR_EMPTY_IMAGE);\n\n  /* Make sure image isn't bigger than I can handle */\n  if ((long) cinfo->jpeg_height > (long) JPEG_MAX_DIMENSION ||\n      (long) cinfo->jpeg_width > (long) JPEG_MAX_DIMENSION)\n    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);\n\n  /* Only 8 to 12 bits data precision are supported for DCT based JPEG */\n  if (cinfo->data_precision < 8 || cinfo->data_precision > 12)\n    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);\n\n  /* Check that number of components won't exceed internal array sizes */\n  if (cinfo->num_components > MAX_COMPONENTS)\n    ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,\n\t     MAX_COMPONENTS);\n\n  /* Compute maximum sampling factors; check factor validity */\n  cinfo->max_h_samp_factor = 1;\n  cinfo->max_v_samp_factor = 1;\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||\n\tcompptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)\n      ERREXIT(cinfo, JERR_BAD_SAMPLING);\n    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,\n\t\t\t\t   compptr->h_samp_factor);\n    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,\n\t\t\t\t   compptr->v_samp_factor);\n  }\n\n  /* Compute dimensions of components */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Fill in the correct component_index value; don't rely on application */\n    compptr->component_index = ci;\n    /* In selecting the actual DCT scaling for each component, we try to\n     * scale down the chroma components via DCT scaling rather than downsampling.\n     * This saves time if the downsampler gets to use 1:1 scaling.\n     * Note this code adapts subsampling ratios which are powers of 2.\n     */\n    ssize = 1;\n#ifdef DCT_SCALING_SUPPORTED\n    while (cinfo->min_DCT_h_scaled_size * ssize <=\n\t   (cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&\n\t   (cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) {\n      ssize = ssize * 2;\n    }\n#endif\n    compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;\n    ssize = 1;\n#ifdef DCT_SCALING_SUPPORTED\n    while (cinfo->min_DCT_v_scaled_size * ssize <=\n\t   (cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&\n\t   (cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) {\n      ssize = ssize * 2;\n    }\n#endif\n    compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize;\n\n    /* We don't support DCT ratios larger than 2. */\n    if (compptr->DCT_h_scaled_size > compptr->DCT_v_scaled_size * 2)\n\tcompptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size * 2;\n    else if (compptr->DCT_v_scaled_size > compptr->DCT_h_scaled_size * 2)\n\tcompptr->DCT_v_scaled_size = compptr->DCT_h_scaled_size * 2;\n\n    /* Size in DCT blocks */\n    compptr->width_in_blocks = (JDIMENSION)\n      jdiv_round_up((long) cinfo->jpeg_width * (long) compptr->h_samp_factor,\n\t\t    (long) (cinfo->max_h_samp_factor * cinfo->block_size));\n    compptr->height_in_blocks = (JDIMENSION)\n      jdiv_round_up((long) cinfo->jpeg_height * (long) compptr->v_samp_factor,\n\t\t    (long) (cinfo->max_v_samp_factor * cinfo->block_size));\n    /* Size in samples */\n    compptr->downsampled_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->jpeg_width *\n\t\t    (long) (compptr->h_samp_factor * compptr->DCT_h_scaled_size),\n\t\t    (long) (cinfo->max_h_samp_factor * cinfo->block_size));\n    compptr->downsampled_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->jpeg_height *\n\t\t    (long) (compptr->v_samp_factor * compptr->DCT_v_scaled_size),\n\t\t    (long) (cinfo->max_v_samp_factor * cinfo->block_size));\n    /* Don't need quantization scale after DCT,\n     * until color conversion says otherwise.\n     */\n    compptr->component_needed = FALSE;\n  }\n\n  /* Compute number of fully interleaved MCU rows (number of times that\n   * main controller will call coefficient controller).\n   */\n  cinfo->total_iMCU_rows = (JDIMENSION)\n    jdiv_round_up((long) cinfo->jpeg_height,\n\t\t  (long) (cinfo->max_v_samp_factor * cinfo->block_size));\n}\n\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n\nLOCAL(void)\nvalidate_script (j_compress_ptr cinfo)\n/* Verify that the scan script in cinfo->scan_info[] is valid; also\n * determine whether it uses progressive JPEG, and set cinfo->progressive_mode.\n */\n{\n  const jpeg_scan_info * scanptr;\n  int scanno, ncomps, ci, coefi, thisi;\n  int Ss, Se, Ah, Al;\n  boolean component_sent[MAX_COMPONENTS];\n#ifdef C_PROGRESSIVE_SUPPORTED\n  int * last_bitpos_ptr;\n  int last_bitpos[MAX_COMPONENTS][DCTSIZE2];\n  /* -1 until that coefficient has been seen; then last Al for it */\n#endif\n\n  if (cinfo->num_scans <= 0)\n    ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0);\n\n  /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1;\n   * for progressive JPEG, no scan can have this.\n   */\n  scanptr = cinfo->scan_info;\n  if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n    cinfo->progressive_mode = TRUE;\n    last_bitpos_ptr = & last_bitpos[0][0];\n    for (ci = 0; ci < cinfo->num_components; ci++) \n      for (coefi = 0; coefi < DCTSIZE2; coefi++)\n\t*last_bitpos_ptr++ = -1;\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    cinfo->progressive_mode = FALSE;\n    for (ci = 0; ci < cinfo->num_components; ci++) \n      component_sent[ci] = FALSE;\n  }\n\n  for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) {\n    /* Validate component indexes */\n    ncomps = scanptr->comps_in_scan;\n    if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN);\n    for (ci = 0; ci < ncomps; ci++) {\n      thisi = scanptr->component_index[ci];\n      if (thisi < 0 || thisi >= cinfo->num_components)\n\tERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);\n      /* Components must appear in SOF order within each scan */\n      if (ci > 0 && thisi <= scanptr->component_index[ci-1])\n\tERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);\n    }\n    /* Validate progression parameters */\n    Ss = scanptr->Ss;\n    Se = scanptr->Se;\n    Ah = scanptr->Ah;\n    Al = scanptr->Al;\n    if (cinfo->progressive_mode) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n      /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that\n       * seems wrong: the upper bound ought to depend on data precision.\n       * Perhaps they really meant 0..N+1 for N-bit precision.\n       * Here we allow 0..10 for 8-bit data; Al larger than 10 results in\n       * out-of-range reconstructed DC values during the first DC scan,\n       * which might cause problems for some decoders.\n       */\n#if BITS_IN_JSAMPLE == 8\n#define MAX_AH_AL 10\n#else\n#define MAX_AH_AL 13\n#endif\n      if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||\n\t  Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)\n\tERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n      if (Ss == 0) {\n\tif (Se != 0)\t\t/* DC and AC together not OK */\n\t  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n      } else {\n\tif (ncomps != 1)\t/* AC scans must be for only one component */\n\t  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n      }\n      for (ci = 0; ci < ncomps; ci++) {\n\tlast_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];\n\tif (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */\n\t  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n\tfor (coefi = Ss; coefi <= Se; coefi++) {\n\t  if (last_bitpos_ptr[coefi] < 0) {\n\t    /* first scan of this coefficient */\n\t    if (Ah != 0)\n\t      ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n\t  } else {\n\t    /* not first scan */\n\t    if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)\n\t      ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n\t  }\n\t  last_bitpos_ptr[coefi] = Al;\n\t}\n      }\n#endif\n    } else {\n      /* For sequential JPEG, all progression parameters must be these: */\n      if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)\n\tERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n      /* Make sure components are not sent twice */\n      for (ci = 0; ci < ncomps; ci++) {\n\tthisi = scanptr->component_index[ci];\n\tif (component_sent[thisi])\n\t  ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);\n\tcomponent_sent[thisi] = TRUE;\n      }\n    }\n  }\n\n  /* Now verify that everything got sent. */\n  if (cinfo->progressive_mode) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n    /* For progressive mode, we only check that at least some DC data\n     * got sent for each component; the spec does not require that all bits\n     * of all coefficients be transmitted.  Would it be wiser to enforce\n     * transmission of all coefficient bits??\n     */\n    for (ci = 0; ci < cinfo->num_components; ci++) {\n      if (last_bitpos[ci][0] < 0)\n\tERREXIT(cinfo, JERR_MISSING_DATA);\n    }\n#endif\n  } else {\n    for (ci = 0; ci < cinfo->num_components; ci++) {\n      if (! component_sent[ci])\n\tERREXIT(cinfo, JERR_MISSING_DATA);\n    }\n  }\n}\n\n\nLOCAL(void)\nreduce_script (j_compress_ptr cinfo)\n/* Adapt scan script for use with reduced block size;\n * assume that script has been validated before.\n */\n{\n  jpeg_scan_info * scanptr;\n  int idxout, idxin;\n\n  /* Circumvent const declaration for this function */\n  scanptr = (jpeg_scan_info *) cinfo->scan_info;\n  idxout = 0;\n\n  for (idxin = 0; idxin < cinfo->num_scans; idxin++) {\n    /* After skipping, idxout becomes smaller than idxin */\n    if (idxin != idxout)\n      /* Copy rest of data;\n       * note we stay in given chunk of allocated memory.\n       */\n      scanptr[idxout] = scanptr[idxin];\n    if (scanptr[idxout].Ss > cinfo->lim_Se)\n      /* Entire scan out of range - skip this entry */\n      continue;\n    if (scanptr[idxout].Se > cinfo->lim_Se)\n      /* Limit scan to end of block */\n      scanptr[idxout].Se = cinfo->lim_Se;\n    idxout++;\n  }\n\n  cinfo->num_scans = idxout;\n}\n\n#endif /* C_MULTISCAN_FILES_SUPPORTED */\n\n\nLOCAL(void)\nselect_scan_parameters (j_compress_ptr cinfo)\n/* Set up the scan parameters for the current scan */\n{\n  int ci;\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n  if (cinfo->scan_info != NULL) {\n    /* Prepare for current scan --- the script is already validated */\n    my_master_ptr master = (my_master_ptr) cinfo->master;\n    const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number;\n\n    cinfo->comps_in_scan = scanptr->comps_in_scan;\n    for (ci = 0; ci < scanptr->comps_in_scan; ci++) {\n      cinfo->cur_comp_info[ci] =\n\t&cinfo->comp_info[scanptr->component_index[ci]];\n    }\n    if (cinfo->progressive_mode) {\n      cinfo->Ss = scanptr->Ss;\n      cinfo->Se = scanptr->Se;\n      cinfo->Ah = scanptr->Ah;\n      cinfo->Al = scanptr->Al;\n      return;\n    }\n  }\n  else\n#endif\n  {\n    /* Prepare for single sequential-JPEG scan containing all components */\n    if (cinfo->num_components > MAX_COMPS_IN_SCAN)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,\n\t       MAX_COMPS_IN_SCAN);\n    cinfo->comps_in_scan = cinfo->num_components;\n    for (ci = 0; ci < cinfo->num_components; ci++) {\n      cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];\n    }\n  }\n  cinfo->Ss = 0;\n  cinfo->Se = cinfo->block_size * cinfo->block_size - 1;\n  cinfo->Ah = 0;\n  cinfo->Al = 0;\n}\n\n\nLOCAL(void)\nper_scan_setup (j_compress_ptr cinfo)\n/* Do computations that are needed before processing a JPEG scan */\n/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */\n{\n  int ci, mcublks, tmp;\n  jpeg_component_info *compptr;\n  \n  if (cinfo->comps_in_scan == 1) {\n    \n    /* Noninterleaved (single-component) scan */\n    compptr = cinfo->cur_comp_info[0];\n    \n    /* Overall image size in MCUs */\n    cinfo->MCUs_per_row = compptr->width_in_blocks;\n    cinfo->MCU_rows_in_scan = compptr->height_in_blocks;\n    \n    /* For noninterleaved scan, always one block per MCU */\n    compptr->MCU_width = 1;\n    compptr->MCU_height = 1;\n    compptr->MCU_blocks = 1;\n    compptr->MCU_sample_width = compptr->DCT_h_scaled_size;\n    compptr->last_col_width = 1;\n    /* For noninterleaved scans, it is convenient to define last_row_height\n     * as the number of block rows present in the last iMCU row.\n     */\n    tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n    if (tmp == 0) tmp = compptr->v_samp_factor;\n    compptr->last_row_height = tmp;\n    \n    /* Prepare array describing MCU composition */\n    cinfo->blocks_in_MCU = 1;\n    cinfo->MCU_membership[0] = 0;\n    \n  } else {\n    \n    /* Interleaved (multi-component) scan */\n    if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,\n\t       MAX_COMPS_IN_SCAN);\n    \n    /* Overall image size in MCUs */\n    cinfo->MCUs_per_row = (JDIMENSION)\n      jdiv_round_up((long) cinfo->jpeg_width,\n\t\t    (long) (cinfo->max_h_samp_factor * cinfo->block_size));\n    cinfo->MCU_rows_in_scan = (JDIMENSION)\n      jdiv_round_up((long) cinfo->jpeg_height,\n\t\t    (long) (cinfo->max_v_samp_factor * cinfo->block_size));\n    \n    cinfo->blocks_in_MCU = 0;\n    \n    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n      compptr = cinfo->cur_comp_info[ci];\n      /* Sampling factors give # of blocks of component in each MCU */\n      compptr->MCU_width = compptr->h_samp_factor;\n      compptr->MCU_height = compptr->v_samp_factor;\n      compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;\n      compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_h_scaled_size;\n      /* Figure number of non-dummy blocks in last MCU column & row */\n      tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);\n      if (tmp == 0) tmp = compptr->MCU_width;\n      compptr->last_col_width = tmp;\n      tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);\n      if (tmp == 0) tmp = compptr->MCU_height;\n      compptr->last_row_height = tmp;\n      /* Prepare array describing MCU composition */\n      mcublks = compptr->MCU_blocks;\n      if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU)\n\tERREXIT(cinfo, JERR_BAD_MCU_SIZE);\n      while (mcublks-- > 0) {\n\tcinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;\n      }\n    }\n    \n  }\n\n  /* Convert restart specified in rows to actual MCU count. */\n  /* Note that count must fit in 16 bits, so we provide limiting. */\n  if (cinfo->restart_in_rows > 0) {\n    long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row;\n    cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L);\n  }\n}\n\n\n/*\n * Per-pass setup.\n * This is called at the beginning of each pass.  We determine which modules\n * will be active during this pass and give them appropriate start_pass calls.\n * We also set is_last_pass to indicate whether any more passes will be\n * required.\n */\n\nMETHODDEF(void)\nprepare_for_pass (j_compress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  switch (master->pass_type) {\n  case main_pass:\n    /* Initial pass: will collect input data, and do either Huffman\n     * optimization or data output for the first scan.\n     */\n    select_scan_parameters(cinfo);\n    per_scan_setup(cinfo);\n    if (! cinfo->raw_data_in) {\n      (*cinfo->cconvert->start_pass) (cinfo);\n      (*cinfo->downsample->start_pass) (cinfo);\n      (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU);\n    }\n    (*cinfo->fdct->start_pass) (cinfo);\n    (*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding);\n    (*cinfo->coef->start_pass) (cinfo,\n\t\t\t\t(master->total_passes > 1 ?\n\t\t\t\t JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));\n    (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);\n    if (cinfo->optimize_coding) {\n      /* No immediate data output; postpone writing frame/scan headers */\n      master->pub.call_pass_startup = FALSE;\n    } else {\n      /* Will write frame/scan headers at first jpeg_write_scanlines call */\n      master->pub.call_pass_startup = TRUE;\n    }\n    break;\n#ifdef ENTROPY_OPT_SUPPORTED\n  case huff_opt_pass:\n    /* Do Huffman optimization for a scan after the first one. */\n    select_scan_parameters(cinfo);\n    per_scan_setup(cinfo);\n    if (cinfo->Ss != 0 || cinfo->Ah == 0) {\n      (*cinfo->entropy->start_pass) (cinfo, TRUE);\n      (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);\n      master->pub.call_pass_startup = FALSE;\n      break;\n    }\n    /* Special case: Huffman DC refinement scans need no Huffman table\n     * and therefore we can skip the optimization pass for them.\n     */\n    master->pass_type = output_pass;\n    master->pass_number++;\n    /*FALLTHROUGH*/\n#endif\n  case output_pass:\n    /* Do a data-output pass. */\n    /* We need not repeat per-scan setup if prior optimization pass did it. */\n    if (! cinfo->optimize_coding) {\n      select_scan_parameters(cinfo);\n      per_scan_setup(cinfo);\n    }\n    (*cinfo->entropy->start_pass) (cinfo, FALSE);\n    (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);\n    /* We emit frame/scan headers now */\n    if (master->scan_number == 0)\n      (*cinfo->marker->write_frame_header) (cinfo);\n    (*cinfo->marker->write_scan_header) (cinfo);\n    master->pub.call_pass_startup = FALSE;\n    break;\n  default:\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n  }\n\n  master->pub.is_last_pass = (master->pass_number == master->total_passes-1);\n\n  /* Set up progress monitor's pass info if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->completed_passes = master->pass_number;\n    cinfo->progress->total_passes = master->total_passes;\n  }\n}\n\n\n/*\n * Special start-of-pass hook.\n * This is called by jpeg_write_scanlines if call_pass_startup is TRUE.\n * In single-pass processing, we need this hook because we don't want to\n * write frame/scan headers during jpeg_start_compress; we want to let the\n * application write COM markers etc. between jpeg_start_compress and the\n * jpeg_write_scanlines loop.\n * In multi-pass processing, this routine is not used.\n */\n\nMETHODDEF(void)\npass_startup (j_compress_ptr cinfo)\n{\n  cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */\n\n  (*cinfo->marker->write_frame_header) (cinfo);\n  (*cinfo->marker->write_scan_header) (cinfo);\n}\n\n\n/*\n * Finish up at end of pass.\n */\n\nMETHODDEF(void)\nfinish_pass_master (j_compress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  /* The entropy coder always needs an end-of-pass call,\n   * either to analyze statistics or to flush its output buffer.\n   */\n  (*cinfo->entropy->finish_pass) (cinfo);\n\n  /* Update state for next pass */\n  switch (master->pass_type) {\n  case main_pass:\n    /* next pass is either output of scan 0 (after optimization)\n     * or output of scan 1 (if no optimization).\n     */\n    master->pass_type = output_pass;\n    if (! cinfo->optimize_coding)\n      master->scan_number++;\n    break;\n  case huff_opt_pass:\n    /* next pass is always output of current scan */\n    master->pass_type = output_pass;\n    break;\n  case output_pass:\n    /* next pass is either optimization or output of next scan */\n    if (cinfo->optimize_coding)\n      master->pass_type = huff_opt_pass;\n    master->scan_number++;\n    break;\n  }\n\n  master->pass_number++;\n}\n\n\n/*\n * Initialize master compression control.\n */\n\nGLOBAL(void)\njinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)\n{\n  my_master_ptr master;\n\n  master = (my_master_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(my_comp_master));\n  cinfo->master = &master->pub;\n  master->pub.prepare_for_pass = prepare_for_pass;\n  master->pub.pass_startup = pass_startup;\n  master->pub.finish_pass = finish_pass_master;\n  master->pub.is_last_pass = FALSE;\n\n  /* Validate parameters, determine derived values */\n  initial_setup(cinfo, transcode_only);\n\n  if (cinfo->scan_info != NULL) {\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n    validate_script(cinfo);\n    if (cinfo->block_size < DCTSIZE)\n      reduce_script(cinfo);\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    cinfo->progressive_mode = FALSE;\n    cinfo->num_scans = 1;\n  }\n\n  if (cinfo->optimize_coding)\n    cinfo->arith_code = FALSE; /* disable arithmetic coding */\n  else if (! cinfo->arith_code &&\n\t   (cinfo->progressive_mode ||\n\t    (cinfo->block_size > 1 && cinfo->block_size < DCTSIZE)))\n    /* TEMPORARY HACK ??? */\n    /* assume default tables no good for progressive or reduced AC mode */\n    cinfo->optimize_coding = TRUE; /* force Huffman optimization */\n\n  /* Initialize my private state */\n  if (transcode_only) {\n    /* no main pass in transcoding */\n    if (cinfo->optimize_coding)\n      master->pass_type = huff_opt_pass;\n    else\n      master->pass_type = output_pass;\n  } else {\n    /* for normal compression, first pass is always this type: */\n    master->pass_type = main_pass;\n  }\n  master->scan_number = 0;\n  master->pass_number = 0;\n  if (cinfo->optimize_coding)\n    master->total_passes = cinfo->num_scans * 2;\n  else\n    master->total_passes = cinfo->num_scans;\n}\n"
  },
  {
    "path": "jcomapi.c",
    "content": "/*\n * jcomapi.c\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains application interface routines that are used for both\n * compression and decompression.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Abort processing of a JPEG compression or decompression operation,\n * but don't destroy the object itself.\n *\n * For this, we merely clean up all the nonpermanent memory pools.\n * Note that temp files (virtual arrays) are not allowed to belong to\n * the permanent pool, so we will be able to close all temp files here.\n * Closing a data source or destination, if necessary, is the application's\n * responsibility.\n */\n\nGLOBAL(void)\njpeg_abort (j_common_ptr cinfo)\n{\n  int pool;\n\n  /* Do nothing if called on a not-initialized or destroyed JPEG object. */\n  if (cinfo->mem == NULL)\n    return;\n\n  /* Releasing pools in reverse order might help avoid fragmentation\n   * with some (brain-damaged) malloc libraries.\n   */\n  for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) {\n    (*cinfo->mem->free_pool) (cinfo, pool);\n  }\n\n  /* Reset overall state for possible reuse of object */\n  if (cinfo->is_decompressor) {\n    cinfo->global_state = DSTATE_START;\n    /* Try to keep application from accessing now-deleted marker list.\n     * A bit kludgy to do it here, but this is the most central place.\n     */\n    ((j_decompress_ptr) cinfo)->marker_list = NULL;\n  } else {\n    cinfo->global_state = CSTATE_START;\n  }\n}\n\n\n/*\n * Destruction of a JPEG object.\n *\n * Everything gets deallocated except the master jpeg_compress_struct itself\n * and the error manager struct.  Both of these are supplied by the application\n * and must be freed, if necessary, by the application.  (Often they are on\n * the stack and so don't need to be freed anyway.)\n * Closing a data source or destination, if necessary, is the application's\n * responsibility.\n */\n\nGLOBAL(void)\njpeg_destroy (j_common_ptr cinfo)\n{\n  /* We need only tell the memory manager to release everything. */\n  /* NB: mem pointer is NULL if memory mgr failed to initialize. */\n  if (cinfo->mem != NULL)\n    (*cinfo->mem->self_destruct) (cinfo);\n  cinfo->mem = NULL;\t\t/* be safe if jpeg_destroy is called twice */\n  cinfo->global_state = 0;\t/* mark it destroyed */\n}\n\n\n/*\n * Convenience routines for allocating quantization and Huffman tables.\n * (Would jutils.c be a more reasonable place to put these?)\n */\n\nGLOBAL(JQUANT_TBL *)\njpeg_alloc_quant_table (j_common_ptr cinfo)\n{\n  JQUANT_TBL *tbl;\n\n  tbl = (JQUANT_TBL *)\n    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL));\n  tbl->sent_table = FALSE;\t/* make sure this is false in any new table */\n  return tbl;\n}\n\n\nGLOBAL(JHUFF_TBL *)\njpeg_alloc_huff_table (j_common_ptr cinfo)\n{\n  JHUFF_TBL *tbl;\n\n  tbl = (JHUFF_TBL *)\n    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL));\n  tbl->sent_table = FALSE;\t/* make sure this is false in any new table */\n  return tbl;\n}\n"
  },
  {
    "path": "jconfig.bcc",
    "content": "/* jconfig.bcc --- jconfig.h for Borland C (Turbo C) on MS-DOS or OS/2. */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#ifdef __MSDOS__\n#define NEED_FAR_POINTERS\t/* for small or medium memory model */\n#endif\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\t/* this assumes you have -w-stu in CFLAGS */\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#ifdef __MSDOS__\n#define USE_MSDOS_MEMMGR\t/* Define this if you use jmemdos.c */\n#define MAX_ALLOC_CHUNK 65520L\t/* Maximum request to malloc() */\n#define USE_FMEM\t\t/* Borland has _fmemcpy() and _fmemset() */\n#endif\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#define TWO_FILE_COMMANDLINE\n#define USE_SETMODE\t\t/* Borland has setmode() */\n#ifdef __MSDOS__\n#define NEED_SIGNAL_CATCHER\t/* Define this if you use jmemdos.c */\n#endif\n#undef DONT_USE_B_MODE\n#undef PROGRESS_REPORT\t\t/* optional */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "jconfig.cfg",
    "content": "/* jconfig.cfg --- source file edited by configure script */\n/* see jconfig.txt for explanations */\n\n#undef HAVE_PROTOTYPES\n#undef HAVE_UNSIGNED_CHAR\n#undef HAVE_UNSIGNED_SHORT\n#undef void\n#undef const\n#undef CHAR_IS_UNSIGNED\n#undef HAVE_STDDEF_H\n#undef HAVE_STDLIB_H\n#undef HAVE_LOCALE_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\n#undef NEED_SHORT_EXTERNAL_NAMES\n/* Define this if you get warnings about undefined structures. */\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* Define \"boolean\" as unsigned char, not enum, on Windows systems. */\n#ifdef _WIN32\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#ifndef FALSE\t\t\t/* in case these macros already exist */\n#define FALSE\t0\t\t/* values of boolean */\n#endif\n#ifndef TRUE\n#define TRUE\t1\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n#endif\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n#undef INLINE\n/* These are for configuring the JPEG memory manager. */\n#undef DEFAULT_MAX_MEM\n#undef NO_MKTEMP\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#undef TWO_FILE_COMMANDLINE\n#undef NEED_SIGNAL_CATCHER\n#undef DONT_USE_B_MODE\n\n/* Define this if you want percent-done progress reports from cjpeg/djpeg. */\n#undef PROGRESS_REPORT\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "jconfig.dj",
    "content": "/* jconfig.dj --- jconfig.h for DJGPP (Delorie's GNU C port) on MS-DOS. */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\t/* DJGPP uses flat 32-bit addressing */\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#undef TWO_FILE_COMMANDLINE\t/* optional */\n#define USE_SETMODE\t\t/* Needed to make one-file style work in DJGPP */\n#undef NEED_SIGNAL_CATCHER\t/* Define this if you use jmemname.c */\n#undef DONT_USE_B_MODE\n#undef PROGRESS_REPORT\t\t/* optional */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "jconfig.mac",
    "content": "/* jconfig.mac --- jconfig.h for CodeWarrior on Apple Macintosh */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#define USE_MAC_MEMMGR\t\t/* Define this if you use jmemmac.c */\n\n#define ALIGN_TYPE long\t\t/* Needed for 680x0 Macs */\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#define USE_CCOMMAND\t\t/* Command line reader for Macintosh */\n#define TWO_FILE_COMMANDLINE\t/* Binary I/O thru stdin/stdout doesn't work */\n\n#undef NEED_SIGNAL_CATCHER\n#undef DONT_USE_B_MODE\n#undef PROGRESS_REPORT\t\t/* optional */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "jconfig.manx",
    "content": "/* jconfig.manx --- jconfig.h for Amiga systems using Manx Aztec C ver 5.x. */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#define TEMP_DIRECTORY \"JPEGTMP:\"\t/* recommended setting for Amiga */\n\n#define SHORTxSHORT_32\t\t/* produces better DCT code with Aztec C */\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#define TWO_FILE_COMMANDLINE\n#define NEED_SIGNAL_CATCHER\n#undef DONT_USE_B_MODE\n#undef PROGRESS_REPORT\t\t/* optional */\n\n#define signal_catcher _abort\t/* hack for Aztec C naming requirements */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "jconfig.mc6",
    "content": "/* jconfig.mc6 --- jconfig.h for Microsoft C on MS-DOS, version 6.00A & up. */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#define NEED_FAR_POINTERS\t/* for small or medium memory model */\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#define USE_MSDOS_MEMMGR\t/* Define this if you use jmemdos.c */\n\n#define MAX_ALLOC_CHUNK 65520L\t/* Maximum request to malloc() */\n\n#define USE_FMEM\t\t/* Microsoft has _fmemcpy() and _fmemset() */\n\n#define NEED_FHEAPMIN\t\t/* far heap management routines are broken */\n\n#define SHORTxLCONST_32\t\t/* enable compiler-specific DCT optimization */\n/* Note: the above define is known to improve the code with Microsoft C 6.00A.\n * I do not know whether it is good for later compiler versions.\n * Please report any info on this point to jpeg-info@jpegclub.org.\n */\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#define TWO_FILE_COMMANDLINE\n#define USE_SETMODE\t\t/* Microsoft has setmode() */\n#define NEED_SIGNAL_CATCHER\t/* Define this if you use jmemdos.c */\n#undef DONT_USE_B_MODE\n#undef PROGRESS_REPORT\t\t/* optional */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "jconfig.sas",
    "content": "/* jconfig.sas --- jconfig.h for Amiga systems using SAS C 6.0 and up. */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#define TEMP_DIRECTORY \"JPEGTMP:\"\t/* recommended setting for Amiga */\n\n#define NO_MKTEMP\t\t/* SAS C doesn't have mktemp() */\n\n#define SHORTxSHORT_32\t\t/* produces better DCT code with SAS C */\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#define TWO_FILE_COMMANDLINE\n#define NEED_SIGNAL_CATCHER\n#undef DONT_USE_B_MODE\n#undef PROGRESS_REPORT\t\t/* optional */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "jconfig.st",
    "content": "/* jconfig.st --- jconfig.h for Atari ST/STE/TT using Pure C or Turbo C. */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\n#undef NEED_SHORT_EXTERNAL_NAMES\n#define INCOMPLETE_TYPES_BROKEN\t/* suppress undefined-structure warnings */\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#define ALIGN_TYPE  long\t/* apparently double is a weird size? */\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#define TWO_FILE_COMMANDLINE\t/* optional -- undef if you like Unix style */\n/* Note: if you undef TWO_FILE_COMMANDLINE, you may need to define\n * USE_SETMODE.  Some Atari compilers require it, some do not.\n */\n#define NEED_SIGNAL_CATCHER\t/* needed if you use jmemname.c */\n#undef DONT_USE_B_MODE\n#undef PROGRESS_REPORT\t\t/* optional */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "jconfig.txt",
    "content": "/*\n * jconfig.txt\n *\n * Copyright (C) 1991-1994, Thomas G. Lane.\n * Modified 2009-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file documents the configuration options that are required to\n * customize the JPEG software for a particular system.\n *\n * The actual configuration options for a particular installation are stored\n * in jconfig.h.  On many machines, jconfig.h can be generated automatically\n * or copied from one of the \"canned\" jconfig files that we supply.  But if\n * you need to generate a jconfig.h file by hand, this file tells you how.\n *\n * DO NOT EDIT THIS FILE --- IT WON'T ACCOMPLISH ANYTHING.\n * EDIT A COPY NAMED JCONFIG.H.\n */\n\n\n/*\n * These symbols indicate the properties of your machine or compiler.\n * #define the symbol if yes, #undef it if no.\n */\n\n/* Does your compiler support function prototypes?\n * (If not, you also need to use ansi2knr, see install.txt)\n */\n#define HAVE_PROTOTYPES\n\n/* Does your compiler support the declaration \"unsigned char\" ?\n * How about \"unsigned short\" ?\n */\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n\n/* Define \"void\" as \"char\" if your compiler doesn't know about type void.\n * NOTE: be sure to define void such that \"void *\" represents the most general\n * pointer type, e.g., that returned by malloc().\n */\n/* #define void char */\n\n/* Define \"const\" as empty if your compiler doesn't know the \"const\" keyword.\n */\n/* #define const */\n\n/* Define this if an ordinary \"char\" type is unsigned.\n * If you're not sure, leaving it undefined will work at some cost in speed.\n * If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal.\n */\n#undef CHAR_IS_UNSIGNED\n\n/* Define this if your system has an ANSI-conforming <stddef.h> file.\n */\n#define HAVE_STDDEF_H\n\n/* Define this if your system has an ANSI-conforming <stdlib.h> file.\n */\n#define HAVE_STDLIB_H\n\n/* Define this if your system does not have an ANSI/SysV <string.h>,\n * but does have a BSD-style <strings.h>.\n */\n#undef NEED_BSD_STRINGS\n\n/* Define this if your system does not provide typedef size_t in any of the\n * ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in\n * <sys/types.h> instead.\n */\n#undef NEED_SYS_TYPES_H\n\n/* For 80x86 machines, you need to define NEED_FAR_POINTERS,\n * unless you are using a large-data memory model or 80386 flat-memory mode.\n * On less brain-damaged CPUs this symbol must not be defined.\n * (Defining this symbol causes large data structures to be referenced through\n * \"far\" pointers and to be allocated with a special version of malloc.)\n */\n#undef NEED_FAR_POINTERS\n\n/* Define this if your linker needs global names to be unique in less\n * than the first 15 characters.\n */\n#undef NEED_SHORT_EXTERNAL_NAMES\n\n/* Although a real ANSI C compiler can deal perfectly well with pointers to\n * unspecified structures (see \"incomplete types\" in the spec), a few pre-ANSI\n * and pseudo-ANSI compilers get confused.  To keep one of these bozos happy,\n * define INCOMPLETE_TYPES_BROKEN.  This is not recommended unless you\n * actually get \"missing structure definition\" warnings or errors while\n * compiling the JPEG code.\n */\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* Define \"boolean\" as unsigned char, not enum, on Windows systems.\n */\n#ifdef _WIN32\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#ifndef FALSE\t\t\t/* in case these macros already exist */\n#define FALSE\t0\t\t/* values of boolean */\n#endif\n#ifndef TRUE\n#define TRUE\t1\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n#endif\n\n\n/*\n * The following options affect code selection within the JPEG library,\n * but they don't need to be visible to applications using the library.\n * To minimize application namespace pollution, the symbols won't be\n * defined unless JPEG_INTERNALS has been defined.\n */\n\n#ifdef JPEG_INTERNALS\n\n/* Define this if your compiler implements \">>\" on signed values as a logical\n * (unsigned) shift; leave it undefined if \">>\" is a signed (arithmetic) shift,\n * which is the normal and rational definition.\n */\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n\n#endif /* JPEG_INTERNALS */\n\n\n/*\n * The remaining options do not affect the JPEG library proper,\n * but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c).\n * Other applications can ignore these.\n */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n/* These defines indicate which image (non-JPEG) file formats are allowed. */\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n/* Define this if you want to name both input and output files on the command\n * line, rather than using stdout and optionally stdin.  You MUST do this if\n * your system can't cope with binary I/O to stdin/stdout.  See comments at\n * head of cjpeg.c or djpeg.c.\n */\n#undef TWO_FILE_COMMANDLINE\n\n/* Define this if your system needs explicit cleanup of temporary files.\n * This is crucial under MS-DOS, where the temporary \"files\" may be areas\n * of extended memory; on most other systems it's not as important.\n */\n#undef NEED_SIGNAL_CATCHER\n\n/* By default, we open image files with fopen(...,\"rb\") or fopen(...,\"wb\").\n * This is necessary on systems that distinguish text files from binary files,\n * and is harmless on most systems that don't.  If you have one of the rare\n * systems that complains about the \"b\" spec, define this symbol.\n */\n#undef DONT_USE_B_MODE\n\n/* Define this if you want percent-done progress reports from cjpeg/djpeg.\n */\n#undef PROGRESS_REPORT\n\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "jconfig.vc",
    "content": "/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\t/* we presume a 32-bit flat memory model */\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* Define \"boolean\" as unsigned char, not enum, per Windows custom */\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#ifndef FALSE\t\t\t/* in case these macros already exist */\n#define FALSE\t0\t\t/* values of boolean */\n#endif\n#ifndef TRUE\n#define TRUE\t1\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#define TWO_FILE_COMMANDLINE\t/* optional */\n#define USE_SETMODE\t\t/* Microsoft has setmode() */\n#undef NEED_SIGNAL_CATCHER\n#undef DONT_USE_B_MODE\n#undef PROGRESS_REPORT\t\t/* optional */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "jconfig.vms",
    "content": "/* jconfig.vms --- jconfig.h for use on Digital VMS. */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#define TWO_FILE_COMMANDLINE\t/* Needed on VMS */\n#undef NEED_SIGNAL_CATCHER\n#undef DONT_USE_B_MODE\n#undef PROGRESS_REPORT\t\t/* optional */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "jconfig.wat",
    "content": "/* jconfig.wat --- jconfig.h for Watcom C/C++ on MS-DOS or OS/2. */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#define CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\t/* Watcom uses flat 32-bit addressing */\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#undef TWO_FILE_COMMANDLINE\t/* optional */\n#define USE_SETMODE\t\t/* Needed to make one-file style work in Watcom */\n#undef NEED_SIGNAL_CATCHER\t/* Define this if you use jmemname.c */\n#undef DONT_USE_B_MODE\n#undef PROGRESS_REPORT\t\t/* optional */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "jcparam.c",
    "content": "/*\n * jcparam.c\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2003-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains optional default-setting code for the JPEG compressor.\n * Applications do not have to use this file, but those that don't use it\n * must know a lot more about the innards of the JPEG code.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Quantization table setup routines\n */\n\nGLOBAL(void)\njpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,\n\t\t      const unsigned int *basic_table,\n\t\t      int scale_factor, boolean force_baseline)\n/* Define a quantization table equal to the basic_table times\n * a scale factor (given as a percentage).\n * If force_baseline is TRUE, the computed quantization table entries\n * are limited to 1..255 for JPEG baseline compatibility.\n */\n{\n  JQUANT_TBL ** qtblptr;\n  int i;\n  long temp;\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS)\n    ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);\n\n  qtblptr = & cinfo->quant_tbl_ptrs[which_tbl];\n\n  if (*qtblptr == NULL)\n    *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo);\n\n  for (i = 0; i < DCTSIZE2; i++) {\n    temp = ((long) basic_table[i] * scale_factor + 50L) / 100L;\n    /* limit the values to the valid range */\n    if (temp <= 0L) temp = 1L;\n    if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */\n    if (force_baseline && temp > 255L)\n      temp = 255L;\t\t/* limit to baseline range if requested */\n    (*qtblptr)->quantval[i] = (UINT16) temp;\n  }\n\n  /* Initialize sent_table FALSE so table will be written to JPEG file. */\n  (*qtblptr)->sent_table = FALSE;\n}\n\n\n/* These are the sample quantization tables given in JPEG spec section K.1.\n * The spec says that the values given produce \"good\" quality, and\n * when divided by 2, \"very good\" quality.\n */\nstatic const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {\n  16,  11,  10,  16,  24,  40,  51,  61,\n  12,  12,  14,  19,  26,  58,  60,  55,\n  14,  13,  16,  24,  40,  57,  69,  56,\n  14,  17,  22,  29,  51,  87,  80,  62,\n  18,  22,  37,  56,  68, 109, 103,  77,\n  24,  35,  55,  64,  81, 104, 113,  92,\n  49,  64,  78,  87, 103, 121, 120, 101,\n  72,  92,  95,  98, 112, 100, 103,  99\n};\nstatic const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {\n  17,  18,  24,  47,  99,  99,  99,  99,\n  18,  21,  26,  66,  99,  99,  99,  99,\n  24,  26,  56,  99,  99,  99,  99,  99,\n  47,  66,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99\n};\n\n\nGLOBAL(void)\njpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)\n/* Set or change the 'quality' (quantization) setting, using default tables\n * and straight percentage-scaling quality scales.\n * This entry point allows different scalings for luminance and chrominance.\n */\n{\n  /* Set up two quantization tables using the specified scaling */\n  jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,\n\t\t       cinfo->q_scale_factor[0], force_baseline);\n  jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,\n\t\t       cinfo->q_scale_factor[1], force_baseline);\n}\n\n\nGLOBAL(void)\njpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,\n\t\t\t boolean force_baseline)\n/* Set or change the 'quality' (quantization) setting, using default tables\n * and a straight percentage-scaling quality scale.  In most cases it's better\n * to use jpeg_set_quality (below); this entry point is provided for\n * applications that insist on a linear percentage scaling.\n */\n{\n  /* Set up two quantization tables using the specified scaling */\n  jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,\n\t\t       scale_factor, force_baseline);\n  jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,\n\t\t       scale_factor, force_baseline);\n}\n\n\nGLOBAL(int)\njpeg_quality_scaling (int quality)\n/* Convert a user-specified quality rating to a percentage scaling factor\n * for an underlying quantization table, using our recommended scaling curve.\n * The input 'quality' factor should be 0 (terrible) to 100 (very good).\n */\n{\n  /* Safety limit on quality factor.  Convert 0 to 1 to avoid zero divide. */\n  if (quality <= 0) quality = 1;\n  if (quality > 100) quality = 100;\n\n  /* The basic table is used as-is (scaling 100) for a quality of 50.\n   * Qualities 50..100 are converted to scaling percentage 200 - 2*Q;\n   * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table\n   * to make all the table entries 1 (hence, minimum quantization loss).\n   * Qualities 1..50 are converted to scaling percentage 5000/Q.\n   */\n  if (quality < 50)\n    quality = 5000 / quality;\n  else\n    quality = 200 - quality*2;\n\n  return quality;\n}\n\n\nGLOBAL(void)\njpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)\n/* Set or change the 'quality' (quantization) setting, using default tables.\n * This is the standard quality-adjusting entry point for typical user\n * interfaces; only those who want detailed control over quantization tables\n * would use the preceding routines directly.\n */\n{\n  /* Convert user 0-100 rating to percentage scaling */\n  quality = jpeg_quality_scaling(quality);\n\n  /* Set up standard quality tables */\n  jpeg_set_linear_quality(cinfo, quality, force_baseline);\n}\n\n\n/*\n * Huffman table setup routines\n */\n\nLOCAL(void)\nadd_huff_table (j_compress_ptr cinfo,\n\t\tJHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)\n/* Define a Huffman table */\n{\n  int nsymbols, len;\n\n  if (*htblptr == NULL)\n    *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n\n  /* Copy the number-of-symbols-of-each-code-length counts */\n  MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));\n\n  /* Validate the counts.  We do this here mainly so we can copy the right\n   * number of symbols from the val[] array, without risking marching off\n   * the end of memory.  jchuff.c will do a more thorough test later.\n   */\n  nsymbols = 0;\n  for (len = 1; len <= 16; len++)\n    nsymbols += bits[len];\n  if (nsymbols < 1 || nsymbols > 256)\n    ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n\n  MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));\n\n  /* Initialize sent_table FALSE so table will be written to JPEG file. */\n  (*htblptr)->sent_table = FALSE;\n}\n\n\nLOCAL(void)\nstd_huff_tables (j_compress_ptr cinfo)\n/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */\n/* IMPORTANT: these are only valid for 8-bit data precision! */\n{\n  static const UINT8 bits_dc_luminance[17] =\n    { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };\n  static const UINT8 val_dc_luminance[] =\n    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };\n  \n  static const UINT8 bits_dc_chrominance[17] =\n    { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };\n  static const UINT8 val_dc_chrominance[] =\n    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };\n  \n  static const UINT8 bits_ac_luminance[17] =\n    { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };\n  static const UINT8 val_ac_luminance[] =\n    { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,\n      0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,\n      0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,\n      0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,\n      0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,\n      0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,\n      0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,\n      0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,\n      0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,\n      0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,\n      0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,\n      0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,\n      0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,\n      0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,\n      0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,\n      0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,\n      0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,\n      0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,\n      0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,\n      0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,\n      0xf9, 0xfa };\n  \n  static const UINT8 bits_ac_chrominance[17] =\n    { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };\n  static const UINT8 val_ac_chrominance[] =\n    { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,\n      0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,\n      0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,\n      0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,\n      0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,\n      0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,\n      0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,\n      0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,\n      0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,\n      0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,\n      0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,\n      0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,\n      0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,\n      0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,\n      0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,\n      0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,\n      0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,\n      0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,\n      0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,\n      0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,\n      0xf9, 0xfa };\n  \n  add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],\n\t\t bits_dc_luminance, val_dc_luminance);\n  add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],\n\t\t bits_ac_luminance, val_ac_luminance);\n  add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],\n\t\t bits_dc_chrominance, val_dc_chrominance);\n  add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],\n\t\t bits_ac_chrominance, val_ac_chrominance);\n}\n\n\n/*\n * Default parameter setup for compression.\n *\n * Applications that don't choose to use this routine must do their\n * own setup of all these parameters.  Alternately, you can call this\n * to establish defaults and then alter parameters selectively.  This\n * is the recommended approach since, if we add any new parameters,\n * your code will still work (they'll be set to reasonable defaults).\n */\n\nGLOBAL(void)\njpeg_set_defaults (j_compress_ptr cinfo)\n{\n  int i;\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* Allocate comp_info array large enough for maximum component count.\n   * Array is made permanent in case application wants to compress\n   * multiple images at same param settings.\n   */\n  if (cinfo->comp_info == NULL)\n    cinfo->comp_info = (jpeg_component_info *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  MAX_COMPONENTS * SIZEOF(jpeg_component_info));\n\n  /* Initialize everything not dependent on the color space */\n\n  cinfo->scale_num = 1;\t\t/* 1:1 scaling */\n  cinfo->scale_denom = 1;\n  cinfo->data_precision = BITS_IN_JSAMPLE;\n  /* Set up two quantization tables using default quality of 75 */\n  jpeg_set_quality(cinfo, 75, TRUE);\n  /* Set up two Huffman tables */\n  std_huff_tables(cinfo);\n\n  /* Initialize default arithmetic coding conditioning */\n  for (i = 0; i < NUM_ARITH_TBLS; i++) {\n    cinfo->arith_dc_L[i] = 0;\n    cinfo->arith_dc_U[i] = 1;\n    cinfo->arith_ac_K[i] = 5;\n  }\n\n  /* Default is no multiple-scan output */\n  cinfo->scan_info = NULL;\n  cinfo->num_scans = 0;\n\n  /* Expect normal source image, not raw downsampled data */\n  cinfo->raw_data_in = FALSE;\n\n  /* The standard Huffman tables are only valid for 8-bit data precision.\n   * If the precision is higher, use arithmetic coding.\n   * (Alternatively, using Huffman coding would be possible with forcing\n   * optimization on so that usable tables will be computed, or by\n   * supplying default tables that are valid for the desired precision.)\n   * Otherwise, use Huffman coding by default.\n   */\n  cinfo->arith_code = cinfo->data_precision > 8 ? TRUE : FALSE;\n\n  /* By default, don't do extra passes to optimize entropy coding */\n  cinfo->optimize_coding = FALSE;\n\n  /* By default, use the simpler non-cosited sampling alignment */\n  cinfo->CCIR601_sampling = FALSE;\n\n  /* By default, apply fancy downsampling */\n  cinfo->do_fancy_downsampling = TRUE;\n\n  /* No input smoothing */\n  cinfo->smoothing_factor = 0;\n\n  /* DCT algorithm preference */\n  cinfo->dct_method = JDCT_DEFAULT;\n\n  /* No restart markers */\n  cinfo->restart_interval = 0;\n  cinfo->restart_in_rows = 0;\n\n  /* Fill in default JFIF marker parameters.  Note that whether the marker\n   * will actually be written is determined by jpeg_set_colorspace.\n   *\n   * By default, the library emits JFIF version code 1.01.\n   * An application that wants to emit JFIF 1.02 extension markers should set\n   * JFIF_minor_version to 2.  We could probably get away with just defaulting\n   * to 1.02, but there may still be some decoders in use that will complain\n   * about that; saying 1.01 should minimize compatibility problems.\n   *\n   * For wide gamut colorspaces (BG_RGB and BG_YCC), the major version will be\n   * overridden by jpeg_set_colorspace and set to 2.\n   */\n  cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */\n  cinfo->JFIF_minor_version = 1;\n  cinfo->density_unit = 0;\t/* Pixel size is unknown by default */\n  cinfo->X_density = 1;\t\t/* Pixel aspect ratio is square by default */\n  cinfo->Y_density = 1;\n\n  /* No color transform */\n  cinfo->color_transform = JCT_NONE;\n\n  /* Choose JPEG colorspace based on input space, set defaults accordingly */\n\n  jpeg_default_colorspace(cinfo);\n}\n\n\n/*\n * Select an appropriate JPEG colorspace for in_color_space.\n */\n\nGLOBAL(void)\njpeg_default_colorspace (j_compress_ptr cinfo)\n{\n  switch (cinfo->in_color_space) {\n  case JCS_UNKNOWN:\n    jpeg_set_colorspace(cinfo, JCS_UNKNOWN);\n    break;\n  case JCS_GRAYSCALE:\n    jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);\n    break;\n  case JCS_RGB:\n    jpeg_set_colorspace(cinfo, JCS_YCbCr);\n    break;\n  case JCS_YCbCr:\n    jpeg_set_colorspace(cinfo, JCS_YCbCr);\n    break;\n  case JCS_CMYK:\n    jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */\n    break;\n  case JCS_YCCK:\n    jpeg_set_colorspace(cinfo, JCS_YCCK);\n    break;\n  case JCS_BG_RGB:\n    /* No translation for now -- conversion to BG_YCC not yet supportet */\n    jpeg_set_colorspace(cinfo, JCS_BG_RGB);\n    break;\n  case JCS_BG_YCC:\n    jpeg_set_colorspace(cinfo, JCS_BG_YCC);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n  }\n}\n\n\n/*\n * Set the JPEG colorspace, and choose colorspace-dependent default values.\n */\n\nGLOBAL(void)\njpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)\n{\n  jpeg_component_info * compptr;\n  int ci;\n\n#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl)  \\\n  (compptr = &cinfo->comp_info[index], \\\n   compptr->component_id = (id), \\\n   compptr->h_samp_factor = (hsamp), \\\n   compptr->v_samp_factor = (vsamp), \\\n   compptr->quant_tbl_no = (quant), \\\n   compptr->dc_tbl_no = (dctbl), \\\n   compptr->ac_tbl_no = (actbl) )\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* For all colorspaces, we use Q and Huff tables 0 for luminance components,\n   * tables 1 for chrominance components.\n   */\n\n  cinfo->jpeg_color_space = colorspace;\n\n  cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */\n  cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */\n\n  switch (colorspace) {\n  case JCS_UNKNOWN:\n    cinfo->num_components = cinfo->input_components;\n    if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,\n\t       MAX_COMPONENTS);\n    for (ci = 0; ci < cinfo->num_components; ci++) {\n      SET_COMP(ci, ci, 1,1, 0, 0,0);\n    }\n    break;\n  case JCS_GRAYSCALE:\n    cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */\n    cinfo->num_components = 1;\n    /* JFIF specifies component ID 1 */\n    SET_COMP(0, 0x01, 1,1, 0, 0,0);\n    break;\n  case JCS_RGB:\n    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */\n    cinfo->num_components = 3;\n    SET_COMP(0, 0x52 /* 'R' */, 1,1, 0,\n\t\tcinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,\n\t\tcinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);\n    SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0);\n    SET_COMP(2, 0x42 /* 'B' */, 1,1, 0,\n\t\tcinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,\n\t\tcinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);\n    break;\n  case JCS_YCbCr:\n    cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */\n    cinfo->num_components = 3;\n    /* JFIF specifies component IDs 1,2,3 */\n    /* We default to 2x2 subsamples of chrominance */\n    SET_COMP(0, 0x01, 2,2, 0, 0,0);\n    SET_COMP(1, 0x02, 1,1, 1, 1,1);\n    SET_COMP(2, 0x03, 1,1, 1, 1,1);\n    break;\n  case JCS_CMYK:\n    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */\n    cinfo->num_components = 4;\n    SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0);\n    SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0);\n    SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0);\n    SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0);\n    break;\n  case JCS_YCCK:\n    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */\n    cinfo->num_components = 4;\n    SET_COMP(0, 0x01, 2,2, 0, 0,0);\n    SET_COMP(1, 0x02, 1,1, 1, 1,1);\n    SET_COMP(2, 0x03, 1,1, 1, 1,1);\n    SET_COMP(3, 0x04, 2,2, 0, 0,0);\n    break;\n  case JCS_BG_RGB:\n    cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */\n    cinfo->JFIF_major_version = 2;   /* Set JFIF major version = 2 */\n    cinfo->num_components = 3;\n    /* Add offset 0x20 to the normal R/G/B component IDs */\n    SET_COMP(0, 0x72 /* 'r' */, 1,1, 0,\n\t\tcinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,\n\t\tcinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);\n    SET_COMP(1, 0x67 /* 'g' */, 1,1, 0, 0,0);\n    SET_COMP(2, 0x62 /* 'b' */, 1,1, 0,\n\t\tcinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,\n\t\tcinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);\n    break;\n  case JCS_BG_YCC:\n    cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */\n    cinfo->JFIF_major_version = 2;   /* Set JFIF major version = 2 */\n    cinfo->num_components = 3;\n    /* Add offset 0x20 to the normal Cb/Cr component IDs */\n    /* We default to 2x2 subsamples of chrominance */\n    SET_COMP(0, 0x01, 2,2, 0, 0,0);\n    SET_COMP(1, 0x22, 1,1, 1, 1,1);\n    SET_COMP(2, 0x23, 1,1, 1, 1,1);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n  }\n}\n\n\n#ifdef C_PROGRESSIVE_SUPPORTED\n\nLOCAL(jpeg_scan_info *)\nfill_a_scan (jpeg_scan_info * scanptr, int ci,\n\t     int Ss, int Se, int Ah, int Al)\n/* Support routine: generate one scan for specified component */\n{\n  scanptr->comps_in_scan = 1;\n  scanptr->component_index[0] = ci;\n  scanptr->Ss = Ss;\n  scanptr->Se = Se;\n  scanptr->Ah = Ah;\n  scanptr->Al = Al;\n  scanptr++;\n  return scanptr;\n}\n\nLOCAL(jpeg_scan_info *)\nfill_scans (jpeg_scan_info * scanptr, int ncomps,\n\t    int Ss, int Se, int Ah, int Al)\n/* Support routine: generate one scan for each component */\n{\n  int ci;\n\n  for (ci = 0; ci < ncomps; ci++) {\n    scanptr->comps_in_scan = 1;\n    scanptr->component_index[0] = ci;\n    scanptr->Ss = Ss;\n    scanptr->Se = Se;\n    scanptr->Ah = Ah;\n    scanptr->Al = Al;\n    scanptr++;\n  }\n  return scanptr;\n}\n\nLOCAL(jpeg_scan_info *)\nfill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al)\n/* Support routine: generate interleaved DC scan if possible, else N scans */\n{\n  int ci;\n\n  if (ncomps <= MAX_COMPS_IN_SCAN) {\n    /* Single interleaved DC scan */\n    scanptr->comps_in_scan = ncomps;\n    for (ci = 0; ci < ncomps; ci++)\n      scanptr->component_index[ci] = ci;\n    scanptr->Ss = scanptr->Se = 0;\n    scanptr->Ah = Ah;\n    scanptr->Al = Al;\n    scanptr++;\n  } else {\n    /* Noninterleaved DC scan for each component */\n    scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al);\n  }\n  return scanptr;\n}\n\n\n/*\n * Create a recommended progressive-JPEG script.\n * cinfo->num_components and cinfo->jpeg_color_space must be correct.\n */\n\nGLOBAL(void)\njpeg_simple_progression (j_compress_ptr cinfo)\n{\n  int ncomps = cinfo->num_components;\n  int nscans;\n  jpeg_scan_info * scanptr;\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* Figure space needed for script.  Calculation must match code below! */\n  if (ncomps == 3 &&\n      (cinfo->jpeg_color_space == JCS_YCbCr ||\n       cinfo->jpeg_color_space == JCS_BG_YCC)) {\n    /* Custom script for YCC color images. */\n    nscans = 10;\n  } else {\n    /* All-purpose script for other color spaces. */\n    if (ncomps > MAX_COMPS_IN_SCAN)\n      nscans = 6 * ncomps;\t/* 2 DC + 4 AC scans per component */\n    else\n      nscans = 2 + 4 * ncomps;\t/* 2 DC scans; 4 AC scans per component */\n  }\n\n  /* Allocate space for script.\n   * We need to put it in the permanent pool in case the application performs\n   * multiple compressions without changing the settings.  To avoid a memory\n   * leak if jpeg_simple_progression is called repeatedly for the same JPEG\n   * object, we try to re-use previously allocated space, and we allocate\n   * enough space to handle YCC even if initially asked for grayscale.\n   */\n  if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {\n    cinfo->script_space_size = MAX(nscans, 10);\n    cinfo->script_space = (jpeg_scan_info *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\tcinfo->script_space_size * SIZEOF(jpeg_scan_info));\n  }\n  scanptr = cinfo->script_space;\n  cinfo->scan_info = scanptr;\n  cinfo->num_scans = nscans;\n\n  if (ncomps == 3 &&\n      (cinfo->jpeg_color_space == JCS_YCbCr ||\n       cinfo->jpeg_color_space == JCS_BG_YCC)) {\n    /* Custom script for YCC color images. */\n    /* Initial DC scan */\n    scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);\n    /* Initial AC scan: get some luma data out in a hurry */\n    scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2);\n    /* Chroma data is too small to be worth expending many scans on */\n    scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1);\n    scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1);\n    /* Complete spectral selection for luma AC */\n    scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2);\n    /* Refine next bit of luma AC */\n    scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1);\n    /* Finish DC successive approximation */\n    scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);\n    /* Finish AC successive approximation */\n    scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0);\n    scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0);\n    /* Luma bottom bit comes last since it's usually largest scan */\n    scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0);\n  } else {\n    /* All-purpose script for other color spaces. */\n    /* Successive approximation first pass */\n    scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);\n    scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2);\n    scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2);\n    /* Successive approximation second pass */\n    scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1);\n    /* Successive approximation final pass */\n    scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);\n    scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0);\n  }\n}\n\n#endif /* C_PROGRESSIVE_SUPPORTED */\n"
  },
  {
    "path": "jcprepct.c",
    "content": "/*\n * jcprepct.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the compression preprocessing controller.\n * This controller manages the color conversion, downsampling,\n * and edge expansion steps.\n *\n * Most of the complexity here is associated with buffering input rows\n * as required by the downsampler.  See the comments at the head of\n * jcsample.c for the downsampler's needs.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* At present, jcsample.c can request context rows only for smoothing.\n * In the future, we might also need context rows for CCIR601 sampling\n * or other more-complex downsampling procedures.  The code to support\n * context rows should be compiled only if needed.\n */\n#ifdef INPUT_SMOOTHING_SUPPORTED\n#define CONTEXT_ROWS_SUPPORTED\n#endif\n\n\n/*\n * For the simple (no-context-row) case, we just need to buffer one\n * row group's worth of pixels for the downsampling step.  At the bottom of\n * the image, we pad to a full row group by replicating the last pixel row.\n * The downsampler's last output row is then replicated if needed to pad\n * out to a full iMCU row.\n *\n * When providing context rows, we must buffer three row groups' worth of\n * pixels.  Three row groups are physically allocated, but the row pointer\n * arrays are made five row groups high, with the extra pointers above and\n * below \"wrapping around\" to point to the last and first real row groups.\n * This allows the downsampler to access the proper context rows.\n * At the top and bottom of the image, we create dummy context rows by\n * copying the first or last real pixel row.  This copying could be avoided\n * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the\n * trouble on the compression side.\n */\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_c_prep_controller pub; /* public fields */\n\n  /* Downsampling input buffer.  This buffer holds color-converted data\n   * until we have enough to do a downsample step.\n   */\n  JSAMPARRAY color_buf[MAX_COMPONENTS];\n\n  JDIMENSION rows_to_go;\t/* counts rows remaining in source image */\n  int next_buf_row;\t\t/* index of next row to store in color_buf */\n\n#ifdef CONTEXT_ROWS_SUPPORTED\t/* only needed for context case */\n  int this_row_group;\t\t/* starting row index of group to process */\n  int next_buf_stop;\t\t/* downsample when we reach this index */\n#endif\n} my_prep_controller;\n\ntypedef my_prep_controller * my_prep_ptr;\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;\n\n  if (pass_mode != JBUF_PASS_THRU)\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  /* Initialize total-height counter for detecting bottom of image */\n  prep->rows_to_go = cinfo->image_height;\n  /* Mark the conversion buffer empty */\n  prep->next_buf_row = 0;\n#ifdef CONTEXT_ROWS_SUPPORTED\n  /* Preset additional state variables for context mode.\n   * These aren't used in non-context mode, so we needn't test which mode.\n   */\n  prep->this_row_group = 0;\n  /* Set next_buf_stop to stop after two row groups have been read in. */\n  prep->next_buf_stop = 2 * cinfo->max_v_samp_factor;\n#endif\n}\n\n\n/*\n * Expand an image vertically from height input_rows to height output_rows,\n * by duplicating the bottom row.\n */\n\nLOCAL(void)\nexpand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,\n\t\t    int input_rows, int output_rows)\n{\n  register int row;\n\n  for (row = input_rows; row < output_rows; row++) {\n    jcopy_sample_rows(image_data, input_rows-1, image_data, row,\n\t\t      1, num_cols);\n  }\n}\n\n\n/*\n * Process some data in the simple no-context case.\n *\n * Preprocessor output data is counted in \"row groups\".  A row group\n * is defined to be v_samp_factor sample rows of each component.\n * Downsampling will produce this much data from each max_v_samp_factor\n * input rows.\n */\n\nMETHODDEF(void)\npre_process_data (j_compress_ptr cinfo,\n\t\t  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n\t\t  JDIMENSION in_rows_avail,\n\t\t  JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,\n\t\t  JDIMENSION out_row_groups_avail)\n{\n  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;\n  int numrows, ci;\n  JDIMENSION inrows;\n  jpeg_component_info * compptr;\n\n  while (*in_row_ctr < in_rows_avail &&\n\t *out_row_group_ctr < out_row_groups_avail) {\n    /* Do color conversion to fill the conversion buffer. */\n    inrows = in_rows_avail - *in_row_ctr;\n    numrows = cinfo->max_v_samp_factor - prep->next_buf_row;\n    numrows = (int) MIN((JDIMENSION) numrows, inrows);\n    (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,\n\t\t\t\t       prep->color_buf,\n\t\t\t\t       (JDIMENSION) prep->next_buf_row,\n\t\t\t\t       numrows);\n    *in_row_ctr += numrows;\n    prep->next_buf_row += numrows;\n    prep->rows_to_go -= numrows;\n    /* If at bottom of image, pad to fill the conversion buffer. */\n    if (prep->rows_to_go == 0 &&\n\tprep->next_buf_row < cinfo->max_v_samp_factor) {\n      for (ci = 0; ci < cinfo->num_components; ci++) {\n\texpand_bottom_edge(prep->color_buf[ci], cinfo->image_width,\n\t\t\t   prep->next_buf_row, cinfo->max_v_samp_factor);\n      }\n      prep->next_buf_row = cinfo->max_v_samp_factor;\n    }\n    /* If we've filled the conversion buffer, empty it. */\n    if (prep->next_buf_row == cinfo->max_v_samp_factor) {\n      (*cinfo->downsample->downsample) (cinfo,\n\t\t\t\t\tprep->color_buf, (JDIMENSION) 0,\n\t\t\t\t\toutput_buf, *out_row_group_ctr);\n      prep->next_buf_row = 0;\n      (*out_row_group_ctr)++;\n    }\n    /* If at bottom of image, pad the output to a full iMCU height.\n     * Note we assume the caller is providing a one-iMCU-height output buffer!\n     */\n    if (prep->rows_to_go == 0 &&\n\t*out_row_group_ctr < out_row_groups_avail) {\n      for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t   ci++, compptr++) {\n\tnumrows = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /\n\t\t  cinfo->min_DCT_v_scaled_size;\n\texpand_bottom_edge(output_buf[ci],\n\t\t\t   compptr->width_in_blocks * compptr->DCT_h_scaled_size,\n\t\t\t   (int) (*out_row_group_ctr * numrows),\n\t\t\t   (int) (out_row_groups_avail * numrows));\n      }\n      *out_row_group_ctr = out_row_groups_avail;\n      break;\t\t\t/* can exit outer loop without test */\n    }\n  }\n}\n\n\n#ifdef CONTEXT_ROWS_SUPPORTED\n\n/*\n * Process some data in the context case.\n */\n\nMETHODDEF(void)\npre_process_context (j_compress_ptr cinfo,\n\t\t     JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n\t\t     JDIMENSION in_rows_avail,\n\t\t     JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,\n\t\t     JDIMENSION out_row_groups_avail)\n{\n  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;\n  int numrows, ci;\n  int buf_height = cinfo->max_v_samp_factor * 3;\n  JDIMENSION inrows;\n\n  while (*out_row_group_ctr < out_row_groups_avail) {\n    if (*in_row_ctr < in_rows_avail) {\n      /* Do color conversion to fill the conversion buffer. */\n      inrows = in_rows_avail - *in_row_ctr;\n      numrows = prep->next_buf_stop - prep->next_buf_row;\n      numrows = (int) MIN((JDIMENSION) numrows, inrows);\n      (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,\n\t\t\t\t\t prep->color_buf,\n\t\t\t\t\t (JDIMENSION) prep->next_buf_row,\n\t\t\t\t\t numrows);\n      /* Pad at top of image, if first time through */\n      if (prep->rows_to_go == cinfo->image_height) {\n\tfor (ci = 0; ci < cinfo->num_components; ci++) {\n\t  int row;\n\t  for (row = 1; row <= cinfo->max_v_samp_factor; row++) {\n\t    jcopy_sample_rows(prep->color_buf[ci], 0,\n\t\t\t      prep->color_buf[ci], -row,\n\t\t\t      1, cinfo->image_width);\n\t  }\n\t}\n      }\n      *in_row_ctr += numrows;\n      prep->next_buf_row += numrows;\n      prep->rows_to_go -= numrows;\n    } else {\n      /* Return for more data, unless we are at the bottom of the image. */\n      if (prep->rows_to_go != 0)\n\tbreak;\n      /* When at bottom of image, pad to fill the conversion buffer. */\n      if (prep->next_buf_row < prep->next_buf_stop) {\n\tfor (ci = 0; ci < cinfo->num_components; ci++) {\n\t  expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,\n\t\t\t     prep->next_buf_row, prep->next_buf_stop);\n\t}\n\tprep->next_buf_row = prep->next_buf_stop;\n      }\n    }\n    /* If we've gotten enough data, downsample a row group. */\n    if (prep->next_buf_row == prep->next_buf_stop) {\n      (*cinfo->downsample->downsample) (cinfo,\n\t\t\t\t\tprep->color_buf,\n\t\t\t\t\t(JDIMENSION) prep->this_row_group,\n\t\t\t\t\toutput_buf, *out_row_group_ctr);\n      (*out_row_group_ctr)++;\n      /* Advance pointers with wraparound as necessary. */\n      prep->this_row_group += cinfo->max_v_samp_factor;\n      if (prep->this_row_group >= buf_height)\n\tprep->this_row_group = 0;\n      if (prep->next_buf_row >= buf_height)\n\tprep->next_buf_row = 0;\n      prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor;\n    }\n  }\n}\n\n\n/*\n * Create the wrapped-around downsampling input buffer needed for context mode.\n */\n\nLOCAL(void)\ncreate_context_buffer (j_compress_ptr cinfo)\n{\n  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;\n  int rgroup_height = cinfo->max_v_samp_factor;\n  int ci, i;\n  jpeg_component_info * compptr;\n  JSAMPARRAY true_buffer, fake_buffer;\n\n  /* Grab enough space for fake row pointers for all the components;\n   * we need five row groups' worth of pointers for each component.\n   */\n  fake_buffer = (JSAMPARRAY)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(cinfo->num_components * 5 * rgroup_height) *\n\t\t\t\tSIZEOF(JSAMPROW));\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Allocate the actual buffer space (3 row groups) for this component.\n     * We make the buffer wide enough to allow the downsampler to edge-expand\n     * horizontally within the buffer, if it so chooses.\n     */\n    true_buffer = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) (((long) compptr->width_in_blocks *\n\t\t      cinfo->min_DCT_h_scaled_size *\n\t\t      cinfo->max_h_samp_factor) / compptr->h_samp_factor),\n       (JDIMENSION) (3 * rgroup_height));\n    /* Copy true buffer row pointers into the middle of the fake row array */\n    MEMCOPY(fake_buffer + rgroup_height, true_buffer,\n\t    3 * rgroup_height * SIZEOF(JSAMPROW));\n    /* Fill in the above and below wraparound pointers */\n    for (i = 0; i < rgroup_height; i++) {\n      fake_buffer[i] = true_buffer[2 * rgroup_height + i];\n      fake_buffer[4 * rgroup_height + i] = true_buffer[i];\n    }\n    prep->color_buf[ci] = fake_buffer + rgroup_height;\n    fake_buffer += 5 * rgroup_height; /* point to space for next component */\n  }\n}\n\n#endif /* CONTEXT_ROWS_SUPPORTED */\n\n\n/*\n * Initialize preprocessing controller.\n */\n\nGLOBAL(void)\njinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)\n{\n  my_prep_ptr prep;\n  int ci;\n  jpeg_component_info * compptr;\n\n  if (need_full_buffer)\t\t/* safety check */\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  prep = (my_prep_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_prep_controller));\n  cinfo->prep = (struct jpeg_c_prep_controller *) prep;\n  prep->pub.start_pass = start_pass_prep;\n\n  /* Allocate the color conversion buffer.\n   * We make the buffer wide enough to allow the downsampler to edge-expand\n   * horizontally within the buffer, if it so chooses.\n   */\n  if (cinfo->downsample->need_context_rows) {\n    /* Set up to provide context rows */\n#ifdef CONTEXT_ROWS_SUPPORTED\n    prep->pub.pre_process_data = pre_process_context;\n    create_context_buffer(cinfo);\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    /* No context, just make it tall enough for one row group */\n    prep->pub.pre_process_data = pre_process_data;\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t (JDIMENSION) (((long) compptr->width_in_blocks *\n\t\t\tcinfo->min_DCT_h_scaled_size *\n\t\t\tcinfo->max_h_samp_factor) / compptr->h_samp_factor),\n\t (JDIMENSION) cinfo->max_v_samp_factor);\n    }\n  }\n}\n"
  },
  {
    "path": "jcsample.c",
    "content": "/*\n * jcsample.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains downsampling routines.\n *\n * Downsampling input data is counted in \"row groups\".  A row group\n * is defined to be max_v_samp_factor pixel rows of each component,\n * from which the downsampler produces v_samp_factor sample rows.\n * A single row group is processed in each call to the downsampler module.\n *\n * The downsampler is responsible for edge-expansion of its output data\n * to fill an integral number of DCT blocks horizontally.  The source buffer\n * may be modified if it is helpful for this purpose (the source buffer is\n * allocated wide enough to correspond to the desired output width).\n * The caller (the prep controller) is responsible for vertical padding.\n *\n * The downsampler may request \"context rows\" by setting need_context_rows\n * during startup.  In this case, the input arrays will contain at least\n * one row group's worth of pixels above and below the passed-in data;\n * the caller will create dummy rows at image top and bottom by replicating\n * the first or last real pixel row.\n *\n * An excellent reference for image resampling is\n *   Digital Image Warping, George Wolberg, 1990.\n *   Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.\n *\n * The downsampling algorithm used here is a simple average of the source\n * pixels covered by the output pixel.  The hi-falutin sampling literature\n * refers to this as a \"box filter\".  In general the characteristics of a box\n * filter are not very good, but for the specific cases we normally use (1:1\n * and 2:1 ratios) the box is equivalent to a \"triangle filter\" which is not\n * nearly so bad.  If you intend to use other sampling ratios, you'd be well\n * advised to improve this code.\n *\n * A simple input-smoothing capability is provided.  This is mainly intended\n * for cleaning up color-dithered GIF input files (if you find it inadequate,\n * we suggest using an external filtering program such as pnmconvol).  When\n * enabled, each input pixel P is replaced by a weighted sum of itself and its\n * eight neighbors.  P's weight is 1-8*SF and each neighbor's weight is SF,\n * where SF = (smoothing_factor / 1024).\n * Currently, smoothing is only supported for 2h2v sampling factors.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Pointer to routine to downsample a single component */\ntypedef JMETHOD(void, downsample1_ptr,\n\t\t(j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JSAMPARRAY input_data, JSAMPARRAY output_data));\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_downsampler pub;\t/* public fields */\n\n  /* Downsampling method pointers, one per component */\n  downsample1_ptr methods[MAX_COMPONENTS];\n\n  /* Height of an output row group for each component. */\n  int rowgroup_height[MAX_COMPONENTS];\n\n  /* These arrays save pixel expansion factors so that int_downsample need not\n   * recompute them each time.  They are unused for other downsampling methods.\n   */\n  UINT8 h_expand[MAX_COMPONENTS];\n  UINT8 v_expand[MAX_COMPONENTS];\n} my_downsampler;\n\ntypedef my_downsampler * my_downsample_ptr;\n\n\n/*\n * Initialize for a downsampling pass.\n */\n\nMETHODDEF(void)\nstart_pass_downsample (j_compress_ptr cinfo)\n{\n  /* no work for now */\n}\n\n\n/*\n * Expand a component horizontally from width input_cols to width output_cols,\n * by duplicating the rightmost samples.\n */\n\nLOCAL(void)\nexpand_right_edge (JSAMPARRAY image_data, int num_rows,\n\t\t   JDIMENSION input_cols, JDIMENSION output_cols)\n{\n  register JSAMPROW ptr;\n  register JSAMPLE pixval;\n  register int count;\n  int row;\n  int numcols = (int) (output_cols - input_cols);\n\n  if (numcols > 0) {\n    for (row = 0; row < num_rows; row++) {\n      ptr = image_data[row] + input_cols;\n      pixval = ptr[-1];\t\t/* don't need GETJSAMPLE() here */\n      for (count = numcols; count > 0; count--)\n\t*ptr++ = pixval;\n    }\n  }\n}\n\n\n/*\n * Do downsampling for a whole row group (all components).\n *\n * In this version we simply downsample each component independently.\n */\n\nMETHODDEF(void)\nsep_downsample (j_compress_ptr cinfo,\n\t\tJSAMPIMAGE input_buf, JDIMENSION in_row_index,\n\t\tJSAMPIMAGE output_buf, JDIMENSION out_row_group_index)\n{\n  my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;\n  int ci;\n  jpeg_component_info * compptr;\n  JSAMPARRAY in_ptr, out_ptr;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    in_ptr = input_buf[ci] + in_row_index;\n    out_ptr = output_buf[ci] +\n\t      (out_row_group_index * downsample->rowgroup_height[ci]);\n    (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);\n  }\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * One row group is processed per call.\n * This version handles arbitrary integral sampling ratios, without smoothing.\n * Note that this version is not actually used for customary sampling ratios.\n */\n\nMETHODDEF(void)\nint_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\tJSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;\n  int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;\n  JDIMENSION outcol, outcol_h;\t/* outcol_h == outcol*h_expand */\n  JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;\n  JSAMPROW inptr, outptr;\n  INT32 outvalue;\n\n  h_expand = downsample->h_expand[compptr->component_index];\n  v_expand = downsample->v_expand[compptr->component_index];\n  numpix = h_expand * v_expand;\n  numpix2 = numpix/2;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data, cinfo->max_v_samp_factor,\n\t\t    cinfo->image_width, output_cols * h_expand);\n\n  inrow = outrow = 0;\n  while (inrow < cinfo->max_v_samp_factor) {\n    outptr = output_data[outrow];\n    for (outcol = 0, outcol_h = 0; outcol < output_cols;\n\t outcol++, outcol_h += h_expand) {\n      outvalue = 0;\n      for (v = 0; v < v_expand; v++) {\n\tinptr = input_data[inrow+v] + outcol_h;\n\tfor (h = 0; h < h_expand; h++) {\n\t  outvalue += (INT32) GETJSAMPLE(*inptr++);\n\t}\n      }\n      *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix);\n    }\n    inrow += v_expand;\n    outrow++;\n  }\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the special case of a full-size component,\n * without smoothing.\n */\n\nMETHODDEF(void)\nfullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t     JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  /* Copy the data */\n  jcopy_sample_rows(input_data, 0, output_data, 0,\n\t\t    cinfo->max_v_samp_factor, cinfo->image_width);\n  /* Edge-expand */\n  expand_right_edge(output_data, cinfo->max_v_samp_factor, cinfo->image_width,\n\t\t    compptr->width_in_blocks * compptr->DCT_h_scaled_size);\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the common case of 2:1 horizontal and 1:1 vertical,\n * without smoothing.\n *\n * A note about the \"bias\" calculations: when rounding fractional values to\n * integer, we do not want to always round 0.5 up to the next integer.\n * If we did that, we'd introduce a noticeable bias towards larger values.\n * Instead, this code is arranged so that 0.5 will be rounded up or down at\n * alternate pixel locations (a simple ordered dither pattern).\n */\n\nMETHODDEF(void)\nh2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int inrow;\n  JDIMENSION outcol;\n  JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;\n  register JSAMPROW inptr, outptr;\n  register int bias;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data, cinfo->max_v_samp_factor,\n\t\t    cinfo->image_width, output_cols * 2);\n\n  for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {\n    outptr = output_data[inrow];\n    inptr = input_data[inrow];\n    bias = 0;\t\t\t/* bias = 0,1,0,1,... for successive samples */\n    for (outcol = 0; outcol < output_cols; outcol++) {\n      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1])\n\t\t\t      + bias) >> 1);\n      bias ^= 1;\t\t/* 0=>1, 1=>0 */\n      inptr += 2;\n    }\n  }\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the standard case of 2:1 horizontal and 2:1 vertical,\n * without smoothing.\n */\n\nMETHODDEF(void)\nh2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int inrow, outrow;\n  JDIMENSION outcol;\n  JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;\n  register JSAMPROW inptr0, inptr1, outptr;\n  register int bias;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data, cinfo->max_v_samp_factor,\n\t\t    cinfo->image_width, output_cols * 2);\n\n  inrow = outrow = 0;\n  while (inrow < cinfo->max_v_samp_factor) {\n    outptr = output_data[outrow];\n    inptr0 = input_data[inrow];\n    inptr1 = input_data[inrow+1];\n    bias = 1;\t\t\t/* bias = 1,2,1,2,... for successive samples */\n    for (outcol = 0; outcol < output_cols; outcol++) {\n      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +\n\t\t\t      GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1])\n\t\t\t      + bias) >> 2);\n      bias ^= 3;\t\t/* 1=>2, 2=>1 */\n      inptr0 += 2; inptr1 += 2;\n    }\n    inrow += 2;\n    outrow++;\n  }\n}\n\n\n#ifdef INPUT_SMOOTHING_SUPPORTED\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the standard case of 2:1 horizontal and 2:1 vertical,\n * with smoothing.  One row of context is required.\n */\n\nMETHODDEF(void)\nh2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t\tJSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int inrow, outrow;\n  JDIMENSION colctr;\n  JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;\n  register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr;\n  INT32 membersum, neighsum, memberscale, neighscale;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,\n\t\t    cinfo->image_width, output_cols * 2);\n\n  /* We don't bother to form the individual \"smoothed\" input pixel values;\n   * we can directly compute the output which is the average of the four\n   * smoothed values.  Each of the four member pixels contributes a fraction\n   * (1-8*SF) to its own smoothed image and a fraction SF to each of the three\n   * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final\n   * output.  The four corner-adjacent neighbor pixels contribute a fraction\n   * SF to just one smoothed pixel, or SF/4 to the final output; while the\n   * eight edge-adjacent neighbors contribute SF to each of two smoothed\n   * pixels, or SF/2 overall.  In order to use integer arithmetic, these\n   * factors are scaled by 2^16 = 65536.\n   * Also recall that SF = smoothing_factor / 1024.\n   */\n\n  memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */\n  neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */\n\n  inrow = outrow = 0;\n  while (inrow < cinfo->max_v_samp_factor) {\n    outptr = output_data[outrow];\n    inptr0 = input_data[inrow];\n    inptr1 = input_data[inrow+1];\n    above_ptr = input_data[inrow-1];\n    below_ptr = input_data[inrow+2];\n\n    /* Special case for first column: pretend column -1 is same as column 0 */\n    membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +\n\t\tGETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);\n    neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +\n\t       GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +\n\t       GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +\n\t       GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);\n    neighsum += neighsum;\n    neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +\n\t\tGETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);\n    membersum = membersum * memberscale + neighsum * neighscale;\n    *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);\n    inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;\n\n    for (colctr = output_cols - 2; colctr > 0; colctr--) {\n      /* sum of pixels directly mapped to this output element */\n      membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +\n\t\t  GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);\n      /* sum of edge-neighbor pixels */\n      neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +\n\t\t GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +\n\t\t GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +\n\t\t GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);\n      /* The edge-neighbors count twice as much as corner-neighbors */\n      neighsum += neighsum;\n      /* Add in the corner-neighbors */\n      neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) +\n\t\t  GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);\n      /* form final output scaled up by 2^16 */\n      membersum = membersum * memberscale + neighsum * neighscale;\n      /* round, descale and output it */\n      *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);\n      inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;\n    }\n\n    /* Special case for last column */\n    membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +\n\t\tGETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);\n    neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +\n\t       GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +\n\t       GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +\n\t       GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);\n    neighsum += neighsum;\n    neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +\n\t\tGETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);\n    membersum = membersum * memberscale + neighsum * neighscale;\n    *outptr = (JSAMPLE) ((membersum + 32768) >> 16);\n\n    inrow += 2;\n    outrow++;\n  }\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the special case of a full-size component,\n * with smoothing.  One row of context is required.\n */\n\nMETHODDEF(void)\nfullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n\t\t\t    JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int inrow;\n  JDIMENSION colctr;\n  JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;\n  register JSAMPROW inptr, above_ptr, below_ptr, outptr;\n  INT32 membersum, neighsum, memberscale, neighscale;\n  int colsum, lastcolsum, nextcolsum;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,\n\t\t    cinfo->image_width, output_cols);\n\n  /* Each of the eight neighbor pixels contributes a fraction SF to the\n   * smoothed pixel, while the main pixel contributes (1-8*SF).  In order\n   * to use integer arithmetic, these factors are multiplied by 2^16 = 65536.\n   * Also recall that SF = smoothing_factor / 1024.\n   */\n\n  memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */\n  neighscale = cinfo->smoothing_factor * 64; /* scaled SF */\n\n  for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {\n    outptr = output_data[inrow];\n    inptr = input_data[inrow];\n    above_ptr = input_data[inrow-1];\n    below_ptr = input_data[inrow+1];\n\n    /* Special case for first column */\n    colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) +\n\t     GETJSAMPLE(*inptr);\n    membersum = GETJSAMPLE(*inptr++);\n    nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +\n\t\t GETJSAMPLE(*inptr);\n    neighsum = colsum + (colsum - membersum) + nextcolsum;\n    membersum = membersum * memberscale + neighsum * neighscale;\n    *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);\n    lastcolsum = colsum; colsum = nextcolsum;\n\n    for (colctr = output_cols - 2; colctr > 0; colctr--) {\n      membersum = GETJSAMPLE(*inptr++);\n      above_ptr++; below_ptr++;\n      nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +\n\t\t   GETJSAMPLE(*inptr);\n      neighsum = lastcolsum + (colsum - membersum) + nextcolsum;\n      membersum = membersum * memberscale + neighsum * neighscale;\n      *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);\n      lastcolsum = colsum; colsum = nextcolsum;\n    }\n\n    /* Special case for last column */\n    membersum = GETJSAMPLE(*inptr);\n    neighsum = lastcolsum + (colsum - membersum) + colsum;\n    membersum = membersum * memberscale + neighsum * neighscale;\n    *outptr = (JSAMPLE) ((membersum + 32768) >> 16);\n\n  }\n}\n\n#endif /* INPUT_SMOOTHING_SUPPORTED */\n\n\n/*\n * Module initialization routine for downsampling.\n * Note that we must select a routine for each component.\n */\n\nGLOBAL(void)\njinit_downsampler (j_compress_ptr cinfo)\n{\n  my_downsample_ptr downsample;\n  int ci;\n  jpeg_component_info * compptr;\n  boolean smoothok = TRUE;\n  int h_in_group, v_in_group, h_out_group, v_out_group;\n\n  downsample = (my_downsample_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_downsampler));\n  cinfo->downsample = (struct jpeg_downsampler *) downsample;\n  downsample->pub.start_pass = start_pass_downsample;\n  downsample->pub.downsample = sep_downsample;\n  downsample->pub.need_context_rows = FALSE;\n\n  if (cinfo->CCIR601_sampling)\n    ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);\n\n  /* Verify we can handle the sampling factors, and set up method pointers */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Compute size of an \"output group\" for DCT scaling.  This many samples\n     * are to be converted from max_h_samp_factor * max_v_samp_factor pixels.\n     */\n    h_out_group = (compptr->h_samp_factor * compptr->DCT_h_scaled_size) /\n\t\t  cinfo->min_DCT_h_scaled_size;\n    v_out_group = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /\n\t\t  cinfo->min_DCT_v_scaled_size;\n    h_in_group = cinfo->max_h_samp_factor;\n    v_in_group = cinfo->max_v_samp_factor;\n    downsample->rowgroup_height[ci] = v_out_group; /* save for use later */\n    if (h_in_group == h_out_group && v_in_group == v_out_group) {\n#ifdef INPUT_SMOOTHING_SUPPORTED\n      if (cinfo->smoothing_factor) {\n\tdownsample->methods[ci] = fullsize_smooth_downsample;\n\tdownsample->pub.need_context_rows = TRUE;\n      } else\n#endif\n\tdownsample->methods[ci] = fullsize_downsample;\n    } else if (h_in_group == h_out_group * 2 &&\n\t       v_in_group == v_out_group) {\n      smoothok = FALSE;\n      downsample->methods[ci] = h2v1_downsample;\n    } else if (h_in_group == h_out_group * 2 &&\n\t       v_in_group == v_out_group * 2) {\n#ifdef INPUT_SMOOTHING_SUPPORTED\n      if (cinfo->smoothing_factor) {\n\tdownsample->methods[ci] = h2v2_smooth_downsample;\n\tdownsample->pub.need_context_rows = TRUE;\n      } else\n#endif\n\tdownsample->methods[ci] = h2v2_downsample;\n    } else if ((h_in_group % h_out_group) == 0 &&\n\t       (v_in_group % v_out_group) == 0) {\n      smoothok = FALSE;\n      downsample->methods[ci] = int_downsample;\n      downsample->h_expand[ci] = (UINT8) (h_in_group / h_out_group);\n      downsample->v_expand[ci] = (UINT8) (v_in_group / v_out_group);\n    } else\n      ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);\n  }\n\n#ifdef INPUT_SMOOTHING_SUPPORTED\n  if (cinfo->smoothing_factor && !smoothok)\n    TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);\n#endif\n}\n"
  },
  {
    "path": "jctrans.c",
    "content": "/*\n * jctrans.c\n *\n * Copyright (C) 1995-1998, Thomas G. Lane.\n * Modified 2000-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains library routines for transcoding compression,\n * that is, writing raw DCT coefficient arrays to an output JPEG file.\n * The routines in jcapimin.c will also be needed by a transcoder.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Forward declarations */\nLOCAL(void) transencode_master_selection\n\tJPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));\nLOCAL(void) transencode_coef_controller\n\tJPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));\n\n\n/*\n * Compression initialization for writing raw-coefficient data.\n * Before calling this, all parameters and a data destination must be set up.\n * Call jpeg_finish_compress() to actually write the data.\n *\n * The number of passed virtual arrays must match cinfo->num_components.\n * Note that the virtual arrays need not be filled or even realized at\n * the time write_coefficients is called; indeed, if the virtual arrays\n * were requested from this compression object's memory manager, they\n * typically will be realized during this routine and filled afterwards.\n */\n\nGLOBAL(void)\njpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)\n{\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  /* Mark all tables to be written */\n  jpeg_suppress_tables(cinfo, FALSE);\n  /* (Re)initialize error mgr and destination modules */\n  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);\n  (*cinfo->dest->init_destination) (cinfo);\n  /* Perform master selection of active modules */\n  transencode_master_selection(cinfo, coef_arrays);\n  /* Wait for jpeg_finish_compress() call */\n  cinfo->next_scanline = 0;\t/* so jpeg_write_marker works */\n  cinfo->global_state = CSTATE_WRCOEFS;\n}\n\n\n/*\n * Initialize the compression object with default parameters,\n * then copy from the source object all parameters needed for lossless\n * transcoding.  Parameters that can be varied without loss (such as\n * scan script and Huffman optimization) are left in their default states.\n */\n\nGLOBAL(void)\njpeg_copy_critical_parameters (j_decompress_ptr srcinfo,\n\t\t\t       j_compress_ptr dstinfo)\n{\n  JQUANT_TBL ** qtblptr;\n  jpeg_component_info *incomp, *outcomp;\n  JQUANT_TBL *c_quant, *slot_quant;\n  int tblno, ci, coefi;\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (dstinfo->global_state != CSTATE_START)\n    ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);\n  /* Copy fundamental image dimensions */\n  dstinfo->image_width = srcinfo->image_width;\n  dstinfo->image_height = srcinfo->image_height;\n  dstinfo->input_components = srcinfo->num_components;\n  dstinfo->in_color_space = srcinfo->jpeg_color_space;\n  dstinfo->jpeg_width = srcinfo->output_width;\n  dstinfo->jpeg_height = srcinfo->output_height;\n  dstinfo->min_DCT_h_scaled_size = srcinfo->min_DCT_h_scaled_size;\n  dstinfo->min_DCT_v_scaled_size = srcinfo->min_DCT_v_scaled_size;\n  /* Initialize all parameters to default values */\n  jpeg_set_defaults(dstinfo);\n  /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.\n   * Fix it to get the right header markers for the image colorspace.\n   * Note: Entropy table assignment in jpeg_set_colorspace depends\n   * on color_transform.\n   */\n  dstinfo->color_transform = srcinfo->color_transform;\n  jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);\n  dstinfo->data_precision = srcinfo->data_precision;\n  dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;\n  /* Copy the source's quantization tables. */\n  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {\n    if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {\n      qtblptr = & dstinfo->quant_tbl_ptrs[tblno];\n      if (*qtblptr == NULL)\n\t*qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo);\n      MEMCOPY((*qtblptr)->quantval,\n\t      srcinfo->quant_tbl_ptrs[tblno]->quantval,\n\t      SIZEOF((*qtblptr)->quantval));\n      (*qtblptr)->sent_table = FALSE;\n    }\n  }\n  /* Copy the source's per-component info.\n   * Note we assume jpeg_set_defaults has allocated the dest comp_info array.\n   */\n  dstinfo->num_components = srcinfo->num_components;\n  if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS)\n    ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,\n\t     MAX_COMPONENTS);\n  for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;\n       ci < dstinfo->num_components; ci++, incomp++, outcomp++) {\n    outcomp->component_id = incomp->component_id;\n    outcomp->h_samp_factor = incomp->h_samp_factor;\n    outcomp->v_samp_factor = incomp->v_samp_factor;\n    outcomp->quant_tbl_no = incomp->quant_tbl_no;\n    /* Make sure saved quantization table for component matches the qtable\n     * slot.  If not, the input file re-used this qtable slot.\n     * IJG encoder currently cannot duplicate this.\n     */\n    tblno = outcomp->quant_tbl_no;\n    if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||\n\tsrcinfo->quant_tbl_ptrs[tblno] == NULL)\n      ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);\n    slot_quant = srcinfo->quant_tbl_ptrs[tblno];\n    c_quant = incomp->quant_table;\n    if (c_quant != NULL) {\n      for (coefi = 0; coefi < DCTSIZE2; coefi++) {\n\tif (c_quant->quantval[coefi] != slot_quant->quantval[coefi])\n\t  ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);\n      }\n    }\n    /* Note: we do not copy the source's entropy table assignments;\n     * instead we rely on jpeg_set_colorspace to have made a suitable choice.\n     */\n  }\n  /* Also copy JFIF version and resolution information, if available.\n   * Strictly speaking this isn't \"critical\" info, but it's nearly\n   * always appropriate to copy it if available.  In particular,\n   * if the application chooses to copy JFIF 1.02 extension markers from\n   * the source file, we need to copy the version to make sure we don't\n   * emit a file that has 1.02 extensions but a claimed version of 1.01.\n   */\n  if (srcinfo->saw_JFIF_marker) {\n    if (srcinfo->JFIF_major_version == 1 ||\n\tsrcinfo->JFIF_major_version == 2) {\n      dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;\n      dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;\n    }\n    dstinfo->density_unit = srcinfo->density_unit;\n    dstinfo->X_density = srcinfo->X_density;\n    dstinfo->Y_density = srcinfo->Y_density;\n  }\n}\n\n\n/*\n * Master selection of compression modules for transcoding.\n * This substitutes for jcinit.c's initialization of the full compressor.\n */\n\nLOCAL(void)\ntransencode_master_selection (j_compress_ptr cinfo,\n\t\t\t      jvirt_barray_ptr * coef_arrays)\n{\n  /* Initialize master control (includes parameter checking/processing) */\n  jinit_c_master_control(cinfo, TRUE /* transcode only */);\n\n  /* Entropy encoding: either Huffman or arithmetic coding. */\n  if (cinfo->arith_code)\n    jinit_arith_encoder(cinfo);\n  else {\n    jinit_huff_encoder(cinfo);\n  }\n\n  /* We need a special coefficient buffer controller. */\n  transencode_coef_controller(cinfo, coef_arrays);\n\n  jinit_marker_writer(cinfo);\n\n  /* We can now tell the memory manager to allocate virtual arrays. */\n  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);\n\n  /* Write the datastream header (SOI, JFIF) immediately.\n   * Frame and scan headers are postponed till later.\n   * This lets application insert special markers after the SOI.\n   */\n  (*cinfo->marker->write_file_header) (cinfo);\n}\n\n\n/*\n * The rest of this file is a special implementation of the coefficient\n * buffer controller.  This is similar to jccoefct.c, but it handles only\n * output from presupplied virtual arrays.  Furthermore, we generate any\n * dummy padding blocks on-the-fly rather than expecting them to be present\n * in the arrays.\n */\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_c_coef_controller pub; /* public fields */\n\n  JDIMENSION iMCU_row_num;\t/* iMCU row # within image */\n  JDIMENSION mcu_ctr;\t\t/* counts MCUs processed in current row */\n  int MCU_vert_offset;\t\t/* counts MCU rows within iMCU row */\n  int MCU_rows_per_iMCU_row;\t/* number of such rows needed */\n\n  /* Virtual block array for each component. */\n  jvirt_barray_ptr * whole_image;\n\n  /* Workspace for constructing dummy blocks at right/bottom edges. */\n  JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];\n} my_coef_controller;\n\ntypedef my_coef_controller * my_coef_ptr;\n\n\nLOCAL(void)\nstart_iMCU_row (j_compress_ptr cinfo)\n/* Reset within-iMCU-row counters for a new row */\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  /* In an interleaved scan, an MCU row is the same as an iMCU row.\n   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.\n   * But at the bottom of the image, process only what's left.\n   */\n  if (cinfo->comps_in_scan > 1) {\n    coef->MCU_rows_per_iMCU_row = 1;\n  } else {\n    if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;\n    else\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;\n  }\n\n  coef->mcu_ctr = 0;\n  coef->MCU_vert_offset = 0;\n}\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  if (pass_mode != JBUF_CRANK_DEST)\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  coef->iMCU_row_num = 0;\n  start_iMCU_row(cinfo);\n}\n\n\n/*\n * Process some data.\n * We process the equivalent of one fully interleaved MCU row (\"iMCU\" row)\n * per call, ie, v_samp_factor block rows for each component in the scan.\n * The data is obtained from the virtual arrays and fed to the entropy coder.\n * Returns TRUE if the iMCU row is completed, FALSE if suspended.\n *\n * NB: input_buf is ignored; it is likely to be a NULL pointer.\n */\n\nMETHODDEF(boolean)\ncompress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;\t/* index of current MCU within row */\n  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  int blkn, ci, xindex, yindex, yoffset, blockcnt;\n  JDIMENSION start_col;\n  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];\n  JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];\n  JBLOCKROW buffer_ptr;\n  jpeg_component_info *compptr;\n\n  /* Align the virtual buffers for the components used in this scan. */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    buffer[ci] = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],\n       coef->iMCU_row_num * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, FALSE);\n  }\n\n  /* Loop to process one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;\n\t MCU_col_num++) {\n      /* Construct list of pointers to DCT blocks belonging to this MCU */\n      blkn = 0;\t\t\t/* index of current DCT block within MCU */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n\tcompptr = cinfo->cur_comp_info[ci];\n\tstart_col = MCU_col_num * compptr->MCU_width;\n\tblockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width\n\t\t\t\t\t\t: compptr->last_col_width;\n\tfor (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n\t  if (coef->iMCU_row_num < last_iMCU_row ||\n\t      yindex+yoffset < compptr->last_row_height) {\n\t    /* Fill in pointers to real blocks in this row */\n\t    buffer_ptr = buffer[ci][yindex+yoffset] + start_col;\n\t    for (xindex = 0; xindex < blockcnt; xindex++)\n\t      MCU_buffer[blkn++] = buffer_ptr++;\n\t  } else {\n\t    /* At bottom of image, need a whole row of dummy blocks */\n\t    xindex = 0;\n\t  }\n\t  /* Fill in any dummy blocks needed in this row.\n\t   * Dummy blocks are filled in the same way as in jccoefct.c:\n\t   * all zeroes in the AC entries, DC entries equal to previous\n\t   * block's DC value.  The init routine has already zeroed the\n\t   * AC entries, so we need only set the DC entries correctly.\n\t   */\n\t  for (; xindex < compptr->MCU_width; xindex++) {\n\t    MCU_buffer[blkn] = coef->dummy_buffer[blkn];\n\t    MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];\n\t    blkn++;\n\t  }\n\t}\n      }\n      /* Try to write the MCU. */\n      if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {\n\t/* Suspension forced; update state counters and exit */\n\tcoef->MCU_vert_offset = yoffset;\n\tcoef->mcu_ctr = MCU_col_num;\n\treturn FALSE;\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->mcu_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  coef->iMCU_row_num++;\n  start_iMCU_row(cinfo);\n  return TRUE;\n}\n\n\n/*\n * Initialize coefficient buffer controller.\n *\n * Each passed coefficient array must be the right size for that\n * coefficient: width_in_blocks wide and height_in_blocks high,\n * with unitheight at least v_samp_factor.\n */\n\nLOCAL(void)\ntransencode_coef_controller (j_compress_ptr cinfo,\n\t\t\t     jvirt_barray_ptr * coef_arrays)\n{\n  my_coef_ptr coef;\n  JBLOCKROW buffer;\n  int i;\n\n  coef = (my_coef_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_coef_controller));\n  cinfo->coef = &coef->pub;\n  coef->pub.start_pass = start_pass_coef;\n  coef->pub.compress_data = compress_output;\n\n  /* Save pointer to virtual arrays */\n  coef->whole_image = coef_arrays;\n\n  /* Allocate and pre-zero space for dummy DCT blocks. */\n  buffer = (JBLOCKROW)\n    (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tC_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));\n  FMEMZERO((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));\n  for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {\n    coef->dummy_buffer[i] = buffer + i;\n  }\n}\n"
  },
  {
    "path": "jdapimin.c",
    "content": "/*\n * jdapimin.c\n *\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * Modified 2009-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains application interface code for the decompression half\n * of the JPEG library.  These are the \"minimum\" API routines that may be\n * needed in either the normal full-decompression case or the\n * transcoding-only case.\n *\n * Most of the routines intended to be called directly by an application\n * are in this file or in jdapistd.c.  But also see jcomapi.c for routines\n * shared by compression and decompression, and jdtrans.c for the transcoding\n * case.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Initialization of a JPEG decompression object.\n * The error manager must already be set up (in case memory manager fails).\n */\n\nGLOBAL(void)\njpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)\n{\n  int i;\n\n  /* Guard against version mismatches between library and caller. */\n  cinfo->mem = NULL;\t\t/* so jpeg_destroy knows mem mgr not called */\n  if (version != JPEG_LIB_VERSION)\n    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);\n  if (structsize != SIZEOF(struct jpeg_decompress_struct))\n    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, \n\t     (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize);\n\n  /* For debugging purposes, we zero the whole master structure.\n   * But the application has already set the err pointer, and may have set\n   * client_data, so we have to save and restore those fields.\n   * Note: if application hasn't set client_data, tools like Purify may\n   * complain here.\n   */\n  {\n    struct jpeg_error_mgr * err = cinfo->err;\n    void * client_data = cinfo->client_data; /* ignore Purify complaint here */\n    MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct));\n    cinfo->err = err;\n    cinfo->client_data = client_data;\n  }\n  cinfo->is_decompressor = TRUE;\n\n  /* Initialize a memory manager instance for this object */\n  jinit_memory_mgr((j_common_ptr) cinfo);\n\n  /* Zero out pointers to permanent structures. */\n  cinfo->progress = NULL;\n  cinfo->src = NULL;\n\n  for (i = 0; i < NUM_QUANT_TBLS; i++)\n    cinfo->quant_tbl_ptrs[i] = NULL;\n\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    cinfo->dc_huff_tbl_ptrs[i] = NULL;\n    cinfo->ac_huff_tbl_ptrs[i] = NULL;\n  }\n\n  /* Initialize marker processor so application can override methods\n   * for COM, APPn markers before calling jpeg_read_header.\n   */\n  cinfo->marker_list = NULL;\n  jinit_marker_reader(cinfo);\n\n  /* And initialize the overall input controller. */\n  jinit_input_controller(cinfo);\n\n  /* OK, I'm ready */\n  cinfo->global_state = DSTATE_START;\n}\n\n\n/*\n * Destruction of a JPEG decompression object\n */\n\nGLOBAL(void)\njpeg_destroy_decompress (j_decompress_ptr cinfo)\n{\n  jpeg_destroy((j_common_ptr) cinfo); /* use common routine */\n}\n\n\n/*\n * Abort processing of a JPEG decompression operation,\n * but don't destroy the object itself.\n */\n\nGLOBAL(void)\njpeg_abort_decompress (j_decompress_ptr cinfo)\n{\n  jpeg_abort((j_common_ptr) cinfo); /* use common routine */\n}\n\n\n/*\n * Set default decompression parameters.\n */\n\nLOCAL(void)\ndefault_decompress_parms (j_decompress_ptr cinfo)\n{\n  int cid0, cid1, cid2;\n\n  /* Guess the input colorspace, and set output colorspace accordingly. */\n  /* Note application may override our guesses. */\n  switch (cinfo->num_components) {\n  case 1:\n    cinfo->jpeg_color_space = JCS_GRAYSCALE;\n    cinfo->out_color_space = JCS_GRAYSCALE;\n    break;\n    \n  case 3:\n    cid0 = cinfo->comp_info[0].component_id;\n    cid1 = cinfo->comp_info[1].component_id;\n    cid2 = cinfo->comp_info[2].component_id;\n\n    /* First try to guess from the component IDs */\n    if      (cid0 == 0x01 && cid1 == 0x02 && cid2 == 0x03)\n      cinfo->jpeg_color_space = JCS_YCbCr;\n    else if (cid0 == 0x01 && cid1 == 0x22 && cid2 == 0x23)\n      cinfo->jpeg_color_space = JCS_BG_YCC;\n    else if (cid0 == 0x52 && cid1 == 0x47 && cid2 == 0x42)\n      cinfo->jpeg_color_space = JCS_RGB;\t/* ASCII 'R', 'G', 'B' */\n    else if (cid0 == 0x72 && cid1 == 0x67 && cid2 == 0x62)\n      cinfo->jpeg_color_space = JCS_BG_RGB;\t/* ASCII 'r', 'g', 'b' */\n    else if (cinfo->saw_JFIF_marker)\n      cinfo->jpeg_color_space = JCS_YCbCr;\t/* assume it's YCbCr */\n    else if (cinfo->saw_Adobe_marker) {\n      switch (cinfo->Adobe_transform) {\n      case 0:\n\tcinfo->jpeg_color_space = JCS_RGB;\n\tbreak;\n      case 1:\n\tcinfo->jpeg_color_space = JCS_YCbCr;\n\tbreak;\n      default:\n\tWARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);\n\tcinfo->jpeg_color_space = JCS_YCbCr;\t/* assume it's YCbCr */\n\tbreak;\n      }\n    } else {\n      TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);\n      cinfo->jpeg_color_space = JCS_YCbCr;\t/* assume it's YCbCr */\n    }\n    /* Always guess RGB is proper output colorspace. */\n    cinfo->out_color_space = JCS_RGB;\n    break;\n    \n  case 4:\n    if (cinfo->saw_Adobe_marker) {\n      switch (cinfo->Adobe_transform) {\n      case 0:\n\tcinfo->jpeg_color_space = JCS_CMYK;\n\tbreak;\n      case 2:\n\tcinfo->jpeg_color_space = JCS_YCCK;\n\tbreak;\n      default:\n\tWARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);\n\tcinfo->jpeg_color_space = JCS_YCCK;\t/* assume it's YCCK */\n\tbreak;\n      }\n    } else {\n      /* No special markers, assume straight CMYK. */\n      cinfo->jpeg_color_space = JCS_CMYK;\n    }\n    cinfo->out_color_space = JCS_CMYK;\n    break;\n    \n  default:\n    cinfo->jpeg_color_space = JCS_UNKNOWN;\n    cinfo->out_color_space = JCS_UNKNOWN;\n    break;\n  }\n\n  /* Set defaults for other decompression parameters. */\n  cinfo->scale_num = cinfo->block_size;\t\t/* 1:1 scaling */\n  cinfo->scale_denom = cinfo->block_size;\n  cinfo->output_gamma = 1.0;\n  cinfo->buffered_image = FALSE;\n  cinfo->raw_data_out = FALSE;\n  cinfo->dct_method = JDCT_DEFAULT;\n  cinfo->do_fancy_upsampling = TRUE;\n  cinfo->do_block_smoothing = TRUE;\n  cinfo->quantize_colors = FALSE;\n  /* We set these in case application only sets quantize_colors. */\n  cinfo->dither_mode = JDITHER_FS;\n#ifdef QUANT_2PASS_SUPPORTED\n  cinfo->two_pass_quantize = TRUE;\n#else\n  cinfo->two_pass_quantize = FALSE;\n#endif\n  cinfo->desired_number_of_colors = 256;\n  cinfo->colormap = NULL;\n  /* Initialize for no mode change in buffered-image mode. */\n  cinfo->enable_1pass_quant = FALSE;\n  cinfo->enable_external_quant = FALSE;\n  cinfo->enable_2pass_quant = FALSE;\n}\n\n\n/*\n * Decompression startup: read start of JPEG datastream to see what's there.\n * Need only initialize JPEG object and supply a data source before calling.\n *\n * This routine will read as far as the first SOS marker (ie, actual start of\n * compressed data), and will save all tables and parameters in the JPEG\n * object.  It will also initialize the decompression parameters to default\n * values, and finally return JPEG_HEADER_OK.  On return, the application may\n * adjust the decompression parameters and then call jpeg_start_decompress.\n * (Or, if the application only wanted to determine the image parameters,\n * the data need not be decompressed.  In that case, call jpeg_abort or\n * jpeg_destroy to release any temporary space.)\n * If an abbreviated (tables only) datastream is presented, the routine will\n * return JPEG_HEADER_TABLES_ONLY upon reaching EOI.  The application may then\n * re-use the JPEG object to read the abbreviated image datastream(s).\n * It is unnecessary (but OK) to call jpeg_abort in this case.\n * The JPEG_SUSPENDED return code only occurs if the data source module\n * requests suspension of the decompressor.  In this case the application\n * should load more source data and then re-call jpeg_read_header to resume\n * processing.\n * If a non-suspending data source is used and require_image is TRUE, then the\n * return code need not be inspected since only JPEG_HEADER_OK is possible.\n *\n * This routine is now just a front end to jpeg_consume_input, with some\n * extra error checking.\n */\n\nGLOBAL(int)\njpeg_read_header (j_decompress_ptr cinfo, boolean require_image)\n{\n  int retcode;\n\n  if (cinfo->global_state != DSTATE_START &&\n      cinfo->global_state != DSTATE_INHEADER)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  retcode = jpeg_consume_input(cinfo);\n\n  switch (retcode) {\n  case JPEG_REACHED_SOS:\n    retcode = JPEG_HEADER_OK;\n    break;\n  case JPEG_REACHED_EOI:\n    if (require_image)\t\t/* Complain if application wanted an image */\n      ERREXIT(cinfo, JERR_NO_IMAGE);\n    /* Reset to start state; it would be safer to require the application to\n     * call jpeg_abort, but we can't change it now for compatibility reasons.\n     * A side effect is to free any temporary memory (there shouldn't be any).\n     */\n    jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */\n    retcode = JPEG_HEADER_TABLES_ONLY;\n    break;\n  case JPEG_SUSPENDED:\n    /* no work */\n    break;\n  }\n\n  return retcode;\n}\n\n\n/*\n * Consume data in advance of what the decompressor requires.\n * This can be called at any time once the decompressor object has\n * been created and a data source has been set up.\n *\n * This routine is essentially a state machine that handles a couple\n * of critical state-transition actions, namely initial setup and\n * transition from header scanning to ready-for-start_decompress.\n * All the actual input is done via the input controller's consume_input\n * method.\n */\n\nGLOBAL(int)\njpeg_consume_input (j_decompress_ptr cinfo)\n{\n  int retcode = JPEG_SUSPENDED;\n\n  /* NB: every possible DSTATE value should be listed in this switch */\n  switch (cinfo->global_state) {\n  case DSTATE_START:\n    /* Start-of-datastream actions: reset appropriate modules */\n    (*cinfo->inputctl->reset_input_controller) (cinfo);\n    /* Initialize application's data source module */\n    (*cinfo->src->init_source) (cinfo);\n    cinfo->global_state = DSTATE_INHEADER;\n    /*FALLTHROUGH*/\n  case DSTATE_INHEADER:\n    retcode = (*cinfo->inputctl->consume_input) (cinfo);\n    if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */\n      /* Set up default parameters based on header data */\n      default_decompress_parms(cinfo);\n      /* Set global state: ready for start_decompress */\n      cinfo->global_state = DSTATE_READY;\n    }\n    break;\n  case DSTATE_READY:\n    /* Can't advance past first SOS until start_decompress is called */\n    retcode = JPEG_REACHED_SOS;\n    break;\n  case DSTATE_PRELOAD:\n  case DSTATE_PRESCAN:\n  case DSTATE_SCANNING:\n  case DSTATE_RAW_OK:\n  case DSTATE_BUFIMAGE:\n  case DSTATE_BUFPOST:\n  case DSTATE_STOPPING:\n    retcode = (*cinfo->inputctl->consume_input) (cinfo);\n    break;\n  default:\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  }\n  return retcode;\n}\n\n\n/*\n * Have we finished reading the input file?\n */\n\nGLOBAL(boolean)\njpeg_input_complete (j_decompress_ptr cinfo)\n{\n  /* Check for valid jpeg object */\n  if (cinfo->global_state < DSTATE_START ||\n      cinfo->global_state > DSTATE_STOPPING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  return cinfo->inputctl->eoi_reached;\n}\n\n\n/*\n * Is there more than one scan?\n */\n\nGLOBAL(boolean)\njpeg_has_multiple_scans (j_decompress_ptr cinfo)\n{\n  /* Only valid after jpeg_read_header completes */\n  if (cinfo->global_state < DSTATE_READY ||\n      cinfo->global_state > DSTATE_STOPPING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  return cinfo->inputctl->has_multiple_scans;\n}\n\n\n/*\n * Finish JPEG decompression.\n *\n * This will normally just verify the file trailer and release temp storage.\n *\n * Returns FALSE if suspended.  The return value need be inspected only if\n * a suspending data source is used.\n */\n\nGLOBAL(boolean)\njpeg_finish_decompress (j_decompress_ptr cinfo)\n{\n  if ((cinfo->global_state == DSTATE_SCANNING ||\n       cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) {\n    /* Terminate final pass of non-buffered mode */\n    if (cinfo->output_scanline < cinfo->output_height)\n      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);\n    (*cinfo->master->finish_output_pass) (cinfo);\n    cinfo->global_state = DSTATE_STOPPING;\n  } else if (cinfo->global_state == DSTATE_BUFIMAGE) {\n    /* Finishing after a buffered-image operation */\n    cinfo->global_state = DSTATE_STOPPING;\n  } else if (cinfo->global_state != DSTATE_STOPPING) {\n    /* STOPPING = repeat call after a suspension, anything else is error */\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  }\n  /* Read until EOI */\n  while (! cinfo->inputctl->eoi_reached) {\n    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)\n      return FALSE;\t\t/* Suspend, come back later */\n  }\n  /* Do final cleanup */\n  (*cinfo->src->term_source) (cinfo);\n  /* We can use jpeg_abort to release memory and reset global_state */\n  jpeg_abort((j_common_ptr) cinfo);\n  return TRUE;\n}\n"
  },
  {
    "path": "jdapistd.c",
    "content": "/*\n * jdapistd.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2002-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains application interface code for the decompression half\n * of the JPEG library.  These are the \"standard\" API routines that are\n * used in the normal full-decompression case.  They are not used by a\n * transcoding-only application.  Note that if an application links in\n * jpeg_start_decompress, it will end up linking in the entire decompressor.\n * We thus must separate this file from jdapimin.c to avoid linking the\n * whole decompression library into a transcoder.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Forward declarations */\nLOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo));\n\n\n/*\n * Decompression initialization.\n * jpeg_read_header must be completed before calling this.\n *\n * If a multipass operating mode was selected, this will do all but the\n * last pass, and thus may take a great deal of time.\n *\n * Returns FALSE if suspended.  The return value need be inspected only if\n * a suspending data source is used.\n */\n\nGLOBAL(boolean)\njpeg_start_decompress (j_decompress_ptr cinfo)\n{\n  if (cinfo->global_state == DSTATE_READY) {\n    /* First call: initialize master control, select active modules */\n    jinit_master_decompress(cinfo);\n    if (cinfo->buffered_image) {\n      /* No more work here; expecting jpeg_start_output next */\n      cinfo->global_state = DSTATE_BUFIMAGE;\n      return TRUE;\n    }\n    cinfo->global_state = DSTATE_PRELOAD;\n  }\n  if (cinfo->global_state == DSTATE_PRELOAD) {\n    /* If file has multiple scans, absorb them all into the coef buffer */\n    if (cinfo->inputctl->has_multiple_scans) {\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n      for (;;) {\n\tint retcode;\n\t/* Call progress monitor hook if present */\n\tif (cinfo->progress != NULL)\n\t  (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n\t/* Absorb some more input */\n\tretcode = (*cinfo->inputctl->consume_input) (cinfo);\n\tif (retcode == JPEG_SUSPENDED)\n\t  return FALSE;\n\tif (retcode == JPEG_REACHED_EOI)\n\t  break;\n\t/* Advance progress counter if appropriate */\n\tif (cinfo->progress != NULL &&\n\t    (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {\n\t  if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {\n\t    /* jdmaster underestimated number of scans; ratchet up one scan */\n\t    cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;\n\t  }\n\t}\n      }\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n    }\n    cinfo->output_scan_number = cinfo->input_scan_number;\n  } else if (cinfo->global_state != DSTATE_PRESCAN)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  /* Perform any dummy output passes, and set up for the final pass */\n  return output_pass_setup(cinfo);\n}\n\n\n/*\n * Set up for an output pass, and perform any dummy pass(es) needed.\n * Common subroutine for jpeg_start_decompress and jpeg_start_output.\n * Entry: global_state = DSTATE_PRESCAN only if previously suspended.\n * Exit: If done, returns TRUE and sets global_state for proper output mode.\n *       If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN.\n */\n\nLOCAL(boolean)\noutput_pass_setup (j_decompress_ptr cinfo)\n{\n  if (cinfo->global_state != DSTATE_PRESCAN) {\n    /* First call: do pass setup */\n    (*cinfo->master->prepare_for_output_pass) (cinfo);\n    cinfo->output_scanline = 0;\n    cinfo->global_state = DSTATE_PRESCAN;\n  }\n  /* Loop over any required dummy passes */\n  while (cinfo->master->is_dummy_pass) {\n#ifdef QUANT_2PASS_SUPPORTED\n    /* Crank through the dummy pass */\n    while (cinfo->output_scanline < cinfo->output_height) {\n      JDIMENSION last_scanline;\n      /* Call progress monitor hook if present */\n      if (cinfo->progress != NULL) {\n\tcinfo->progress->pass_counter = (long) cinfo->output_scanline;\n\tcinfo->progress->pass_limit = (long) cinfo->output_height;\n\t(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n      }\n      /* Process some data */\n      last_scanline = cinfo->output_scanline;\n      (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL,\n\t\t\t\t    &cinfo->output_scanline, (JDIMENSION) 0);\n      if (cinfo->output_scanline == last_scanline)\n\treturn FALSE;\t\t/* No progress made, must suspend */\n    }\n    /* Finish up dummy pass, and set up for another one */\n    (*cinfo->master->finish_output_pass) (cinfo);\n    (*cinfo->master->prepare_for_output_pass) (cinfo);\n    cinfo->output_scanline = 0;\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif /* QUANT_2PASS_SUPPORTED */\n  }\n  /* Ready for application to drive output pass through\n   * jpeg_read_scanlines or jpeg_read_raw_data.\n   */\n  cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;\n  return TRUE;\n}\n\n\n/*\n * Read some scanlines of data from the JPEG decompressor.\n *\n * The return value will be the number of lines actually read.\n * This may be less than the number requested in several cases,\n * including bottom of image, data source suspension, and operating\n * modes that emit multiple scanlines at a time.\n *\n * Note: we warn about excess calls to jpeg_read_scanlines() since\n * this likely signals an application programmer error.  However,\n * an oversize buffer (max_lines > scanlines remaining) is not an error.\n */\n\nGLOBAL(JDIMENSION)\njpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,\n\t\t     JDIMENSION max_lines)\n{\n  JDIMENSION row_ctr;\n\n  if (cinfo->global_state != DSTATE_SCANNING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  if (cinfo->output_scanline >= cinfo->output_height) {\n    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);\n    return 0;\n  }\n\n  /* Call progress monitor hook if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->pass_counter = (long) cinfo->output_scanline;\n    cinfo->progress->pass_limit = (long) cinfo->output_height;\n    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n  }\n\n  /* Process some data */\n  row_ctr = 0;\n  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);\n  cinfo->output_scanline += row_ctr;\n  return row_ctr;\n}\n\n\n/*\n * Alternate entry point to read raw data.\n * Processes exactly one iMCU row per call, unless suspended.\n */\n\nGLOBAL(JDIMENSION)\njpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,\n\t\t    JDIMENSION max_lines)\n{\n  JDIMENSION lines_per_iMCU_row;\n\n  if (cinfo->global_state != DSTATE_RAW_OK)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  if (cinfo->output_scanline >= cinfo->output_height) {\n    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);\n    return 0;\n  }\n\n  /* Call progress monitor hook if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->pass_counter = (long) cinfo->output_scanline;\n    cinfo->progress->pass_limit = (long) cinfo->output_height;\n    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n  }\n\n  /* Verify that at least one iMCU row can be returned. */\n  lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_v_scaled_size;\n  if (max_lines < lines_per_iMCU_row)\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* Decompress directly into user's buffer. */\n  if (! (*cinfo->coef->decompress_data) (cinfo, data))\n    return 0;\t\t\t/* suspension forced, can do nothing more */\n\n  /* OK, we processed one iMCU row. */\n  cinfo->output_scanline += lines_per_iMCU_row;\n  return lines_per_iMCU_row;\n}\n\n\n/* Additional entry points for buffered-image mode. */\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n\n/*\n * Initialize for an output pass in buffered-image mode.\n */\n\nGLOBAL(boolean)\njpeg_start_output (j_decompress_ptr cinfo, int scan_number)\n{\n  if (cinfo->global_state != DSTATE_BUFIMAGE &&\n      cinfo->global_state != DSTATE_PRESCAN)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  /* Limit scan number to valid range */\n  if (scan_number <= 0)\n    scan_number = 1;\n  if (cinfo->inputctl->eoi_reached &&\n      scan_number > cinfo->input_scan_number)\n    scan_number = cinfo->input_scan_number;\n  cinfo->output_scan_number = scan_number;\n  /* Perform any dummy output passes, and set up for the real pass */\n  return output_pass_setup(cinfo);\n}\n\n\n/*\n * Finish up after an output pass in buffered-image mode.\n *\n * Returns FALSE if suspended.  The return value need be inspected only if\n * a suspending data source is used.\n */\n\nGLOBAL(boolean)\njpeg_finish_output (j_decompress_ptr cinfo)\n{\n  if ((cinfo->global_state == DSTATE_SCANNING ||\n       cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {\n    /* Terminate this pass. */\n    /* We do not require the whole pass to have been completed. */\n    (*cinfo->master->finish_output_pass) (cinfo);\n    cinfo->global_state = DSTATE_BUFPOST;\n  } else if (cinfo->global_state != DSTATE_BUFPOST) {\n    /* BUFPOST = repeat call after a suspension, anything else is error */\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  }\n  /* Read markers looking for SOS or EOI */\n  while (cinfo->input_scan_number <= cinfo->output_scan_number &&\n\t ! cinfo->inputctl->eoi_reached) {\n    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)\n      return FALSE;\t\t/* Suspend, come back later */\n  }\n  cinfo->global_state = DSTATE_BUFIMAGE;\n  return TRUE;\n}\n\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n"
  },
  {
    "path": "jdarith.c",
    "content": "/*\n * jdarith.c\n *\n * Developed 1997-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains portable arithmetic entropy decoding routines for JPEG\n * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).\n *\n * Both sequential and progressive modes are supported in this single module.\n *\n * Suspension is not currently supported in this module.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Expanded entropy decoder object for arithmetic decoding. */\n\ntypedef struct {\n  struct jpeg_entropy_decoder pub; /* public fields */\n\n  INT32 c;       /* C register, base of coding interval + input bit buffer */\n  INT32 a;               /* A register, normalized size of coding interval */\n  int ct;     /* bit shift counter, # of bits left in bit buffer part of C */\n                                                         /* init: ct = -16 */\n                                                         /* run: ct = 0..7 */\n                                                         /* error: ct = -1 */\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n  int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */\n\n  unsigned int restarts_to_go;\t/* MCUs left in this restart interval */\n\n  /* Pointers to statistics areas (these workspaces have image lifespan) */\n  unsigned char * dc_stats[NUM_ARITH_TBLS];\n  unsigned char * ac_stats[NUM_ARITH_TBLS];\n\n  /* Statistics bin for coding with fixed probability 0.5 */\n  unsigned char fixed_bin[4];\n} arith_entropy_decoder;\n\ntypedef arith_entropy_decoder * arith_entropy_ptr;\n\n/* The following two definitions specify the allocation chunk size\n * for the statistics area.\n * According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least\n * 49 statistics bins for DC, and 245 statistics bins for AC coding.\n *\n * We use a compact representation with 1 byte per statistics bin,\n * thus the numbers directly represent byte sizes.\n * This 1 byte per statistics bin contains the meaning of the MPS\n * (more probable symbol) in the highest bit (mask 0x80), and the\n * index into the probability estimation state machine table\n * in the lower bits (mask 0x7F).\n */\n\n#define DC_STAT_BINS 64\n#define AC_STAT_BINS 256\n\n\nLOCAL(int)\nget_byte (j_decompress_ptr cinfo)\n/* Read next input byte; we do not support suspension in this module. */\n{\n  struct jpeg_source_mgr * src = cinfo->src;\n\n  if (src->bytes_in_buffer == 0)\n    if (! (*src->fill_input_buffer) (cinfo))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n  src->bytes_in_buffer--;\n  return GETJOCTET(*src->next_input_byte++);\n}\n\n\n/*\n * The core arithmetic decoding routine (common in JPEG and JBIG).\n * This needs to go as fast as possible.\n * Machine-dependent optimization facilities\n * are not utilized in this portable implementation.\n * However, this code should be fairly efficient and\n * may be a good base for further optimizations anyway.\n *\n * Return value is 0 or 1 (binary decision).\n *\n * Note: I've changed the handling of the code base & bit\n * buffer register C compared to other implementations\n * based on the standards layout & procedures.\n * While it also contains both the actual base of the\n * coding interval (16 bits) and the next-bits buffer,\n * the cut-point between these two parts is floating\n * (instead of fixed) with the bit shift counter CT.\n * Thus, we also need only one (variable instead of\n * fixed size) shift for the LPS/MPS decision, and\n * we can get away with any renormalization update\n * of C (except for new data insertion, of course).\n *\n * I've also introduced a new scheme for accessing\n * the probability estimation state machine table,\n * derived from Markus Kuhn's JBIG implementation.\n */\n\nLOCAL(int)\narith_decode (j_decompress_ptr cinfo, unsigned char *st)\n{\n  register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;\n  register unsigned char nl, nm;\n  register INT32 qe, temp;\n  register int sv, data;\n\n  /* Renormalization & data input per section D.2.6 */\n  while (e->a < 0x8000L) {\n    if (--e->ct < 0) {\n      /* Need to fetch next data byte */\n      if (cinfo->unread_marker)\n\tdata = 0;\t\t/* stuff zero data */\n      else {\n\tdata = get_byte(cinfo);\t/* read next input byte */\n\tif (data == 0xFF) {\t/* zero stuff or marker code */\n\t  do data = get_byte(cinfo);\n\t  while (data == 0xFF);\t/* swallow extra 0xFF bytes */\n\t  if (data == 0)\n\t    data = 0xFF;\t/* discard stuffed zero byte */\n\t  else {\n\t    /* Note: Different from the Huffman decoder, hitting\n\t     * a marker while processing the compressed data\n\t     * segment is legal in arithmetic coding.\n\t     * The convention is to supply zero data\n\t     * then until decoding is complete.\n\t     */\n\t    cinfo->unread_marker = data;\n\t    data = 0;\n\t  }\n\t}\n      }\n      e->c = (e->c << 8) | data; /* insert data into C register */\n      if ((e->ct += 8) < 0)\t /* update bit shift counter */\n\t/* Need more initial bytes */\n\tif (++e->ct == 0)\n\t  /* Got 2 initial bytes -> re-init A and exit loop */\n\t  e->a = 0x8000L; /* => e->a = 0x10000L after loop exit */\n    }\n    e->a <<= 1;\n  }\n\n  /* Fetch values from our compact representation of Table D.3(D.2):\n   * Qe values and probability estimation state machine\n   */\n  sv = *st;\n  qe = jpeg_aritab[sv & 0x7F];\t/* => Qe_Value */\n  nl = qe & 0xFF; qe >>= 8;\t/* Next_Index_LPS + Switch_MPS */\n  nm = qe & 0xFF; qe >>= 8;\t/* Next_Index_MPS */\n\n  /* Decode & estimation procedures per sections D.2.4 & D.2.5 */\n  temp = e->a - qe;\n  e->a = temp;\n  temp <<= e->ct;\n  if (e->c >= temp) {\n    e->c -= temp;\n    /* Conditional LPS (less probable symbol) exchange */\n    if (e->a < qe) {\n      e->a = qe;\n      *st = (sv & 0x80) ^ nm;\t/* Estimate_after_MPS */\n    } else {\n      e->a = qe;\n      *st = (sv & 0x80) ^ nl;\t/* Estimate_after_LPS */\n      sv ^= 0x80;\t\t/* Exchange LPS/MPS */\n    }\n  } else if (e->a < 0x8000L) {\n    /* Conditional MPS (more probable symbol) exchange */\n    if (e->a < qe) {\n      *st = (sv & 0x80) ^ nl;\t/* Estimate_after_LPS */\n      sv ^= 0x80;\t\t/* Exchange LPS/MPS */\n    } else {\n      *st = (sv & 0x80) ^ nm;\t/* Estimate_after_MPS */\n    }\n  }\n\n  return sv >> 7;\n}\n\n\n/*\n * Check for a restart marker & resynchronize decoder.\n */\n\nLOCAL(void)\nprocess_restart (j_decompress_ptr cinfo)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  int ci;\n  jpeg_component_info * compptr;\n\n  /* Advance past the RSTn marker */\n  if (! (*cinfo->marker->read_restart_marker) (cinfo))\n    ERREXIT(cinfo, JERR_CANT_SUSPEND);\n\n  /* Re-initialize statistics areas */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {\n      MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);\n      /* Reset DC predictions to 0 */\n      entropy->last_dc_val[ci] = 0;\n      entropy->dc_context[ci] = 0;\n    }\n    if ((! cinfo->progressive_mode && cinfo->lim_Se) ||\n\t(cinfo->progressive_mode && cinfo->Ss)) {\n      MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);\n    }\n  }\n\n  /* Reset arithmetic decoding variables */\n  entropy->c = 0;\n  entropy->a = 0;\n  entropy->ct = -16;\t/* force reading 2 initial bytes to fill C */\n\n  /* Reset restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n}\n\n\n/*\n * Arithmetic MCU decoding.\n * Each of these routines decodes and returns one MCU's worth of\n * arithmetic-compressed coefficients.\n * The coefficients are reordered from zigzag order into natural array order,\n * but are not dequantized.\n *\n * The i'th block of the MCU is stored into the block pointed to by\n * MCU_data[i].  WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.\n */\n\n/*\n * MCU decoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\ndecode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  unsigned char *st;\n  int blkn, ci, tbl, sign;\n  int v, m;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  if (entropy->ct == -1) return TRUE;\t/* if error do nothing */\n\n  /* Outer loop handles each block in the MCU */\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n    ci = cinfo->MCU_membership[blkn];\n    tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;\n\n    /* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */\n\n    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */\n    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];\n\n    /* Figure F.19: Decode_DC_DIFF */\n    if (arith_decode(cinfo, st) == 0)\n      entropy->dc_context[ci] = 0;\n    else {\n      /* Figure F.21: Decoding nonzero value v */\n      /* Figure F.22: Decoding the sign of v */\n      sign = arith_decode(cinfo, st + 1);\n      st += 2; st += sign;\n      /* Figure F.23: Decoding the magnitude category of v */\n      if ((m = arith_decode(cinfo, st)) != 0) {\n\tst = entropy->dc_stats[tbl] + 20;\t/* Table F.4: X1 = 20 */\n\twhile (arith_decode(cinfo, st)) {\n\t  if ((m <<= 1) == 0x8000) {\n\t    WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\t    entropy->ct = -1;\t\t\t/* magnitude overflow */\n\t    return TRUE;\n\t  }\n\t  st += 1;\n\t}\n      }\n      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */\n      if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))\n\tentropy->dc_context[ci] = 0;\t\t   /* zero diff category */\n      else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))\n\tentropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */\n      else\n\tentropy->dc_context[ci] = 4 + (sign * 4);  /* small diff category */\n      v = m;\n      /* Figure F.24: Decoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n\tif (arith_decode(cinfo, st)) v |= m;\n      v += 1; if (sign) v = -v;\n      entropy->last_dc_val[ci] += v;\n    }\n\n    /* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */\n    (*block)[0] = (JCOEF) (entropy->last_dc_val[ci] << cinfo->Al);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\ndecode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  unsigned char *st;\n  int tbl, sign, k;\n  int v, m;\n  const int * natural_order;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  if (entropy->ct == -1) return TRUE;\t/* if error do nothing */\n\n  natural_order = cinfo->natural_order;\n\n  /* There is always only one block per MCU */\n  block = MCU_data[0];\n  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;\n\n  /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */\n\n  /* Figure F.20: Decode_AC_coefficients */\n  k = cinfo->Ss - 1;\n  do {\n    st = entropy->ac_stats[tbl] + 3 * k;\n    if (arith_decode(cinfo, st)) break;\t\t/* EOB flag */\n    for (;;) {\n      k++;\n      if (arith_decode(cinfo, st + 1)) break;\n      st += 3;\n      if (k >= cinfo->Se) {\n\tWARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\tentropy->ct = -1;\t\t\t/* spectral overflow */\n\treturn TRUE;\n      }\n    }\n    /* Figure F.21: Decoding nonzero value v */\n    /* Figure F.22: Decoding the sign of v */\n    sign = arith_decode(cinfo, entropy->fixed_bin);\n    st += 2;\n    /* Figure F.23: Decoding the magnitude category of v */\n    if ((m = arith_decode(cinfo, st)) != 0) {\n      if (arith_decode(cinfo, st)) {\n\tm <<= 1;\n\tst = entropy->ac_stats[tbl] +\n\t     (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);\n\twhile (arith_decode(cinfo, st)) {\n\t  if ((m <<= 1) == 0x8000) {\n\t    WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\t    entropy->ct = -1;\t\t\t/* magnitude overflow */\n\t    return TRUE;\n\t  }\n\t  st += 1;\n\t}\n      }\n    }\n    v = m;\n    /* Figure F.24: Decoding the magnitude bit pattern of v */\n    st += 14;\n    while (m >>= 1)\n      if (arith_decode(cinfo, st)) v |= m;\n    v += 1; if (sign) v = -v;\n    /* Scale and output coefficient in natural (dezigzagged) order */\n    (*block)[natural_order[k]] = (JCOEF) (v << cinfo->Al);\n  } while (k < cinfo->Se);\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for DC successive approximation refinement scan.\n * Note: we assume such scans can be multi-component,\n * although the spec is not very clear on the point.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  unsigned char *st;\n  int p1, blkn;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  st = entropy->fixed_bin;\t/* use fixed probability estimation */\n  p1 = 1 << cinfo->Al;\t\t/* 1 in the bit position being coded */\n\n  /* Outer loop handles each block in the MCU */\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    /* Encoded data is simply the next bit of the two's-complement DC value */\n    if (arith_decode(cinfo, st))\n      MCU_data[blkn][0][0] |= p1;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  JCOEFPTR thiscoef;\n  unsigned char *st;\n  int tbl, k, kex;\n  int p1, m1;\n  const int * natural_order;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  if (entropy->ct == -1) return TRUE;\t/* if error do nothing */\n\n  natural_order = cinfo->natural_order;\n\n  /* There is always only one block per MCU */\n  block = MCU_data[0];\n  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;\n\n  p1 = 1 << cinfo->Al;\t\t/* 1 in the bit position being coded */\n  m1 = (-1) << cinfo->Al;\t/* -1 in the bit position being coded */\n\n  /* Establish EOBx (previous stage end-of-block) index */\n  kex = cinfo->Se;\n  do {\n    if ((*block)[natural_order[kex]]) break;\n  } while (--kex);\n\n  k = cinfo->Ss - 1;\n  do {\n    st = entropy->ac_stats[tbl] + 3 * k;\n    if (k >= kex)\n      if (arith_decode(cinfo, st)) break;\t/* EOB flag */\n    for (;;) {\n      thiscoef = *block + natural_order[++k];\n      if (*thiscoef) {\t\t\t\t/* previously nonzero coef */\n\tif (arith_decode(cinfo, st + 2)) {\n\t  if (*thiscoef < 0)\n\t    *thiscoef += m1;\n\t  else\n\t    *thiscoef += p1;\n\t}\n\tbreak;\n      }\n      if (arith_decode(cinfo, st + 1)) {\t/* newly nonzero coef */\n\tif (arith_decode(cinfo, entropy->fixed_bin))\n\t  *thiscoef = m1;\n\telse\n\t  *thiscoef = p1;\n\tbreak;\n      }\n      st += 3;\n      if (k >= cinfo->Se) {\n\tWARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\tentropy->ct = -1;\t\t\t/* spectral overflow */\n\treturn TRUE;\n      }\n    }\n  } while (k < cinfo->Se);\n\n  return TRUE;\n}\n\n\n/*\n * Decode one MCU's worth of arithmetic-compressed coefficients.\n */\n\nMETHODDEF(boolean)\ndecode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  jpeg_component_info * compptr;\n  JBLOCKROW block;\n  unsigned char *st;\n  int blkn, ci, tbl, sign, k;\n  int v, m;\n  const int * natural_order;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  if (entropy->ct == -1) return TRUE;\t/* if error do nothing */\n\n  natural_order = cinfo->natural_order;\n\n  /* Outer loop handles each block in the MCU */\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n\n    /* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */\n\n    tbl = compptr->dc_tbl_no;\n\n    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */\n    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];\n\n    /* Figure F.19: Decode_DC_DIFF */\n    if (arith_decode(cinfo, st) == 0)\n      entropy->dc_context[ci] = 0;\n    else {\n      /* Figure F.21: Decoding nonzero value v */\n      /* Figure F.22: Decoding the sign of v */\n      sign = arith_decode(cinfo, st + 1);\n      st += 2; st += sign;\n      /* Figure F.23: Decoding the magnitude category of v */\n      if ((m = arith_decode(cinfo, st)) != 0) {\n\tst = entropy->dc_stats[tbl] + 20;\t/* Table F.4: X1 = 20 */\n\twhile (arith_decode(cinfo, st)) {\n\t  if ((m <<= 1) == 0x8000) {\n\t    WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\t    entropy->ct = -1;\t\t\t/* magnitude overflow */\n\t    return TRUE;\n\t  }\n\t  st += 1;\n\t}\n      }\n      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */\n      if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))\n\tentropy->dc_context[ci] = 0;\t\t   /* zero diff category */\n      else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))\n\tentropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */\n      else\n\tentropy->dc_context[ci] = 4 + (sign * 4);  /* small diff category */\n      v = m;\n      /* Figure F.24: Decoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n\tif (arith_decode(cinfo, st)) v |= m;\n      v += 1; if (sign) v = -v;\n      entropy->last_dc_val[ci] += v;\n    }\n\n    (*block)[0] = (JCOEF) entropy->last_dc_val[ci];\n\n    /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */\n\n    if (cinfo->lim_Se == 0) continue;\n    tbl = compptr->ac_tbl_no;\n    k = 0;\n\n    /* Figure F.20: Decode_AC_coefficients */\n    do {\n      st = entropy->ac_stats[tbl] + 3 * k;\n      if (arith_decode(cinfo, st)) break;\t/* EOB flag */\n      for (;;) {\n\tk++;\n\tif (arith_decode(cinfo, st + 1)) break;\n\tst += 3;\n\tif (k >= cinfo->lim_Se) {\n\t  WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\t  entropy->ct = -1;\t\t\t/* spectral overflow */\n\t  return TRUE;\n\t}\n      }\n      /* Figure F.21: Decoding nonzero value v */\n      /* Figure F.22: Decoding the sign of v */\n      sign = arith_decode(cinfo, entropy->fixed_bin);\n      st += 2;\n      /* Figure F.23: Decoding the magnitude category of v */\n      if ((m = arith_decode(cinfo, st)) != 0) {\n\tif (arith_decode(cinfo, st)) {\n\t  m <<= 1;\n\t  st = entropy->ac_stats[tbl] +\n\t       (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);\n\t  while (arith_decode(cinfo, st)) {\n\t    if ((m <<= 1) == 0x8000) {\n\t      WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\t      entropy->ct = -1;\t\t\t/* magnitude overflow */\n\t      return TRUE;\n\t    }\n\t    st += 1;\n\t  }\n\t}\n      }\n      v = m;\n      /* Figure F.24: Decoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n\tif (arith_decode(cinfo, st)) v |= m;\n      v += 1; if (sign) v = -v;\n      (*block)[natural_order[k]] = (JCOEF) v;\n    } while (k < cinfo->lim_Se);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Initialize for an arithmetic-compressed scan.\n */\n\nMETHODDEF(void)\nstart_pass (j_decompress_ptr cinfo)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  int ci, tbl;\n  jpeg_component_info * compptr;\n\n  if (cinfo->progressive_mode) {\n    /* Validate progressive scan parameters */\n    if (cinfo->Ss == 0) {\n      if (cinfo->Se != 0)\n\tgoto bad;\n    } else {\n      /* need not check Ss/Se < 0 since they came from unsigned bytes */\n      if (cinfo->Se < cinfo->Ss || cinfo->Se > cinfo->lim_Se)\n\tgoto bad;\n      /* AC scans may have only one component */\n      if (cinfo->comps_in_scan != 1)\n\tgoto bad;\n    }\n    if (cinfo->Ah != 0) {\n      /* Successive approximation refinement scan: must have Al = Ah-1. */\n      if (cinfo->Ah-1 != cinfo->Al)\n\tgoto bad;\n    }\n    if (cinfo->Al > 13) {\t/* need not check for < 0 */\n      bad:\n      ERREXIT4(cinfo, JERR_BAD_PROGRESSION,\n\t       cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);\n    }\n    /* Update progression status, and verify that scan order is legal.\n     * Note that inter-scan inconsistencies are treated as warnings\n     * not fatal errors ... not clear if this is right way to behave.\n     */\n    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n      int coefi, cindex = cinfo->cur_comp_info[ci]->component_index;\n      int *coef_bit_ptr = & cinfo->coef_bits[cindex][0];\n      if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */\n\tWARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);\n      for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {\n\tint expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];\n\tif (cinfo->Ah != expected)\n\t  WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);\n\tcoef_bit_ptr[coefi] = cinfo->Al;\n      }\n    }\n    /* Select MCU decoding routine */\n    if (cinfo->Ah == 0) {\n      if (cinfo->Ss == 0)\n\tentropy->pub.decode_mcu = decode_mcu_DC_first;\n      else\n\tentropy->pub.decode_mcu = decode_mcu_AC_first;\n    } else {\n      if (cinfo->Ss == 0)\n\tentropy->pub.decode_mcu = decode_mcu_DC_refine;\n      else\n\tentropy->pub.decode_mcu = decode_mcu_AC_refine;\n    }\n  } else {\n    /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.\n     * This ought to be an error condition, but we make it a warning.\n     */\n    if (cinfo->Ss != 0 || cinfo->Ah != 0 || cinfo->Al != 0 ||\n\t(cinfo->Se < DCTSIZE2 && cinfo->Se != cinfo->lim_Se))\n      WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);\n    /* Select MCU decoding routine */\n    entropy->pub.decode_mcu = decode_mcu;\n  }\n\n  /* Allocate & initialize requested statistics areas */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {\n      tbl = compptr->dc_tbl_no;\n      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)\n\tERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);\n      if (entropy->dc_stats[tbl] == NULL)\n\tentropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)\n\t  ((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS);\n      MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);\n      /* Initialize DC predictions to 0 */\n      entropy->last_dc_val[ci] = 0;\n      entropy->dc_context[ci] = 0;\n    }\n    if ((! cinfo->progressive_mode && cinfo->lim_Se) ||\n\t(cinfo->progressive_mode && cinfo->Ss)) {\n      tbl = compptr->ac_tbl_no;\n      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)\n\tERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);\n      if (entropy->ac_stats[tbl] == NULL)\n\tentropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)\n\t  ((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS);\n      MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);\n    }\n  }\n\n  /* Initialize arithmetic decoding variables */\n  entropy->c = 0;\n  entropy->a = 0;\n  entropy->ct = -16;\t/* force reading 2 initial bytes to fill C */\n\n  /* Initialize restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n}\n\n\n/*\n * Finish up at the end of an arithmetic-compressed scan.\n */\n\nMETHODDEF(void)\nfinish_pass (j_decompress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n\n/*\n * Module initialization routine for arithmetic entropy decoding.\n */\n\nGLOBAL(void)\njinit_arith_decoder (j_decompress_ptr cinfo)\n{\n  arith_entropy_ptr entropy;\n  int i;\n\n  entropy = (arith_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(arith_entropy_decoder));\n  cinfo->entropy = &entropy->pub;\n  entropy->pub.start_pass = start_pass;\n  entropy->pub.finish_pass = finish_pass;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_ARITH_TBLS; i++) {\n    entropy->dc_stats[i] = NULL;\n    entropy->ac_stats[i] = NULL;\n  }\n\n  /* Initialize index for fixed probability estimation */\n  entropy->fixed_bin[0] = 113;\n\n  if (cinfo->progressive_mode) {\n    /* Create progression status table */\n    int *coef_bit_ptr, ci;\n    cinfo->coef_bits = (int (*)[DCTSIZE2])\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  cinfo->num_components*DCTSIZE2*SIZEOF(int));\n    coef_bit_ptr = & cinfo->coef_bits[0][0];\n    for (ci = 0; ci < cinfo->num_components; ci++) \n      for (i = 0; i < DCTSIZE2; i++)\n\t*coef_bit_ptr++ = -1;\n  }\n}\n"
  },
  {
    "path": "jdatadst.c",
    "content": "/*\n * jdatadst.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains compression data destination routines for the case of\n * emitting JPEG data to memory or to a file (or any stdio stream).\n * While these routines are sufficient for most applications,\n * some will want to use a different destination manager.\n * IMPORTANT: we assume that fwrite() will correctly transcribe an array of\n * JOCTETs into 8-bit-wide elements on external storage.  If char is wider\n * than 8 bits on your machine, you may need to do some tweaking.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"\n\n#ifndef HAVE_STDLIB_H\t\t/* <stdlib.h> should declare malloc(),free() */\nextern void * malloc JPP((size_t size));\nextern void free JPP((void *ptr));\n#endif\n\n\n/* Expanded data destination object for stdio output */\n\ntypedef struct {\n  struct jpeg_destination_mgr pub; /* public fields */\n\n  FILE * outfile;\t\t/* target stream */\n  JOCTET * buffer;\t\t/* start of buffer */\n} my_destination_mgr;\n\ntypedef my_destination_mgr * my_dest_ptr;\n\n#define OUTPUT_BUF_SIZE  4096\t/* choose an efficiently fwrite'able size */\n\n\n/* Expanded data destination object for memory output */\n\ntypedef struct {\n  struct jpeg_destination_mgr pub; /* public fields */\n\n  unsigned char ** outbuffer;\t/* target buffer */\n  unsigned long * outsize;\n  unsigned char * newbuffer;\t/* newly allocated buffer */\n  JOCTET * buffer;\t\t/* start of buffer */\n  size_t bufsize;\n} my_mem_destination_mgr;\n\ntypedef my_mem_destination_mgr * my_mem_dest_ptr;\n\n\n/*\n * Initialize destination --- called by jpeg_start_compress\n * before any data is actually written.\n */\n\nMETHODDEF(void)\ninit_destination (j_compress_ptr cinfo)\n{\n  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;\n\n  /* Allocate the output buffer --- it will be released when done with image */\n  dest->buffer = (JOCTET *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  OUTPUT_BUF_SIZE * SIZEOF(JOCTET));\n\n  dest->pub.next_output_byte = dest->buffer;\n  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;\n}\n\nMETHODDEF(void)\ninit_mem_destination (j_compress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n\n/*\n * Empty the output buffer --- called whenever buffer fills up.\n *\n * In typical applications, this should write the entire output buffer\n * (ignoring the current state of next_output_byte & free_in_buffer),\n * reset the pointer & count to the start of the buffer, and return TRUE\n * indicating that the buffer has been dumped.\n *\n * In applications that need to be able to suspend compression due to output\n * overrun, a FALSE return indicates that the buffer cannot be emptied now.\n * In this situation, the compressor will return to its caller (possibly with\n * an indication that it has not accepted all the supplied scanlines).  The\n * application should resume compression after it has made more room in the\n * output buffer.  Note that there are substantial restrictions on the use of\n * suspension --- see the documentation.\n *\n * When suspending, the compressor will back up to a convenient restart point\n * (typically the start of the current MCU). next_output_byte & free_in_buffer\n * indicate where the restart point will be if the current call returns FALSE.\n * Data beyond this point will be regenerated after resumption, so do not\n * write it out when emptying the buffer externally.\n */\n\nMETHODDEF(boolean)\nempty_output_buffer (j_compress_ptr cinfo)\n{\n  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;\n\n  if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) !=\n      (size_t) OUTPUT_BUF_SIZE)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n\n  dest->pub.next_output_byte = dest->buffer;\n  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;\n\n  return TRUE;\n}\n\nMETHODDEF(boolean)\nempty_mem_output_buffer (j_compress_ptr cinfo)\n{\n  size_t nextsize;\n  JOCTET * nextbuffer;\n  my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;\n\n  /* Try to allocate new buffer with double size */\n  nextsize = dest->bufsize * 2;\n  nextbuffer = (JOCTET *) malloc(nextsize);\n\n  if (nextbuffer == NULL)\n    ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);\n\n  MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);\n\n  if (dest->newbuffer != NULL)\n    free(dest->newbuffer);\n\n  dest->newbuffer = nextbuffer;\n\n  dest->pub.next_output_byte = nextbuffer + dest->bufsize;\n  dest->pub.free_in_buffer = dest->bufsize;\n\n  dest->buffer = nextbuffer;\n  dest->bufsize = nextsize;\n\n  return TRUE;\n}\n\n\n/*\n * Terminate destination --- called by jpeg_finish_compress\n * after all data has been written.  Usually needs to flush buffer.\n *\n * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding\n * application must deal with any cleanup that should happen even\n * for error exit.\n */\n\nMETHODDEF(void)\nterm_destination (j_compress_ptr cinfo)\n{\n  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;\n  size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;\n\n  /* Write any data remaining in the buffer */\n  if (datacount > 0) {\n    if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)\n      ERREXIT(cinfo, JERR_FILE_WRITE);\n  }\n  fflush(dest->outfile);\n  /* Make sure we wrote the output file OK */\n  if (ferror(dest->outfile))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\nMETHODDEF(void)\nterm_mem_destination (j_compress_ptr cinfo)\n{\n  my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;\n\n  *dest->outbuffer = dest->buffer;\n  *dest->outsize = dest->bufsize - dest->pub.free_in_buffer;\n}\n\n\n/*\n * Prepare for output to a stdio stream.\n * The caller must have already opened the stream, and is responsible\n * for closing it after finishing compression.\n */\n\nGLOBAL(void)\njpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)\n{\n  my_dest_ptr dest;\n\n  /* The destination object is made permanent so that multiple JPEG images\n   * can be written to the same file without re-executing jpeg_stdio_dest.\n   * This makes it dangerous to use this manager and a different destination\n   * manager serially with the same JPEG object, because their private object\n   * sizes may be different.  Caveat programmer.\n   */\n  if (cinfo->dest == NULL) {\t/* first time for this JPEG object? */\n    cinfo->dest = (struct jpeg_destination_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  SIZEOF(my_destination_mgr));\n  }\n\n  dest = (my_dest_ptr) cinfo->dest;\n  dest->pub.init_destination = init_destination;\n  dest->pub.empty_output_buffer = empty_output_buffer;\n  dest->pub.term_destination = term_destination;\n  dest->outfile = outfile;\n}\n\n\n/*\n * Prepare for output to a memory buffer.\n * The caller may supply an own initial buffer with appropriate size.\n * Otherwise, or when the actual data output exceeds the given size,\n * the library adapts the buffer size as necessary.\n * The standard library functions malloc/free are used for allocating\n * larger memory, so the buffer is available to the application after\n * finishing compression, and then the application is responsible for\n * freeing the requested memory.\n * Note:  An initial buffer supplied by the caller is expected to be\n * managed by the application.  The library does not free such buffer\n * when allocating a larger buffer.\n */\n\nGLOBAL(void)\njpeg_mem_dest (j_compress_ptr cinfo,\n\t       unsigned char ** outbuffer, unsigned long * outsize)\n{\n  my_mem_dest_ptr dest;\n\n  if (outbuffer == NULL || outsize == NULL)\t/* sanity check */\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* The destination object is made permanent so that multiple JPEG images\n   * can be written to the same buffer without re-executing jpeg_mem_dest.\n   */\n  if (cinfo->dest == NULL) {\t/* first time for this JPEG object? */\n    cinfo->dest = (struct jpeg_destination_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  SIZEOF(my_mem_destination_mgr));\n  }\n\n  dest = (my_mem_dest_ptr) cinfo->dest;\n  dest->pub.init_destination = init_mem_destination;\n  dest->pub.empty_output_buffer = empty_mem_output_buffer;\n  dest->pub.term_destination = term_mem_destination;\n  dest->outbuffer = outbuffer;\n  dest->outsize = outsize;\n  dest->newbuffer = NULL;\n\n  if (*outbuffer == NULL || *outsize == 0) {\n    /* Allocate initial buffer */\n    dest->newbuffer = *outbuffer = (unsigned char *) malloc(OUTPUT_BUF_SIZE);\n    if (dest->newbuffer == NULL)\n      ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);\n    *outsize = OUTPUT_BUF_SIZE;\n  }\n\n  dest->pub.next_output_byte = dest->buffer = *outbuffer;\n  dest->pub.free_in_buffer = dest->bufsize = *outsize;\n}\n"
  },
  {
    "path": "jdatasrc.c",
    "content": "/*\n * jdatasrc.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2011 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains decompression data source routines for the case of\n * reading JPEG data from memory or from a file (or any stdio stream).\n * While these routines are sufficient for most applications,\n * some will want to use a different source manager.\n * IMPORTANT: we assume that fread() will correctly transcribe an array of\n * JOCTETs from 8-bit-wide elements on external storage.  If char is wider\n * than 8 bits on your machine, you may need to do some tweaking.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"\n\n\n/* Expanded data source object for stdio input */\n\ntypedef struct {\n  struct jpeg_source_mgr pub;\t/* public fields */\n\n  FILE * infile;\t\t/* source stream */\n  JOCTET * buffer;\t\t/* start of buffer */\n  boolean start_of_file;\t/* have we gotten any data yet? */\n} my_source_mgr;\n\ntypedef my_source_mgr * my_src_ptr;\n\n#define INPUT_BUF_SIZE  4096\t/* choose an efficiently fread'able size */\n\n\n/*\n * Initialize source --- called by jpeg_read_header\n * before any data is actually read.\n */\n\nMETHODDEF(void)\ninit_source (j_decompress_ptr cinfo)\n{\n  my_src_ptr src = (my_src_ptr) cinfo->src;\n\n  /* We reset the empty-input-file flag for each image,\n   * but we don't clear the input buffer.\n   * This is correct behavior for reading a series of images from one source.\n   */\n  src->start_of_file = TRUE;\n}\n\nMETHODDEF(void)\ninit_mem_source (j_decompress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n\n/*\n * Fill the input buffer --- called whenever buffer is emptied.\n *\n * In typical applications, this should read fresh data into the buffer\n * (ignoring the current state of next_input_byte & bytes_in_buffer),\n * reset the pointer & count to the start of the buffer, and return TRUE\n * indicating that the buffer has been reloaded.  It is not necessary to\n * fill the buffer entirely, only to obtain at least one more byte.\n *\n * There is no such thing as an EOF return.  If the end of the file has been\n * reached, the routine has a choice of ERREXIT() or inserting fake data into\n * the buffer.  In most cases, generating a warning message and inserting a\n * fake EOI marker is the best course of action --- this will allow the\n * decompressor to output however much of the image is there.  However,\n * the resulting error message is misleading if the real problem is an empty\n * input file, so we handle that case specially.\n *\n * In applications that need to be able to suspend compression due to input\n * not being available yet, a FALSE return indicates that no more data can be\n * obtained right now, but more may be forthcoming later.  In this situation,\n * the decompressor will return to its caller (with an indication of the\n * number of scanlines it has read, if any).  The application should resume\n * decompression after it has loaded more data into the input buffer.  Note\n * that there are substantial restrictions on the use of suspension --- see\n * the documentation.\n *\n * When suspending, the decompressor will back up to a convenient restart point\n * (typically the start of the current MCU). next_input_byte & bytes_in_buffer\n * indicate where the restart point will be if the current call returns FALSE.\n * Data beyond this point must be rescanned after resumption, so move it to\n * the front of the buffer rather than discarding it.\n */\n\nMETHODDEF(boolean)\nfill_input_buffer (j_decompress_ptr cinfo)\n{\n  my_src_ptr src = (my_src_ptr) cinfo->src;\n  size_t nbytes;\n\n  nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);\n\n  if (nbytes <= 0) {\n    if (src->start_of_file)\t/* Treat empty input file as fatal error */\n      ERREXIT(cinfo, JERR_INPUT_EMPTY);\n    WARNMS(cinfo, JWRN_JPEG_EOF);\n    /* Insert a fake EOI marker */\n    src->buffer[0] = (JOCTET) 0xFF;\n    src->buffer[1] = (JOCTET) JPEG_EOI;\n    nbytes = 2;\n  }\n\n  src->pub.next_input_byte = src->buffer;\n  src->pub.bytes_in_buffer = nbytes;\n  src->start_of_file = FALSE;\n\n  return TRUE;\n}\n\nMETHODDEF(boolean)\nfill_mem_input_buffer (j_decompress_ptr cinfo)\n{\n  static const JOCTET mybuffer[4] = {\n    (JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0\n  };\n\n  /* The whole JPEG data is expected to reside in the supplied memory\n   * buffer, so any request for more data beyond the given buffer size\n   * is treated as an error.\n   */\n  WARNMS(cinfo, JWRN_JPEG_EOF);\n\n  /* Insert a fake EOI marker */\n\n  cinfo->src->next_input_byte = mybuffer;\n  cinfo->src->bytes_in_buffer = 2;\n\n  return TRUE;\n}\n\n\n/*\n * Skip data --- used to skip over a potentially large amount of\n * uninteresting data (such as an APPn marker).\n *\n * Writers of suspendable-input applications must note that skip_input_data\n * is not granted the right to give a suspension return.  If the skip extends\n * beyond the data currently in the buffer, the buffer can be marked empty so\n * that the next read will cause a fill_input_buffer call that can suspend.\n * Arranging for additional bytes to be discarded before reloading the input\n * buffer is the application writer's problem.\n */\n\nMETHODDEF(void)\nskip_input_data (j_decompress_ptr cinfo, long num_bytes)\n{\n  struct jpeg_source_mgr * src = cinfo->src;\n\n  /* Just a dumb implementation for now.  Could use fseek() except\n   * it doesn't work on pipes.  Not clear that being smart is worth\n   * any trouble anyway --- large skips are infrequent.\n   */\n  if (num_bytes > 0) {\n    while (num_bytes > (long) src->bytes_in_buffer) {\n      num_bytes -= (long) src->bytes_in_buffer;\n      (void) (*src->fill_input_buffer) (cinfo);\n      /* note we assume that fill_input_buffer will never return FALSE,\n       * so suspension need not be handled.\n       */\n    }\n    src->next_input_byte += (size_t) num_bytes;\n    src->bytes_in_buffer -= (size_t) num_bytes;\n  }\n}\n\n\n/*\n * An additional method that can be provided by data source modules is the\n * resync_to_restart method for error recovery in the presence of RST markers.\n * For the moment, this source module just uses the default resync method\n * provided by the JPEG library.  That method assumes that no backtracking\n * is possible.\n */\n\n\n/*\n * Terminate source --- called by jpeg_finish_decompress\n * after all data has been read.  Often a no-op.\n *\n * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding\n * application must deal with any cleanup that should happen even\n * for error exit.\n */\n\nMETHODDEF(void)\nterm_source (j_decompress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n\n/*\n * Prepare for input from a stdio stream.\n * The caller must have already opened the stream, and is responsible\n * for closing it after finishing decompression.\n */\n\nGLOBAL(void)\njpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)\n{\n  my_src_ptr src;\n\n  /* The source object and input buffer are made permanent so that a series\n   * of JPEG images can be read from the same file by calling jpeg_stdio_src\n   * only before the first one.  (If we discarded the buffer at the end of\n   * one image, we'd likely lose the start of the next one.)\n   * This makes it unsafe to use this manager and a different source\n   * manager serially with the same JPEG object.  Caveat programmer.\n   */\n  if (cinfo->src == NULL) {\t/* first time for this JPEG object? */\n    cinfo->src = (struct jpeg_source_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  SIZEOF(my_source_mgr));\n    src = (my_src_ptr) cinfo->src;\n    src->buffer = (JOCTET *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  INPUT_BUF_SIZE * SIZEOF(JOCTET));\n  }\n\n  src = (my_src_ptr) cinfo->src;\n  src->pub.init_source = init_source;\n  src->pub.fill_input_buffer = fill_input_buffer;\n  src->pub.skip_input_data = skip_input_data;\n  src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */\n  src->pub.term_source = term_source;\n  src->infile = infile;\n  src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */\n  src->pub.next_input_byte = NULL; /* until buffer loaded */\n}\n\n\n/*\n * Prepare for input from a supplied memory buffer.\n * The buffer must contain the whole JPEG data.\n */\n\nGLOBAL(void)\njpeg_mem_src (j_decompress_ptr cinfo,\n\t      unsigned char * inbuffer, unsigned long insize)\n{\n  struct jpeg_source_mgr * src;\n\n  if (inbuffer == NULL || insize == 0)\t/* Treat empty input as fatal error */\n    ERREXIT(cinfo, JERR_INPUT_EMPTY);\n\n  /* The source object is made permanent so that a series of JPEG images\n   * can be read from the same buffer by calling jpeg_mem_src only before\n   * the first one.\n   */\n  if (cinfo->src == NULL) {\t/* first time for this JPEG object? */\n    cinfo->src = (struct jpeg_source_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  SIZEOF(struct jpeg_source_mgr));\n  }\n\n  src = cinfo->src;\n  src->init_source = init_mem_source;\n  src->fill_input_buffer = fill_mem_input_buffer;\n  src->skip_input_data = skip_input_data;\n  src->resync_to_restart = jpeg_resync_to_restart; /* use default method */\n  src->term_source = term_source;\n  src->bytes_in_buffer = (size_t) insize;\n  src->next_input_byte = (JOCTET *) inbuffer;\n}\n"
  },
  {
    "path": "jdcoefct.c",
    "content": "/*\n * jdcoefct.c\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * Modified 2002-2011 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the coefficient buffer controller for decompression.\n * This controller is the top level of the JPEG decompressor proper.\n * The coefficient buffer lies between entropy decoding and inverse-DCT steps.\n *\n * In buffered-image mode, this controller is the interface between\n * input-oriented processing and output-oriented processing.\n * Also, the input side (only) is used when reading a file for transcoding.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n/* Block smoothing is only applicable for progressive JPEG, so: */\n#ifndef D_PROGRESSIVE_SUPPORTED\n#undef BLOCK_SMOOTHING_SUPPORTED\n#endif\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_d_coef_controller pub; /* public fields */\n\n  /* These variables keep track of the current location of the input side. */\n  /* cinfo->input_iMCU_row is also used for this. */\n  JDIMENSION MCU_ctr;\t\t/* counts MCUs processed in current row */\n  int MCU_vert_offset;\t\t/* counts MCU rows within iMCU row */\n  int MCU_rows_per_iMCU_row;\t/* number of such rows needed */\n\n  /* The output side's location is represented by cinfo->output_iMCU_row. */\n\n  /* In single-pass modes, it's sufficient to buffer just one MCU.\n   * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,\n   * and let the entropy decoder write into that workspace each time.\n   * (On 80x86, the workspace is FAR even though it's not really very big;\n   * this is to keep the module interfaces unchanged when a large coefficient\n   * buffer is necessary.)\n   * In multi-pass modes, this array points to the current MCU's blocks\n   * within the virtual arrays; it is used only by the input side.\n   */\n  JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU];\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n  /* In multi-pass modes, we need a virtual block array for each component. */\n  jvirt_barray_ptr whole_image[MAX_COMPONENTS];\n#endif\n\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n  /* When doing block smoothing, we latch coefficient Al values here */\n  int * coef_bits_latch;\n#define SAVED_COEFS  6\t\t/* we save coef_bits[0..5] */\n#endif\n} my_coef_controller;\n\ntypedef my_coef_controller * my_coef_ptr;\n\n/* Forward declarations */\nMETHODDEF(int) decompress_onepass\n\tJPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));\n#ifdef D_MULTISCAN_FILES_SUPPORTED\nMETHODDEF(int) decompress_data\n\tJPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));\n#endif\n#ifdef BLOCK_SMOOTHING_SUPPORTED\nLOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo));\nMETHODDEF(int) decompress_smooth_data\n\tJPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));\n#endif\n\n\nLOCAL(void)\nstart_iMCU_row (j_decompress_ptr cinfo)\n/* Reset within-iMCU-row counters for a new row (input side) */\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  /* In an interleaved scan, an MCU row is the same as an iMCU row.\n   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.\n   * But at the bottom of the image, process only what's left.\n   */\n  if (cinfo->comps_in_scan > 1) {\n    coef->MCU_rows_per_iMCU_row = 1;\n  } else {\n    if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1))\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;\n    else\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;\n  }\n\n  coef->MCU_ctr = 0;\n  coef->MCU_vert_offset = 0;\n}\n\n\n/*\n * Initialize for an input processing pass.\n */\n\nMETHODDEF(void)\nstart_input_pass (j_decompress_ptr cinfo)\n{\n  cinfo->input_iMCU_row = 0;\n  start_iMCU_row(cinfo);\n}\n\n\n/*\n * Initialize for an output processing pass.\n */\n\nMETHODDEF(void)\nstart_output_pass (j_decompress_ptr cinfo)\n{\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  /* If multipass, check to see whether to use block smoothing on this pass */\n  if (coef->pub.coef_arrays != NULL) {\n    if (cinfo->do_block_smoothing && smoothing_ok(cinfo))\n      coef->pub.decompress_data = decompress_smooth_data;\n    else\n      coef->pub.decompress_data = decompress_data;\n  }\n#endif\n  cinfo->output_iMCU_row = 0;\n}\n\n\n/*\n * Decompress and return some data in the single-pass case.\n * Always attempts to emit one fully interleaved MCU row (\"iMCU\" row).\n * Input and output must run in lockstep since we have only a one-MCU buffer.\n * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.\n *\n * NB: output_buf contains a plane for each component in image,\n * which we index according to the component's SOF position.\n */\n\nMETHODDEF(int)\ndecompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;\t/* index of current MCU within row */\n  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  int blkn, ci, xindex, yindex, yoffset, useful_width;\n  JSAMPARRAY output_ptr;\n  JDIMENSION start_col, output_col;\n  jpeg_component_info *compptr;\n  inverse_DCT_method_ptr inverse_DCT;\n\n  /* Loop to process as much as one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;\n\t MCU_col_num++) {\n      /* Try to fetch an MCU.  Entropy decoder expects buffer to be zeroed. */\n      if (cinfo->lim_Se)\t/* can bypass in DC only case */\n\tFMEMZERO((void FAR *) coef->MCU_buffer[0],\n\t\t (size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK)));\n      if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {\n\t/* Suspension forced; update state counters and exit */\n\tcoef->MCU_vert_offset = yoffset;\n\tcoef->MCU_ctr = MCU_col_num;\n\treturn JPEG_SUSPENDED;\n      }\n      /* Determine where data should go in output_buf and do the IDCT thing.\n       * We skip dummy blocks at the right and bottom edges (but blkn gets\n       * incremented past them!).  Note the inner loop relies on having\n       * allocated the MCU_buffer[] blocks sequentially.\n       */\n      blkn = 0;\t\t\t/* index of current DCT block within MCU */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n\tcompptr = cinfo->cur_comp_info[ci];\n\t/* Don't bother to IDCT an uninteresting component. */\n\tif (! compptr->component_needed) {\n\t  blkn += compptr->MCU_blocks;\n\t  continue;\n\t}\n\tinverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];\n\tuseful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width\n\t\t\t\t\t\t    : compptr->last_col_width;\n\toutput_ptr = output_buf[compptr->component_index] +\n\t  yoffset * compptr->DCT_v_scaled_size;\n\tstart_col = MCU_col_num * compptr->MCU_sample_width;\n\tfor (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n\t  if (cinfo->input_iMCU_row < last_iMCU_row ||\n\t      yoffset+yindex < compptr->last_row_height) {\n\t    output_col = start_col;\n\t    for (xindex = 0; xindex < useful_width; xindex++) {\n\t      (*inverse_DCT) (cinfo, compptr,\n\t\t\t      (JCOEFPTR) coef->MCU_buffer[blkn+xindex],\n\t\t\t      output_ptr, output_col);\n\t      output_col += compptr->DCT_h_scaled_size;\n\t    }\n\t  }\n\t  blkn += compptr->MCU_width;\n\t  output_ptr += compptr->DCT_v_scaled_size;\n\t}\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->MCU_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  cinfo->output_iMCU_row++;\n  if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {\n    start_iMCU_row(cinfo);\n    return JPEG_ROW_COMPLETED;\n  }\n  /* Completed the scan */\n  (*cinfo->inputctl->finish_input_pass) (cinfo);\n  return JPEG_SCAN_COMPLETED;\n}\n\n\n/*\n * Dummy consume-input routine for single-pass operation.\n */\n\nMETHODDEF(int)\ndummy_consume_data (j_decompress_ptr cinfo)\n{\n  return JPEG_SUSPENDED;\t/* Always indicate nothing was done */\n}\n\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n\n/*\n * Consume input data and store it in the full-image coefficient buffer.\n * We read as much as one fully interleaved MCU row (\"iMCU\" row) per call,\n * ie, v_samp_factor block rows for each component in the scan.\n * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.\n */\n\nMETHODDEF(int)\nconsume_data (j_decompress_ptr cinfo)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;\t/* index of current MCU within row */\n  int blkn, ci, xindex, yindex, yoffset;\n  JDIMENSION start_col;\n  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];\n  JBLOCKROW buffer_ptr;\n  jpeg_component_info *compptr;\n\n  /* Align the virtual buffers for the components used in this scan. */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    buffer[ci] = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],\n       cinfo->input_iMCU_row * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, TRUE);\n    /* Note: entropy decoder expects buffer to be zeroed,\n     * but this is handled automatically by the memory manager\n     * because we requested a pre-zeroed array.\n     */\n  }\n\n  /* Loop to process one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;\n\t MCU_col_num++) {\n      /* Construct list of pointers to DCT blocks belonging to this MCU */\n      blkn = 0;\t\t\t/* index of current DCT block within MCU */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n\tcompptr = cinfo->cur_comp_info[ci];\n\tstart_col = MCU_col_num * compptr->MCU_width;\n\tfor (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n\t  buffer_ptr = buffer[ci][yindex+yoffset] + start_col;\n\t  for (xindex = 0; xindex < compptr->MCU_width; xindex++) {\n\t    coef->MCU_buffer[blkn++] = buffer_ptr++;\n\t  }\n\t}\n      }\n      /* Try to fetch the MCU. */\n      if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {\n\t/* Suspension forced; update state counters and exit */\n\tcoef->MCU_vert_offset = yoffset;\n\tcoef->MCU_ctr = MCU_col_num;\n\treturn JPEG_SUSPENDED;\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->MCU_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {\n    start_iMCU_row(cinfo);\n    return JPEG_ROW_COMPLETED;\n  }\n  /* Completed the scan */\n  (*cinfo->inputctl->finish_input_pass) (cinfo);\n  return JPEG_SCAN_COMPLETED;\n}\n\n\n/*\n * Decompress and return some data in the multi-pass case.\n * Always attempts to emit one fully interleaved MCU row (\"iMCU\" row).\n * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.\n *\n * NB: output_buf contains a plane for each component in image.\n */\n\nMETHODDEF(int)\ndecompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  JDIMENSION block_num;\n  int ci, block_row, block_rows;\n  JBLOCKARRAY buffer;\n  JBLOCKROW buffer_ptr;\n  JSAMPARRAY output_ptr;\n  JDIMENSION output_col;\n  jpeg_component_info *compptr;\n  inverse_DCT_method_ptr inverse_DCT;\n\n  /* Force some input to be done if we are getting ahead of the input. */\n  while (cinfo->input_scan_number < cinfo->output_scan_number ||\n\t (cinfo->input_scan_number == cinfo->output_scan_number &&\n\t  cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {\n    if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)\n      return JPEG_SUSPENDED;\n  }\n\n  /* OK, output from the virtual arrays. */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Don't bother to IDCT an uninteresting component. */\n    if (! compptr->component_needed)\n      continue;\n    /* Align the virtual buffer for this component. */\n    buffer = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[ci],\n       cinfo->output_iMCU_row * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, FALSE);\n    /* Count non-dummy DCT block rows in this iMCU row. */\n    if (cinfo->output_iMCU_row < last_iMCU_row)\n      block_rows = compptr->v_samp_factor;\n    else {\n      /* NB: can't use last_row_height here; it is input-side-dependent! */\n      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n      if (block_rows == 0) block_rows = compptr->v_samp_factor;\n    }\n    inverse_DCT = cinfo->idct->inverse_DCT[ci];\n    output_ptr = output_buf[ci];\n    /* Loop over all DCT blocks to be processed. */\n    for (block_row = 0; block_row < block_rows; block_row++) {\n      buffer_ptr = buffer[block_row];\n      output_col = 0;\n      for (block_num = 0; block_num < compptr->width_in_blocks; block_num++) {\n\t(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr,\n\t\t\toutput_ptr, output_col);\n\tbuffer_ptr++;\n\toutput_col += compptr->DCT_h_scaled_size;\n      }\n      output_ptr += compptr->DCT_v_scaled_size;\n    }\n  }\n\n  if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)\n    return JPEG_ROW_COMPLETED;\n  return JPEG_SCAN_COMPLETED;\n}\n\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n\n\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n\n/*\n * This code applies interblock smoothing as described by section K.8\n * of the JPEG standard: the first 5 AC coefficients are estimated from\n * the DC values of a DCT block and its 8 neighboring blocks.\n * We apply smoothing only for progressive JPEG decoding, and only if\n * the coefficients it can estimate are not yet known to full precision.\n */\n\n/* Natural-order array positions of the first 5 zigzag-order coefficients */\n#define Q01_POS  1\n#define Q10_POS  8\n#define Q20_POS  16\n#define Q11_POS  9\n#define Q02_POS  2\n\n/*\n * Determine whether block smoothing is applicable and safe.\n * We also latch the current states of the coef_bits[] entries for the\n * AC coefficients; otherwise, if the input side of the decompressor\n * advances into a new scan, we might think the coefficients are known\n * more accurately than they really are.\n */\n\nLOCAL(boolean)\nsmoothing_ok (j_decompress_ptr cinfo)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  boolean smoothing_useful = FALSE;\n  int ci, coefi;\n  jpeg_component_info *compptr;\n  JQUANT_TBL * qtable;\n  int * coef_bits;\n  int * coef_bits_latch;\n\n  if (! cinfo->progressive_mode || cinfo->coef_bits == NULL)\n    return FALSE;\n\n  /* Allocate latch area if not already done */\n  if (coef->coef_bits_latch == NULL)\n    coef->coef_bits_latch = (int *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  cinfo->num_components *\n\t\t\t\t  (SAVED_COEFS * SIZEOF(int)));\n  coef_bits_latch = coef->coef_bits_latch;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* All components' quantization values must already be latched. */\n    if ((qtable = compptr->quant_table) == NULL)\n      return FALSE;\n    /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */\n    if (qtable->quantval[0] == 0 ||\n\tqtable->quantval[Q01_POS] == 0 ||\n\tqtable->quantval[Q10_POS] == 0 ||\n\tqtable->quantval[Q20_POS] == 0 ||\n\tqtable->quantval[Q11_POS] == 0 ||\n\tqtable->quantval[Q02_POS] == 0)\n      return FALSE;\n    /* DC values must be at least partly known for all components. */\n    coef_bits = cinfo->coef_bits[ci];\n    if (coef_bits[0] < 0)\n      return FALSE;\n    /* Block smoothing is helpful if some AC coefficients remain inaccurate. */\n    for (coefi = 1; coefi <= 5; coefi++) {\n      coef_bits_latch[coefi] = coef_bits[coefi];\n      if (coef_bits[coefi] != 0)\n\tsmoothing_useful = TRUE;\n    }\n    coef_bits_latch += SAVED_COEFS;\n  }\n\n  return smoothing_useful;\n}\n\n\n/*\n * Variant of decompress_data for use when doing block smoothing.\n */\n\nMETHODDEF(int)\ndecompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  JDIMENSION block_num, last_block_column;\n  int ci, block_row, block_rows, access_rows;\n  JBLOCKARRAY buffer;\n  JBLOCKROW buffer_ptr, prev_block_row, next_block_row;\n  JSAMPARRAY output_ptr;\n  JDIMENSION output_col;\n  jpeg_component_info *compptr;\n  inverse_DCT_method_ptr inverse_DCT;\n  boolean first_row, last_row;\n  JBLOCK workspace;\n  int *coef_bits;\n  JQUANT_TBL *quanttbl;\n  INT32 Q00,Q01,Q02,Q10,Q11,Q20, num;\n  int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9;\n  int Al, pred;\n\n  /* Force some input to be done if we are getting ahead of the input. */\n  while (cinfo->input_scan_number <= cinfo->output_scan_number &&\n\t ! cinfo->inputctl->eoi_reached) {\n    if (cinfo->input_scan_number == cinfo->output_scan_number) {\n      /* If input is working on current scan, we ordinarily want it to\n       * have completed the current row.  But if input scan is DC,\n       * we want it to keep one row ahead so that next block row's DC\n       * values are up to date.\n       */\n      JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;\n      if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta)\n\tbreak;\n    }\n    if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)\n      return JPEG_SUSPENDED;\n  }\n\n  /* OK, output from the virtual arrays. */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Don't bother to IDCT an uninteresting component. */\n    if (! compptr->component_needed)\n      continue;\n    /* Count non-dummy DCT block rows in this iMCU row. */\n    if (cinfo->output_iMCU_row < last_iMCU_row) {\n      block_rows = compptr->v_samp_factor;\n      access_rows = block_rows * 2; /* this and next iMCU row */\n      last_row = FALSE;\n    } else {\n      /* NB: can't use last_row_height here; it is input-side-dependent! */\n      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n      if (block_rows == 0) block_rows = compptr->v_samp_factor;\n      access_rows = block_rows; /* this iMCU row only */\n      last_row = TRUE;\n    }\n    /* Align the virtual buffer for this component. */\n    if (cinfo->output_iMCU_row > 0) {\n      access_rows += compptr->v_samp_factor; /* prior iMCU row too */\n      buffer = (*cinfo->mem->access_virt_barray)\n\t((j_common_ptr) cinfo, coef->whole_image[ci],\n\t (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,\n\t (JDIMENSION) access_rows, FALSE);\n      buffer += compptr->v_samp_factor;\t/* point to current iMCU row */\n      first_row = FALSE;\n    } else {\n      buffer = (*cinfo->mem->access_virt_barray)\n\t((j_common_ptr) cinfo, coef->whole_image[ci],\n\t (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE);\n      first_row = TRUE;\n    }\n    /* Fetch component-dependent info */\n    coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);\n    quanttbl = compptr->quant_table;\n    Q00 = quanttbl->quantval[0];\n    Q01 = quanttbl->quantval[Q01_POS];\n    Q10 = quanttbl->quantval[Q10_POS];\n    Q20 = quanttbl->quantval[Q20_POS];\n    Q11 = quanttbl->quantval[Q11_POS];\n    Q02 = quanttbl->quantval[Q02_POS];\n    inverse_DCT = cinfo->idct->inverse_DCT[ci];\n    output_ptr = output_buf[ci];\n    /* Loop over all DCT blocks to be processed. */\n    for (block_row = 0; block_row < block_rows; block_row++) {\n      buffer_ptr = buffer[block_row];\n      if (first_row && block_row == 0)\n\tprev_block_row = buffer_ptr;\n      else\n\tprev_block_row = buffer[block_row-1];\n      if (last_row && block_row == block_rows-1)\n\tnext_block_row = buffer_ptr;\n      else\n\tnext_block_row = buffer[block_row+1];\n      /* We fetch the surrounding DC values using a sliding-register approach.\n       * Initialize all nine here so as to do the right thing on narrow pics.\n       */\n      DC1 = DC2 = DC3 = (int) prev_block_row[0][0];\n      DC4 = DC5 = DC6 = (int) buffer_ptr[0][0];\n      DC7 = DC8 = DC9 = (int) next_block_row[0][0];\n      output_col = 0;\n      last_block_column = compptr->width_in_blocks - 1;\n      for (block_num = 0; block_num <= last_block_column; block_num++) {\n\t/* Fetch current DCT block into workspace so we can modify it. */\n\tjcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1);\n\t/* Update DC values */\n\tif (block_num < last_block_column) {\n\t  DC3 = (int) prev_block_row[1][0];\n\t  DC6 = (int) buffer_ptr[1][0];\n\t  DC9 = (int) next_block_row[1][0];\n\t}\n\t/* Compute coefficient estimates per K.8.\n\t * An estimate is applied only if coefficient is still zero,\n\t * and is not known to be fully accurate.\n\t */\n\t/* AC01 */\n\tif ((Al=coef_bits[1]) != 0 && workspace[1] == 0) {\n\t  num = 36 * Q00 * (DC4 - DC6);\n\t  if (num >= 0) {\n\t    pred = (int) (((Q01<<7) + num) / (Q01<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t  } else {\n\t    pred = (int) (((Q01<<7) - num) / (Q01<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t    pred = -pred;\n\t  }\n\t  workspace[1] = (JCOEF) pred;\n\t}\n\t/* AC10 */\n\tif ((Al=coef_bits[2]) != 0 && workspace[8] == 0) {\n\t  num = 36 * Q00 * (DC2 - DC8);\n\t  if (num >= 0) {\n\t    pred = (int) (((Q10<<7) + num) / (Q10<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t  } else {\n\t    pred = (int) (((Q10<<7) - num) / (Q10<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t    pred = -pred;\n\t  }\n\t  workspace[8] = (JCOEF) pred;\n\t}\n\t/* AC20 */\n\tif ((Al=coef_bits[3]) != 0 && workspace[16] == 0) {\n\t  num = 9 * Q00 * (DC2 + DC8 - 2*DC5);\n\t  if (num >= 0) {\n\t    pred = (int) (((Q20<<7) + num) / (Q20<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t  } else {\n\t    pred = (int) (((Q20<<7) - num) / (Q20<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t    pred = -pred;\n\t  }\n\t  workspace[16] = (JCOEF) pred;\n\t}\n\t/* AC11 */\n\tif ((Al=coef_bits[4]) != 0 && workspace[9] == 0) {\n\t  num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);\n\t  if (num >= 0) {\n\t    pred = (int) (((Q11<<7) + num) / (Q11<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t  } else {\n\t    pred = (int) (((Q11<<7) - num) / (Q11<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t    pred = -pred;\n\t  }\n\t  workspace[9] = (JCOEF) pred;\n\t}\n\t/* AC02 */\n\tif ((Al=coef_bits[5]) != 0 && workspace[2] == 0) {\n\t  num = 9 * Q00 * (DC4 + DC6 - 2*DC5);\n\t  if (num >= 0) {\n\t    pred = (int) (((Q02<<7) + num) / (Q02<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t  } else {\n\t    pred = (int) (((Q02<<7) - num) / (Q02<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t    pred = -pred;\n\t  }\n\t  workspace[2] = (JCOEF) pred;\n\t}\n\t/* OK, do the IDCT */\n\t(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) workspace,\n\t\t\toutput_ptr, output_col);\n\t/* Advance for next column */\n\tDC1 = DC2; DC2 = DC3;\n\tDC4 = DC5; DC5 = DC6;\n\tDC7 = DC8; DC8 = DC9;\n\tbuffer_ptr++, prev_block_row++, next_block_row++;\n\toutput_col += compptr->DCT_h_scaled_size;\n      }\n      output_ptr += compptr->DCT_v_scaled_size;\n    }\n  }\n\n  if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)\n    return JPEG_ROW_COMPLETED;\n  return JPEG_SCAN_COMPLETED;\n}\n\n#endif /* BLOCK_SMOOTHING_SUPPORTED */\n\n\n/*\n * Initialize coefficient buffer controller.\n */\n\nGLOBAL(void)\njinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)\n{\n  my_coef_ptr coef;\n\n  coef = (my_coef_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_coef_controller));\n  cinfo->coef = (struct jpeg_d_coef_controller *) coef;\n  coef->pub.start_input_pass = start_input_pass;\n  coef->pub.start_output_pass = start_output_pass;\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n  coef->coef_bits_latch = NULL;\n#endif\n\n  /* Create the coefficient buffer. */\n  if (need_full_buffer) {\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n    /* Allocate a full-image virtual array for each component, */\n    /* padded to a multiple of samp_factor DCT blocks in each direction. */\n    /* Note we ask for a pre-zeroed array. */\n    int ci, access_rows;\n    jpeg_component_info *compptr;\n\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      access_rows = compptr->v_samp_factor;\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n      /* If block smoothing could be used, need a bigger window */\n      if (cinfo->progressive_mode)\n\taccess_rows *= 3;\n#endif\n      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE,\n\t (JDIMENSION) jround_up((long) compptr->width_in_blocks,\n\t\t\t\t(long) compptr->h_samp_factor),\n\t (JDIMENSION) jround_up((long) compptr->height_in_blocks,\n\t\t\t\t(long) compptr->v_samp_factor),\n\t (JDIMENSION) access_rows);\n    }\n    coef->pub.consume_data = consume_data;\n    coef->pub.decompress_data = decompress_data;\n    coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    /* We only need a single-MCU buffer. */\n    JBLOCKROW buffer;\n    int i;\n\n    buffer = (JBLOCKROW)\n      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));\n    for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {\n      coef->MCU_buffer[i] = buffer + i;\n    }\n    if (cinfo->lim_Se == 0)\t/* DC only case: want to bypass later */\n      FMEMZERO((void FAR *) buffer,\n\t       (size_t) (D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)));\n    coef->pub.consume_data = dummy_consume_data;\n    coef->pub.decompress_data = decompress_onepass;\n    coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */\n  }\n}\n"
  },
  {
    "path": "jdcolor.c",
    "content": "/*\n * jdcolor.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2011-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains output colorspace conversion routines.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_color_deconverter pub; /* public fields */\n\n  /* Private state for YCbCr->RGB and BG_YCC->RGB conversion */\n  int * Cr_r_tab;\t\t/* => table for Cr to R conversion */\n  int * Cb_b_tab;\t\t/* => table for Cb to B conversion */\n  INT32 * Cr_g_tab;\t\t/* => table for Cr to G conversion */\n  INT32 * Cb_g_tab;\t\t/* => table for Cb to G conversion */\n\n  JSAMPLE * range_limit; /* pointer to normal sample range limit table, */\n\t\t     /* or extended sample range limit table for BG_YCC */\n\n  /* Private state for RGB->Y conversion */\n  INT32 * rgb_y_tab;\t\t/* => table for RGB to Y conversion */\n} my_color_deconverter;\n\ntypedef my_color_deconverter * my_cconvert_ptr;\n\n\n/***************  YCbCr -> RGB conversion: most common case **************/\n/*************** BG_YCC -> RGB conversion: less common case **************/\n/***************    RGB -> Y   conversion: less common case **************/\n\n/*\n * YCbCr is defined per Recommendation ITU-R BT.601-7 (03/2011),\n * previously known as Recommendation CCIR 601-1, except that Cb and Cr\n * are normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.\n * sRGB (standard RGB color space) is defined per IEC 61966-2-1:1999.\n * sYCC (standard luma-chroma-chroma color space with extended gamut)\n * is defined per IEC 61966-2-1:1999 Amendment A1:2003 Annex F.\n * bg-sRGB and bg-sYCC (big gamut standard color spaces)\n * are defined per IEC 61966-2-1:1999 Amendment A1:2003 Annex G.\n * Note that the derived conversion coefficients given in some of these\n * documents are imprecise.  The general conversion equations are\n *\n *\tR = Y + K * (1 - Kr) * Cr\n *\tG = Y - K * (Kb * (1 - Kb) * Cb + Kr * (1 - Kr) * Cr) / (1 - Kr - Kb)\n *\tB = Y + K * (1 - Kb) * Cb\n *\n *\tY = Kr * R + (1 - Kr - Kb) * G + Kb * B\n *\n * With Kr = 0.299 and Kb = 0.114 (derived according to SMPTE RP 177-1993\n * from the 1953 FCC NTSC primaries and CIE Illuminant C), K = 2 for sYCC,\n * the conversion equations to be implemented are therefore\n *\n *\tR = Y + 1.402 * Cr\n *\tG = Y - 0.344136286 * Cb - 0.714136286 * Cr\n *\tB = Y + 1.772 * Cb\n *\n *\tY = 0.299 * R + 0.587 * G + 0.114 * B\n *\n * where Cb and Cr represent the incoming values less CENTERJSAMPLE.\n * For bg-sYCC, with K = 4, the equations are\n *\n *\tR = Y + 2.804 * Cr\n *\tG = Y - 0.688272572 * Cb - 1.428272572 * Cr\n *\tB = Y + 3.544 * Cb\n *\n * To avoid floating-point arithmetic, we represent the fractional constants\n * as integers scaled up by 2^16 (about 4 digits precision); we have to divide\n * the products by 2^16, with appropriate rounding, to get the correct answer.\n * Notice that Y, being an integral input, does not contribute any fraction\n * so it need not participate in the rounding.\n *\n * For even more speed, we avoid doing any multiplications in the inner loop\n * by precalculating the constants times Cb and Cr for all possible values.\n * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);\n * for 9-bit to 12-bit samples it is still acceptable.  It's not very\n * reasonable for 16-bit samples, but if you want lossless storage you\n * shouldn't be changing colorspace anyway.\n * The Cr=>R and Cb=>B values can be rounded to integers in advance; the\n * values for the G calculation are left scaled up, since we must add them\n * together before rounding.\n */\n\n#define SCALEBITS\t16\t/* speediest right-shift on some machines */\n#define ONE_HALF\t((INT32) 1 << (SCALEBITS-1))\n#define FIX(x)\t\t((INT32) ((x) * (1L<<SCALEBITS) + 0.5))\n\n/* We allocate one big table for RGB->Y conversion and divide it up into\n * three parts, instead of doing three alloc_small requests.  This lets us\n * use a single table base address, which can be held in a register in the\n * inner loops on many machines (more than can hold all three addresses,\n * anyway).\n */\n\n#define R_Y_OFF\t\t0\t\t\t/* offset to R => Y section */\n#define G_Y_OFF\t\t(1*(MAXJSAMPLE+1))\t/* offset to G => Y section */\n#define B_Y_OFF\t\t(2*(MAXJSAMPLE+1))\t/* etc. */\n#define TABLE_SIZE\t(3*(MAXJSAMPLE+1))\n\n\n/*\n * Initialize tables for YCbCr->RGB and BG_YCC->RGB colorspace conversion.\n */\n\nLOCAL(void)\nbuild_ycc_rgb_table (j_decompress_ptr cinfo)\n/* Normal case, sYCC */\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  int i;\n  INT32 x;\n  SHIFT_TEMPS\n\n  cconvert->Cr_r_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(int));\n  cconvert->Cb_b_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(int));\n  cconvert->Cr_g_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(INT32));\n  cconvert->Cb_g_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(INT32));\n\n  cconvert->range_limit = cinfo->sample_range_limit;\n\n  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {\n    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */\n    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */\n    /* Cr=>R value is nearest int to 1.402 * x */\n    cconvert->Cr_r_tab[i] = (int)\n\t\t    RIGHT_SHIFT(FIX(1.402) * x + ONE_HALF, SCALEBITS);\n    /* Cb=>B value is nearest int to 1.772 * x */\n    cconvert->Cb_b_tab[i] = (int)\n\t\t    RIGHT_SHIFT(FIX(1.772) * x + ONE_HALF, SCALEBITS);\n    /* Cr=>G value is scaled-up -0.714136286 * x */\n    cconvert->Cr_g_tab[i] = (- FIX(0.714136286)) * x;\n    /* Cb=>G value is scaled-up -0.344136286 * x */\n    /* We also add in ONE_HALF so that need not do it in inner loop */\n    cconvert->Cb_g_tab[i] = (- FIX(0.344136286)) * x + ONE_HALF;\n  }\n}\n\n\nLOCAL(void)\nbuild_bg_ycc_rgb_table (j_decompress_ptr cinfo)\n/* Wide gamut case, bg-sYCC */\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  int i;\n  INT32 x;\n  SHIFT_TEMPS\n\n  cconvert->Cr_r_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(int));\n  cconvert->Cb_b_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(int));\n  cconvert->Cr_g_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(INT32));\n  cconvert->Cb_g_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(INT32));\n\n  cconvert->range_limit = (JSAMPLE *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));\n\n  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {\n    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */\n    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */\n    /* Cr=>R value is nearest int to 2.804 * x */\n    cconvert->Cr_r_tab[i] = (int)\n\t\t    RIGHT_SHIFT(FIX(2.804) * x + ONE_HALF, SCALEBITS);\n    /* Cb=>B value is nearest int to 3.544 * x */\n    cconvert->Cb_b_tab[i] = (int)\n\t\t    RIGHT_SHIFT(FIX(3.544) * x + ONE_HALF, SCALEBITS);\n    /* Cr=>G value is scaled-up -1.428272572 * x */\n    cconvert->Cr_g_tab[i] = (- FIX(1.428272572)) * x;\n    /* Cb=>G value is scaled-up -0.688272572 * x */\n    /* We also add in ONE_HALF so that need not do it in inner loop */\n    cconvert->Cb_g_tab[i] = (- FIX(0.688272572)) * x + ONE_HALF;\n  }\n\n  /* Cb and Cr portions can extend to double range in wide gamut case,\n   * so we prepare an appropriate extended range limit table.\n   */\n\n  /* First segment of range limit table: limit[x] = 0 for x < 0 */\n  MEMZERO(cconvert->range_limit, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));\n  cconvert->range_limit += 2 * (MAXJSAMPLE+1);\n  /* Main part of range limit table: limit[x] = x */\n  for (i = 0; i <= MAXJSAMPLE; i++)\n    cconvert->range_limit[i] = (JSAMPLE) i;\n  /* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */\n  for (; i < 3 * (MAXJSAMPLE+1); i++)\n    cconvert->range_limit[i] = MAXJSAMPLE;\n}\n\n\n/*\n * Convert some rows of samples to the output colorspace.\n *\n * Note that we change from noninterleaved, one-plane-per-component format\n * to interleaved-pixel format.  The output buffer is therefore three times\n * as wide as the input buffer.\n * A starting row offset is provided only for the input buffer.  The caller\n * can easily adjust the passed output_buf value to accommodate any row\n * offset required on that side.\n */\n\nMETHODDEF(void)\nycc_rgb_convert (j_decompress_ptr cinfo,\n\t\t JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t JSAMPARRAY output_buf, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int y, cb, cr;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cconvert->range_limit;\n  register int * Crrtab = cconvert->Cr_r_tab;\n  register int * Cbbtab = cconvert->Cb_b_tab;\n  register INT32 * Crgtab = cconvert->Cr_g_tab;\n  register INT32 * Cbgtab = cconvert->Cb_g_tab;\n  SHIFT_TEMPS\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      y  = GETJSAMPLE(inptr0[col]);\n      cb = GETJSAMPLE(inptr1[col]);\n      cr = GETJSAMPLE(inptr2[col]);\n      /* Range-limiting is essential due to noise introduced by DCT losses,\n       * for extended gamut (sYCC) and wide gamut (bg-sYCC) encodings.\n       */\n      outptr[RGB_RED]   = range_limit[y + Crrtab[cr]];\n      outptr[RGB_GREEN] = range_limit[y +\n\t\t\t      ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n\t\t\t\t\t\t SCALEBITS))];\n      outptr[RGB_BLUE]  = range_limit[y + Cbbtab[cb]];\n      outptr += RGB_PIXELSIZE;\n    }\n  }\n}\n\n\n/**************** Cases other than YCC -> RGB ****************/\n\n\n/*\n * Initialize for RGB->grayscale colorspace conversion.\n */\n\nLOCAL(void)\nbuild_rgb_y_table (j_decompress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  INT32 * rgb_y_tab;\n  INT32 i;\n\n  /* Allocate and fill in the conversion tables. */\n  cconvert->rgb_y_tab = rgb_y_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(TABLE_SIZE * SIZEOF(INT32)));\n\n  for (i = 0; i <= MAXJSAMPLE; i++) {\n    rgb_y_tab[i+R_Y_OFF] = FIX(0.299) * i;\n    rgb_y_tab[i+G_Y_OFF] = FIX(0.587) * i;\n    rgb_y_tab[i+B_Y_OFF] = FIX(0.114) * i + ONE_HALF;\n  }\n}\n\n\n/*\n * Convert RGB to grayscale.\n */\n\nMETHODDEF(void)\nrgb_gray_convert (j_decompress_ptr cinfo,\n\t\t  JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t  JSAMPARRAY output_buf, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register INT32 * ctab = cconvert->rgb_y_tab;\n  register int r, g, b;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      r = GETJSAMPLE(inptr0[col]);\n      g = GETJSAMPLE(inptr1[col]);\n      b = GETJSAMPLE(inptr2[col]);\n      /* Y */\n      outptr[col] = (JSAMPLE)\n\t\t((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n\t\t >> SCALEBITS);\n    }\n  }\n}\n\n\n/*\n * [R-G,G,B-G] to [R,G,B] conversion with modulo calculation\n * (inverse color transform).\n * This can be seen as an adaption of the general YCbCr->RGB\n * conversion equation with Kr = Kb = 0, while replacing the\n * normalization by modulo calculation.\n */\n\nMETHODDEF(void)\nrgb1_rgb_convert (j_decompress_ptr cinfo,\n\t\t  JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t  JSAMPARRAY output_buf, int num_rows)\n{\n  register int r, g, b;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      r = GETJSAMPLE(inptr0[col]);\n      g = GETJSAMPLE(inptr1[col]);\n      b = GETJSAMPLE(inptr2[col]);\n      /* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD\n       * (modulo) operator is equivalent to the bitmask operator AND.\n       */\n      outptr[RGB_RED]   = (JSAMPLE) ((r + g - CENTERJSAMPLE) & MAXJSAMPLE);\n      outptr[RGB_GREEN] = (JSAMPLE) g;\n      outptr[RGB_BLUE]  = (JSAMPLE) ((b + g - CENTERJSAMPLE) & MAXJSAMPLE);\n      outptr += RGB_PIXELSIZE;\n    }\n  }\n}\n\n\n/*\n * [R-G,G,B-G] to grayscale conversion with modulo calculation\n * (inverse color transform).\n */\n\nMETHODDEF(void)\nrgb1_gray_convert (j_decompress_ptr cinfo,\n\t\t   JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t   JSAMPARRAY output_buf, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register INT32 * ctab = cconvert->rgb_y_tab;\n  register int r, g, b;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      r = GETJSAMPLE(inptr0[col]);\n      g = GETJSAMPLE(inptr1[col]);\n      b = GETJSAMPLE(inptr2[col]);\n      /* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD\n       * (modulo) operator is equivalent to the bitmask operator AND.\n       */\n      r = (r + g - CENTERJSAMPLE) & MAXJSAMPLE;\n      b = (b + g - CENTERJSAMPLE) & MAXJSAMPLE;\n      /* Y */\n      outptr[col] = (JSAMPLE)\n\t\t((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n\t\t >> SCALEBITS);\n    }\n  }\n}\n\n\n/*\n * No colorspace change, but conversion from separate-planes\n * to interleaved representation.\n */\n\nMETHODDEF(void)\nrgb_convert (j_decompress_ptr cinfo,\n\t     JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t     JSAMPARRAY output_buf, int num_rows)\n{\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      /* We can dispense with GETJSAMPLE() here */\n      outptr[RGB_RED]   = inptr0[col];\n      outptr[RGB_GREEN] = inptr1[col];\n      outptr[RGB_BLUE]  = inptr2[col];\n      outptr += RGB_PIXELSIZE;\n    }\n  }\n}\n\n\n/*\n * Color conversion for no colorspace change: just copy the data,\n * converting from separate-planes to interleaved representation.\n */\n\nMETHODDEF(void)\nnull_convert (j_decompress_ptr cinfo,\n\t      JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t      JSAMPARRAY output_buf, int num_rows)\n{\n  int ci;\n  register int nc = cinfo->num_components;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    for (ci = 0; ci < nc; ci++) {\n      inptr = input_buf[ci][input_row];\n      outptr = output_buf[0] + ci;\n      for (col = 0; col < num_cols; col++) {\n\t*outptr = *inptr++;\t/* needn't bother with GETJSAMPLE() here */\n\toutptr += nc;\n      }\n    }\n    input_row++;\n    output_buf++;\n  }\n}\n\n\n/*\n * Color conversion for grayscale: just copy the data.\n * This also works for YCC -> grayscale conversion, in which\n * we just copy the Y (luminance) component and ignore chrominance.\n */\n\nMETHODDEF(void)\ngrayscale_convert (j_decompress_ptr cinfo,\n\t\t   JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t   JSAMPARRAY output_buf, int num_rows)\n{\n  jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0,\n\t\t    num_rows, cinfo->output_width);\n}\n\n\n/*\n * Convert grayscale to RGB: just duplicate the graylevel three times.\n * This is provided to support applications that don't want to cope\n * with grayscale as a separate case.\n */\n\nMETHODDEF(void)\ngray_rgb_convert (j_decompress_ptr cinfo,\n\t\t  JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t  JSAMPARRAY output_buf, int num_rows)\n{\n  register JSAMPROW outptr;\n  register JSAMPROW inptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    inptr = input_buf[0][input_row++];\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      /* We can dispense with GETJSAMPLE() here */\n      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];\n      outptr += RGB_PIXELSIZE;\n    }\n  }\n}\n\n\n/*\n * Adobe-style YCCK->CMYK conversion.\n * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same\n * conversion as above, while passing K (black) unchanged.\n * We assume build_ycc_rgb_table has been called.\n */\n\nMETHODDEF(void)\nycck_cmyk_convert (j_decompress_ptr cinfo,\n\t\t   JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t   JSAMPARRAY output_buf, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int y, cb, cr;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2, inptr3;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  register int * Crrtab = cconvert->Cr_r_tab;\n  register int * Cbbtab = cconvert->Cb_b_tab;\n  register INT32 * Crgtab = cconvert->Cr_g_tab;\n  register INT32 * Cbgtab = cconvert->Cb_g_tab;\n  SHIFT_TEMPS\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    inptr3 = input_buf[3][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      y  = GETJSAMPLE(inptr0[col]);\n      cb = GETJSAMPLE(inptr1[col]);\n      cr = GETJSAMPLE(inptr2[col]);\n      /* Range-limiting is essential due to noise introduced by DCT losses,\n       * and for extended gamut encodings (sYCC).\n       */\n      outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])];\t/* red */\n      outptr[1] = range_limit[MAXJSAMPLE - (y +\t\t\t/* green */\n\t\t\t      ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n\t\t\t\t\t\t SCALEBITS)))];\n      outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])];\t/* blue */\n      /* K passes through unchanged */\n      outptr[3] = inptr3[col];\t/* don't need GETJSAMPLE here */\n      outptr += 4;\n    }\n  }\n}\n\n\n/*\n * Empty method for start_pass.\n */\n\nMETHODDEF(void)\nstart_pass_dcolor (j_decompress_ptr cinfo)\n{\n  /* no work needed */\n}\n\n\n/*\n * Module initialization routine for output colorspace conversion.\n */\n\nGLOBAL(void)\njinit_color_deconverter (j_decompress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert;\n  int ci;\n\n  cconvert = (my_cconvert_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_color_deconverter));\n  cinfo->cconvert = &cconvert->pub;\n  cconvert->pub.start_pass = start_pass_dcolor;\n\n  /* Make sure num_components agrees with jpeg_color_space */\n  switch (cinfo->jpeg_color_space) {\n  case JCS_GRAYSCALE:\n    if (cinfo->num_components != 1)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    break;\n\n  case JCS_RGB:\n  case JCS_YCbCr:\n  case JCS_BG_RGB:\n  case JCS_BG_YCC:\n    if (cinfo->num_components != 3)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    break;\n\n  case JCS_CMYK:\n  case JCS_YCCK:\n    if (cinfo->num_components != 4)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    break;\n\n  default:\t\t\t/* JCS_UNKNOWN can be anything */\n    if (cinfo->num_components < 1)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    break;\n  }\n\n  /* Support color transform only for RGB colorspaces */\n  if (cinfo->color_transform &&\n      cinfo->jpeg_color_space != JCS_RGB &&\n      cinfo->jpeg_color_space != JCS_BG_RGB)\n    ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n\n  /* Set out_color_components and conversion method based on requested space.\n   * Also clear the component_needed flags for any unused components,\n   * so that earlier pipeline stages can avoid useless computation.\n   */\n\n  switch (cinfo->out_color_space) {\n  case JCS_GRAYSCALE:\n    cinfo->out_color_components = 1;\n    switch (cinfo->jpeg_color_space) {\n    case JCS_GRAYSCALE:\n    case JCS_YCbCr:\n    case JCS_BG_YCC:\n      cconvert->pub.color_convert = grayscale_convert;\n      /* For color->grayscale conversion, only the Y (0) component is needed */\n      for (ci = 1; ci < cinfo->num_components; ci++)\n\tcinfo->comp_info[ci].component_needed = FALSE;\n      break;\n    case JCS_RGB:\n      switch (cinfo->color_transform) {\n      case JCT_NONE:\n\tcconvert->pub.color_convert = rgb_gray_convert;\n\tbreak;\n      case JCT_SUBTRACT_GREEN:\n\tcconvert->pub.color_convert = rgb1_gray_convert;\n\tbreak;\n      default:\n\tERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n      }\n      build_rgb_y_table(cinfo);\n      break;\n    default:\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    }\n    break;\n\n  case JCS_RGB:\n    cinfo->out_color_components = RGB_PIXELSIZE;\n    switch (cinfo->jpeg_color_space) {\n    case JCS_GRAYSCALE:\n      cconvert->pub.color_convert = gray_rgb_convert;\n      break;\n    case JCS_YCbCr:\n      cconvert->pub.color_convert = ycc_rgb_convert;\n      build_ycc_rgb_table(cinfo);\n      break;\n    case JCS_BG_YCC:\n      cconvert->pub.color_convert = ycc_rgb_convert;\n      build_bg_ycc_rgb_table(cinfo);\n      break;\n    case JCS_RGB:\n      switch (cinfo->color_transform) {\n      case JCT_NONE:\n\tcconvert->pub.color_convert = rgb_convert;\n\tbreak;\n      case JCT_SUBTRACT_GREEN:\n\tcconvert->pub.color_convert = rgb1_rgb_convert;\n\tbreak;\n      default:\n\tERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n      }\n      break;\n    default:\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    }\n    break;\n\n  case JCS_BG_RGB:\n    cinfo->out_color_components = RGB_PIXELSIZE;\n    if (cinfo->jpeg_color_space == JCS_BG_RGB) {\n      switch (cinfo->color_transform) {\n      case JCT_NONE:\n\tcconvert->pub.color_convert = rgb_convert;\n\tbreak;\n      case JCT_SUBTRACT_GREEN:\n\tcconvert->pub.color_convert = rgb1_rgb_convert;\n\tbreak;\n      default:\n\tERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n      }\n    } else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_CMYK:\n    cinfo->out_color_components = 4;\n    switch (cinfo->jpeg_color_space) {\n    case JCS_YCCK:\n      cconvert->pub.color_convert = ycck_cmyk_convert;\n      build_ycc_rgb_table(cinfo);\n      break;\n    case JCS_CMYK:\n      cconvert->pub.color_convert = null_convert;\n      break;\n    default:\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    }\n    break;\n\n  default:\n    /* Permit null conversion to same output space */\n    if (cinfo->out_color_space == cinfo->jpeg_color_space) {\n      cinfo->out_color_components = cinfo->num_components;\n      cconvert->pub.color_convert = null_convert;\n    } else\t\t\t/* unsupported non-null conversion */\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n  }\n\n  if (cinfo->quantize_colors)\n    cinfo->output_components = 1; /* single colormapped output component */\n  else\n    cinfo->output_components = cinfo->out_color_components;\n}\n"
  },
  {
    "path": "jdct.h",
    "content": "/*\n * jdct.h\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This include file contains common declarations for the forward and\n * inverse DCT modules.  These declarations are private to the DCT managers\n * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.\n * The individual DCT algorithms are kept in separate files to ease \n * machine-dependent tuning (e.g., assembly coding).\n */\n\n\n/*\n * A forward DCT routine is given a pointer to an input sample array and\n * a pointer to a work area of type DCTELEM[]; the DCT is to be performed\n * in-place in that buffer.  Type DCTELEM is int for 8-bit samples, INT32\n * for 12-bit samples.  (NOTE: Floating-point DCT implementations use an\n * array of type FAST_FLOAT, instead.)\n * The input data is to be fetched from the sample array starting at a\n * specified column.  (Any row offset needed will be applied to the array\n * pointer before it is passed to the FDCT code.)\n * Note that the number of samples fetched by the FDCT routine is\n * DCT_h_scaled_size * DCT_v_scaled_size.\n * The DCT outputs are returned scaled up by a factor of 8; they therefore\n * have a range of +-8K for 8-bit data, +-128K for 12-bit data.  This\n * convention improves accuracy in integer implementations and saves some\n * work in floating-point ones.\n * Quantization of the output coefficients is done by jcdctmgr.c.\n */\n\n#if BITS_IN_JSAMPLE == 8\ntypedef int DCTELEM;\t\t/* 16 or 32 bits is fine */\n#else\ntypedef INT32 DCTELEM;\t\t/* must have 32 bits */\n#endif\n\ntypedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data,\n\t\t\t\t\t       JSAMPARRAY sample_data,\n\t\t\t\t\t       JDIMENSION start_col));\ntypedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data,\n\t\t\t\t\t     JSAMPARRAY sample_data,\n\t\t\t\t\t     JDIMENSION start_col));\n\n\n/*\n * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer\n * to an output sample array.  The routine must dequantize the input data as\n * well as perform the IDCT; for dequantization, it uses the multiplier table\n * pointed to by compptr->dct_table.  The output data is to be placed into the\n * sample array starting at a specified column.  (Any row offset needed will\n * be applied to the array pointer before it is passed to the IDCT code.)\n * Note that the number of samples emitted by the IDCT routine is\n * DCT_h_scaled_size * DCT_v_scaled_size.\n */\n\n/* typedef inverse_DCT_method_ptr is declared in jpegint.h */\n\n/*\n * Each IDCT routine has its own ideas about the best dct_table element type.\n */\n\ntypedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */\n#if BITS_IN_JSAMPLE == 8\ntypedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */\n#define IFAST_SCALE_BITS  2\t/* fractional bits in scale factors */\n#else\ntypedef INT32 IFAST_MULT_TYPE;\t/* need 32 bits for scaled quantizers */\n#define IFAST_SCALE_BITS  13\t/* fractional bits in scale factors */\n#endif\ntypedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */\n\n\n/*\n * Each IDCT routine is responsible for range-limiting its results and\n * converting them to unsigned form (0..MAXJSAMPLE).  The raw outputs could\n * be quite far out of range if the input data is corrupt, so a bulletproof\n * range-limiting step is required.  We use a mask-and-table-lookup method\n * to do the combined operations quickly.  See the comments with\n * prepare_range_limit_table (in jdmaster.c) for more info.\n */\n\n#define IDCT_range_limit(cinfo)  ((cinfo)->sample_range_limit + CENTERJSAMPLE)\n\n#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */\n\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_fdct_islow\t\tjFDislow\n#define jpeg_fdct_ifast\t\tjFDifast\n#define jpeg_fdct_float\t\tjFDfloat\n#define jpeg_fdct_7x7\t\tjFD7x7\n#define jpeg_fdct_6x6\t\tjFD6x6\n#define jpeg_fdct_5x5\t\tjFD5x5\n#define jpeg_fdct_4x4\t\tjFD4x4\n#define jpeg_fdct_3x3\t\tjFD3x3\n#define jpeg_fdct_2x2\t\tjFD2x2\n#define jpeg_fdct_1x1\t\tjFD1x1\n#define jpeg_fdct_9x9\t\tjFD9x9\n#define jpeg_fdct_10x10\t\tjFD10x10\n#define jpeg_fdct_11x11\t\tjFD11x11\n#define jpeg_fdct_12x12\t\tjFD12x12\n#define jpeg_fdct_13x13\t\tjFD13x13\n#define jpeg_fdct_14x14\t\tjFD14x14\n#define jpeg_fdct_15x15\t\tjFD15x15\n#define jpeg_fdct_16x16\t\tjFD16x16\n#define jpeg_fdct_16x8\t\tjFD16x8\n#define jpeg_fdct_14x7\t\tjFD14x7\n#define jpeg_fdct_12x6\t\tjFD12x6\n#define jpeg_fdct_10x5\t\tjFD10x5\n#define jpeg_fdct_8x4\t\tjFD8x4\n#define jpeg_fdct_6x3\t\tjFD6x3\n#define jpeg_fdct_4x2\t\tjFD4x2\n#define jpeg_fdct_2x1\t\tjFD2x1\n#define jpeg_fdct_8x16\t\tjFD8x16\n#define jpeg_fdct_7x14\t\tjFD7x14\n#define jpeg_fdct_6x12\t\tjFD6x12\n#define jpeg_fdct_5x10\t\tjFD5x10\n#define jpeg_fdct_4x8\t\tjFD4x8\n#define jpeg_fdct_3x6\t\tjFD3x6\n#define jpeg_fdct_2x4\t\tjFD2x4\n#define jpeg_fdct_1x2\t\tjFD1x2\n#define jpeg_idct_islow\t\tjRDislow\n#define jpeg_idct_ifast\t\tjRDifast\n#define jpeg_idct_float\t\tjRDfloat\n#define jpeg_idct_7x7\t\tjRD7x7\n#define jpeg_idct_6x6\t\tjRD6x6\n#define jpeg_idct_5x5\t\tjRD5x5\n#define jpeg_idct_4x4\t\tjRD4x4\n#define jpeg_idct_3x3\t\tjRD3x3\n#define jpeg_idct_2x2\t\tjRD2x2\n#define jpeg_idct_1x1\t\tjRD1x1\n#define jpeg_idct_9x9\t\tjRD9x9\n#define jpeg_idct_10x10\t\tjRD10x10\n#define jpeg_idct_11x11\t\tjRD11x11\n#define jpeg_idct_12x12\t\tjRD12x12\n#define jpeg_idct_13x13\t\tjRD13x13\n#define jpeg_idct_14x14\t\tjRD14x14\n#define jpeg_idct_15x15\t\tjRD15x15\n#define jpeg_idct_16x16\t\tjRD16x16\n#define jpeg_idct_16x8\t\tjRD16x8\n#define jpeg_idct_14x7\t\tjRD14x7\n#define jpeg_idct_12x6\t\tjRD12x6\n#define jpeg_idct_10x5\t\tjRD10x5\n#define jpeg_idct_8x4\t\tjRD8x4\n#define jpeg_idct_6x3\t\tjRD6x3\n#define jpeg_idct_4x2\t\tjRD4x2\n#define jpeg_idct_2x1\t\tjRD2x1\n#define jpeg_idct_8x16\t\tjRD8x16\n#define jpeg_idct_7x14\t\tjRD7x14\n#define jpeg_idct_6x12\t\tjRD6x12\n#define jpeg_idct_5x10\t\tjRD5x10\n#define jpeg_idct_4x8\t\tjRD4x8\n#define jpeg_idct_3x6\t\tjRD3x8\n#define jpeg_idct_2x4\t\tjRD2x4\n#define jpeg_idct_1x2\t\tjRD1x2\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n/* Extern declarations for the forward and inverse DCT routines. */\n\nEXTERN(void) jpeg_fdct_islow\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_ifast\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_float\n    JPP((FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_7x7\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_6x6\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_5x5\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_4x4\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_3x3\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_2x2\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_1x1\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_9x9\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_10x10\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_11x11\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_12x12\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_13x13\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_14x14\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_15x15\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_16x16\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_16x8\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_14x7\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_12x6\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_10x5\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_8x4\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_6x3\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_4x2\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_2x1\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_8x16\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_7x14\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_6x12\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_5x10\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_4x8\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_3x6\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_2x4\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\nEXTERN(void) jpeg_fdct_1x2\n    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));\n\nEXTERN(void) jpeg_idct_islow\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_ifast\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_float\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_7x7\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_6x6\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_5x5\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_4x4\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_3x3\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_2x2\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_1x1\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_9x9\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_10x10\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_11x11\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_12x12\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_13x13\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_14x14\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_15x15\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_16x16\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_16x8\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_14x7\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_12x6\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_10x5\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_8x4\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_6x3\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_4x2\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_2x1\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_8x16\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_7x14\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_6x12\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_5x10\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_4x8\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_3x6\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_2x4\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_1x2\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\n\n\n/*\n * Macros for handling fixed-point arithmetic; these are used by many\n * but not all of the DCT/IDCT modules.\n *\n * All values are expected to be of type INT32.\n * Fractional constants are scaled left by CONST_BITS bits.\n * CONST_BITS is defined within each module using these macros,\n * and may differ from one module to the next.\n */\n\n#define ONE\t((INT32) 1)\n#define CONST_SCALE (ONE << CONST_BITS)\n\n/* Convert a positive real constant to an integer scaled by CONST_SCALE.\n * Caution: some C compilers fail to reduce \"FIX(constant)\" at compile time,\n * thus causing a lot of useless floating-point operations at run time.\n */\n\n#define FIX(x)\t((INT32) ((x) * CONST_SCALE + 0.5))\n\n/* Descale and correctly round an INT32 value that's scaled by N bits.\n * We assume RIGHT_SHIFT rounds towards minus infinity, so adding\n * the fudge factor is correct for either sign of X.\n */\n\n#define DESCALE(x,n)  RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)\n\n/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.\n * This macro is used only when the two inputs will actually be no more than\n * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a\n * full 32x32 multiply.  This provides a useful speedup on many machines.\n * Unfortunately there is no way to specify a 16x16->32 multiply portably\n * in C, but some C compilers will do the right thing if you provide the\n * correct combination of casts.\n */\n\n#ifdef SHORTxSHORT_32\t\t/* may work if 'int' is 32 bits */\n#define MULTIPLY16C16(var,const)  (((INT16) (var)) * ((INT16) (const)))\n#endif\n#ifdef SHORTxLCONST_32\t\t/* known to work with Microsoft C 6.0 */\n#define MULTIPLY16C16(var,const)  (((INT16) (var)) * ((INT32) (const)))\n#endif\n\n#ifndef MULTIPLY16C16\t\t/* default definition */\n#define MULTIPLY16C16(var,const)  ((var) * (const))\n#endif\n\n/* Same except both inputs are variables. */\n\n#ifdef SHORTxSHORT_32\t\t/* may work if 'int' is 32 bits */\n#define MULTIPLY16V16(var1,var2)  (((INT16) (var1)) * ((INT16) (var2)))\n#endif\n\n#ifndef MULTIPLY16V16\t\t/* default definition */\n#define MULTIPLY16V16(var1,var2)  ((var1) * (var2))\n#endif\n"
  },
  {
    "path": "jddctmgr.c",
    "content": "/*\n * jddctmgr.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2002-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the inverse-DCT management logic.\n * This code selects a particular IDCT implementation to be used,\n * and it performs related housekeeping chores.  No code in this file\n * is executed per IDCT step, only during output pass setup.\n *\n * Note that the IDCT routines are responsible for performing coefficient\n * dequantization as well as the IDCT proper.  This module sets up the\n * dequantization multiplier table needed by the IDCT routine.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n\n/*\n * The decompressor input side (jdinput.c) saves away the appropriate\n * quantization table for each component at the start of the first scan\n * involving that component.  (This is necessary in order to correctly\n * decode files that reuse Q-table slots.)\n * When we are ready to make an output pass, the saved Q-table is converted\n * to a multiplier table that will actually be used by the IDCT routine.\n * The multiplier table contents are IDCT-method-dependent.  To support\n * application changes in IDCT method between scans, we can remake the\n * multiplier tables if necessary.\n * In buffered-image mode, the first output pass may occur before any data\n * has been seen for some components, and thus before their Q-tables have\n * been saved away.  To handle this case, multiplier tables are preset\n * to zeroes; the result of the IDCT will be a neutral gray level.\n */\n\n\n/* Private subobject for this module */\n\ntypedef struct {\n  struct jpeg_inverse_dct pub;\t/* public fields */\n\n  /* This array contains the IDCT method code that each multiplier table\n   * is currently set up for, or -1 if it's not yet set up.\n   * The actual multiplier tables are pointed to by dct_table in the\n   * per-component comp_info structures.\n   */\n  int cur_method[MAX_COMPONENTS];\n} my_idct_controller;\n\ntypedef my_idct_controller * my_idct_ptr;\n\n\n/* Allocated multiplier tables: big enough for any supported variant */\n\ntypedef union {\n  ISLOW_MULT_TYPE islow_array[DCTSIZE2];\n#ifdef DCT_IFAST_SUPPORTED\n  IFAST_MULT_TYPE ifast_array[DCTSIZE2];\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  FLOAT_MULT_TYPE float_array[DCTSIZE2];\n#endif\n} multiplier_table;\n\n\n/* The current scaled-IDCT routines require ISLOW-style multiplier tables,\n * so be sure to compile that code if either ISLOW or SCALING is requested.\n */\n#ifdef DCT_ISLOW_SUPPORTED\n#define PROVIDE_ISLOW_TABLES\n#else\n#ifdef IDCT_SCALING_SUPPORTED\n#define PROVIDE_ISLOW_TABLES\n#endif\n#endif\n\n\n/*\n * Prepare for an output pass.\n * Here we select the proper IDCT routine for each component and build\n * a matching multiplier table.\n */\n\nMETHODDEF(void)\nstart_pass (j_decompress_ptr cinfo)\n{\n  my_idct_ptr idct = (my_idct_ptr) cinfo->idct;\n  int ci, i;\n  jpeg_component_info *compptr;\n  int method = 0;\n  inverse_DCT_method_ptr method_ptr = NULL;\n  JQUANT_TBL * qtbl;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Select the proper IDCT routine for this component's scaling */\n    switch ((compptr->DCT_h_scaled_size << 8) + compptr->DCT_v_scaled_size) {\n#ifdef IDCT_SCALING_SUPPORTED\n    case ((1 << 8) + 1):\n      method_ptr = jpeg_idct_1x1;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((2 << 8) + 2):\n      method_ptr = jpeg_idct_2x2;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((3 << 8) + 3):\n      method_ptr = jpeg_idct_3x3;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((4 << 8) + 4):\n      method_ptr = jpeg_idct_4x4;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((5 << 8) + 5):\n      method_ptr = jpeg_idct_5x5;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((6 << 8) + 6):\n      method_ptr = jpeg_idct_6x6;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((7 << 8) + 7):\n      method_ptr = jpeg_idct_7x7;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((9 << 8) + 9):\n      method_ptr = jpeg_idct_9x9;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((10 << 8) + 10):\n      method_ptr = jpeg_idct_10x10;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((11 << 8) + 11):\n      method_ptr = jpeg_idct_11x11;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((12 << 8) + 12):\n      method_ptr = jpeg_idct_12x12;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((13 << 8) + 13):\n      method_ptr = jpeg_idct_13x13;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((14 << 8) + 14):\n      method_ptr = jpeg_idct_14x14;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((15 << 8) + 15):\n      method_ptr = jpeg_idct_15x15;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((16 << 8) + 16):\n      method_ptr = jpeg_idct_16x16;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((16 << 8) + 8):\n      method_ptr = jpeg_idct_16x8;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((14 << 8) + 7):\n      method_ptr = jpeg_idct_14x7;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((12 << 8) + 6):\n      method_ptr = jpeg_idct_12x6;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((10 << 8) + 5):\n      method_ptr = jpeg_idct_10x5;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((8 << 8) + 4):\n      method_ptr = jpeg_idct_8x4;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((6 << 8) + 3):\n      method_ptr = jpeg_idct_6x3;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((4 << 8) + 2):\n      method_ptr = jpeg_idct_4x2;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((2 << 8) + 1):\n      method_ptr = jpeg_idct_2x1;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((8 << 8) + 16):\n      method_ptr = jpeg_idct_8x16;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((7 << 8) + 14):\n      method_ptr = jpeg_idct_7x14;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((6 << 8) + 12):\n      method_ptr = jpeg_idct_6x12;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((5 << 8) + 10):\n      method_ptr = jpeg_idct_5x10;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((4 << 8) + 8):\n      method_ptr = jpeg_idct_4x8;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((3 << 8) + 6):\n      method_ptr = jpeg_idct_3x6;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((2 << 8) + 4):\n      method_ptr = jpeg_idct_2x4;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case ((1 << 8) + 2):\n      method_ptr = jpeg_idct_1x2;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n#endif\n    case ((DCTSIZE << 8) + DCTSIZE):\n      switch (cinfo->dct_method) {\n#ifdef DCT_ISLOW_SUPPORTED\n      case JDCT_ISLOW:\n\tmethod_ptr = jpeg_idct_islow;\n\tmethod = JDCT_ISLOW;\n\tbreak;\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n      case JDCT_IFAST:\n\tmethod_ptr = jpeg_idct_ifast;\n\tmethod = JDCT_IFAST;\n\tbreak;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n      case JDCT_FLOAT:\n\tmethod_ptr = jpeg_idct_float;\n\tmethod = JDCT_FLOAT;\n\tbreak;\n#endif\n      default:\n\tERREXIT(cinfo, JERR_NOT_COMPILED);\n\tbreak;\n      }\n      break;\n    default:\n      ERREXIT2(cinfo, JERR_BAD_DCTSIZE,\n\t       compptr->DCT_h_scaled_size, compptr->DCT_v_scaled_size);\n      break;\n    }\n    idct->pub.inverse_DCT[ci] = method_ptr;\n    /* Create multiplier table from quant table.\n     * However, we can skip this if the component is uninteresting\n     * or if we already built the table.  Also, if no quant table\n     * has yet been saved for the component, we leave the\n     * multiplier table all-zero; we'll be reading zeroes from the\n     * coefficient controller's buffer anyway.\n     */\n    if (! compptr->component_needed || idct->cur_method[ci] == method)\n      continue;\n    qtbl = compptr->quant_table;\n    if (qtbl == NULL)\t\t/* happens if no data yet for component */\n      continue;\n    idct->cur_method[ci] = method;\n    switch (method) {\n#ifdef PROVIDE_ISLOW_TABLES\n    case JDCT_ISLOW:\n      {\n\t/* For LL&M IDCT method, multipliers are equal to raw quantization\n\t * coefficients, but are stored as ints to ensure access efficiency.\n\t */\n\tISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table;\n\tfor (i = 0; i < DCTSIZE2; i++) {\n\t  ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i];\n\t}\n      }\n      break;\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n    case JDCT_IFAST:\n      {\n\t/* For AA&N IDCT method, multipliers are equal to quantization\n\t * coefficients scaled by scalefactor[row]*scalefactor[col], where\n\t *   scalefactor[0] = 1\n\t *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n\t * For integer operation, the multiplier table is to be scaled by\n\t * IFAST_SCALE_BITS.\n\t */\n\tIFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table;\n#define CONST_BITS 14\n\tstatic const INT16 aanscales[DCTSIZE2] = {\n\t  /* precomputed values scaled up by 14 bits */\n\t  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,\n\t  22725, 31521, 29692, 26722, 22725, 17855, 12299,  6270,\n\t  21407, 29692, 27969, 25172, 21407, 16819, 11585,  5906,\n\t  19266, 26722, 25172, 22654, 19266, 15137, 10426,  5315,\n\t  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,\n\t  12873, 17855, 16819, 15137, 12873, 10114,  6967,  3552,\n\t   8867, 12299, 11585, 10426,  8867,  6967,  4799,  2446,\n\t   4520,  6270,  5906,  5315,  4520,  3552,  2446,  1247\n\t};\n\tSHIFT_TEMPS\n\n\tfor (i = 0; i < DCTSIZE2; i++) {\n\t  ifmtbl[i] = (IFAST_MULT_TYPE)\n\t    DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],\n\t\t\t\t  (INT32) aanscales[i]),\n\t\t    CONST_BITS-IFAST_SCALE_BITS);\n\t}\n      }\n      break;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n    case JDCT_FLOAT:\n      {\n\t/* For float AA&N IDCT method, multipliers are equal to quantization\n\t * coefficients scaled by scalefactor[row]*scalefactor[col], where\n\t *   scalefactor[0] = 1\n\t *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n\t * We apply a further scale factor of 1/8.\n\t */\n\tFLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;\n\tint row, col;\n\tstatic const double aanscalefactor[DCTSIZE] = {\n\t  1.0, 1.387039845, 1.306562965, 1.175875602,\n\t  1.0, 0.785694958, 0.541196100, 0.275899379\n\t};\n\n\ti = 0;\n\tfor (row = 0; row < DCTSIZE; row++) {\n\t  for (col = 0; col < DCTSIZE; col++) {\n\t    fmtbl[i] = (FLOAT_MULT_TYPE)\n\t      ((double) qtbl->quantval[i] *\n\t       aanscalefactor[row] * aanscalefactor[col] * 0.125);\n\t    i++;\n\t  }\n\t}\n      }\n      break;\n#endif\n    default:\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n      break;\n    }\n  }\n}\n\n\n/*\n * Initialize IDCT manager.\n */\n\nGLOBAL(void)\njinit_inverse_dct (j_decompress_ptr cinfo)\n{\n  my_idct_ptr idct;\n  int ci;\n  jpeg_component_info *compptr;\n\n  idct = (my_idct_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_idct_controller));\n  cinfo->idct = &idct->pub;\n  idct->pub.start_pass = start_pass;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Allocate and pre-zero a multiplier table for each component */\n    compptr->dct_table =\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(multiplier_table));\n    MEMZERO(compptr->dct_table, SIZEOF(multiplier_table));\n    /* Mark multiplier table not yet set up for any method */\n    idct->cur_method[ci] = -1;\n  }\n}\n"
  },
  {
    "path": "jdhuff.c",
    "content": "/*\n * jdhuff.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2006-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains Huffman entropy decoding routines.\n * Both sequential and progressive modes are supported in this single module.\n *\n * Much of the complexity here has to do with supporting input suspension.\n * If the data source module demands suspension, we want to be able to back\n * up to the start of the current MCU.  To do this, we copy state variables\n * into local working storage, and update them back to the permanent\n * storage only upon successful completion of an MCU.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Derived data constructed for each Huffman table */\n\n#define HUFF_LOOKAHEAD\t8\t/* # of bits of lookahead */\n\ntypedef struct {\n  /* Basic tables: (element [0] of each array is unused) */\n  INT32 maxcode[18];\t\t/* largest code of length k (-1 if none) */\n  /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */\n  INT32 valoffset[17];\t\t/* huffval[] offset for codes of length k */\n  /* valoffset[k] = huffval[] index of 1st symbol of code length k, less\n   * the smallest code of length k; so given a code of length k, the\n   * corresponding symbol is huffval[code + valoffset[k]]\n   */\n\n  /* Link to public Huffman table (needed only in jpeg_huff_decode) */\n  JHUFF_TBL *pub;\n\n  /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of\n   * the input data stream.  If the next Huffman code is no more\n   * than HUFF_LOOKAHEAD bits long, we can obtain its length and\n   * the corresponding symbol directly from these tables.\n   */\n  int look_nbits[1<<HUFF_LOOKAHEAD]; /* # bits, or 0 if too long */\n  UINT8 look_sym[1<<HUFF_LOOKAHEAD]; /* symbol, or unused */\n} d_derived_tbl;\n\n\n/*\n * Fetching the next N bits from the input stream is a time-critical operation\n * for the Huffman decoders.  We implement it with a combination of inline\n * macros and out-of-line subroutines.  Note that N (the number of bits\n * demanded at one time) never exceeds 15 for JPEG use.\n *\n * We read source bytes into get_buffer and dole out bits as needed.\n * If get_buffer already contains enough bits, they are fetched in-line\n * by the macros CHECK_BIT_BUFFER and GET_BITS.  When there aren't enough\n * bits, jpeg_fill_bit_buffer is called; it will attempt to fill get_buffer\n * as full as possible (not just to the number of bits needed; this\n * prefetching reduces the overhead cost of calling jpeg_fill_bit_buffer).\n * Note that jpeg_fill_bit_buffer may return FALSE to indicate suspension.\n * On TRUE return, jpeg_fill_bit_buffer guarantees that get_buffer contains\n * at least the requested number of bits --- dummy zeroes are inserted if\n * necessary.\n */\n\ntypedef INT32 bit_buf_type;\t/* type of bit-extraction buffer */\n#define BIT_BUF_SIZE  32\t/* size of buffer in bits */\n\n/* If long is > 32 bits on your machine, and shifting/masking longs is\n * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE\n * appropriately should be a win.  Unfortunately we can't define the size\n * with something like  #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8)\n * because not all machines measure sizeof in 8-bit bytes.\n */\n\ntypedef struct {\t\t/* Bitreading state saved across MCUs */\n  bit_buf_type get_buffer;\t/* current bit-extraction buffer */\n  int bits_left;\t\t/* # of unused bits in it */\n} bitread_perm_state;\n\ntypedef struct {\t\t/* Bitreading working state within an MCU */\n  /* Current data source location */\n  /* We need a copy, rather than munging the original, in case of suspension */\n  const JOCTET * next_input_byte; /* => next byte to read from source */\n  size_t bytes_in_buffer;\t/* # of bytes remaining in source buffer */\n  /* Bit input buffer --- note these values are kept in register variables,\n   * not in this struct, inside the inner loops.\n   */\n  bit_buf_type get_buffer;\t/* current bit-extraction buffer */\n  int bits_left;\t\t/* # of unused bits in it */\n  /* Pointer needed by jpeg_fill_bit_buffer. */\n  j_decompress_ptr cinfo;\t/* back link to decompress master record */\n} bitread_working_state;\n\n/* Macros to declare and load/save bitread local variables. */\n#define BITREAD_STATE_VARS  \\\n\tregister bit_buf_type get_buffer;  \\\n\tregister int bits_left;  \\\n\tbitread_working_state br_state\n\n#define BITREAD_LOAD_STATE(cinfop,permstate)  \\\n\tbr_state.cinfo = cinfop; \\\n\tbr_state.next_input_byte = cinfop->src->next_input_byte; \\\n\tbr_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \\\n\tget_buffer = permstate.get_buffer; \\\n\tbits_left = permstate.bits_left;\n\n#define BITREAD_SAVE_STATE(cinfop,permstate)  \\\n\tcinfop->src->next_input_byte = br_state.next_input_byte; \\\n\tcinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \\\n\tpermstate.get_buffer = get_buffer; \\\n\tpermstate.bits_left = bits_left\n\n/*\n * These macros provide the in-line portion of bit fetching.\n * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer\n * before using GET_BITS, PEEK_BITS, or DROP_BITS.\n * The variables get_buffer and bits_left are assumed to be locals,\n * but the state struct might not be (jpeg_huff_decode needs this).\n *\tCHECK_BIT_BUFFER(state,n,action);\n *\t\tEnsure there are N bits in get_buffer; if suspend, take action.\n *      val = GET_BITS(n);\n *\t\tFetch next N bits.\n *      val = PEEK_BITS(n);\n *\t\tFetch next N bits without removing them from the buffer.\n *\tDROP_BITS(n);\n *\t\tDiscard next N bits.\n * The value N should be a simple variable, not an expression, because it\n * is evaluated multiple times.\n */\n\n#define CHECK_BIT_BUFFER(state,nbits,action) \\\n\t{ if (bits_left < (nbits)) {  \\\n\t    if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits))  \\\n\t      { action; }  \\\n\t    get_buffer = (state).get_buffer; bits_left = (state).bits_left; } }\n\n#define GET_BITS(nbits) \\\n\t(((int) (get_buffer >> (bits_left -= (nbits)))) & BIT_MASK(nbits))\n\n#define PEEK_BITS(nbits) \\\n\t(((int) (get_buffer >> (bits_left -  (nbits)))) & BIT_MASK(nbits))\n\n#define DROP_BITS(nbits) \\\n\t(bits_left -= (nbits))\n\n\n/*\n * Code for extracting next Huffman-coded symbol from input bit stream.\n * Again, this is time-critical and we make the main paths be macros.\n *\n * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits\n * without looping.  Usually, more than 95% of the Huffman codes will be 8\n * or fewer bits long.  The few overlength codes are handled with a loop,\n * which need not be inline code.\n *\n * Notes about the HUFF_DECODE macro:\n * 1. Near the end of the data segment, we may fail to get enough bits\n *    for a lookahead.  In that case, we do it the hard way.\n * 2. If the lookahead table contains no entry, the next code must be\n *    more than HUFF_LOOKAHEAD bits long.\n * 3. jpeg_huff_decode returns -1 if forced to suspend.\n */\n\n#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \\\n{ register int nb, look; \\\n  if (bits_left < HUFF_LOOKAHEAD) { \\\n    if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \\\n    get_buffer = state.get_buffer; bits_left = state.bits_left; \\\n    if (bits_left < HUFF_LOOKAHEAD) { \\\n      nb = 1; goto slowlabel; \\\n    } \\\n  } \\\n  look = PEEK_BITS(HUFF_LOOKAHEAD); \\\n  if ((nb = htbl->look_nbits[look]) != 0) { \\\n    DROP_BITS(nb); \\\n    result = htbl->look_sym[look]; \\\n  } else { \\\n    nb = HUFF_LOOKAHEAD+1; \\\nslowlabel: \\\n    if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \\\n\t{ failaction; } \\\n    get_buffer = state.get_buffer; bits_left = state.bits_left; \\\n  } \\\n}\n\n\n/*\n * Expanded entropy decoder object for Huffman decoding.\n *\n * The savable_state subrecord contains fields that change within an MCU,\n * but must not be updated permanently until we complete the MCU.\n */\n\ntypedef struct {\n  unsigned int EOBRUN;\t\t\t/* remaining EOBs in EOBRUN */\n  int last_dc_val[MAX_COMPS_IN_SCAN];\t/* last DC coef for each component */\n} savable_state;\n\n/* This macro is to work around compilers with missing or broken\n * structure assignment.  You'll need to fix this code if you have\n * such a compiler and you change MAX_COMPS_IN_SCAN.\n */\n\n#ifndef NO_STRUCT_ASSIGN\n#define ASSIGN_STATE(dest,src)  ((dest) = (src))\n#else\n#if MAX_COMPS_IN_SCAN == 4\n#define ASSIGN_STATE(dest,src)  \\\n\t((dest).EOBRUN = (src).EOBRUN, \\\n\t (dest).last_dc_val[0] = (src).last_dc_val[0], \\\n\t (dest).last_dc_val[1] = (src).last_dc_val[1], \\\n\t (dest).last_dc_val[2] = (src).last_dc_val[2], \\\n\t (dest).last_dc_val[3] = (src).last_dc_val[3])\n#endif\n#endif\n\n\ntypedef struct {\n  struct jpeg_entropy_decoder pub; /* public fields */\n\n  /* These fields are loaded into local variables at start of each MCU.\n   * In case of suspension, we exit WITHOUT updating them.\n   */\n  bitread_perm_state bitstate;\t/* Bit buffer at start of MCU */\n  savable_state saved;\t\t/* Other state at start of MCU */\n\n  /* These fields are NOT loaded into local working state. */\n  boolean insufficient_data;\t/* set TRUE after emitting warning */\n  unsigned int restarts_to_go;\t/* MCUs left in this restart interval */\n\n  /* Following two fields used only in progressive mode */\n\n  /* Pointers to derived tables (these workspaces have image lifespan) */\n  d_derived_tbl * derived_tbls[NUM_HUFF_TBLS];\n\n  d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */\n\n  /* Following fields used only in sequential mode */\n\n  /* Pointers to derived tables (these workspaces have image lifespan) */\n  d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];\n  d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];\n\n  /* Precalculated info set up by start_pass for use in decode_mcu: */\n\n  /* Pointers to derived tables to be used for each block within an MCU */\n  d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU];\n  d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU];\n  /* Whether we care about the DC and AC coefficient values for each block */\n  int coef_limit[D_MAX_BLOCKS_IN_MCU];\n} huff_entropy_decoder;\n\ntypedef huff_entropy_decoder * huff_entropy_ptr;\n\n\nstatic const int jpeg_zigzag_order[8][8] = {\n  {  0,  1,  5,  6, 14, 15, 27, 28 },\n  {  2,  4,  7, 13, 16, 26, 29, 42 },\n  {  3,  8, 12, 17, 25, 30, 41, 43 },\n  {  9, 11, 18, 24, 31, 40, 44, 53 },\n  { 10, 19, 23, 32, 39, 45, 52, 54 },\n  { 20, 22, 33, 38, 46, 51, 55, 60 },\n  { 21, 34, 37, 47, 50, 56, 59, 61 },\n  { 35, 36, 48, 49, 57, 58, 62, 63 }\n};\n\nstatic const int jpeg_zigzag_order7[7][7] = {\n  {  0,  1,  5,  6, 14, 15, 27 },\n  {  2,  4,  7, 13, 16, 26, 28 },\n  {  3,  8, 12, 17, 25, 29, 38 },\n  {  9, 11, 18, 24, 30, 37, 39 },\n  { 10, 19, 23, 31, 36, 40, 45 },\n  { 20, 22, 32, 35, 41, 44, 46 },\n  { 21, 33, 34, 42, 43, 47, 48 }\n};\n\nstatic const int jpeg_zigzag_order6[6][6] = {\n  {  0,  1,  5,  6, 14, 15 },\n  {  2,  4,  7, 13, 16, 25 },\n  {  3,  8, 12, 17, 24, 26 },\n  {  9, 11, 18, 23, 27, 32 },\n  { 10, 19, 22, 28, 31, 33 },\n  { 20, 21, 29, 30, 34, 35 }\n};\n\nstatic const int jpeg_zigzag_order5[5][5] = {\n  {  0,  1,  5,  6, 14 },\n  {  2,  4,  7, 13, 15 },\n  {  3,  8, 12, 16, 21 },\n  {  9, 11, 17, 20, 22 },\n  { 10, 18, 19, 23, 24 }\n};\n\nstatic const int jpeg_zigzag_order4[4][4] = {\n  { 0,  1,  5,  6 },\n  { 2,  4,  7, 12 },\n  { 3,  8, 11, 13 },\n  { 9, 10, 14, 15 }\n};\n\nstatic const int jpeg_zigzag_order3[3][3] = {\n  { 0, 1, 5 },\n  { 2, 4, 6 },\n  { 3, 7, 8 }\n};\n\nstatic const int jpeg_zigzag_order2[2][2] = {\n  { 0, 1 },\n  { 2, 3 }\n};\n\n\n/*\n * Compute the derived values for a Huffman table.\n * This routine also performs some validation checks on the table.\n */\n\nLOCAL(void)\njpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,\n\t\t\t d_derived_tbl ** pdtbl)\n{\n  JHUFF_TBL *htbl;\n  d_derived_tbl *dtbl;\n  int p, i, l, si, numsymbols;\n  int lookbits, ctr;\n  char huffsize[257];\n  unsigned int huffcode[257];\n  unsigned int code;\n\n  /* Note that huffsize[] and huffcode[] are filled in code-length order,\n   * paralleling the order of the symbols themselves in htbl->huffval[].\n   */\n\n  /* Find the input Huffman table */\n  if (tblno < 0 || tblno >= NUM_HUFF_TBLS)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);\n  htbl =\n    isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];\n  if (htbl == NULL)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);\n\n  /* Allocate a workspace if we haven't already done so. */\n  if (*pdtbl == NULL)\n    *pdtbl = (d_derived_tbl *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(d_derived_tbl));\n  dtbl = *pdtbl;\n  dtbl->pub = htbl;\t\t/* fill in back link */\n  \n  /* Figure C.1: make table of Huffman code length for each symbol */\n\n  p = 0;\n  for (l = 1; l <= 16; l++) {\n    i = (int) htbl->bits[l];\n    if (i < 0 || p + i > 256)\t/* protect against table overrun */\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    while (i--)\n      huffsize[p++] = (char) l;\n  }\n  huffsize[p] = 0;\n  numsymbols = p;\n  \n  /* Figure C.2: generate the codes themselves */\n  /* We also validate that the counts represent a legal Huffman code tree. */\n  \n  code = 0;\n  si = huffsize[0];\n  p = 0;\n  while (huffsize[p]) {\n    while (((int) huffsize[p]) == si) {\n      huffcode[p++] = code;\n      code++;\n    }\n    /* code is now 1 more than the last code used for codelength si; but\n     * it must still fit in si bits, since no code is allowed to be all ones.\n     */\n    if (((INT32) code) >= (((INT32) 1) << si))\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    code <<= 1;\n    si++;\n  }\n\n  /* Figure F.15: generate decoding tables for bit-sequential decoding */\n\n  p = 0;\n  for (l = 1; l <= 16; l++) {\n    if (htbl->bits[l]) {\n      /* valoffset[l] = huffval[] index of 1st symbol of code length l,\n       * minus the minimum code of length l\n       */\n      dtbl->valoffset[l] = (INT32) p - (INT32) huffcode[p];\n      p += htbl->bits[l];\n      dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */\n    } else {\n      dtbl->maxcode[l] = -1;\t/* -1 if no codes of this length */\n    }\n  }\n  dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */\n\n  /* Compute lookahead tables to speed up decoding.\n   * First we set all the table entries to 0, indicating \"too long\";\n   * then we iterate through the Huffman codes that are short enough and\n   * fill in all the entries that correspond to bit sequences starting\n   * with that code.\n   */\n\n  MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits));\n\n  p = 0;\n  for (l = 1; l <= HUFF_LOOKAHEAD; l++) {\n    for (i = 1; i <= (int) htbl->bits[l]; i++, p++) {\n      /* l = current code's length, p = its index in huffcode[] & huffval[]. */\n      /* Generate left-justified code followed by all possible bit sequences */\n      lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l);\n      for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) {\n\tdtbl->look_nbits[lookbits] = l;\n\tdtbl->look_sym[lookbits] = htbl->huffval[p];\n\tlookbits++;\n      }\n    }\n  }\n\n  /* Validate symbols as being reasonable.\n   * For AC tables, we make no check, but accept all byte values 0..255.\n   * For DC tables, we require the symbols to be in range 0..15.\n   * (Tighter bounds could be applied depending on the data depth and mode,\n   * but this is sufficient to ensure safe decoding.)\n   */\n  if (isDC) {\n    for (i = 0; i < numsymbols; i++) {\n      int sym = htbl->huffval[i];\n      if (sym < 0 || sym > 15)\n\tERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    }\n  }\n}\n\n\n/*\n * Out-of-line code for bit fetching.\n * Note: current values of get_buffer and bits_left are passed as parameters,\n * but are returned in the corresponding fields of the state struct.\n *\n * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width\n * of get_buffer to be used.  (On machines with wider words, an even larger\n * buffer could be used.)  However, on some machines 32-bit shifts are\n * quite slow and take time proportional to the number of places shifted.\n * (This is true with most PC compilers, for instance.)  In this case it may\n * be a win to set MIN_GET_BITS to the minimum value of 15.  This reduces the\n * average shift distance at the cost of more calls to jpeg_fill_bit_buffer.\n */\n\n#ifdef SLOW_SHIFT_32\n#define MIN_GET_BITS  15\t/* minimum allowable value */\n#else\n#define MIN_GET_BITS  (BIT_BUF_SIZE-7)\n#endif\n\n\nLOCAL(boolean)\njpeg_fill_bit_buffer (bitread_working_state * state,\n\t\t      register bit_buf_type get_buffer, register int bits_left,\n\t\t      int nbits)\n/* Load up the bit buffer to a depth of at least nbits */\n{\n  /* Copy heavily used state fields into locals (hopefully registers) */\n  register const JOCTET * next_input_byte = state->next_input_byte;\n  register size_t bytes_in_buffer = state->bytes_in_buffer;\n  j_decompress_ptr cinfo = state->cinfo;\n\n  /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */\n  /* (It is assumed that no request will be for more than that many bits.) */\n  /* We fail to do so only if we hit a marker or are forced to suspend. */\n\n  if (cinfo->unread_marker == 0) {\t/* cannot advance past a marker */\n    while (bits_left < MIN_GET_BITS) {\n      register int c;\n\n      /* Attempt to read a byte */\n      if (bytes_in_buffer == 0) {\n\tif (! (*cinfo->src->fill_input_buffer) (cinfo))\n\t  return FALSE;\n\tnext_input_byte = cinfo->src->next_input_byte;\n\tbytes_in_buffer = cinfo->src->bytes_in_buffer;\n      }\n      bytes_in_buffer--;\n      c = GETJOCTET(*next_input_byte++);\n\n      /* If it's 0xFF, check and discard stuffed zero byte */\n      if (c == 0xFF) {\n\t/* Loop here to discard any padding FF's on terminating marker,\n\t * so that we can save a valid unread_marker value.  NOTE: we will\n\t * accept multiple FF's followed by a 0 as meaning a single FF data\n\t * byte.  This data pattern is not valid according to the standard.\n\t */\n\tdo {\n\t  if (bytes_in_buffer == 0) {\n\t    if (! (*cinfo->src->fill_input_buffer) (cinfo))\n\t      return FALSE;\n\t    next_input_byte = cinfo->src->next_input_byte;\n\t    bytes_in_buffer = cinfo->src->bytes_in_buffer;\n\t  }\n\t  bytes_in_buffer--;\n\t  c = GETJOCTET(*next_input_byte++);\n\t} while (c == 0xFF);\n\n\tif (c == 0) {\n\t  /* Found FF/00, which represents an FF data byte */\n\t  c = 0xFF;\n\t} else {\n\t  /* Oops, it's actually a marker indicating end of compressed data.\n\t   * Save the marker code for later use.\n\t   * Fine point: it might appear that we should save the marker into\n\t   * bitread working state, not straight into permanent state.  But\n\t   * once we have hit a marker, we cannot need to suspend within the\n\t   * current MCU, because we will read no more bytes from the data\n\t   * source.  So it is OK to update permanent state right away.\n\t   */\n\t  cinfo->unread_marker = c;\n\t  /* See if we need to insert some fake zero bits. */\n\t  goto no_more_bytes;\n\t}\n      }\n\n      /* OK, load c into get_buffer */\n      get_buffer = (get_buffer << 8) | c;\n      bits_left += 8;\n    } /* end while */\n  } else {\n  no_more_bytes:\n    /* We get here if we've read the marker that terminates the compressed\n     * data segment.  There should be enough bits in the buffer register\n     * to satisfy the request; if so, no problem.\n     */\n    if (nbits > bits_left) {\n      /* Uh-oh.  Report corrupted data to user and stuff zeroes into\n       * the data stream, so that we can produce some kind of image.\n       * We use a nonvolatile flag to ensure that only one warning message\n       * appears per data segment.\n       */\n      if (! ((huff_entropy_ptr) cinfo->entropy)->insufficient_data) {\n\tWARNMS(cinfo, JWRN_HIT_MARKER);\n\t((huff_entropy_ptr) cinfo->entropy)->insufficient_data = TRUE;\n      }\n      /* Fill the buffer with zero bits */\n      get_buffer <<= MIN_GET_BITS - bits_left;\n      bits_left = MIN_GET_BITS;\n    }\n  }\n\n  /* Unload the local registers */\n  state->next_input_byte = next_input_byte;\n  state->bytes_in_buffer = bytes_in_buffer;\n  state->get_buffer = get_buffer;\n  state->bits_left = bits_left;\n\n  return TRUE;\n}\n\n\n/*\n * Figure F.12: extend sign bit.\n * On some machines, a shift and sub will be faster than a table lookup.\n */\n\n#ifdef AVOID_TABLES\n\n#define BIT_MASK(nbits)   ((1<<(nbits))-1)\n#define HUFF_EXTEND(x,s)  ((x) < (1<<((s)-1)) ? (x) - ((1<<(s))-1) : (x))\n\n#else\n\n#define BIT_MASK(nbits)   bmask[nbits]\n#define HUFF_EXTEND(x,s)  ((x) <= bmask[(s) - 1] ? (x) - bmask[s] : (x))\n\nstatic const int bmask[16] =\t/* bmask[n] is mask for n rightmost bits */\n  { 0, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF,\n    0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF };\n\n#endif /* AVOID_TABLES */\n\n\n/*\n * Out-of-line code for Huffman code decoding.\n */\n\nLOCAL(int)\njpeg_huff_decode (bitread_working_state * state,\n\t\t  register bit_buf_type get_buffer, register int bits_left,\n\t\t  d_derived_tbl * htbl, int min_bits)\n{\n  register int l = min_bits;\n  register INT32 code;\n\n  /* HUFF_DECODE has determined that the code is at least min_bits */\n  /* bits long, so fetch that many bits in one swoop. */\n\n  CHECK_BIT_BUFFER(*state, l, return -1);\n  code = GET_BITS(l);\n\n  /* Collect the rest of the Huffman code one bit at a time. */\n  /* This is per Figure F.16 in the JPEG spec. */\n\n  while (code > htbl->maxcode[l]) {\n    code <<= 1;\n    CHECK_BIT_BUFFER(*state, 1, return -1);\n    code |= GET_BITS(1);\n    l++;\n  }\n\n  /* Unload the local registers */\n  state->get_buffer = get_buffer;\n  state->bits_left = bits_left;\n\n  /* With garbage input we may reach the sentinel value l = 17. */\n\n  if (l > 16) {\n    WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);\n    return 0;\t\t\t/* fake a zero as the safest result */\n  }\n\n  return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ];\n}\n\n\n/*\n * Finish up at the end of a Huffman-compressed scan.\n */\n\nMETHODDEF(void)\nfinish_pass_huff (j_decompress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n\n  /* Throw away any unused bits remaining in bit buffer; */\n  /* include any full bytes in next_marker's count of discarded bytes */\n  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;\n  entropy->bitstate.bits_left = 0;\n}\n\n\n/*\n * Check for a restart marker & resynchronize decoder.\n * Returns FALSE if must suspend.\n */\n\nLOCAL(boolean)\nprocess_restart (j_decompress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int ci;\n\n  finish_pass_huff(cinfo);\n\n  /* Advance past the RSTn marker */\n  if (! (*cinfo->marker->read_restart_marker) (cinfo))\n    return FALSE;\n\n  /* Re-initialize DC predictions to 0 */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++)\n    entropy->saved.last_dc_val[ci] = 0;\n  /* Re-init EOB run count, too */\n  entropy->saved.EOBRUN = 0;\n\n  /* Reset restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n\n  /* Reset out-of-data flag, unless read_restart_marker left us smack up\n   * against a marker.  In that case we will end up treating the next data\n   * segment as empty, and we can avoid producing bogus output pixels by\n   * leaving the flag set.\n   */\n  if (cinfo->unread_marker == 0)\n    entropy->insufficient_data = FALSE;\n\n  return TRUE;\n}\n\n\n/*\n * Huffman MCU decoding.\n * Each of these routines decodes and returns one MCU's worth of\n * Huffman-compressed coefficients. \n * The coefficients are reordered from zigzag order into natural array order,\n * but are not dequantized.\n *\n * The i'th block of the MCU is stored into the block pointed to by\n * MCU_data[i].  WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.\n * (Wholesale zeroing is usually a little faster than retail...)\n *\n * We return FALSE if data source requested suspension.  In that case no\n * changes have been made to permanent state.  (Exception: some output\n * coefficients may already have been assigned.  This is harmless for\n * spectral selection, since we'll just re-assign them on the next call.\n * Successive approximation AC refinement has to be more careful, however.)\n */\n\n/*\n * MCU decoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\ndecode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{   \n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int Al = cinfo->Al;\n  register int s, r;\n  int blkn, ci;\n  JBLOCKROW block;\n  BITREAD_STATE_VARS;\n  savable_state state;\n  d_derived_tbl * tbl;\n  jpeg_component_info * compptr;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n\treturn FALSE;\n  }\n\n  /* If we've run out of data, just leave the MCU set to zeroes.\n   * This way, we return uniform gray for the remainder of the segment.\n   */\n  if (! entropy->insufficient_data) {\n\n    /* Load up working state */\n    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n    ASSIGN_STATE(state, entropy->saved);\n\n    /* Outer loop handles each block in the MCU */\n\n    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n      block = MCU_data[blkn];\n      ci = cinfo->MCU_membership[blkn];\n      compptr = cinfo->cur_comp_info[ci];\n      tbl = entropy->derived_tbls[compptr->dc_tbl_no];\n\n      /* Decode a single block's worth of coefficients */\n\n      /* Section F.2.2.1: decode the DC coefficient difference */\n      HUFF_DECODE(s, br_state, tbl, return FALSE, label1);\n      if (s) {\n\tCHECK_BIT_BUFFER(br_state, s, return FALSE);\n\tr = GET_BITS(s);\n\ts = HUFF_EXTEND(r, s);\n      }\n\n      /* Convert DC difference to actual value, update last_dc_val */\n      s += state.last_dc_val[ci];\n      state.last_dc_val[ci] = s;\n      /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */\n      (*block)[0] = (JCOEF) (s << Al);\n    }\n\n    /* Completed MCU, so update state */\n    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n    ASSIGN_STATE(entropy->saved, state);\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\ndecode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{   \n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  register int s, k, r;\n  unsigned int EOBRUN;\n  int Se, Al;\n  const int * natural_order;\n  JBLOCKROW block;\n  BITREAD_STATE_VARS;\n  d_derived_tbl * tbl;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n\treturn FALSE;\n  }\n\n  /* If we've run out of data, just leave the MCU set to zeroes.\n   * This way, we return uniform gray for the remainder of the segment.\n   */\n  if (! entropy->insufficient_data) {\n\n    Se = cinfo->Se;\n    Al = cinfo->Al;\n    natural_order = cinfo->natural_order;\n\n    /* Load up working state.\n     * We can avoid loading/saving bitread state if in an EOB run.\n     */\n    EOBRUN = entropy->saved.EOBRUN;\t/* only part of saved state we need */\n\n    /* There is always only one block per MCU */\n\n    if (EOBRUN)\t\t\t/* if it's a band of zeroes... */\n      EOBRUN--;\t\t\t/* ...process it now (we do nothing) */\n    else {\n      BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n      block = MCU_data[0];\n      tbl = entropy->ac_derived_tbl;\n\n      for (k = cinfo->Ss; k <= Se; k++) {\n\tHUFF_DECODE(s, br_state, tbl, return FALSE, label2);\n\tr = s >> 4;\n\ts &= 15;\n\tif (s) {\n\t  k += r;\n\t  CHECK_BIT_BUFFER(br_state, s, return FALSE);\n\t  r = GET_BITS(s);\n\t  s = HUFF_EXTEND(r, s);\n\t  /* Scale and output coefficient in natural (dezigzagged) order */\n\t  (*block)[natural_order[k]] = (JCOEF) (s << Al);\n\t} else {\n\t  if (r != 15) {\t/* EOBr, run length is 2^r + appended bits */\n\t    if (r) {\t\t/* EOBr, r > 0 */\n\t      EOBRUN = 1 << r;\n\t      CHECK_BIT_BUFFER(br_state, r, return FALSE);\n\t      r = GET_BITS(r);\n\t      EOBRUN += r;\n\t      EOBRUN--;\t\t/* this band is processed at this moment */\n\t    }\n\t    break;\t\t/* force end-of-band */\n\t  }\n\t  k += 15;\t\t/* ZRL: skip 15 zeroes in band */\n\t}\n      }\n\n      BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n    }\n\n    /* Completed MCU, so update state */\n    entropy->saved.EOBRUN = EOBRUN;\t/* only part of saved state we need */\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for DC successive approximation refinement scan.\n * Note: we assume such scans can be multi-component,\n * although the spec is not very clear on the point.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{   \n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int p1, blkn;\n  BITREAD_STATE_VARS;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n\treturn FALSE;\n  }\n\n  /* Not worth the cycles to check insufficient_data here,\n   * since we will not change the data anyway if we read zeroes.\n   */\n\n  /* Load up working state */\n  BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n\n  p1 = 1 << cinfo->Al;\t\t/* 1 in the bit position being coded */\n\n  /* Outer loop handles each block in the MCU */\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    /* Encoded data is simply the next bit of the two's-complement DC value */\n    CHECK_BIT_BUFFER(br_state, 1, return FALSE);\n    if (GET_BITS(1))\n      MCU_data[blkn][0][0] |= p1;\n    /* Note: since we use |=, repeating the assignment later is safe */\n  }\n\n  /* Completed MCU, so update state */\n  BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{   \n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  register int s, k, r;\n  unsigned int EOBRUN;\n  int Se, p1, m1;\n  const int * natural_order;\n  JBLOCKROW block;\n  JCOEFPTR thiscoef;\n  BITREAD_STATE_VARS;\n  d_derived_tbl * tbl;\n  int num_newnz;\n  int newnz_pos[DCTSIZE2];\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n\treturn FALSE;\n  }\n\n  /* If we've run out of data, don't modify the MCU.\n   */\n  if (! entropy->insufficient_data) {\n\n    Se = cinfo->Se;\n    p1 = 1 << cinfo->Al;\t/* 1 in the bit position being coded */\n    m1 = (-1) << cinfo->Al;\t/* -1 in the bit position being coded */\n    natural_order = cinfo->natural_order;\n\n    /* Load up working state */\n    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n    EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */\n\n    /* There is always only one block per MCU */\n    block = MCU_data[0];\n    tbl = entropy->ac_derived_tbl;\n\n    /* If we are forced to suspend, we must undo the assignments to any newly\n     * nonzero coefficients in the block, because otherwise we'd get confused\n     * next time about which coefficients were already nonzero.\n     * But we need not undo addition of bits to already-nonzero coefficients;\n     * instead, we can test the current bit to see if we already did it.\n     */\n    num_newnz = 0;\n\n    /* initialize coefficient loop counter to start of band */\n    k = cinfo->Ss;\n\n    if (EOBRUN == 0) {\n      do {\n\tHUFF_DECODE(s, br_state, tbl, goto undoit, label3);\n\tr = s >> 4;\n\ts &= 15;\n\tif (s) {\n\t  if (s != 1)\t\t/* size of new coef should always be 1 */\n\t    WARNMS(cinfo, JWRN_HUFF_BAD_CODE);\n\t  CHECK_BIT_BUFFER(br_state, 1, goto undoit);\n\t  if (GET_BITS(1))\n\t    s = p1;\t\t/* newly nonzero coef is positive */\n\t  else\n\t    s = m1;\t\t/* newly nonzero coef is negative */\n\t} else {\n\t  if (r != 15) {\n\t    EOBRUN = 1 << r;\t/* EOBr, run length is 2^r + appended bits */\n\t    if (r) {\n\t      CHECK_BIT_BUFFER(br_state, r, goto undoit);\n\t      r = GET_BITS(r);\n\t      EOBRUN += r;\n\t    }\n\t    break;\t\t/* rest of block is handled by EOB logic */\n\t  }\n\t  /* note s = 0 for processing ZRL */\n\t}\n\t/* Advance over already-nonzero coefs and r still-zero coefs,\n\t * appending correction bits to the nonzeroes.  A correction bit is 1\n\t * if the absolute value of the coefficient must be increased.\n\t */\n\tdo {\n\t  thiscoef = *block + natural_order[k];\n\t  if (*thiscoef) {\n\t    CHECK_BIT_BUFFER(br_state, 1, goto undoit);\n\t    if (GET_BITS(1)) {\n\t      if ((*thiscoef & p1) == 0) { /* do nothing if already set it */\n\t\tif (*thiscoef >= 0)\n\t\t  *thiscoef += p1;\n\t\telse\n\t\t  *thiscoef += m1;\n\t      }\n\t    }\n\t  } else {\n\t    if (--r < 0)\n\t      break;\t\t/* reached target zero coefficient */\n\t  }\n\t  k++;\n\t} while (k <= Se);\n\tif (s) {\n\t  int pos = natural_order[k];\n\t  /* Output newly nonzero coefficient */\n\t  (*block)[pos] = (JCOEF) s;\n\t  /* Remember its position in case we have to suspend */\n\t  newnz_pos[num_newnz++] = pos;\n\t}\n\tk++;\n      } while (k <= Se);\n    }\n\n    if (EOBRUN) {\n      /* Scan any remaining coefficient positions after the end-of-band\n       * (the last newly nonzero coefficient, if any).  Append a correction\n       * bit to each already-nonzero coefficient.  A correction bit is 1\n       * if the absolute value of the coefficient must be increased.\n       */\n      do {\n\tthiscoef = *block + natural_order[k];\n\tif (*thiscoef) {\n\t  CHECK_BIT_BUFFER(br_state, 1, goto undoit);\n\t  if (GET_BITS(1)) {\n\t    if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */\n\t      if (*thiscoef >= 0)\n\t\t*thiscoef += p1;\n\t      else\n\t\t*thiscoef += m1;\n\t    }\n\t  }\n\t}\n\tk++;\n      } while (k <= Se);\n      /* Count one block completed in EOB run */\n      EOBRUN--;\n    }\n\n    /* Completed MCU, so update state */\n    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n    entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n\nundoit:\n  /* Re-zero any output coefficients that we made newly nonzero */\n  while (num_newnz)\n    (*block)[newnz_pos[--num_newnz]] = 0;\n\n  return FALSE;\n}\n\n\n/*\n * Decode one MCU's worth of Huffman-compressed coefficients,\n * partial blocks.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_sub (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  const int * natural_order;\n  int Se, blkn;\n  BITREAD_STATE_VARS;\n  savable_state state;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n\treturn FALSE;\n  }\n\n  /* If we've run out of data, just leave the MCU set to zeroes.\n   * This way, we return uniform gray for the remainder of the segment.\n   */\n  if (! entropy->insufficient_data) {\n\n    natural_order = cinfo->natural_order;\n    Se = cinfo->lim_Se;\n\n    /* Load up working state */\n    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n    ASSIGN_STATE(state, entropy->saved);\n\n    /* Outer loop handles each block in the MCU */\n\n    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n      JBLOCKROW block = MCU_data[blkn];\n      d_derived_tbl * htbl;\n      register int s, k, r;\n      int coef_limit, ci;\n\n      /* Decode a single block's worth of coefficients */\n\n      /* Section F.2.2.1: decode the DC coefficient difference */\n      htbl = entropy->dc_cur_tbls[blkn];\n      HUFF_DECODE(s, br_state, htbl, return FALSE, label1);\n\n      htbl = entropy->ac_cur_tbls[blkn];\n      k = 1;\n      coef_limit = entropy->coef_limit[blkn];\n      if (coef_limit) {\n\t/* Convert DC difference to actual value, update last_dc_val */\n\tif (s) {\n\t  CHECK_BIT_BUFFER(br_state, s, return FALSE);\n\t  r = GET_BITS(s);\n\t  s = HUFF_EXTEND(r, s);\n\t}\n\tci = cinfo->MCU_membership[blkn];\n\ts += state.last_dc_val[ci];\n\tstate.last_dc_val[ci] = s;\n\t/* Output the DC coefficient */\n\t(*block)[0] = (JCOEF) s;\n\n\t/* Section F.2.2.2: decode the AC coefficients */\n\t/* Since zeroes are skipped, output area must be cleared beforehand */\n\tfor (; k < coef_limit; k++) {\n\t  HUFF_DECODE(s, br_state, htbl, return FALSE, label2);\n\n\t  r = s >> 4;\n\t  s &= 15;\n\n\t  if (s) {\n\t    k += r;\n\t    CHECK_BIT_BUFFER(br_state, s, return FALSE);\n\t    r = GET_BITS(s);\n\t    s = HUFF_EXTEND(r, s);\n\t    /* Output coefficient in natural (dezigzagged) order.\n\t     * Note: the extra entries in natural_order[] will save us\n\t     * if k > Se, which could happen if the data is corrupted.\n\t     */\n\t    (*block)[natural_order[k]] = (JCOEF) s;\n\t  } else {\n\t    if (r != 15)\n\t      goto EndOfBlock;\n\t    k += 15;\n\t  }\n\t}\n      } else {\n\tif (s) {\n\t  CHECK_BIT_BUFFER(br_state, s, return FALSE);\n\t  DROP_BITS(s);\n\t}\n      }\n\n      /* Section F.2.2.2: decode the AC coefficients */\n      /* In this path we just discard the values */\n      for (; k <= Se; k++) {\n\tHUFF_DECODE(s, br_state, htbl, return FALSE, label3);\n\n\tr = s >> 4;\n\ts &= 15;\n\n\tif (s) {\n\t  k += r;\n\t  CHECK_BIT_BUFFER(br_state, s, return FALSE);\n\t  DROP_BITS(s);\n\t} else {\n\t  if (r != 15)\n\t    break;\n\t  k += 15;\n\t}\n      }\n\n      EndOfBlock: ;\n    }\n\n    /* Completed MCU, so update state */\n    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n    ASSIGN_STATE(entropy->saved, state);\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * Decode one MCU's worth of Huffman-compressed coefficients,\n * full-size blocks.\n */\n\nMETHODDEF(boolean)\ndecode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int blkn;\n  BITREAD_STATE_VARS;\n  savable_state state;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n\treturn FALSE;\n  }\n\n  /* If we've run out of data, just leave the MCU set to zeroes.\n   * This way, we return uniform gray for the remainder of the segment.\n   */\n  if (! entropy->insufficient_data) {\n\n    /* Load up working state */\n    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n    ASSIGN_STATE(state, entropy->saved);\n\n    /* Outer loop handles each block in the MCU */\n\n    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n      JBLOCKROW block = MCU_data[blkn];\n      d_derived_tbl * htbl;\n      register int s, k, r;\n      int coef_limit, ci;\n\n      /* Decode a single block's worth of coefficients */\n\n      /* Section F.2.2.1: decode the DC coefficient difference */\n      htbl = entropy->dc_cur_tbls[blkn];\n      HUFF_DECODE(s, br_state, htbl, return FALSE, label1);\n\n      htbl = entropy->ac_cur_tbls[blkn];\n      k = 1;\n      coef_limit = entropy->coef_limit[blkn];\n      if (coef_limit) {\n\t/* Convert DC difference to actual value, update last_dc_val */\n\tif (s) {\n\t  CHECK_BIT_BUFFER(br_state, s, return FALSE);\n\t  r = GET_BITS(s);\n\t  s = HUFF_EXTEND(r, s);\n\t}\n\tci = cinfo->MCU_membership[blkn];\n\ts += state.last_dc_val[ci];\n\tstate.last_dc_val[ci] = s;\n\t/* Output the DC coefficient */\n\t(*block)[0] = (JCOEF) s;\n\n\t/* Section F.2.2.2: decode the AC coefficients */\n\t/* Since zeroes are skipped, output area must be cleared beforehand */\n\tfor (; k < coef_limit; k++) {\n\t  HUFF_DECODE(s, br_state, htbl, return FALSE, label2);\n\n\t  r = s >> 4;\n\t  s &= 15;\n\n\t  if (s) {\n\t    k += r;\n\t    CHECK_BIT_BUFFER(br_state, s, return FALSE);\n\t    r = GET_BITS(s);\n\t    s = HUFF_EXTEND(r, s);\n\t    /* Output coefficient in natural (dezigzagged) order.\n\t     * Note: the extra entries in jpeg_natural_order[] will save us\n\t     * if k >= DCTSIZE2, which could happen if the data is corrupted.\n\t     */\n\t    (*block)[jpeg_natural_order[k]] = (JCOEF) s;\n\t  } else {\n\t    if (r != 15)\n\t      goto EndOfBlock;\n\t    k += 15;\n\t  }\n\t}\n      } else {\n\tif (s) {\n\t  CHECK_BIT_BUFFER(br_state, s, return FALSE);\n\t  DROP_BITS(s);\n\t}\n      }\n\n      /* Section F.2.2.2: decode the AC coefficients */\n      /* In this path we just discard the values */\n      for (; k < DCTSIZE2; k++) {\n\tHUFF_DECODE(s, br_state, htbl, return FALSE, label3);\n\n\tr = s >> 4;\n\ts &= 15;\n\n\tif (s) {\n\t  k += r;\n\t  CHECK_BIT_BUFFER(br_state, s, return FALSE);\n\t  DROP_BITS(s);\n\t} else {\n\t  if (r != 15)\n\t    break;\n\t  k += 15;\n\t}\n      }\n\n      EndOfBlock: ;\n    }\n\n    /* Completed MCU, so update state */\n    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n    ASSIGN_STATE(entropy->saved, state);\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * Initialize for a Huffman-compressed scan.\n */\n\nMETHODDEF(void)\nstart_pass_huff_decoder (j_decompress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int ci, blkn, tbl, i;\n  jpeg_component_info * compptr;\n\n  if (cinfo->progressive_mode) {\n    /* Validate progressive scan parameters */\n    if (cinfo->Ss == 0) {\n      if (cinfo->Se != 0)\n\tgoto bad;\n    } else {\n      /* need not check Ss/Se < 0 since they came from unsigned bytes */\n      if (cinfo->Se < cinfo->Ss || cinfo->Se > cinfo->lim_Se)\n\tgoto bad;\n      /* AC scans may have only one component */\n      if (cinfo->comps_in_scan != 1)\n\tgoto bad;\n    }\n    if (cinfo->Ah != 0) {\n      /* Successive approximation refinement scan: must have Al = Ah-1. */\n      if (cinfo->Ah-1 != cinfo->Al)\n\tgoto bad;\n    }\n    if (cinfo->Al > 13) {\t/* need not check for < 0 */\n      /* Arguably the maximum Al value should be less than 13 for 8-bit precision,\n       * but the spec doesn't say so, and we try to be liberal about what we\n       * accept.  Note: large Al values could result in out-of-range DC\n       * coefficients during early scans, leading to bizarre displays due to\n       * overflows in the IDCT math.  But we won't crash.\n       */\n      bad:\n      ERREXIT4(cinfo, JERR_BAD_PROGRESSION,\n\t       cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);\n    }\n    /* Update progression status, and verify that scan order is legal.\n     * Note that inter-scan inconsistencies are treated as warnings\n     * not fatal errors ... not clear if this is right way to behave.\n     */\n    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n      int coefi, cindex = cinfo->cur_comp_info[ci]->component_index;\n      int *coef_bit_ptr = & cinfo->coef_bits[cindex][0];\n      if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */\n\tWARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);\n      for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {\n\tint expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];\n\tif (cinfo->Ah != expected)\n\t  WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);\n\tcoef_bit_ptr[coefi] = cinfo->Al;\n      }\n    }\n\n    /* Select MCU decoding routine */\n    if (cinfo->Ah == 0) {\n      if (cinfo->Ss == 0)\n\tentropy->pub.decode_mcu = decode_mcu_DC_first;\n      else\n\tentropy->pub.decode_mcu = decode_mcu_AC_first;\n    } else {\n      if (cinfo->Ss == 0)\n\tentropy->pub.decode_mcu = decode_mcu_DC_refine;\n      else\n\tentropy->pub.decode_mcu = decode_mcu_AC_refine;\n    }\n\n    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n      compptr = cinfo->cur_comp_info[ci];\n      /* Make sure requested tables are present, and compute derived tables.\n       * We may build same derived table more than once, but it's not expensive.\n       */\n      if (cinfo->Ss == 0) {\n\tif (cinfo->Ah == 0) {\t/* DC refinement needs no table */\n\t  tbl = compptr->dc_tbl_no;\n\t  jpeg_make_d_derived_tbl(cinfo, TRUE, tbl,\n\t\t\t\t  & entropy->derived_tbls[tbl]);\n\t}\n      } else {\n\ttbl = compptr->ac_tbl_no;\n\tjpeg_make_d_derived_tbl(cinfo, FALSE, tbl,\n\t\t\t\t& entropy->derived_tbls[tbl]);\n\t/* remember the single active table */\n\tentropy->ac_derived_tbl = entropy->derived_tbls[tbl];\n      }\n      /* Initialize DC predictions to 0 */\n      entropy->saved.last_dc_val[ci] = 0;\n    }\n\n    /* Initialize private state variables */\n    entropy->saved.EOBRUN = 0;\n  } else {\n    /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.\n     * This ought to be an error condition, but we make it a warning because\n     * there are some baseline files out there with all zeroes in these bytes.\n     */\n    if (cinfo->Ss != 0 || cinfo->Ah != 0 || cinfo->Al != 0 ||\n\t((cinfo->is_baseline || cinfo->Se < DCTSIZE2) &&\n\tcinfo->Se != cinfo->lim_Se))\n      WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);\n\n    /* Select MCU decoding routine */\n    /* We retain the hard-coded case for full-size blocks.\n     * This is not necessary, but it appears that this version is slightly\n     * more performant in the given implementation.\n     * With an improved implementation we would prefer a single optimized\n     * function.\n     */\n    if (cinfo->lim_Se != DCTSIZE2-1)\n      entropy->pub.decode_mcu = decode_mcu_sub;\n    else\n      entropy->pub.decode_mcu = decode_mcu;\n\n    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n      compptr = cinfo->cur_comp_info[ci];\n      /* Compute derived values for Huffman tables */\n      /* We may do this more than once for a table, but it's not expensive */\n      tbl = compptr->dc_tbl_no;\n      jpeg_make_d_derived_tbl(cinfo, TRUE, tbl,\n\t\t\t      & entropy->dc_derived_tbls[tbl]);\n      if (cinfo->lim_Se) {\t/* AC needs no table when not present */\n\ttbl = compptr->ac_tbl_no;\n\tjpeg_make_d_derived_tbl(cinfo, FALSE, tbl,\n\t\t\t\t& entropy->ac_derived_tbls[tbl]);\n      }\n      /* Initialize DC predictions to 0 */\n      entropy->saved.last_dc_val[ci] = 0;\n    }\n\n    /* Precalculate decoding info for each block in an MCU of this scan */\n    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n      ci = cinfo->MCU_membership[blkn];\n      compptr = cinfo->cur_comp_info[ci];\n      /* Precalculate which table to use for each block */\n      entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];\n      entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];\n      /* Decide whether we really care about the coefficient values */\n      if (compptr->component_needed) {\n\tci = compptr->DCT_v_scaled_size;\n\ti = compptr->DCT_h_scaled_size;\n\tswitch (cinfo->lim_Se) {\n\tcase (1*1-1):\n\t  entropy->coef_limit[blkn] = 1;\n\t  break;\n\tcase (2*2-1):\n\t  if (ci <= 0 || ci > 2) ci = 2;\n\t  if (i <= 0 || i > 2) i = 2;\n\t  entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order2[ci - 1][i - 1];\n\t  break;\n\tcase (3*3-1):\n\t  if (ci <= 0 || ci > 3) ci = 3;\n\t  if (i <= 0 || i > 3) i = 3;\n\t  entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order3[ci - 1][i - 1];\n\t  break;\n\tcase (4*4-1):\n\t  if (ci <= 0 || ci > 4) ci = 4;\n\t  if (i <= 0 || i > 4) i = 4;\n\t  entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order4[ci - 1][i - 1];\n\t  break;\n\tcase (5*5-1):\n\t  if (ci <= 0 || ci > 5) ci = 5;\n\t  if (i <= 0 || i > 5) i = 5;\n\t  entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order5[ci - 1][i - 1];\n\t  break;\n\tcase (6*6-1):\n\t  if (ci <= 0 || ci > 6) ci = 6;\n\t  if (i <= 0 || i > 6) i = 6;\n\t  entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order6[ci - 1][i - 1];\n\t  break;\n\tcase (7*7-1):\n\t  if (ci <= 0 || ci > 7) ci = 7;\n\t  if (i <= 0 || i > 7) i = 7;\n\t  entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order7[ci - 1][i - 1];\n\t  break;\n\tdefault:\n\t  if (ci <= 0 || ci > 8) ci = 8;\n\t  if (i <= 0 || i > 8) i = 8;\n\t  entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order[ci - 1][i - 1];\n\t  break;\n\t}\n      } else {\n\tentropy->coef_limit[blkn] = 0;\n      }\n    }\n  }\n\n  /* Initialize bitread state variables */\n  entropy->bitstate.bits_left = 0;\n  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */\n  entropy->insufficient_data = FALSE;\n\n  /* Initialize restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n}\n\n\n/*\n * Module initialization routine for Huffman entropy decoding.\n */\n\nGLOBAL(void)\njinit_huff_decoder (j_decompress_ptr cinfo)\n{\n  huff_entropy_ptr entropy;\n  int i;\n\n  entropy = (huff_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(huff_entropy_decoder));\n  cinfo->entropy = &entropy->pub;\n  entropy->pub.start_pass = start_pass_huff_decoder;\n  entropy->pub.finish_pass = finish_pass_huff;\n\n  if (cinfo->progressive_mode) {\n    /* Create progression status table */\n    int *coef_bit_ptr, ci;\n    cinfo->coef_bits = (int (*)[DCTSIZE2])\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  cinfo->num_components*DCTSIZE2*SIZEOF(int));\n    coef_bit_ptr = & cinfo->coef_bits[0][0];\n    for (ci = 0; ci < cinfo->num_components; ci++)\n      for (i = 0; i < DCTSIZE2; i++)\n\t*coef_bit_ptr++ = -1;\n\n    /* Mark derived tables unallocated */\n    for (i = 0; i < NUM_HUFF_TBLS; i++) {\n      entropy->derived_tbls[i] = NULL;\n    }\n  } else {\n    /* Mark tables unallocated */\n    for (i = 0; i < NUM_HUFF_TBLS; i++) {\n      entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;\n    }\n  }\n}\n"
  },
  {
    "path": "jdinput.c",
    "content": "/*\n * jdinput.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2002-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains input control logic for the JPEG decompressor.\n * These routines are concerned with controlling the decompressor's input\n * processing (marker reading and coefficient decoding).  The actual input\n * reading is done in jdmarker.c, jdhuff.c, and jdarith.c.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Private state */\n\ntypedef struct {\n  struct jpeg_input_controller pub; /* public fields */\n\n  int inheaders;\t\t/* Nonzero until first SOS is reached */\n} my_input_controller;\n\ntypedef my_input_controller * my_inputctl_ptr;\n\n\n/* Forward declarations */\nMETHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo));\n\n\n/*\n * Routines to calculate various quantities related to the size of the image.\n */\n\n\n/*\n * Compute output image dimensions and related values.\n * NOTE: this is exported for possible use by application.\n * Hence it mustn't do anything that can't be done twice.\n */\n\nGLOBAL(void)\njpeg_core_output_dimensions (j_decompress_ptr cinfo)\n/* Do computations that are needed before master selection phase.\n * This function is used for transcoding and full decompression.\n */\n{\n#ifdef IDCT_SCALING_SUPPORTED\n  int ci;\n  jpeg_component_info *compptr;\n\n  /* Compute actual output image dimensions and DCT scaling choices. */\n  if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom) {\n    /* Provide 1/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 1;\n    cinfo->min_DCT_v_scaled_size = 1;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 2) {\n    /* Provide 2/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 2L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 2L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 2;\n    cinfo->min_DCT_v_scaled_size = 2;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 3) {\n    /* Provide 3/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 3L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 3L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 3;\n    cinfo->min_DCT_v_scaled_size = 3;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 4) {\n    /* Provide 4/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 4L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 4L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 4;\n    cinfo->min_DCT_v_scaled_size = 4;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 5) {\n    /* Provide 5/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 5L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 5L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 5;\n    cinfo->min_DCT_v_scaled_size = 5;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 6) {\n    /* Provide 6/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 6L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 6L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 6;\n    cinfo->min_DCT_v_scaled_size = 6;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 7) {\n    /* Provide 7/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 7L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 7L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 7;\n    cinfo->min_DCT_v_scaled_size = 7;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 8) {\n    /* Provide 8/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 8L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 8L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 8;\n    cinfo->min_DCT_v_scaled_size = 8;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 9) {\n    /* Provide 9/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 9L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 9L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 9;\n    cinfo->min_DCT_v_scaled_size = 9;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 10) {\n    /* Provide 10/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 10L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 10L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 10;\n    cinfo->min_DCT_v_scaled_size = 10;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 11) {\n    /* Provide 11/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 11L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 11L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 11;\n    cinfo->min_DCT_v_scaled_size = 11;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 12) {\n    /* Provide 12/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 12L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 12L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 12;\n    cinfo->min_DCT_v_scaled_size = 12;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 13) {\n    /* Provide 13/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 13L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 13L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 13;\n    cinfo->min_DCT_v_scaled_size = 13;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 14) {\n    /* Provide 14/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 14L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 14L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 14;\n    cinfo->min_DCT_v_scaled_size = 14;\n  } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 15) {\n    /* Provide 15/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 15L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 15L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 15;\n    cinfo->min_DCT_v_scaled_size = 15;\n  } else {\n    /* Provide 16/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 16L, (long) cinfo->block_size);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 16L, (long) cinfo->block_size);\n    cinfo->min_DCT_h_scaled_size = 16;\n    cinfo->min_DCT_v_scaled_size = 16;\n  }\n\n  /* Recompute dimensions of components */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size;\n    compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size;\n  }\n\n#else /* !IDCT_SCALING_SUPPORTED */\n\n  /* Hardwire it to \"no scaling\" */\n  cinfo->output_width = cinfo->image_width;\n  cinfo->output_height = cinfo->image_height;\n  /* initial_setup has already initialized DCT_scaled_size,\n   * and has computed unscaled downsampled_width and downsampled_height.\n   */\n\n#endif /* IDCT_SCALING_SUPPORTED */\n}\n\n\nLOCAL(void)\ninitial_setup (j_decompress_ptr cinfo)\n/* Called once, when first SOS marker is reached */\n{\n  int ci;\n  jpeg_component_info *compptr;\n\n  /* Make sure image isn't bigger than I can handle */\n  if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||\n      (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)\n    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);\n\n  /* Only 8 to 12 bits data precision are supported for DCT based JPEG */\n  if (cinfo->data_precision < 8 || cinfo->data_precision > 12)\n    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);\n\n  /* Check that number of components won't exceed internal array sizes */\n  if (cinfo->num_components > MAX_COMPONENTS)\n    ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,\n\t     MAX_COMPONENTS);\n\n  /* Compute maximum sampling factors; check factor validity */\n  cinfo->max_h_samp_factor = 1;\n  cinfo->max_v_samp_factor = 1;\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||\n\tcompptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)\n      ERREXIT(cinfo, JERR_BAD_SAMPLING);\n    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,\n\t\t\t\t   compptr->h_samp_factor);\n    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,\n\t\t\t\t   compptr->v_samp_factor);\n  }\n\n  /* Derive block_size, natural_order, and lim_Se */\n  if (cinfo->is_baseline || (cinfo->progressive_mode &&\n      cinfo->comps_in_scan)) { /* no pseudo SOS marker */\n    cinfo->block_size = DCTSIZE;\n    cinfo->natural_order = jpeg_natural_order;\n    cinfo->lim_Se = DCTSIZE2-1;\n  } else\n    switch (cinfo->Se) {\n    case (1*1-1):\n      cinfo->block_size = 1;\n      cinfo->natural_order = jpeg_natural_order; /* not needed */\n      cinfo->lim_Se = cinfo->Se;\n      break;\n    case (2*2-1):\n      cinfo->block_size = 2;\n      cinfo->natural_order = jpeg_natural_order2;\n      cinfo->lim_Se = cinfo->Se;\n      break;\n    case (3*3-1):\n      cinfo->block_size = 3;\n      cinfo->natural_order = jpeg_natural_order3;\n      cinfo->lim_Se = cinfo->Se;\n      break;\n    case (4*4-1):\n      cinfo->block_size = 4;\n      cinfo->natural_order = jpeg_natural_order4;\n      cinfo->lim_Se = cinfo->Se;\n      break;\n    case (5*5-1):\n      cinfo->block_size = 5;\n      cinfo->natural_order = jpeg_natural_order5;\n      cinfo->lim_Se = cinfo->Se;\n      break;\n    case (6*6-1):\n      cinfo->block_size = 6;\n      cinfo->natural_order = jpeg_natural_order6;\n      cinfo->lim_Se = cinfo->Se;\n      break;\n    case (7*7-1):\n      cinfo->block_size = 7;\n      cinfo->natural_order = jpeg_natural_order7;\n      cinfo->lim_Se = cinfo->Se;\n      break;\n    case (8*8-1):\n      cinfo->block_size = 8;\n      cinfo->natural_order = jpeg_natural_order;\n      cinfo->lim_Se = DCTSIZE2-1;\n      break;\n    case (9*9-1):\n      cinfo->block_size = 9;\n      cinfo->natural_order = jpeg_natural_order;\n      cinfo->lim_Se = DCTSIZE2-1;\n      break;\n    case (10*10-1):\n      cinfo->block_size = 10;\n      cinfo->natural_order = jpeg_natural_order;\n      cinfo->lim_Se = DCTSIZE2-1;\n      break;\n    case (11*11-1):\n      cinfo->block_size = 11;\n      cinfo->natural_order = jpeg_natural_order;\n      cinfo->lim_Se = DCTSIZE2-1;\n      break;\n    case (12*12-1):\n      cinfo->block_size = 12;\n      cinfo->natural_order = jpeg_natural_order;\n      cinfo->lim_Se = DCTSIZE2-1;\n      break;\n    case (13*13-1):\n      cinfo->block_size = 13;\n      cinfo->natural_order = jpeg_natural_order;\n      cinfo->lim_Se = DCTSIZE2-1;\n      break;\n    case (14*14-1):\n      cinfo->block_size = 14;\n      cinfo->natural_order = jpeg_natural_order;\n      cinfo->lim_Se = DCTSIZE2-1;\n      break;\n    case (15*15-1):\n      cinfo->block_size = 15;\n      cinfo->natural_order = jpeg_natural_order;\n      cinfo->lim_Se = DCTSIZE2-1;\n      break;\n    case (16*16-1):\n      cinfo->block_size = 16;\n      cinfo->natural_order = jpeg_natural_order;\n      cinfo->lim_Se = DCTSIZE2-1;\n      break;\n    default:\n      ERREXIT4(cinfo, JERR_BAD_PROGRESSION,\n\t       cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);\n      break;\n    }\n\n  /* We initialize DCT_scaled_size and min_DCT_scaled_size to block_size.\n   * In the full decompressor,\n   * this will be overridden by jpeg_calc_output_dimensions in jdmaster.c;\n   * but in the transcoder,\n   * jpeg_calc_output_dimensions is not used, so we must do it here.\n   */\n  cinfo->min_DCT_h_scaled_size = cinfo->block_size;\n  cinfo->min_DCT_v_scaled_size = cinfo->block_size;\n\n  /* Compute dimensions of components */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    compptr->DCT_h_scaled_size = cinfo->block_size;\n    compptr->DCT_v_scaled_size = cinfo->block_size;\n    /* Size in DCT blocks */\n    compptr->width_in_blocks = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,\n\t\t    (long) (cinfo->max_h_samp_factor * cinfo->block_size));\n    compptr->height_in_blocks = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,\n\t\t    (long) (cinfo->max_v_samp_factor * cinfo->block_size));\n    /* downsampled_width and downsampled_height will also be overridden by\n     * jdmaster.c if we are doing full decompression.  The transcoder library\n     * doesn't use these values, but the calling application might.\n     */\n    /* Size in samples */\n    compptr->downsampled_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,\n\t\t    (long) cinfo->max_h_samp_factor);\n    compptr->downsampled_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,\n\t\t    (long) cinfo->max_v_samp_factor);\n    /* Mark component needed, until color conversion says otherwise */\n    compptr->component_needed = TRUE;\n    /* Mark no quantization table yet saved for component */\n    compptr->quant_table = NULL;\n  }\n\n  /* Compute number of fully interleaved MCU rows. */\n  cinfo->total_iMCU_rows = (JDIMENSION)\n    jdiv_round_up((long) cinfo->image_height,\n\t          (long) (cinfo->max_v_samp_factor * cinfo->block_size));\n\n  /* Decide whether file contains multiple scans */\n  if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)\n    cinfo->inputctl->has_multiple_scans = TRUE;\n  else\n    cinfo->inputctl->has_multiple_scans = FALSE;\n}\n\n\nLOCAL(void)\nper_scan_setup (j_decompress_ptr cinfo)\n/* Do computations that are needed before processing a JPEG scan */\n/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */\n{\n  int ci, mcublks, tmp;\n  jpeg_component_info *compptr;\n  \n  if (cinfo->comps_in_scan == 1) {\n    \n    /* Noninterleaved (single-component) scan */\n    compptr = cinfo->cur_comp_info[0];\n    \n    /* Overall image size in MCUs */\n    cinfo->MCUs_per_row = compptr->width_in_blocks;\n    cinfo->MCU_rows_in_scan = compptr->height_in_blocks;\n    \n    /* For noninterleaved scan, always one block per MCU */\n    compptr->MCU_width = 1;\n    compptr->MCU_height = 1;\n    compptr->MCU_blocks = 1;\n    compptr->MCU_sample_width = compptr->DCT_h_scaled_size;\n    compptr->last_col_width = 1;\n    /* For noninterleaved scans, it is convenient to define last_row_height\n     * as the number of block rows present in the last iMCU row.\n     */\n    tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n    if (tmp == 0) tmp = compptr->v_samp_factor;\n    compptr->last_row_height = tmp;\n    \n    /* Prepare array describing MCU composition */\n    cinfo->blocks_in_MCU = 1;\n    cinfo->MCU_membership[0] = 0;\n    \n  } else {\n    \n    /* Interleaved (multi-component) scan */\n    if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,\n\t       MAX_COMPS_IN_SCAN);\n    \n    /* Overall image size in MCUs */\n    cinfo->MCUs_per_row = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width,\n\t\t    (long) (cinfo->max_h_samp_factor * cinfo->block_size));\n    cinfo->MCU_rows_in_scan = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height,\n\t\t    (long) (cinfo->max_v_samp_factor * cinfo->block_size));\n    \n    cinfo->blocks_in_MCU = 0;\n    \n    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n      compptr = cinfo->cur_comp_info[ci];\n      /* Sampling factors give # of blocks of component in each MCU */\n      compptr->MCU_width = compptr->h_samp_factor;\n      compptr->MCU_height = compptr->v_samp_factor;\n      compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;\n      compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_h_scaled_size;\n      /* Figure number of non-dummy blocks in last MCU column & row */\n      tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);\n      if (tmp == 0) tmp = compptr->MCU_width;\n      compptr->last_col_width = tmp;\n      tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);\n      if (tmp == 0) tmp = compptr->MCU_height;\n      compptr->last_row_height = tmp;\n      /* Prepare array describing MCU composition */\n      mcublks = compptr->MCU_blocks;\n      if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU)\n\tERREXIT(cinfo, JERR_BAD_MCU_SIZE);\n      while (mcublks-- > 0) {\n\tcinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;\n      }\n    }\n    \n  }\n}\n\n\n/*\n * Save away a copy of the Q-table referenced by each component present\n * in the current scan, unless already saved during a prior scan.\n *\n * In a multiple-scan JPEG file, the encoder could assign different components\n * the same Q-table slot number, but change table definitions between scans\n * so that each component uses a different Q-table.  (The IJG encoder is not\n * currently capable of doing this, but other encoders might.)  Since we want\n * to be able to dequantize all the components at the end of the file, this\n * means that we have to save away the table actually used for each component.\n * We do this by copying the table at the start of the first scan containing\n * the component.\n * The JPEG spec prohibits the encoder from changing the contents of a Q-table\n * slot between scans of a component using that slot.  If the encoder does so\n * anyway, this decoder will simply use the Q-table values that were current\n * at the start of the first scan for the component.\n *\n * The decompressor output side looks only at the saved quant tables,\n * not at the current Q-table slots.\n */\n\nLOCAL(void)\nlatch_quant_tables (j_decompress_ptr cinfo)\n{\n  int ci, qtblno;\n  jpeg_component_info *compptr;\n  JQUANT_TBL * qtbl;\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* No work if we already saved Q-table for this component */\n    if (compptr->quant_table != NULL)\n      continue;\n    /* Make sure specified quantization table is present */\n    qtblno = compptr->quant_tbl_no;\n    if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||\n\tcinfo->quant_tbl_ptrs[qtblno] == NULL)\n      ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);\n    /* OK, save away the quantization table */\n    qtbl = (JQUANT_TBL *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(JQUANT_TBL));\n    MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL));\n    compptr->quant_table = qtbl;\n  }\n}\n\n\n/*\n * Initialize the input modules to read a scan of compressed data.\n * The first call to this is done by jdmaster.c after initializing\n * the entire decompressor (during jpeg_start_decompress).\n * Subsequent calls come from consume_markers, below.\n */\n\nMETHODDEF(void)\nstart_input_pass (j_decompress_ptr cinfo)\n{\n  per_scan_setup(cinfo);\n  latch_quant_tables(cinfo);\n  (*cinfo->entropy->start_pass) (cinfo);\n  (*cinfo->coef->start_input_pass) (cinfo);\n  cinfo->inputctl->consume_input = cinfo->coef->consume_data;\n}\n\n\n/*\n * Finish up after inputting a compressed-data scan.\n * This is called by the coefficient controller after it's read all\n * the expected data of the scan.\n */\n\nMETHODDEF(void)\nfinish_input_pass (j_decompress_ptr cinfo)\n{\n  (*cinfo->entropy->finish_pass) (cinfo);\n  cinfo->inputctl->consume_input = consume_markers;\n}\n\n\n/*\n * Read JPEG markers before, between, or after compressed-data scans.\n * Change state as necessary when a new scan is reached.\n * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.\n *\n * The consume_input method pointer points either here or to the\n * coefficient controller's consume_data routine, depending on whether\n * we are reading a compressed data segment or inter-segment markers.\n *\n * Note: This function should NOT return a pseudo SOS marker (with zero\n * component number) to the caller.  A pseudo marker received by\n * read_markers is processed and then skipped for other markers.\n */\n\nMETHODDEF(int)\nconsume_markers (j_decompress_ptr cinfo)\n{\n  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;\n  int val;\n\n  if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */\n    return JPEG_REACHED_EOI;\n\n  for (;;) {\t\t\t/* Loop to pass pseudo SOS marker */\n    val = (*cinfo->marker->read_markers) (cinfo);\n\n    switch (val) {\n    case JPEG_REACHED_SOS:\t/* Found SOS */\n      if (inputctl->inheaders) { /* 1st SOS */\n\tif (inputctl->inheaders == 1)\n\t  initial_setup(cinfo);\n\tif (cinfo->comps_in_scan == 0) { /* pseudo SOS marker */\n\t  inputctl->inheaders = 2;\n\t  break;\n\t}\n\tinputctl->inheaders = 0;\n\t/* Note: start_input_pass must be called by jdmaster.c\n\t * before any more input can be consumed.  jdapimin.c is\n\t * responsible for enforcing this sequencing.\n\t */\n      } else {\t\t\t/* 2nd or later SOS marker */\n\tif (! inputctl->pub.has_multiple_scans)\n\t  ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */\n\tif (cinfo->comps_in_scan == 0) /* unexpected pseudo SOS marker */\n\t  break;\n\tstart_input_pass(cinfo);\n      }\n      return val;\n    case JPEG_REACHED_EOI:\t/* Found EOI */\n      inputctl->pub.eoi_reached = TRUE;\n      if (inputctl->inheaders) { /* Tables-only datastream, apparently */\n\tif (cinfo->marker->saw_SOF)\n\t  ERREXIT(cinfo, JERR_SOF_NO_SOS);\n      } else {\n\t/* Prevent infinite loop in coef ctlr's decompress_data routine\n\t * if user set output_scan_number larger than number of scans.\n\t */\n\tif (cinfo->output_scan_number > cinfo->input_scan_number)\n\t  cinfo->output_scan_number = cinfo->input_scan_number;\n      }\n      return val;\n    case JPEG_SUSPENDED:\n      return val;\n    default:\n      return val;\n    }\n  }\n}\n\n\n/*\n * Reset state to begin a fresh datastream.\n */\n\nMETHODDEF(void)\nreset_input_controller (j_decompress_ptr cinfo)\n{\n  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;\n\n  inputctl->pub.consume_input = consume_markers;\n  inputctl->pub.has_multiple_scans = FALSE; /* \"unknown\" would be better */\n  inputctl->pub.eoi_reached = FALSE;\n  inputctl->inheaders = 1;\n  /* Reset other modules */\n  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);\n  (*cinfo->marker->reset_marker_reader) (cinfo);\n  /* Reset progression state -- would be cleaner if entropy decoder did this */\n  cinfo->coef_bits = NULL;\n}\n\n\n/*\n * Initialize the input controller module.\n * This is called only once, when the decompression object is created.\n */\n\nGLOBAL(void)\njinit_input_controller (j_decompress_ptr cinfo)\n{\n  my_inputctl_ptr inputctl;\n\n  /* Create subobject in permanent pool */\n  inputctl = (my_inputctl_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\tSIZEOF(my_input_controller));\n  cinfo->inputctl = &inputctl->pub;\n  /* Initialize method pointers */\n  inputctl->pub.consume_input = consume_markers;\n  inputctl->pub.reset_input_controller = reset_input_controller;\n  inputctl->pub.start_input_pass = start_input_pass;\n  inputctl->pub.finish_input_pass = finish_input_pass;\n  /* Initialize state: can't use reset_input_controller since we don't\n   * want to try to reset other modules yet.\n   */\n  inputctl->pub.has_multiple_scans = FALSE; /* \"unknown\" would be better */\n  inputctl->pub.eoi_reached = FALSE;\n  inputctl->inheaders = 1;\n}\n"
  },
  {
    "path": "jdmainct.c",
    "content": "/*\n * jdmainct.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2002-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the main buffer controller for decompression.\n * The main buffer lies between the JPEG decompressor proper and the\n * post-processor; it holds downsampled data in the JPEG colorspace.\n *\n * Note that this code is bypassed in raw-data mode, since the application\n * supplies the equivalent of the main buffer in that case.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * In the current system design, the main buffer need never be a full-image\n * buffer; any full-height buffers will be found inside the coefficient or\n * postprocessing controllers.  Nonetheless, the main controller is not\n * trivial.  Its responsibility is to provide context rows for upsampling/\n * rescaling, and doing this in an efficient fashion is a bit tricky.\n *\n * Postprocessor input data is counted in \"row groups\".  A row group\n * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)\n * sample rows of each component.  (We require DCT_scaled_size values to be\n * chosen such that these numbers are integers.  In practice DCT_scaled_size\n * values will likely be powers of two, so we actually have the stronger\n * condition that DCT_scaled_size / min_DCT_scaled_size is an integer.)\n * Upsampling will typically produce max_v_samp_factor pixel rows from each\n * row group (times any additional scale factor that the upsampler is\n * applying).\n *\n * The coefficient controller will deliver data to us one iMCU row at a time;\n * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or\n * exactly min_DCT_scaled_size row groups.  (This amount of data corresponds\n * to one row of MCUs when the image is fully interleaved.)  Note that the\n * number of sample rows varies across components, but the number of row\n * groups does not.  Some garbage sample rows may be included in the last iMCU\n * row at the bottom of the image.\n *\n * Depending on the vertical scaling algorithm used, the upsampler may need\n * access to the sample row(s) above and below its current input row group.\n * The upsampler is required to set need_context_rows TRUE at global selection\n * time if so.  When need_context_rows is FALSE, this controller can simply\n * obtain one iMCU row at a time from the coefficient controller and dole it\n * out as row groups to the postprocessor.\n *\n * When need_context_rows is TRUE, this controller guarantees that the buffer\n * passed to postprocessing contains at least one row group's worth of samples\n * above and below the row group(s) being processed.  Note that the context\n * rows \"above\" the first passed row group appear at negative row offsets in\n * the passed buffer.  At the top and bottom of the image, the required\n * context rows are manufactured by duplicating the first or last real sample\n * row; this avoids having special cases in the upsampling inner loops.\n *\n * The amount of context is fixed at one row group just because that's a\n * convenient number for this controller to work with.  The existing\n * upsamplers really only need one sample row of context.  An upsampler\n * supporting arbitrary output rescaling might wish for more than one row\n * group of context when shrinking the image; tough, we don't handle that.\n * (This is justified by the assumption that downsizing will be handled mostly\n * by adjusting the DCT_scaled_size values, so that the actual scale factor at\n * the upsample step needn't be much less than one.)\n *\n * To provide the desired context, we have to retain the last two row groups\n * of one iMCU row while reading in the next iMCU row.  (The last row group\n * can't be processed until we have another row group for its below-context,\n * and so we have to save the next-to-last group too for its above-context.)\n * We could do this most simply by copying data around in our buffer, but\n * that'd be very slow.  We can avoid copying any data by creating a rather\n * strange pointer structure.  Here's how it works.  We allocate a workspace\n * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number\n * of row groups per iMCU row).  We create two sets of redundant pointers to\n * the workspace.  Labeling the physical row groups 0 to M+1, the synthesized\n * pointer lists look like this:\n *                   M+1                          M-1\n * master pointer --> 0         master pointer --> 0\n *                    1                            1\n *                   ...                          ...\n *                   M-3                          M-3\n *                   M-2                           M\n *                   M-1                          M+1\n *                    M                           M-2\n *                   M+1                          M-1\n *                    0                            0\n * We read alternate iMCU rows using each master pointer; thus the last two\n * row groups of the previous iMCU row remain un-overwritten in the workspace.\n * The pointer lists are set up so that the required context rows appear to\n * be adjacent to the proper places when we pass the pointer lists to the\n * upsampler.\n *\n * The above pictures describe the normal state of the pointer lists.\n * At top and bottom of the image, we diddle the pointer lists to duplicate\n * the first or last sample row as necessary (this is cheaper than copying\n * sample rows around).\n *\n * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1.  In that\n * situation each iMCU row provides only one row group so the buffering logic\n * must be different (eg, we must read two iMCU rows before we can emit the\n * first row group).  For now, we simply do not support providing context\n * rows when min_DCT_scaled_size is 1.  That combination seems unlikely to\n * be worth providing --- if someone wants a 1/8th-size preview, they probably\n * want it quick and dirty, so a context-free upsampler is sufficient.\n */\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_d_main_controller pub; /* public fields */\n\n  /* Pointer to allocated workspace (M or M+2 row groups). */\n  JSAMPARRAY buffer[MAX_COMPONENTS];\n\n  boolean buffer_full;\t\t/* Have we gotten an iMCU row from decoder? */\n  JDIMENSION rowgroup_ctr;\t/* counts row groups output to postprocessor */\n\n  /* Remaining fields are only used in the context case. */\n\n  /* These are the master pointers to the funny-order pointer lists. */\n  JSAMPIMAGE xbuffer[2];\t/* pointers to weird pointer lists */\n\n  int whichptr;\t\t\t/* indicates which pointer set is now in use */\n  int context_state;\t\t/* process_data state machine status */\n  JDIMENSION rowgroups_avail;\t/* row groups available to postprocessor */\n  JDIMENSION iMCU_row_ctr;\t/* counts iMCU rows to detect image top/bot */\n} my_main_controller;\n\ntypedef my_main_controller * my_main_ptr;\n\n/* context_state values: */\n#define CTX_PREPARE_FOR_IMCU\t0\t/* need to prepare for MCU row */\n#define CTX_PROCESS_IMCU\t1\t/* feeding iMCU to postprocessor */\n#define CTX_POSTPONED_ROW\t2\t/* feeding postponed row group */\n\n\n/* Forward declarations */\nMETHODDEF(void) process_data_simple_main\n\tJPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n\t     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));\nMETHODDEF(void) process_data_context_main\n\tJPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n\t     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));\n#ifdef QUANT_2PASS_SUPPORTED\nMETHODDEF(void) process_data_crank_post\n\tJPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n\t     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));\n#endif\n\n\nLOCAL(void)\nalloc_funny_pointers (j_decompress_ptr cinfo)\n/* Allocate space for the funny pointer lists.\n * This is done only once, not once per pass.\n */\n{\n  my_main_ptr mainp = (my_main_ptr) cinfo->main;\n  int ci, rgroup;\n  int M = cinfo->min_DCT_v_scaled_size;\n  jpeg_component_info *compptr;\n  JSAMPARRAY xbuf;\n\n  /* Get top-level space for component array pointers.\n   * We alloc both arrays with one call to save a few cycles.\n   */\n  mainp->xbuffer[0] = (JSAMPIMAGE)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tcinfo->num_components * 2 * SIZEOF(JSAMPARRAY));\n  mainp->xbuffer[1] = mainp->xbuffer[0] + cinfo->num_components;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /\n      cinfo->min_DCT_v_scaled_size; /* height of a row group of component */\n    /* Get space for pointer lists --- M+4 row groups in each list.\n     * We alloc both pointer lists with one call to save a few cycles.\n     */\n    xbuf = (JSAMPARRAY)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));\n    xbuf += rgroup;\t\t/* want one row group at negative offsets */\n    mainp->xbuffer[0][ci] = xbuf;\n    xbuf += rgroup * (M + 4);\n    mainp->xbuffer[1][ci] = xbuf;\n  }\n}\n\n\nLOCAL(void)\nmake_funny_pointers (j_decompress_ptr cinfo)\n/* Create the funny pointer lists discussed in the comments above.\n * The actual workspace is already allocated (in main->buffer),\n * and the space for the pointer lists is allocated too.\n * This routine just fills in the curiously ordered lists.\n * This will be repeated at the beginning of each pass.\n */\n{\n  my_main_ptr mainp = (my_main_ptr) cinfo->main;\n  int ci, i, rgroup;\n  int M = cinfo->min_DCT_v_scaled_size;\n  jpeg_component_info *compptr;\n  JSAMPARRAY buf, xbuf0, xbuf1;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /\n      cinfo->min_DCT_v_scaled_size; /* height of a row group of component */\n    xbuf0 = mainp->xbuffer[0][ci];\n    xbuf1 = mainp->xbuffer[1][ci];\n    /* First copy the workspace pointers as-is */\n    buf = mainp->buffer[ci];\n    for (i = 0; i < rgroup * (M + 2); i++) {\n      xbuf0[i] = xbuf1[i] = buf[i];\n    }\n    /* In the second list, put the last four row groups in swapped order */\n    for (i = 0; i < rgroup * 2; i++) {\n      xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i];\n      xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i];\n    }\n    /* The wraparound pointers at top and bottom will be filled later\n     * (see set_wraparound_pointers, below).  Initially we want the \"above\"\n     * pointers to duplicate the first actual data line.  This only needs\n     * to happen in xbuffer[0].\n     */\n    for (i = 0; i < rgroup; i++) {\n      xbuf0[i - rgroup] = xbuf0[0];\n    }\n  }\n}\n\n\nLOCAL(void)\nset_wraparound_pointers (j_decompress_ptr cinfo)\n/* Set up the \"wraparound\" pointers at top and bottom of the pointer lists.\n * This changes the pointer list state from top-of-image to the normal state.\n */\n{\n  my_main_ptr mainp = (my_main_ptr) cinfo->main;\n  int ci, i, rgroup;\n  int M = cinfo->min_DCT_v_scaled_size;\n  jpeg_component_info *compptr;\n  JSAMPARRAY xbuf0, xbuf1;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /\n      cinfo->min_DCT_v_scaled_size; /* height of a row group of component */\n    xbuf0 = mainp->xbuffer[0][ci];\n    xbuf1 = mainp->xbuffer[1][ci];\n    for (i = 0; i < rgroup; i++) {\n      xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];\n      xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];\n      xbuf0[rgroup*(M+2) + i] = xbuf0[i];\n      xbuf1[rgroup*(M+2) + i] = xbuf1[i];\n    }\n  }\n}\n\n\nLOCAL(void)\nset_bottom_pointers (j_decompress_ptr cinfo)\n/* Change the pointer lists to duplicate the last sample row at the bottom\n * of the image.  whichptr indicates which xbuffer holds the final iMCU row.\n * Also sets rowgroups_avail to indicate number of nondummy row groups in row.\n */\n{\n  my_main_ptr mainp = (my_main_ptr) cinfo->main;\n  int ci, i, rgroup, iMCUheight, rows_left;\n  jpeg_component_info *compptr;\n  JSAMPARRAY xbuf;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Count sample rows in one iMCU row and in one row group */\n    iMCUheight = compptr->v_samp_factor * compptr->DCT_v_scaled_size;\n    rgroup = iMCUheight / cinfo->min_DCT_v_scaled_size;\n    /* Count nondummy sample rows remaining for this component */\n    rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight);\n    if (rows_left == 0) rows_left = iMCUheight;\n    /* Count nondummy row groups.  Should get same answer for each component,\n     * so we need only do it once.\n     */\n    if (ci == 0) {\n      mainp->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);\n    }\n    /* Duplicate the last real sample row rgroup*2 times; this pads out the\n     * last partial rowgroup and ensures at least one full rowgroup of context.\n     */\n    xbuf = mainp->xbuffer[mainp->whichptr][ci];\n    for (i = 0; i < rgroup * 2; i++) {\n      xbuf[rows_left + i] = xbuf[rows_left-1];\n    }\n  }\n}\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_main_ptr mainp = (my_main_ptr) cinfo->main;\n\n  switch (pass_mode) {\n  case JBUF_PASS_THRU:\n    if (cinfo->upsample->need_context_rows) {\n      mainp->pub.process_data = process_data_context_main;\n      make_funny_pointers(cinfo); /* Create the xbuffer[] lists */\n      mainp->whichptr = 0;\t/* Read first iMCU row into xbuffer[0] */\n      mainp->context_state = CTX_PREPARE_FOR_IMCU;\n      mainp->iMCU_row_ctr = 0;\n    } else {\n      /* Simple case with no context needed */\n      mainp->pub.process_data = process_data_simple_main;\n    }\n    mainp->buffer_full = FALSE;\t/* Mark buffer empty */\n    mainp->rowgroup_ctr = 0;\n    break;\n#ifdef QUANT_2PASS_SUPPORTED\n  case JBUF_CRANK_DEST:\n    /* For last pass of 2-pass quantization, just crank the postprocessor */\n    mainp->pub.process_data = process_data_crank_post;\n    break;\n#endif\n  default:\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    break;\n  }\n}\n\n\n/*\n * Process some data.\n * This handles the simple case where no context is required.\n */\n\nMETHODDEF(void)\nprocess_data_simple_main (j_decompress_ptr cinfo,\n\t\t\t  JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t\t  JDIMENSION out_rows_avail)\n{\n  my_main_ptr mainp = (my_main_ptr) cinfo->main;\n  JDIMENSION rowgroups_avail;\n\n  /* Read input data if we haven't filled the main buffer yet */\n  if (! mainp->buffer_full) {\n    if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer))\n      return;\t\t\t/* suspension forced, can do nothing more */\n    mainp->buffer_full = TRUE;\t/* OK, we have an iMCU row to work with */\n  }\n\n  /* There are always min_DCT_scaled_size row groups in an iMCU row. */\n  rowgroups_avail = (JDIMENSION) cinfo->min_DCT_v_scaled_size;\n  /* Note: at the bottom of the image, we may pass extra garbage row groups\n   * to the postprocessor.  The postprocessor has to check for bottom\n   * of image anyway (at row resolution), so no point in us doing it too.\n   */\n\n  /* Feed the postprocessor */\n  (*cinfo->post->post_process_data) (cinfo, mainp->buffer,\n\t\t\t\t     &mainp->rowgroup_ctr, rowgroups_avail,\n\t\t\t\t     output_buf, out_row_ctr, out_rows_avail);\n\n  /* Has postprocessor consumed all the data yet? If so, mark buffer empty */\n  if (mainp->rowgroup_ctr >= rowgroups_avail) {\n    mainp->buffer_full = FALSE;\n    mainp->rowgroup_ctr = 0;\n  }\n}\n\n\n/*\n * Process some data.\n * This handles the case where context rows must be provided.\n */\n\nMETHODDEF(void)\nprocess_data_context_main (j_decompress_ptr cinfo,\n\t\t\t   JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t\t   JDIMENSION out_rows_avail)\n{\n  my_main_ptr mainp = (my_main_ptr) cinfo->main;\n\n  /* Read input data if we haven't filled the main buffer yet */\n  if (! mainp->buffer_full) {\n    if (! (*cinfo->coef->decompress_data) (cinfo,\n\t\t\t\t\t   mainp->xbuffer[mainp->whichptr]))\n      return;\t\t\t/* suspension forced, can do nothing more */\n    mainp->buffer_full = TRUE;\t/* OK, we have an iMCU row to work with */\n    mainp->iMCU_row_ctr++;\t/* count rows received */\n  }\n\n  /* Postprocessor typically will not swallow all the input data it is handed\n   * in one call (due to filling the output buffer first).  Must be prepared\n   * to exit and restart.  This switch lets us keep track of how far we got.\n   * Note that each case falls through to the next on successful completion.\n   */\n  switch (mainp->context_state) {\n  case CTX_POSTPONED_ROW:\n    /* Call postprocessor using previously set pointers for postponed row */\n    (*cinfo->post->post_process_data) (cinfo, mainp->xbuffer[mainp->whichptr],\n\t\t\t&mainp->rowgroup_ctr, mainp->rowgroups_avail,\n\t\t\toutput_buf, out_row_ctr, out_rows_avail);\n    if (mainp->rowgroup_ctr < mainp->rowgroups_avail)\n      return;\t\t\t/* Need to suspend */\n    mainp->context_state = CTX_PREPARE_FOR_IMCU;\n    if (*out_row_ctr >= out_rows_avail)\n      return;\t\t\t/* Postprocessor exactly filled output buf */\n    /*FALLTHROUGH*/\n  case CTX_PREPARE_FOR_IMCU:\n    /* Prepare to process first M-1 row groups of this iMCU row */\n    mainp->rowgroup_ctr = 0;\n    mainp->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size - 1);\n    /* Check for bottom of image: if so, tweak pointers to \"duplicate\"\n     * the last sample row, and adjust rowgroups_avail to ignore padding rows.\n     */\n    if (mainp->iMCU_row_ctr == cinfo->total_iMCU_rows)\n      set_bottom_pointers(cinfo);\n    mainp->context_state = CTX_PROCESS_IMCU;\n    /*FALLTHROUGH*/\n  case CTX_PROCESS_IMCU:\n    /* Call postprocessor using previously set pointers */\n    (*cinfo->post->post_process_data) (cinfo, mainp->xbuffer[mainp->whichptr],\n\t\t\t&mainp->rowgroup_ctr, mainp->rowgroups_avail,\n\t\t\toutput_buf, out_row_ctr, out_rows_avail);\n    if (mainp->rowgroup_ctr < mainp->rowgroups_avail)\n      return;\t\t\t/* Need to suspend */\n    /* After the first iMCU, change wraparound pointers to normal state */\n    if (mainp->iMCU_row_ctr == 1)\n      set_wraparound_pointers(cinfo);\n    /* Prepare to load new iMCU row using other xbuffer list */\n    mainp->whichptr ^= 1;\t/* 0=>1 or 1=>0 */\n    mainp->buffer_full = FALSE;\n    /* Still need to process last row group of this iMCU row, */\n    /* which is saved at index M+1 of the other xbuffer */\n    mainp->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 1);\n    mainp->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 2);\n    mainp->context_state = CTX_POSTPONED_ROW;\n  }\n}\n\n\n/*\n * Process some data.\n * Final pass of two-pass quantization: just call the postprocessor.\n * Source data will be the postprocessor controller's internal buffer.\n */\n\n#ifdef QUANT_2PASS_SUPPORTED\n\nMETHODDEF(void)\nprocess_data_crank_post (j_decompress_ptr cinfo,\n\t\t\t JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t\t JDIMENSION out_rows_avail)\n{\n  (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL,\n\t\t\t\t     (JDIMENSION *) NULL, (JDIMENSION) 0,\n\t\t\t\t     output_buf, out_row_ctr, out_rows_avail);\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n\n\n/*\n * Initialize main buffer controller.\n */\n\nGLOBAL(void)\njinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)\n{\n  my_main_ptr mainp;\n  int ci, rgroup, ngroups;\n  jpeg_component_info *compptr;\n\n  mainp = (my_main_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_main_controller));\n  cinfo->main = &mainp->pub;\n  mainp->pub.start_pass = start_pass_main;\n\n  if (need_full_buffer)\t\t/* shouldn't happen */\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  /* Allocate the workspace.\n   * ngroups is the number of row groups we need.\n   */\n  if (cinfo->upsample->need_context_rows) {\n    if (cinfo->min_DCT_v_scaled_size < 2) /* unsupported, see comments above */\n      ERREXIT(cinfo, JERR_NOTIMPL);\n    alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */\n    ngroups = cinfo->min_DCT_v_scaled_size + 2;\n  } else {\n    ngroups = cinfo->min_DCT_v_scaled_size;\n  }\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /\n      cinfo->min_DCT_v_scaled_size; /* height of a row group of component */\n    mainp->buffer[ci] = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       compptr->width_in_blocks * ((JDIMENSION) compptr->DCT_h_scaled_size),\n       (JDIMENSION) (rgroup * ngroups));\n  }\n}\n"
  },
  {
    "path": "jdmarker.c",
    "content": "/*\n * jdmarker.c\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2009-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to decode JPEG datastream markers.\n * Most of the complexity arises from our desire to support input\n * suspension: if not all of the data for a marker is available,\n * we must exit back to the application.  On resumption, we reprocess\n * the marker.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\ntypedef enum {\t\t\t/* JPEG marker codes */\n  M_SOF0  = 0xc0,\n  M_SOF1  = 0xc1,\n  M_SOF2  = 0xc2,\n  M_SOF3  = 0xc3,\n\n  M_SOF5  = 0xc5,\n  M_SOF6  = 0xc6,\n  M_SOF7  = 0xc7,\n\n  M_JPG   = 0xc8,\n  M_SOF9  = 0xc9,\n  M_SOF10 = 0xca,\n  M_SOF11 = 0xcb,\n\n  M_SOF13 = 0xcd,\n  M_SOF14 = 0xce,\n  M_SOF15 = 0xcf,\n\n  M_DHT   = 0xc4,\n\n  M_DAC   = 0xcc,\n\n  M_RST0  = 0xd0,\n  M_RST1  = 0xd1,\n  M_RST2  = 0xd2,\n  M_RST3  = 0xd3,\n  M_RST4  = 0xd4,\n  M_RST5  = 0xd5,\n  M_RST6  = 0xd6,\n  M_RST7  = 0xd7,\n\n  M_SOI   = 0xd8,\n  M_EOI   = 0xd9,\n  M_SOS   = 0xda,\n  M_DQT   = 0xdb,\n  M_DNL   = 0xdc,\n  M_DRI   = 0xdd,\n  M_DHP   = 0xde,\n  M_EXP   = 0xdf,\n\n  M_APP0  = 0xe0,\n  M_APP1  = 0xe1,\n  M_APP2  = 0xe2,\n  M_APP3  = 0xe3,\n  M_APP4  = 0xe4,\n  M_APP5  = 0xe5,\n  M_APP6  = 0xe6,\n  M_APP7  = 0xe7,\n  M_APP8  = 0xe8,\n  M_APP9  = 0xe9,\n  M_APP10 = 0xea,\n  M_APP11 = 0xeb,\n  M_APP12 = 0xec,\n  M_APP13 = 0xed,\n  M_APP14 = 0xee,\n  M_APP15 = 0xef,\n\n  M_JPG0  = 0xf0,\n  M_JPG8  = 0xf8,\n  M_JPG13 = 0xfd,\n  M_COM   = 0xfe,\n\n  M_TEM   = 0x01,\n\n  M_ERROR = 0x100\n} JPEG_MARKER;\n\n\n/* Private state */\n\ntypedef struct {\n  struct jpeg_marker_reader pub; /* public fields */\n\n  /* Application-overridable marker processing methods */\n  jpeg_marker_parser_method process_COM;\n  jpeg_marker_parser_method process_APPn[16];\n\n  /* Limit on marker data length to save for each marker type */\n  unsigned int length_limit_COM;\n  unsigned int length_limit_APPn[16];\n\n  /* Status of COM/APPn marker saving */\n  jpeg_saved_marker_ptr cur_marker;\t/* NULL if not processing a marker */\n  unsigned int bytes_read;\t\t/* data bytes read so far in marker */\n  /* Note: cur_marker is not linked into marker_list until it's all read. */\n} my_marker_reader;\n\ntypedef my_marker_reader * my_marker_ptr;\n\n\n/*\n * Macros for fetching data from the data source module.\n *\n * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect\n * the current restart point; we update them only when we have reached a\n * suitable place to restart if a suspension occurs.\n */\n\n/* Declare and initialize local copies of input pointer/count */\n#define INPUT_VARS(cinfo)  \\\n\tstruct jpeg_source_mgr * datasrc = (cinfo)->src;  \\\n\tconst JOCTET * next_input_byte = datasrc->next_input_byte;  \\\n\tsize_t bytes_in_buffer = datasrc->bytes_in_buffer\n\n/* Unload the local copies --- do this only at a restart boundary */\n#define INPUT_SYNC(cinfo)  \\\n\t( datasrc->next_input_byte = next_input_byte,  \\\n\t  datasrc->bytes_in_buffer = bytes_in_buffer )\n\n/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */\n#define INPUT_RELOAD(cinfo)  \\\n\t( next_input_byte = datasrc->next_input_byte,  \\\n\t  bytes_in_buffer = datasrc->bytes_in_buffer )\n\n/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available.\n * Note we do *not* do INPUT_SYNC before calling fill_input_buffer,\n * but we must reload the local copies after a successful fill.\n */\n#define MAKE_BYTE_AVAIL(cinfo,action)  \\\n\tif (bytes_in_buffer == 0) {  \\\n\t  if (! (*datasrc->fill_input_buffer) (cinfo))  \\\n\t    { action; }  \\\n\t  INPUT_RELOAD(cinfo);  \\\n\t}\n\n/* Read a byte into variable V.\n * If must suspend, take the specified action (typically \"return FALSE\").\n */\n#define INPUT_BYTE(cinfo,V,action)  \\\n\tMAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \\\n\t\t  bytes_in_buffer--; \\\n\t\t  V = GETJOCTET(*next_input_byte++); )\n\n/* As above, but read two bytes interpreted as an unsigned 16-bit integer.\n * V should be declared unsigned int or perhaps INT32.\n */\n#define INPUT_2BYTES(cinfo,V,action)  \\\n\tMAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \\\n\t\t  bytes_in_buffer--; \\\n\t\t  V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \\\n\t\t  MAKE_BYTE_AVAIL(cinfo,action); \\\n\t\t  bytes_in_buffer--; \\\n\t\t  V += GETJOCTET(*next_input_byte++); )\n\n\n/*\n * Routines to process JPEG markers.\n *\n * Entry condition: JPEG marker itself has been read and its code saved\n *   in cinfo->unread_marker; input restart point is just after the marker.\n *\n * Exit: if return TRUE, have read and processed any parameters, and have\n *   updated the restart point to point after the parameters.\n *   If return FALSE, was forced to suspend before reaching end of\n *   marker parameters; restart point has not been moved.  Same routine\n *   will be called again after application supplies more input data.\n *\n * This approach to suspension assumes that all of a marker's parameters\n * can fit into a single input bufferload.  This should hold for \"normal\"\n * markers.  Some COM/APPn markers might have large parameter segments\n * that might not fit.  If we are simply dropping such a marker, we use\n * skip_input_data to get past it, and thereby put the problem on the\n * source manager's shoulders.  If we are saving the marker's contents\n * into memory, we use a slightly different convention: when forced to\n * suspend, the marker processor updates the restart point to the end of\n * what it's consumed (ie, the end of the buffer) before returning FALSE.\n * On resumption, cinfo->unread_marker still contains the marker code,\n * but the data source will point to the next chunk of marker data.\n * The marker processor must retain internal state to deal with this.\n *\n * Note that we don't bother to avoid duplicate trace messages if a\n * suspension occurs within marker parameters.  Other side effects\n * require more care.\n */\n\n\nLOCAL(boolean)\nget_soi (j_decompress_ptr cinfo)\n/* Process an SOI marker */\n{\n  int i;\n  \n  TRACEMS(cinfo, 1, JTRC_SOI);\n\n  if (cinfo->marker->saw_SOI)\n    ERREXIT(cinfo, JERR_SOI_DUPLICATE);\n\n  /* Reset all parameters that are defined to be reset by SOI */\n\n  for (i = 0; i < NUM_ARITH_TBLS; i++) {\n    cinfo->arith_dc_L[i] = 0;\n    cinfo->arith_dc_U[i] = 1;\n    cinfo->arith_ac_K[i] = 5;\n  }\n  cinfo->restart_interval = 0;\n\n  /* Set initial assumptions for colorspace etc */\n\n  cinfo->jpeg_color_space = JCS_UNKNOWN;\n  cinfo->color_transform = JCT_NONE;\n  cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */\n\n  cinfo->saw_JFIF_marker = FALSE;\n  cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */\n  cinfo->JFIF_minor_version = 1;\n  cinfo->density_unit = 0;\n  cinfo->X_density = 1;\n  cinfo->Y_density = 1;\n  cinfo->saw_Adobe_marker = FALSE;\n  cinfo->Adobe_transform = 0;\n\n  cinfo->marker->saw_SOI = TRUE;\n\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_sof (j_decompress_ptr cinfo, boolean is_baseline, boolean is_prog,\n\t boolean is_arith)\n/* Process a SOFn marker */\n{\n  INT32 length;\n  int c, ci, i;\n  jpeg_component_info * compptr;\n  INPUT_VARS(cinfo);\n\n  cinfo->is_baseline = is_baseline;\n  cinfo->progressive_mode = is_prog;\n  cinfo->arith_code = is_arith;\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n\n  INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE);\n  INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE);\n  INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE);\n  INPUT_BYTE(cinfo, cinfo->num_components, return FALSE);\n\n  length -= 8;\n\n  TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker,\n\t   (int) cinfo->image_width, (int) cinfo->image_height,\n\t   cinfo->num_components);\n\n  if (cinfo->marker->saw_SOF)\n    ERREXIT(cinfo, JERR_SOF_DUPLICATE);\n\n  /* We don't support files in which the image height is initially specified */\n  /* as 0 and is later redefined by DNL.  As long as we have to check that,  */\n  /* might as well have a general sanity check. */\n  if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||\n      cinfo->num_components <= 0)\n    ERREXIT(cinfo, JERR_EMPTY_IMAGE);\n\n  if (length != (cinfo->num_components * 3))\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  if (cinfo->comp_info == NULL)\t/* do only once, even if suspend */\n    cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small)\n\t\t\t((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t cinfo->num_components * SIZEOF(jpeg_component_info));\n\n  for (ci = 0; ci < cinfo->num_components; ci++) {\n    INPUT_BYTE(cinfo, c, return FALSE);\n    /* Check to see whether component id has already been seen   */\n    /* (in violation of the spec, but unfortunately seen in some */\n    /* files).  If so, create \"fake\" component id equal to the   */\n    /* max id seen so far + 1. */\n    for (i = 0, compptr = cinfo->comp_info; i < ci; i++, compptr++) {\n      if (c == compptr->component_id) {\n\tcompptr = cinfo->comp_info;\n\tc = compptr->component_id;\n\tcompptr++;\n\tfor (i = 1; i < ci; i++, compptr++) {\n\t  if (compptr->component_id > c) c = compptr->component_id;\n\t}\n\tc++;\n\tbreak;\n      }\n    }\n    compptr->component_id = c;\n    compptr->component_index = ci;\n    INPUT_BYTE(cinfo, c, return FALSE);\n    compptr->h_samp_factor = (c >> 4) & 15;\n    compptr->v_samp_factor = (c     ) & 15;\n    INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE);\n\n    TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT,\n\t     compptr->component_id, compptr->h_samp_factor,\n\t     compptr->v_samp_factor, compptr->quant_tbl_no);\n  }\n\n  cinfo->marker->saw_SOF = TRUE;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_sos (j_decompress_ptr cinfo)\n/* Process a SOS marker */\n{\n  INT32 length;\n  int c, ci, i, n;\n  jpeg_component_info * compptr;\n  INPUT_VARS(cinfo);\n\n  if (! cinfo->marker->saw_SOF)\n    ERREXITS(cinfo, JERR_SOF_BEFORE, \"SOS\");\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n\n  INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */\n\n  TRACEMS1(cinfo, 1, JTRC_SOS, n);\n\n  if (length != (n * 2 + 6) || n > MAX_COMPS_IN_SCAN ||\n      (n == 0 && !cinfo->progressive_mode))\n      /* pseudo SOS marker only allowed in progressive mode */\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  cinfo->comps_in_scan = n;\n\n  /* Collect the component-spec parameters */\n\n  for (i = 0; i < n; i++) {\n    INPUT_BYTE(cinfo, c, return FALSE);\n\n    /* Detect the case where component id's are not unique, and, if so, */\n    /* create a fake component id using the same logic as in get_sof.   */\n    /* Note:  This also ensures that all of the SOF components are      */\n    /* referenced in the single scan case, which prevents access to     */\n    /* uninitialized memory in later decoding stages. */\n    for (ci = 0; ci < i; ci++) {\n      if (c == cinfo->cur_comp_info[ci]->component_id) {\n\tc = cinfo->cur_comp_info[0]->component_id;\n\tfor (ci = 1; ci < i; ci++) {\n\t  compptr = cinfo->cur_comp_info[ci];\n\t  if (compptr->component_id > c) c = compptr->component_id;\n\t}\n\tc++;\n\tbreak;\n      }\n    }\n\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      if (c == compptr->component_id)\n\tgoto id_found;\n    }\n\n    ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, c);\n\n  id_found:\n\n    cinfo->cur_comp_info[i] = compptr;\n    INPUT_BYTE(cinfo, c, return FALSE);\n    compptr->dc_tbl_no = (c >> 4) & 15;\n    compptr->ac_tbl_no = (c     ) & 15;\n\n    TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, compptr->component_id,\n\t     compptr->dc_tbl_no, compptr->ac_tbl_no);\n  }\n\n  /* Collect the additional scan parameters Ss, Se, Ah/Al. */\n  INPUT_BYTE(cinfo, c, return FALSE);\n  cinfo->Ss = c;\n  INPUT_BYTE(cinfo, c, return FALSE);\n  cinfo->Se = c;\n  INPUT_BYTE(cinfo, c, return FALSE);\n  cinfo->Ah = (c >> 4) & 15;\n  cinfo->Al = (c     ) & 15;\n\n  TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se,\n\t   cinfo->Ah, cinfo->Al);\n\n  /* Prepare to scan data & restart markers */\n  cinfo->marker->next_restart_num = 0;\n\n  /* Count another (non-pseudo) SOS marker */\n  if (n) cinfo->input_scan_number++;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\n#ifdef D_ARITH_CODING_SUPPORTED\n\nLOCAL(boolean)\nget_dac (j_decompress_ptr cinfo)\n/* Process a DAC marker */\n{\n  INT32 length;\n  int index, val;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n  \n  while (length > 0) {\n    INPUT_BYTE(cinfo, index, return FALSE);\n    INPUT_BYTE(cinfo, val, return FALSE);\n\n    length -= 2;\n\n    TRACEMS2(cinfo, 1, JTRC_DAC, index, val);\n\n    if (index < 0 || index >= (2*NUM_ARITH_TBLS))\n      ERREXIT1(cinfo, JERR_DAC_INDEX, index);\n\n    if (index >= NUM_ARITH_TBLS) { /* define AC table */\n      cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val;\n    } else {\t\t\t/* define DC table */\n      cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F);\n      cinfo->arith_dc_U[index] = (UINT8) (val >> 4);\n      if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index])\n\tERREXIT1(cinfo, JERR_DAC_VALUE, val);\n    }\n  }\n\n  if (length != 0)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n#else /* ! D_ARITH_CODING_SUPPORTED */\n\n#define get_dac(cinfo)  skip_variable(cinfo)\n\n#endif /* D_ARITH_CODING_SUPPORTED */\n\n\nLOCAL(boolean)\nget_dht (j_decompress_ptr cinfo)\n/* Process a DHT marker */\n{\n  INT32 length;\n  UINT8 bits[17];\n  UINT8 huffval[256];\n  int i, index, count;\n  JHUFF_TBL **htblptr;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n  \n  while (length > 16) {\n    INPUT_BYTE(cinfo, index, return FALSE);\n\n    TRACEMS1(cinfo, 1, JTRC_DHT, index);\n      \n    bits[0] = 0;\n    count = 0;\n    for (i = 1; i <= 16; i++) {\n      INPUT_BYTE(cinfo, bits[i], return FALSE);\n      count += bits[i];\n    }\n\n    length -= 1 + 16;\n\n    TRACEMS8(cinfo, 2, JTRC_HUFFBITS,\n\t     bits[1], bits[2], bits[3], bits[4],\n\t     bits[5], bits[6], bits[7], bits[8]);\n    TRACEMS8(cinfo, 2, JTRC_HUFFBITS,\n\t     bits[9], bits[10], bits[11], bits[12],\n\t     bits[13], bits[14], bits[15], bits[16]);\n\n    /* Here we just do minimal validation of the counts to avoid walking\n     * off the end of our table space.  jdhuff.c will check more carefully.\n     */\n    if (count > 256 || ((INT32) count) > length)\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n\n    MEMZERO(huffval, SIZEOF(huffval)); /* pre-zero array for later copy */\n\n    for (i = 0; i < count; i++)\n      INPUT_BYTE(cinfo, huffval[i], return FALSE);\n\n    length -= count;\n\n    if (index & 0x10) {\t\t/* AC table definition */\n      index -= 0x10;\n      htblptr = &cinfo->ac_huff_tbl_ptrs[index];\n    } else {\t\t\t/* DC table definition */\n      htblptr = &cinfo->dc_huff_tbl_ptrs[index];\n    }\n\n    if (index < 0 || index >= NUM_HUFF_TBLS)\n      ERREXIT1(cinfo, JERR_DHT_INDEX, index);\n\n    if (*htblptr == NULL)\n      *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n  \n    MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));\n    MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval));\n  }\n\n  if (length != 0)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_dqt (j_decompress_ptr cinfo)\n/* Process a DQT marker */\n{\n  INT32 length, count, i;\n  int n, prec;\n  unsigned int tmp;\n  JQUANT_TBL *quant_ptr;\n  const int *natural_order;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n\n  while (length > 0) {\n    length--;\n    INPUT_BYTE(cinfo, n, return FALSE);\n    prec = n >> 4;\n    n &= 0x0F;\n\n    TRACEMS2(cinfo, 1, JTRC_DQT, n, prec);\n\n    if (n >= NUM_QUANT_TBLS)\n      ERREXIT1(cinfo, JERR_DQT_INDEX, n);\n      \n    if (cinfo->quant_tbl_ptrs[n] == NULL)\n      cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo);\n    quant_ptr = cinfo->quant_tbl_ptrs[n];\n\n    if (prec) {\n      if (length < DCTSIZE2 * 2) {\n\t/* Initialize full table for safety. */\n\tfor (i = 0; i < DCTSIZE2; i++) {\n\t  quant_ptr->quantval[i] = 1;\n\t}\n\tcount = length >> 1;\n      } else\n\tcount = DCTSIZE2;\n    } else {\n      if (length < DCTSIZE2) {\n\t/* Initialize full table for safety. */\n\tfor (i = 0; i < DCTSIZE2; i++) {\n\t  quant_ptr->quantval[i] = 1;\n\t}\n\tcount = length;\n      } else\n\tcount = DCTSIZE2;\n    }\n\n    switch (count) {\n    case (2*2): natural_order = jpeg_natural_order2; break;\n    case (3*3): natural_order = jpeg_natural_order3; break;\n    case (4*4): natural_order = jpeg_natural_order4; break;\n    case (5*5): natural_order = jpeg_natural_order5; break;\n    case (6*6): natural_order = jpeg_natural_order6; break;\n    case (7*7): natural_order = jpeg_natural_order7; break;\n    default:    natural_order = jpeg_natural_order;  break;\n    }\n\n    for (i = 0; i < count; i++) {\n      if (prec)\n\tINPUT_2BYTES(cinfo, tmp, return FALSE);\n      else\n\tINPUT_BYTE(cinfo, tmp, return FALSE);\n      /* We convert the zigzag-order table to natural array order. */\n      quant_ptr->quantval[natural_order[i]] = (UINT16) tmp;\n    }\n\n    if (cinfo->err->trace_level >= 2) {\n      for (i = 0; i < DCTSIZE2; i += 8) {\n\tTRACEMS8(cinfo, 2, JTRC_QUANTVALS,\n\t\t quant_ptr->quantval[i],   quant_ptr->quantval[i+1],\n\t\t quant_ptr->quantval[i+2], quant_ptr->quantval[i+3],\n\t\t quant_ptr->quantval[i+4], quant_ptr->quantval[i+5],\n\t\t quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]);\n      }\n    }\n\n    length -= count;\n    if (prec) length -= count;\n  }\n\n  if (length != 0)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_dri (j_decompress_ptr cinfo)\n/* Process a DRI marker */\n{\n  INT32 length;\n  unsigned int tmp;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  \n  if (length != 4)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_2BYTES(cinfo, tmp, return FALSE);\n\n  TRACEMS1(cinfo, 1, JTRC_DRI, tmp);\n\n  cinfo->restart_interval = tmp;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_lse (j_decompress_ptr cinfo)\n/* Process an LSE marker */\n{\n  INT32 length;\n  unsigned int tmp;\n  int cid;\n  INPUT_VARS(cinfo);\n\n  if (! cinfo->marker->saw_SOF)\n    ERREXITS(cinfo, JERR_SOF_BEFORE, \"LSE\");\n\n  if (cinfo->num_components < 3) goto bad;\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n\n  if (length != 24)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_BYTE(cinfo, tmp, return FALSE);\n  if (tmp != 0x0D)\t/* ID inverse transform specification */\n    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);\n  INPUT_2BYTES(cinfo, tmp, return FALSE);\n  if (tmp != MAXJSAMPLE) goto bad;\t\t/* MAXTRANS */\n  INPUT_BYTE(cinfo, tmp, return FALSE);\n  if (tmp != 3) goto bad;\t\t\t/* Nt=3 */\n  INPUT_BYTE(cinfo, cid, return FALSE);\n  if (cid != cinfo->comp_info[1].component_id) goto bad;\n  INPUT_BYTE(cinfo, cid, return FALSE);\n  if (cid != cinfo->comp_info[0].component_id) goto bad;\n  INPUT_BYTE(cinfo, cid, return FALSE);\n  if (cid != cinfo->comp_info[2].component_id) goto bad;\n  INPUT_BYTE(cinfo, tmp, return FALSE);\n  if (tmp != 0x80) goto bad;\t\t/* F1: CENTER1=1, NORM1=0 */\n  INPUT_2BYTES(cinfo, tmp, return FALSE);\n  if (tmp != 0) goto bad;\t\t\t/* A(1,1)=0 */\n  INPUT_2BYTES(cinfo, tmp, return FALSE);\n  if (tmp != 0) goto bad;\t\t\t/* A(1,2)=0 */\n  INPUT_BYTE(cinfo, tmp, return FALSE);\n  if (tmp != 0) goto bad;\t\t/* F2: CENTER2=0, NORM2=0 */\n  INPUT_2BYTES(cinfo, tmp, return FALSE);\n  if (tmp != 1) goto bad;\t\t\t/* A(2,1)=1 */\n  INPUT_2BYTES(cinfo, tmp, return FALSE);\n  if (tmp != 0) goto bad;\t\t\t/* A(2,2)=0 */\n  INPUT_BYTE(cinfo, tmp, return FALSE);\n  if (tmp != 0) goto bad;\t\t/* F3: CENTER3=0, NORM3=0 */\n  INPUT_2BYTES(cinfo, tmp, return FALSE);\n  if (tmp != 1) goto bad;\t\t\t/* A(3,1)=1 */\n  INPUT_2BYTES(cinfo, tmp, return FALSE);\n  if (tmp != 0) {\t\t\t\t/* A(3,2)=0 */\n    bad:\n    ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n  }\n\n  /* OK, valid transform that we can handle. */\n  cinfo->color_transform = JCT_SUBTRACT_GREEN;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\n/*\n * Routines for processing APPn and COM markers.\n * These are either saved in memory or discarded, per application request.\n * APP0 and APP14 are specially checked to see if they are\n * JFIF and Adobe markers, respectively.\n */\n\n#define APP0_DATA_LEN\t14\t/* Length of interesting data in APP0 */\n#define APP14_DATA_LEN\t12\t/* Length of interesting data in APP14 */\n#define APPN_DATA_LEN\t14\t/* Must be the largest of the above!! */\n\n\nLOCAL(void)\nexamine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,\n\t      unsigned int datalen, INT32 remaining)\n/* Examine first few bytes from an APP0.\n * Take appropriate action if it is a JFIF marker.\n * datalen is # of bytes at data[], remaining is length of rest of marker data.\n */\n{\n  INT32 totallen = (INT32) datalen + remaining;\n\n  if (datalen >= APP0_DATA_LEN &&\n      GETJOCTET(data[0]) == 0x4A &&\n      GETJOCTET(data[1]) == 0x46 &&\n      GETJOCTET(data[2]) == 0x49 &&\n      GETJOCTET(data[3]) == 0x46 &&\n      GETJOCTET(data[4]) == 0) {\n    /* Found JFIF APP0 marker: save info */\n    cinfo->saw_JFIF_marker = TRUE;\n    cinfo->JFIF_major_version = GETJOCTET(data[5]);\n    cinfo->JFIF_minor_version = GETJOCTET(data[6]);\n    cinfo->density_unit = GETJOCTET(data[7]);\n    cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);\n    cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);\n    /* Check version.\n     * Major version must be 1 or 2, anything else signals an incompatible\n     * change.\n     * (We used to treat this as an error, but now it's a nonfatal warning,\n     * because some bozo at Hijaak couldn't read the spec.)\n     * Minor version should be 0..2, but process anyway if newer.\n     */\n    if (cinfo->JFIF_major_version != 1 && cinfo->JFIF_major_version != 2)\n      WARNMS2(cinfo, JWRN_JFIF_MAJOR,\n\t      cinfo->JFIF_major_version, cinfo->JFIF_minor_version);\n    /* Generate trace messages */\n    TRACEMS5(cinfo, 1, JTRC_JFIF,\n\t     cinfo->JFIF_major_version, cinfo->JFIF_minor_version,\n\t     cinfo->X_density, cinfo->Y_density, cinfo->density_unit);\n    /* Validate thumbnail dimensions and issue appropriate messages */\n    if (GETJOCTET(data[12]) | GETJOCTET(data[13]))\n      TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL,\n\t       GETJOCTET(data[12]), GETJOCTET(data[13]));\n    totallen -= APP0_DATA_LEN;\n    if (totallen !=\n\t((INT32)GETJOCTET(data[12]) * (INT32)GETJOCTET(data[13]) * (INT32) 3))\n      TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen);\n  } else if (datalen >= 6 &&\n      GETJOCTET(data[0]) == 0x4A &&\n      GETJOCTET(data[1]) == 0x46 &&\n      GETJOCTET(data[2]) == 0x58 &&\n      GETJOCTET(data[3]) == 0x58 &&\n      GETJOCTET(data[4]) == 0) {\n    /* Found JFIF \"JFXX\" extension APP0 marker */\n    /* The library doesn't actually do anything with these,\n     * but we try to produce a helpful trace message.\n     */\n    switch (GETJOCTET(data[5])) {\n    case 0x10:\n      TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen);\n      break;\n    case 0x11:\n      TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen);\n      break;\n    case 0x13:\n      TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen);\n      break;\n    default:\n      TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,\n\t       GETJOCTET(data[5]), (int) totallen);\n      break;\n    }\n  } else {\n    /* Start of APP0 does not match \"JFIF\" or \"JFXX\", or too short */\n    TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen);\n  }\n}\n\n\nLOCAL(void)\nexamine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,\n\t       unsigned int datalen, INT32 remaining)\n/* Examine first few bytes from an APP14.\n * Take appropriate action if it is an Adobe marker.\n * datalen is # of bytes at data[], remaining is length of rest of marker data.\n */\n{\n  unsigned int version, flags0, flags1, transform;\n\n  if (datalen >= APP14_DATA_LEN &&\n      GETJOCTET(data[0]) == 0x41 &&\n      GETJOCTET(data[1]) == 0x64 &&\n      GETJOCTET(data[2]) == 0x6F &&\n      GETJOCTET(data[3]) == 0x62 &&\n      GETJOCTET(data[4]) == 0x65) {\n    /* Found Adobe APP14 marker */\n    version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);\n    flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);\n    flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);\n    transform = GETJOCTET(data[11]);\n    TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);\n    cinfo->saw_Adobe_marker = TRUE;\n    cinfo->Adobe_transform = (UINT8) transform;\n  } else {\n    /* Start of APP14 does not match \"Adobe\", or too short */\n    TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining));\n  }\n}\n\n\nMETHODDEF(boolean)\nget_interesting_appn (j_decompress_ptr cinfo)\n/* Process an APP0 or APP14 marker without saving it */\n{\n  INT32 length;\n  JOCTET b[APPN_DATA_LEN];\n  unsigned int i, numtoread;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n\n  /* get the interesting part of the marker data */\n  if (length >= APPN_DATA_LEN)\n    numtoread = APPN_DATA_LEN;\n  else if (length > 0)\n    numtoread = (unsigned int) length;\n  else\n    numtoread = 0;\n  for (i = 0; i < numtoread; i++)\n    INPUT_BYTE(cinfo, b[i], return FALSE);\n  length -= numtoread;\n\n  /* process it */\n  switch (cinfo->unread_marker) {\n  case M_APP0:\n    examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length);\n    break;\n  case M_APP14:\n    examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length);\n    break;\n  default:\n    /* can't get here unless jpeg_save_markers chooses wrong processor */\n    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);\n    break;\n  }\n\n  /* skip any remaining data -- could be lots */\n  INPUT_SYNC(cinfo);\n  if (length > 0)\n    (*cinfo->src->skip_input_data) (cinfo, (long) length);\n\n  return TRUE;\n}\n\n\n#ifdef SAVE_MARKERS_SUPPORTED\n\nMETHODDEF(boolean)\nsave_marker (j_decompress_ptr cinfo)\n/* Save an APPn or COM marker into the marker list */\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n  jpeg_saved_marker_ptr cur_marker = marker->cur_marker;\n  unsigned int bytes_read, data_length;\n  JOCTET FAR * data;\n  INT32 length = 0;\n  INPUT_VARS(cinfo);\n\n  if (cur_marker == NULL) {\n    /* begin reading a marker */\n    INPUT_2BYTES(cinfo, length, return FALSE);\n    length -= 2;\n    if (length >= 0) {\t\t/* watch out for bogus length word */\n      /* figure out how much we want to save */\n      unsigned int limit;\n      if (cinfo->unread_marker == (int) M_COM)\n\tlimit = marker->length_limit_COM;\n      else\n\tlimit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0];\n      if ((unsigned int) length < limit)\n\tlimit = (unsigned int) length;\n      /* allocate and initialize the marker item */\n      cur_marker = (jpeg_saved_marker_ptr)\n\t(*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t    SIZEOF(struct jpeg_marker_struct) + limit);\n      cur_marker->next = NULL;\n      cur_marker->marker = (UINT8) cinfo->unread_marker;\n      cur_marker->original_length = (unsigned int) length;\n      cur_marker->data_length = limit;\n      /* data area is just beyond the jpeg_marker_struct */\n      data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1);\n      marker->cur_marker = cur_marker;\n      marker->bytes_read = 0;\n      bytes_read = 0;\n      data_length = limit;\n    } else {\n      /* deal with bogus length word */\n      bytes_read = data_length = 0;\n      data = NULL;\n    }\n  } else {\n    /* resume reading a marker */\n    bytes_read = marker->bytes_read;\n    data_length = cur_marker->data_length;\n    data = cur_marker->data + bytes_read;\n  }\n\n  while (bytes_read < data_length) {\n    INPUT_SYNC(cinfo);\t\t/* move the restart point to here */\n    marker->bytes_read = bytes_read;\n    /* If there's not at least one byte in buffer, suspend */\n    MAKE_BYTE_AVAIL(cinfo, return FALSE);\n    /* Copy bytes with reasonable rapidity */\n    while (bytes_read < data_length && bytes_in_buffer > 0) {\n      *data++ = *next_input_byte++;\n      bytes_in_buffer--;\n      bytes_read++;\n    }\n  }\n\n  /* Done reading what we want to read */\n  if (cur_marker != NULL) {\t/* will be NULL if bogus length word */\n    /* Add new marker to end of list */\n    if (cinfo->marker_list == NULL) {\n      cinfo->marker_list = cur_marker;\n    } else {\n      jpeg_saved_marker_ptr prev = cinfo->marker_list;\n      while (prev->next != NULL)\n\tprev = prev->next;\n      prev->next = cur_marker;\n    }\n    /* Reset pointer & calc remaining data length */\n    data = cur_marker->data;\n    length = cur_marker->original_length - data_length;\n  }\n  /* Reset to initial state for next marker */\n  marker->cur_marker = NULL;\n\n  /* Process the marker if interesting; else just make a generic trace msg */\n  switch (cinfo->unread_marker) {\n  case M_APP0:\n    examine_app0(cinfo, data, data_length, length);\n    break;\n  case M_APP14:\n    examine_app14(cinfo, data, data_length, length);\n    break;\n  default:\n    TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker,\n\t     (int) (data_length + length));\n    break;\n  }\n\n  /* skip any remaining data -- could be lots */\n  INPUT_SYNC(cinfo);\t\t/* do before skip_input_data */\n  if (length > 0)\n    (*cinfo->src->skip_input_data) (cinfo, (long) length);\n\n  return TRUE;\n}\n\n#endif /* SAVE_MARKERS_SUPPORTED */\n\n\nMETHODDEF(boolean)\nskip_variable (j_decompress_ptr cinfo)\n/* Skip over an unknown or uninteresting variable-length marker */\n{\n  INT32 length;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n  \n  TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length);\n\n  INPUT_SYNC(cinfo);\t\t/* do before skip_input_data */\n  if (length > 0)\n    (*cinfo->src->skip_input_data) (cinfo, (long) length);\n\n  return TRUE;\n}\n\n\n/*\n * Find the next JPEG marker, save it in cinfo->unread_marker.\n * Returns FALSE if had to suspend before reaching a marker;\n * in that case cinfo->unread_marker is unchanged.\n *\n * Note that the result might not be a valid marker code,\n * but it will never be 0 or FF.\n */\n\nLOCAL(boolean)\nnext_marker (j_decompress_ptr cinfo)\n{\n  int c;\n  INPUT_VARS(cinfo);\n\n  for (;;) {\n    INPUT_BYTE(cinfo, c, return FALSE);\n    /* Skip any non-FF bytes.\n     * This may look a bit inefficient, but it will not occur in a valid file.\n     * We sync after each discarded byte so that a suspending data source\n     * can discard the byte from its buffer.\n     */\n    while (c != 0xFF) {\n      cinfo->marker->discarded_bytes++;\n      INPUT_SYNC(cinfo);\n      INPUT_BYTE(cinfo, c, return FALSE);\n    }\n    /* This loop swallows any duplicate FF bytes.  Extra FFs are legal as\n     * pad bytes, so don't count them in discarded_bytes.  We assume there\n     * will not be so many consecutive FF bytes as to overflow a suspending\n     * data source's input buffer.\n     */\n    do {\n      INPUT_BYTE(cinfo, c, return FALSE);\n    } while (c == 0xFF);\n    if (c != 0)\n      break;\t\t\t/* found a valid marker, exit loop */\n    /* Reach here if we found a stuffed-zero data sequence (FF/00).\n     * Discard it and loop back to try again.\n     */\n    cinfo->marker->discarded_bytes += 2;\n    INPUT_SYNC(cinfo);\n  }\n\n  if (cinfo->marker->discarded_bytes != 0) {\n    WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);\n    cinfo->marker->discarded_bytes = 0;\n  }\n\n  cinfo->unread_marker = c;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nfirst_marker (j_decompress_ptr cinfo)\n/* Like next_marker, but used to obtain the initial SOI marker. */\n/* For this marker, we do not allow preceding garbage or fill; otherwise,\n * we might well scan an entire input file before realizing it ain't JPEG.\n * If an application wants to process non-JFIF files, it must seek to the\n * SOI before calling the JPEG library.\n */\n{\n  int c, c2;\n  INPUT_VARS(cinfo);\n\n  INPUT_BYTE(cinfo, c, return FALSE);\n  INPUT_BYTE(cinfo, c2, return FALSE);\n  if (c != 0xFF || c2 != (int) M_SOI)\n    ERREXIT2(cinfo, JERR_NO_SOI, c, c2);\n\n  cinfo->unread_marker = c2;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\n/*\n * Read markers until SOS or EOI.\n *\n * Returns same codes as are defined for jpeg_consume_input:\n * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.\n *\n * Note: This function may return a pseudo SOS marker (with zero\n * component number) for treat by input controller's consume_input.\n * consume_input itself should filter out (skip) the pseudo marker\n * after processing for the caller.\n */\n\nMETHODDEF(int)\nread_markers (j_decompress_ptr cinfo)\n{\n  /* Outer loop repeats once for each marker. */\n  for (;;) {\n    /* Collect the marker proper, unless we already did. */\n    /* NB: first_marker() enforces the requirement that SOI appear first. */\n    if (cinfo->unread_marker == 0) {\n      if (! cinfo->marker->saw_SOI) {\n\tif (! first_marker(cinfo))\n\t  return JPEG_SUSPENDED;\n      } else {\n\tif (! next_marker(cinfo))\n\t  return JPEG_SUSPENDED;\n      }\n    }\n    /* At this point cinfo->unread_marker contains the marker code and the\n     * input point is just past the marker proper, but before any parameters.\n     * A suspension will cause us to return with this state still true.\n     */\n    switch (cinfo->unread_marker) {\n    case M_SOI:\n      if (! get_soi(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_SOF0:\t\t/* Baseline */\n      if (! get_sof(cinfo, TRUE, FALSE, FALSE))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_SOF1:\t\t/* Extended sequential, Huffman */\n      if (! get_sof(cinfo, FALSE, FALSE, FALSE))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_SOF2:\t\t/* Progressive, Huffman */\n      if (! get_sof(cinfo, FALSE, TRUE, FALSE))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_SOF9:\t\t/* Extended sequential, arithmetic */\n      if (! get_sof(cinfo, FALSE, FALSE, TRUE))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_SOF10:\t\t/* Progressive, arithmetic */\n      if (! get_sof(cinfo, FALSE, TRUE, TRUE))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    /* Currently unsupported SOFn types */\n    case M_SOF3:\t\t/* Lossless, Huffman */\n    case M_SOF5:\t\t/* Differential sequential, Huffman */\n    case M_SOF6:\t\t/* Differential progressive, Huffman */\n    case M_SOF7:\t\t/* Differential lossless, Huffman */\n    case M_JPG:\t\t\t/* Reserved for JPEG extensions */\n    case M_SOF11:\t\t/* Lossless, arithmetic */\n    case M_SOF13:\t\t/* Differential sequential, arithmetic */\n    case M_SOF14:\t\t/* Differential progressive, arithmetic */\n    case M_SOF15:\t\t/* Differential lossless, arithmetic */\n      ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker);\n      break;\n\n    case M_SOS:\n      if (! get_sos(cinfo))\n\treturn JPEG_SUSPENDED;\n      cinfo->unread_marker = 0;\t/* processed the marker */\n      return JPEG_REACHED_SOS;\n\n    case M_EOI:\n      TRACEMS(cinfo, 1, JTRC_EOI);\n      cinfo->unread_marker = 0;\t/* processed the marker */\n      return JPEG_REACHED_EOI;\n\n    case M_DAC:\n      if (! get_dac(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_DHT:\n      if (! get_dht(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_DQT:\n      if (! get_dqt(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_DRI:\n      if (! get_dri(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_JPG8:\n      if (! get_lse(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_APP0:\n    case M_APP1:\n    case M_APP2:\n    case M_APP3:\n    case M_APP4:\n    case M_APP5:\n    case M_APP6:\n    case M_APP7:\n    case M_APP8:\n    case M_APP9:\n    case M_APP10:\n    case M_APP11:\n    case M_APP12:\n    case M_APP13:\n    case M_APP14:\n    case M_APP15:\n      if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[\n\t\tcinfo->unread_marker - (int) M_APP0]) (cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_COM:\n      if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_RST0:\t\t/* these are all parameterless */\n    case M_RST1:\n    case M_RST2:\n    case M_RST3:\n    case M_RST4:\n    case M_RST5:\n    case M_RST6:\n    case M_RST7:\n    case M_TEM:\n      TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker);\n      break;\n\n    case M_DNL:\t\t\t/* Ignore DNL ... perhaps the wrong thing */\n      if (! skip_variable(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    default:\t\t\t/* must be DHP, EXP, JPGn, or RESn */\n      /* For now, we treat the reserved markers as fatal errors since they are\n       * likely to be used to signal incompatible JPEG Part 3 extensions.\n       * Once the JPEG 3 version-number marker is well defined, this code\n       * ought to change!\n       */\n      ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);\n      break;\n    }\n    /* Successfully processed marker, so reset state variable */\n    cinfo->unread_marker = 0;\n  } /* end loop */\n}\n\n\n/*\n * Read a restart marker, which is expected to appear next in the datastream;\n * if the marker is not there, take appropriate recovery action.\n * Returns FALSE if suspension is required.\n *\n * This is called by the entropy decoder after it has read an appropriate\n * number of MCUs.  cinfo->unread_marker may be nonzero if the entropy decoder\n * has already read a marker from the data source.  Under normal conditions\n * cinfo->unread_marker will be reset to 0 before returning; if not reset,\n * it holds a marker which the decoder will be unable to read past.\n */\n\nMETHODDEF(boolean)\nread_restart_marker (j_decompress_ptr cinfo)\n{\n  /* Obtain a marker unless we already did. */\n  /* Note that next_marker will complain if it skips any data. */\n  if (cinfo->unread_marker == 0) {\n    if (! next_marker(cinfo))\n      return FALSE;\n  }\n\n  if (cinfo->unread_marker ==\n      ((int) M_RST0 + cinfo->marker->next_restart_num)) {\n    /* Normal case --- swallow the marker and let entropy decoder continue */\n    TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num);\n    cinfo->unread_marker = 0;\n  } else {\n    /* Uh-oh, the restart markers have been messed up. */\n    /* Let the data source manager determine how to resync. */\n    if (! (*cinfo->src->resync_to_restart) (cinfo,\n\t\t\t\t\t    cinfo->marker->next_restart_num))\n      return FALSE;\n  }\n\n  /* Update next-restart state */\n  cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7;\n\n  return TRUE;\n}\n\n\n/*\n * This is the default resync_to_restart method for data source managers\n * to use if they don't have any better approach.  Some data source managers\n * may be able to back up, or may have additional knowledge about the data\n * which permits a more intelligent recovery strategy; such managers would\n * presumably supply their own resync method.\n *\n * read_restart_marker calls resync_to_restart if it finds a marker other than\n * the restart marker it was expecting.  (This code is *not* used unless\n * a nonzero restart interval has been declared.)  cinfo->unread_marker is\n * the marker code actually found (might be anything, except 0 or FF).\n * The desired restart marker number (0..7) is passed as a parameter.\n * This routine is supposed to apply whatever error recovery strategy seems\n * appropriate in order to position the input stream to the next data segment.\n * Note that cinfo->unread_marker is treated as a marker appearing before\n * the current data-source input point; usually it should be reset to zero\n * before returning.\n * Returns FALSE if suspension is required.\n *\n * This implementation is substantially constrained by wanting to treat the\n * input as a data stream; this means we can't back up.  Therefore, we have\n * only the following actions to work with:\n *   1. Simply discard the marker and let the entropy decoder resume at next\n *      byte of file.\n *   2. Read forward until we find another marker, discarding intervening\n *      data.  (In theory we could look ahead within the current bufferload,\n *      without having to discard data if we don't find the desired marker.\n *      This idea is not implemented here, in part because it makes behavior\n *      dependent on buffer size and chance buffer-boundary positions.)\n *   3. Leave the marker unread (by failing to zero cinfo->unread_marker).\n *      This will cause the entropy decoder to process an empty data segment,\n *      inserting dummy zeroes, and then we will reprocess the marker.\n *\n * #2 is appropriate if we think the desired marker lies ahead, while #3 is\n * appropriate if the found marker is a future restart marker (indicating\n * that we have missed the desired restart marker, probably because it got\n * corrupted).\n * We apply #2 or #3 if the found marker is a restart marker no more than\n * two counts behind or ahead of the expected one.  We also apply #2 if the\n * found marker is not a legal JPEG marker code (it's certainly bogus data).\n * If the found marker is a restart marker more than 2 counts away, we do #1\n * (too much risk that the marker is erroneous; with luck we will be able to\n * resync at some future point).\n * For any valid non-restart JPEG marker, we apply #3.  This keeps us from\n * overrunning the end of a scan.  An implementation limited to single-scan\n * files might find it better to apply #2 for markers other than EOI, since\n * any other marker would have to be bogus data in that case.\n */\n\nGLOBAL(boolean)\njpeg_resync_to_restart (j_decompress_ptr cinfo, int desired)\n{\n  int marker = cinfo->unread_marker;\n  int action = 1;\n  \n  /* Always put up a warning. */\n  WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);\n  \n  /* Outer loop handles repeated decision after scanning forward. */\n  for (;;) {\n    if (marker < (int) M_SOF0)\n      action = 2;\t\t/* invalid marker */\n    else if (marker < (int) M_RST0 || marker > (int) M_RST7)\n      action = 3;\t\t/* valid non-restart marker */\n    else {\n      if (marker == ((int) M_RST0 + ((desired+1) & 7)) ||\n\t  marker == ((int) M_RST0 + ((desired+2) & 7)))\n\taction = 3;\t\t/* one of the next two expected restarts */\n      else if (marker == ((int) M_RST0 + ((desired-1) & 7)) ||\n\t       marker == ((int) M_RST0 + ((desired-2) & 7)))\n\taction = 2;\t\t/* a prior restart, so advance */\n      else\n\taction = 1;\t\t/* desired restart or too far away */\n    }\n    TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action);\n    switch (action) {\n    case 1:\n      /* Discard marker and let entropy decoder resume processing. */\n      cinfo->unread_marker = 0;\n      return TRUE;\n    case 2:\n      /* Scan to the next marker, and repeat the decision loop. */\n      if (! next_marker(cinfo))\n\treturn FALSE;\n      marker = cinfo->unread_marker;\n      break;\n    case 3:\n      /* Return without advancing past this marker. */\n      /* Entropy decoder will be forced to process an empty segment. */\n      return TRUE;\n    }\n  } /* end loop */\n}\n\n\n/*\n * Reset marker processing state to begin a fresh datastream.\n */\n\nMETHODDEF(void)\nreset_marker_reader (j_decompress_ptr cinfo)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n\n  cinfo->comp_info = NULL;\t\t/* until allocated by get_sof */\n  cinfo->input_scan_number = 0;\t\t/* no SOS seen yet */\n  cinfo->unread_marker = 0;\t\t/* no pending marker */\n  marker->pub.saw_SOI = FALSE;\t\t/* set internal state too */\n  marker->pub.saw_SOF = FALSE;\n  marker->pub.discarded_bytes = 0;\n  marker->cur_marker = NULL;\n}\n\n\n/*\n * Initialize the marker reader module.\n * This is called only once, when the decompression object is created.\n */\n\nGLOBAL(void)\njinit_marker_reader (j_decompress_ptr cinfo)\n{\n  my_marker_ptr marker;\n  int i;\n\n  /* Create subobject in permanent pool */\n  marker = (my_marker_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\tSIZEOF(my_marker_reader));\n  cinfo->marker = &marker->pub;\n  /* Initialize public method pointers */\n  marker->pub.reset_marker_reader = reset_marker_reader;\n  marker->pub.read_markers = read_markers;\n  marker->pub.read_restart_marker = read_restart_marker;\n  /* Initialize COM/APPn processing.\n   * By default, we examine and then discard APP0 and APP14,\n   * but simply discard COM and all other APPn.\n   */\n  marker->process_COM = skip_variable;\n  marker->length_limit_COM = 0;\n  for (i = 0; i < 16; i++) {\n    marker->process_APPn[i] = skip_variable;\n    marker->length_limit_APPn[i] = 0;\n  }\n  marker->process_APPn[0] = get_interesting_appn;\n  marker->process_APPn[14] = get_interesting_appn;\n  /* Reset marker processing state */\n  reset_marker_reader(cinfo);\n}\n\n\n/*\n * Control saving of COM and APPn markers into marker_list.\n */\n\n#ifdef SAVE_MARKERS_SUPPORTED\n\nGLOBAL(void)\njpeg_save_markers (j_decompress_ptr cinfo, int marker_code,\n\t\t   unsigned int length_limit)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n  long maxlength;\n  jpeg_marker_parser_method processor;\n\n  /* Length limit mustn't be larger than what we can allocate\n   * (should only be a concern in a 16-bit environment).\n   */\n  maxlength = cinfo->mem->max_alloc_chunk - SIZEOF(struct jpeg_marker_struct);\n  if (((long) length_limit) > maxlength)\n    length_limit = (unsigned int) maxlength;\n\n  /* Choose processor routine to use.\n   * APP0/APP14 have special requirements.\n   */\n  if (length_limit) {\n    processor = save_marker;\n    /* If saving APP0/APP14, save at least enough for our internal use. */\n    if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN)\n      length_limit = APP0_DATA_LEN;\n    else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN)\n      length_limit = APP14_DATA_LEN;\n  } else {\n    processor = skip_variable;\n    /* If discarding APP0/APP14, use our regular on-the-fly processor. */\n    if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14)\n      processor = get_interesting_appn;\n  }\n\n  if (marker_code == (int) M_COM) {\n    marker->process_COM = processor;\n    marker->length_limit_COM = length_limit;\n  } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) {\n    marker->process_APPn[marker_code - (int) M_APP0] = processor;\n    marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit;\n  } else\n    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);\n}\n\n#endif /* SAVE_MARKERS_SUPPORTED */\n\n\n/*\n * Install a special processing method for COM or APPn markers.\n */\n\nGLOBAL(void)\njpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code,\n\t\t\t   jpeg_marker_parser_method routine)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n\n  if (marker_code == (int) M_COM)\n    marker->process_COM = routine;\n  else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15)\n    marker->process_APPn[marker_code - (int) M_APP0] = routine;\n  else\n    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);\n}\n"
  },
  {
    "path": "jdmaster.c",
    "content": "/*\n * jdmaster.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2002-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains master control logic for the JPEG decompressor.\n * These routines are concerned with selecting the modules to be executed\n * and with determining the number of passes and the work to be done in each\n * pass.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Private state */\n\ntypedef struct {\n  struct jpeg_decomp_master pub; /* public fields */\n\n  int pass_number;\t\t/* # of passes completed */\n\n  boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */\n\n  /* Saved references to initialized quantizer modules,\n   * in case we need to switch modes.\n   */\n  struct jpeg_color_quantizer * quantizer_1pass;\n  struct jpeg_color_quantizer * quantizer_2pass;\n} my_decomp_master;\n\ntypedef my_decomp_master * my_master_ptr;\n\n\n/*\n * Determine whether merged upsample/color conversion should be used.\n * CRUCIAL: this must match the actual capabilities of jdmerge.c!\n */\n\nLOCAL(boolean)\nuse_merged_upsample (j_decompress_ptr cinfo)\n{\n#ifdef UPSAMPLE_MERGING_SUPPORTED\n  /* Merging is the equivalent of plain box-filter upsampling */\n  if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)\n    return FALSE;\n  /* jdmerge.c only supports YCC=>RGB color conversion */\n  if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||\n      cinfo->out_color_space != JCS_RGB ||\n      cinfo->out_color_components != RGB_PIXELSIZE ||\n      cinfo->color_transform)\n    return FALSE;\n  /* and it only handles 2h1v or 2h2v sampling ratios */\n  if (cinfo->comp_info[0].h_samp_factor != 2 ||\n      cinfo->comp_info[1].h_samp_factor != 1 ||\n      cinfo->comp_info[2].h_samp_factor != 1 ||\n      cinfo->comp_info[0].v_samp_factor >  2 ||\n      cinfo->comp_info[1].v_samp_factor != 1 ||\n      cinfo->comp_info[2].v_samp_factor != 1)\n    return FALSE;\n  /* furthermore, it doesn't work if we've scaled the IDCTs differently */\n  if (cinfo->comp_info[0].DCT_h_scaled_size != cinfo->min_DCT_h_scaled_size ||\n      cinfo->comp_info[1].DCT_h_scaled_size != cinfo->min_DCT_h_scaled_size ||\n      cinfo->comp_info[2].DCT_h_scaled_size != cinfo->min_DCT_h_scaled_size ||\n      cinfo->comp_info[0].DCT_v_scaled_size != cinfo->min_DCT_v_scaled_size ||\n      cinfo->comp_info[1].DCT_v_scaled_size != cinfo->min_DCT_v_scaled_size ||\n      cinfo->comp_info[2].DCT_v_scaled_size != cinfo->min_DCT_v_scaled_size)\n    return FALSE;\n  /* ??? also need to test for upsample-time rescaling, when & if supported */\n  return TRUE;\t\t\t/* by golly, it'll work... */\n#else\n  return FALSE;\n#endif\n}\n\n\n/*\n * Compute output image dimensions and related values.\n * NOTE: this is exported for possible use by application.\n * Hence it mustn't do anything that can't be done twice.\n * Also note that it may be called before the master module is initialized!\n */\n\nGLOBAL(void)\njpeg_calc_output_dimensions (j_decompress_ptr cinfo)\n/* Do computations that are needed before master selection phase.\n * This function is used for full decompression.\n */\n{\n#ifdef IDCT_SCALING_SUPPORTED\n  int ci;\n  jpeg_component_info *compptr;\n#endif\n\n  /* Prevent application from calling me at wrong times */\n  if (cinfo->global_state != DSTATE_READY)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* Compute core output image dimensions and DCT scaling choices. */\n  jpeg_core_output_dimensions(cinfo);\n\n#ifdef IDCT_SCALING_SUPPORTED\n\n  /* In selecting the actual DCT scaling for each component, we try to\n   * scale up the chroma components via IDCT scaling rather than upsampling.\n   * This saves time if the upsampler gets to use 1:1 scaling.\n   * Note this code adapts subsampling ratios which are powers of 2.\n   */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    int ssize = 1;\n    while (cinfo->min_DCT_h_scaled_size * ssize <=\n\t   (cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&\n\t   (cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) {\n      ssize = ssize * 2;\n    }\n    compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;\n    ssize = 1;\n    while (cinfo->min_DCT_v_scaled_size * ssize <=\n\t   (cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&\n\t   (cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) {\n      ssize = ssize * 2;\n    }\n    compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize;\n\n    /* We don't support IDCT ratios larger than 2. */\n    if (compptr->DCT_h_scaled_size > compptr->DCT_v_scaled_size * 2)\n\tcompptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size * 2;\n    else if (compptr->DCT_v_scaled_size > compptr->DCT_h_scaled_size * 2)\n\tcompptr->DCT_v_scaled_size = compptr->DCT_h_scaled_size * 2;\n  }\n\n  /* Recompute downsampled dimensions of components;\n   * application needs to know these if using raw downsampled data.\n   */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Size in samples, after IDCT scaling */\n    compptr->downsampled_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width *\n\t\t    (long) (compptr->h_samp_factor * compptr->DCT_h_scaled_size),\n\t\t    (long) (cinfo->max_h_samp_factor * cinfo->block_size));\n    compptr->downsampled_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height *\n\t\t    (long) (compptr->v_samp_factor * compptr->DCT_v_scaled_size),\n\t\t    (long) (cinfo->max_v_samp_factor * cinfo->block_size));\n  }\n\n#endif /* IDCT_SCALING_SUPPORTED */\n\n  /* Report number of components in selected colorspace. */\n  /* Probably this should be in the color conversion module... */\n  switch (cinfo->out_color_space) {\n  case JCS_GRAYSCALE:\n    cinfo->out_color_components = 1;\n    break;\n  case JCS_RGB:\n  case JCS_BG_RGB:\n    cinfo->out_color_components = RGB_PIXELSIZE;\n    break;\n  case JCS_YCbCr:\n  case JCS_BG_YCC:\n    cinfo->out_color_components = 3;\n    break;\n  case JCS_CMYK:\n  case JCS_YCCK:\n    cinfo->out_color_components = 4;\n    break;\n  default:\t\t\t/* else must be same colorspace as in file */\n    cinfo->out_color_components = cinfo->num_components;\n    break;\n  }\n  cinfo->output_components = (cinfo->quantize_colors ? 1 :\n\t\t\t      cinfo->out_color_components);\n\n  /* See if upsampler will want to emit more than one row at a time */\n  if (use_merged_upsample(cinfo))\n    cinfo->rec_outbuf_height = cinfo->max_v_samp_factor;\n  else\n    cinfo->rec_outbuf_height = 1;\n}\n\n\n/*\n * Several decompression processes need to range-limit values to the range\n * 0..MAXJSAMPLE; the input value may fall somewhat outside this range\n * due to noise introduced by quantization, roundoff error, etc.  These\n * processes are inner loops and need to be as fast as possible.  On most\n * machines, particularly CPUs with pipelines or instruction prefetch,\n * a (subscript-check-less) C table lookup\n *\t\tx = sample_range_limit[x];\n * is faster than explicit tests\n *\t\tif (x < 0)  x = 0;\n *\t\telse if (x > MAXJSAMPLE)  x = MAXJSAMPLE;\n * These processes all use a common table prepared by the routine below.\n *\n * For most steps we can mathematically guarantee that the initial value\n * of x is within MAXJSAMPLE+1 of the legal range, so a table running from\n * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient.  But for the initial\n * limiting step (just after the IDCT), a wildly out-of-range value is \n * possible if the input data is corrupt.  To avoid any chance of indexing\n * off the end of memory and getting a bad-pointer trap, we perform the\n * post-IDCT limiting thus:\n *\t\tx = range_limit[x & MASK];\n * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit\n * samples.  Under normal circumstances this is more than enough range and\n * a correct output will be generated; with bogus input data the mask will\n * cause wraparound, and we will safely generate a bogus-but-in-range output.\n * For the post-IDCT step, we want to convert the data from signed to unsigned\n * representation by adding CENTERJSAMPLE at the same time that we limit it.\n * So the post-IDCT limiting table ends up looking like this:\n *   CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,\n *   MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),\n *   0          (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),\n *   0,1,...,CENTERJSAMPLE-1\n * Negative inputs select values from the upper half of the table after\n * masking.\n *\n * We can save some space by overlapping the start of the post-IDCT table\n * with the simpler range limiting table.  The post-IDCT table begins at\n * sample_range_limit + CENTERJSAMPLE.\n *\n * Note that the table is allocated in near data space on PCs; it's small\n * enough and used often enough to justify this.\n */\n\nLOCAL(void)\nprepare_range_limit_table (j_decompress_ptr cinfo)\n/* Allocate and fill in the sample_range_limit table */\n{\n  JSAMPLE * table;\n  int i;\n\n  table = (JSAMPLE *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t(5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE));\n  table += (MAXJSAMPLE+1);\t/* allow negative subscripts of simple table */\n  cinfo->sample_range_limit = table;\n  /* First segment of \"simple\" table: limit[x] = 0 for x < 0 */\n  MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));\n  /* Main part of \"simple\" table: limit[x] = x */\n  for (i = 0; i <= MAXJSAMPLE; i++)\n    table[i] = (JSAMPLE) i;\n  table += CENTERJSAMPLE;\t/* Point to where post-IDCT table starts */\n  /* End of simple table, rest of first half of post-IDCT table */\n  for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)\n    table[i] = MAXJSAMPLE;\n  /* Second half of post-IDCT table */\n  MEMZERO(table + (2 * (MAXJSAMPLE+1)),\n\t  (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE));\n  MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),\n\t  cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE));\n}\n\n\n/*\n * Master selection of decompression modules.\n * This is done once at jpeg_start_decompress time.  We determine\n * which modules will be used and give them appropriate initialization calls.\n * We also initialize the decompressor input side to begin consuming data.\n *\n * Since jpeg_read_header has finished, we know what is in the SOF\n * and (first) SOS markers.  We also have all the application parameter\n * settings.\n */\n\nLOCAL(void)\nmaster_selection (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n  boolean use_c_buffer;\n  long samplesperrow;\n  JDIMENSION jd_samplesperrow;\n\n  /* For now, precision must match compiled-in value... */\n  if (cinfo->data_precision != BITS_IN_JSAMPLE)\n    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);\n\n  /* Initialize dimensions and other stuff */\n  jpeg_calc_output_dimensions(cinfo);\n  prepare_range_limit_table(cinfo);\n\n  /* Sanity check on image dimensions */\n  if (cinfo->output_height <= 0 || cinfo->output_width <= 0 ||\n      cinfo->out_color_components <= 0)\n    ERREXIT(cinfo, JERR_EMPTY_IMAGE);\n\n  /* Width of an output scanline must be representable as JDIMENSION. */\n  samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;\n  jd_samplesperrow = (JDIMENSION) samplesperrow;\n  if ((long) jd_samplesperrow != samplesperrow)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n\n  /* Initialize my private state */\n  master->pass_number = 0;\n  master->using_merged_upsample = use_merged_upsample(cinfo);\n\n  /* Color quantizer selection */\n  master->quantizer_1pass = NULL;\n  master->quantizer_2pass = NULL;\n  /* No mode changes if not using buffered-image mode. */\n  if (! cinfo->quantize_colors || ! cinfo->buffered_image) {\n    cinfo->enable_1pass_quant = FALSE;\n    cinfo->enable_external_quant = FALSE;\n    cinfo->enable_2pass_quant = FALSE;\n  }\n  if (cinfo->quantize_colors) {\n    if (cinfo->raw_data_out)\n      ERREXIT(cinfo, JERR_NOTIMPL);\n    /* 2-pass quantizer only works in 3-component color space. */\n    if (cinfo->out_color_components != 3) {\n      cinfo->enable_1pass_quant = TRUE;\n      cinfo->enable_external_quant = FALSE;\n      cinfo->enable_2pass_quant = FALSE;\n      cinfo->colormap = NULL;\n    } else if (cinfo->colormap != NULL) {\n      cinfo->enable_external_quant = TRUE;\n    } else if (cinfo->two_pass_quantize) {\n      cinfo->enable_2pass_quant = TRUE;\n    } else {\n      cinfo->enable_1pass_quant = TRUE;\n    }\n\n    if (cinfo->enable_1pass_quant) {\n#ifdef QUANT_1PASS_SUPPORTED\n      jinit_1pass_quantizer(cinfo);\n      master->quantizer_1pass = cinfo->cquantize;\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    }\n\n    /* We use the 2-pass code to map to external colormaps. */\n    if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) {\n#ifdef QUANT_2PASS_SUPPORTED\n      jinit_2pass_quantizer(cinfo);\n      master->quantizer_2pass = cinfo->cquantize;\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    }\n    /* If both quantizers are initialized, the 2-pass one is left active;\n     * this is necessary for starting with quantization to an external map.\n     */\n  }\n\n  /* Post-processing: in particular, color conversion first */\n  if (! cinfo->raw_data_out) {\n    if (master->using_merged_upsample) {\n#ifdef UPSAMPLE_MERGING_SUPPORTED\n      jinit_merged_upsampler(cinfo); /* does color conversion too */\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    } else {\n      jinit_color_deconverter(cinfo);\n      jinit_upsampler(cinfo);\n    }\n    jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant);\n  }\n  /* Inverse DCT */\n  jinit_inverse_dct(cinfo);\n  /* Entropy decoding: either Huffman or arithmetic coding. */\n  if (cinfo->arith_code)\n    jinit_arith_decoder(cinfo);\n  else {\n    jinit_huff_decoder(cinfo);\n  }\n\n  /* Initialize principal buffer controllers. */\n  use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image;\n  jinit_d_coef_controller(cinfo, use_c_buffer);\n\n  if (! cinfo->raw_data_out)\n    jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */);\n\n  /* We can now tell the memory manager to allocate virtual arrays. */\n  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);\n\n  /* Initialize input side of decompressor to consume first scan. */\n  (*cinfo->inputctl->start_input_pass) (cinfo);\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n  /* If jpeg_start_decompress will read the whole file, initialize\n   * progress monitoring appropriately.  The input step is counted\n   * as one pass.\n   */\n  if (cinfo->progress != NULL && ! cinfo->buffered_image &&\n      cinfo->inputctl->has_multiple_scans) {\n    int nscans;\n    /* Estimate number of scans to set pass_limit. */\n    if (cinfo->progressive_mode) {\n      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */\n      nscans = 2 + 3 * cinfo->num_components;\n    } else {\n      /* For a nonprogressive multiscan file, estimate 1 scan per component. */\n      nscans = cinfo->num_components;\n    }\n    cinfo->progress->pass_counter = 0L;\n    cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;\n    cinfo->progress->completed_passes = 0;\n    cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2);\n    /* Count the input pass as done */\n    master->pass_number++;\n  }\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n}\n\n\n/*\n * Per-pass setup.\n * This is called at the beginning of each output pass.  We determine which\n * modules will be active during this pass and give them appropriate\n * start_pass calls.  We also set is_dummy_pass to indicate whether this\n * is a \"real\" output pass or a dummy pass for color quantization.\n * (In the latter case, jdapistd.c will crank the pass to completion.)\n */\n\nMETHODDEF(void)\nprepare_for_output_pass (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  if (master->pub.is_dummy_pass) {\n#ifdef QUANT_2PASS_SUPPORTED\n    /* Final pass of 2-pass quantization */\n    master->pub.is_dummy_pass = FALSE;\n    (*cinfo->cquantize->start_pass) (cinfo, FALSE);\n    (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST);\n    (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST);\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif /* QUANT_2PASS_SUPPORTED */\n  } else {\n    if (cinfo->quantize_colors && cinfo->colormap == NULL) {\n      /* Select new quantization method */\n      if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) {\n\tcinfo->cquantize = master->quantizer_2pass;\n\tmaster->pub.is_dummy_pass = TRUE;\n      } else if (cinfo->enable_1pass_quant) {\n\tcinfo->cquantize = master->quantizer_1pass;\n      } else {\n\tERREXIT(cinfo, JERR_MODE_CHANGE);\n      }\n    }\n    (*cinfo->idct->start_pass) (cinfo);\n    (*cinfo->coef->start_output_pass) (cinfo);\n    if (! cinfo->raw_data_out) {\n      if (! master->using_merged_upsample)\n\t(*cinfo->cconvert->start_pass) (cinfo);\n      (*cinfo->upsample->start_pass) (cinfo);\n      if (cinfo->quantize_colors)\n\t(*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass);\n      (*cinfo->post->start_pass) (cinfo,\n\t    (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));\n      (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);\n    }\n  }\n\n  /* Set up progress monitor's pass info if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->completed_passes = master->pass_number;\n    cinfo->progress->total_passes = master->pass_number +\n\t\t\t\t    (master->pub.is_dummy_pass ? 2 : 1);\n    /* In buffered-image mode, we assume one more output pass if EOI not\n     * yet reached, but no more passes if EOI has been reached.\n     */\n    if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) {\n      cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1);\n    }\n  }\n}\n\n\n/*\n * Finish up at end of an output pass.\n */\n\nMETHODDEF(void)\nfinish_output_pass (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  if (cinfo->quantize_colors)\n    (*cinfo->cquantize->finish_pass) (cinfo);\n  master->pass_number++;\n}\n\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n\n/*\n * Switch to a new external colormap between output passes.\n */\n\nGLOBAL(void)\njpeg_new_colormap (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  /* Prevent application from calling me at wrong times */\n  if (cinfo->global_state != DSTATE_BUFIMAGE)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  if (cinfo->quantize_colors && cinfo->enable_external_quant &&\n      cinfo->colormap != NULL) {\n    /* Select 2-pass quantizer for external colormap use */\n    cinfo->cquantize = master->quantizer_2pass;\n    /* Notify quantizer of colormap change */\n    (*cinfo->cquantize->new_color_map) (cinfo);\n    master->pub.is_dummy_pass = FALSE; /* just in case */\n  } else\n    ERREXIT(cinfo, JERR_MODE_CHANGE);\n}\n\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n\n\n/*\n * Initialize master decompression control and select active modules.\n * This is performed at the start of jpeg_start_decompress.\n */\n\nGLOBAL(void)\njinit_master_decompress (j_decompress_ptr cinfo)\n{\n  my_master_ptr master;\n\n  master = (my_master_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(my_decomp_master));\n  cinfo->master = &master->pub;\n  master->pub.prepare_for_output_pass = prepare_for_output_pass;\n  master->pub.finish_output_pass = finish_output_pass;\n\n  master->pub.is_dummy_pass = FALSE;\n\n  master_selection(cinfo);\n}\n"
  },
  {
    "path": "jdmerge.c",
    "content": "/*\n * jdmerge.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains code for merged upsampling/color conversion.\n *\n * This file combines functions from jdsample.c and jdcolor.c;\n * read those files first to understand what's going on.\n *\n * When the chroma components are to be upsampled by simple replication\n * (ie, box filtering), we can save some work in color conversion by\n * calculating all the output pixels corresponding to a pair of chroma\n * samples at one time.  In the conversion equations\n *\tR = Y           + K1 * Cr\n *\tG = Y + K2 * Cb + K3 * Cr\n *\tB = Y + K4 * Cb\n * only the Y term varies among the group of pixels corresponding to a pair\n * of chroma samples, so the rest of the terms can be calculated just once.\n * At typical sampling ratios, this eliminates half or three-quarters of the\n * multiplications needed for color conversion.\n *\n * This file currently provides implementations for the following cases:\n *\tYCbCr => RGB color conversion only.\n *\tSampling ratios of 2h1v or 2h2v.\n *\tNo scaling needed at upsample time.\n *\tCorner-aligned (non-CCIR601) sampling alignment.\n * Other special cases could be added, but in most applications these are\n * the only common cases.  (For uncommon cases we fall back on the more\n * general code in jdsample.c and jdcolor.c.)\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n#ifdef UPSAMPLE_MERGING_SUPPORTED\n\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_upsampler pub;\t/* public fields */\n\n  /* Pointer to routine to do actual upsampling/conversion of one row group */\n  JMETHOD(void, upmethod, (j_decompress_ptr cinfo,\n\t\t\t   JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n\t\t\t   JSAMPARRAY output_buf));\n\n  /* Private state for YCC->RGB conversion */\n  int * Cr_r_tab;\t\t/* => table for Cr to R conversion */\n  int * Cb_b_tab;\t\t/* => table for Cb to B conversion */\n  INT32 * Cr_g_tab;\t\t/* => table for Cr to G conversion */\n  INT32 * Cb_g_tab;\t\t/* => table for Cb to G conversion */\n\n  /* For 2:1 vertical sampling, we produce two output rows at a time.\n   * We need a \"spare\" row buffer to hold the second output row if the\n   * application provides just a one-row buffer; we also use the spare\n   * to discard the dummy last row if the image height is odd.\n   */\n  JSAMPROW spare_row;\n  boolean spare_full;\t\t/* T if spare buffer is occupied */\n\n  JDIMENSION out_row_width;\t/* samples per output row */\n  JDIMENSION rows_to_go;\t/* counts rows remaining in image */\n} my_upsampler;\n\ntypedef my_upsampler * my_upsample_ptr;\n\n#define SCALEBITS\t16\t/* speediest right-shift on some machines */\n#define ONE_HALF\t((INT32) 1 << (SCALEBITS-1))\n#define FIX(x)\t\t((INT32) ((x) * (1L<<SCALEBITS) + 0.5))\n\n\n/*\n * Initialize tables for YCC->RGB colorspace conversion.\n * This is taken directly from jdcolor.c; see that file for more info.\n */\n\nLOCAL(void)\nbuild_ycc_rgb_table (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  int i;\n  INT32 x;\n  SHIFT_TEMPS\n\n  upsample->Cr_r_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(int));\n  upsample->Cb_b_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(int));\n  upsample->Cr_g_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(INT32));\n  upsample->Cb_g_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(INT32));\n\n  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {\n    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */\n    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */\n    /* Cr=>R value is nearest int to 1.402 * x */\n    upsample->Cr_r_tab[i] = (int)\n\t\t    RIGHT_SHIFT(FIX(1.402) * x + ONE_HALF, SCALEBITS);\n    /* Cb=>B value is nearest int to 1.772 * x */\n    upsample->Cb_b_tab[i] = (int)\n\t\t    RIGHT_SHIFT(FIX(1.772) * x + ONE_HALF, SCALEBITS);\n    /* Cr=>G value is scaled-up -0.714136286 * x */\n    upsample->Cr_g_tab[i] = (- FIX(0.714136286)) * x;\n    /* Cb=>G value is scaled-up -0.344136286 * x */\n    /* We also add in ONE_HALF so that need not do it in inner loop */\n    upsample->Cb_g_tab[i] = (- FIX(0.344136286)) * x + ONE_HALF;\n  }\n}\n\n\n/*\n * Initialize for an upsampling pass.\n */\n\nMETHODDEF(void)\nstart_pass_merged_upsample (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n\n  /* Mark the spare buffer empty */\n  upsample->spare_full = FALSE;\n  /* Initialize total-height counter for detecting bottom of image */\n  upsample->rows_to_go = cinfo->output_height;\n}\n\n\n/*\n * Control routine to do upsampling (and color conversion).\n *\n * The control routine just handles the row buffering considerations.\n */\n\nMETHODDEF(void)\nmerged_2v_upsample (j_decompress_ptr cinfo,\n\t\t    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t\t    JDIMENSION in_row_groups_avail,\n\t\t    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t    JDIMENSION out_rows_avail)\n/* 2:1 vertical sampling case: may need a spare row. */\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  JSAMPROW work_ptrs[2];\n  JDIMENSION num_rows;\t\t/* number of rows returned to caller */\n\n  if (upsample->spare_full) {\n    /* If we have a spare row saved from a previous cycle, just return it. */\n    jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,\n\t\t      1, upsample->out_row_width);\n    num_rows = 1;\n    upsample->spare_full = FALSE;\n  } else {\n    /* Figure number of rows to return to caller. */\n    num_rows = 2;\n    /* Not more than the distance to the end of the image. */\n    if (num_rows > upsample->rows_to_go)\n      num_rows = upsample->rows_to_go;\n    /* And not more than what the client can accept: */\n    out_rows_avail -= *out_row_ctr;\n    if (num_rows > out_rows_avail)\n      num_rows = out_rows_avail;\n    /* Create output pointer array for upsampler. */\n    work_ptrs[0] = output_buf[*out_row_ctr];\n    if (num_rows > 1) {\n      work_ptrs[1] = output_buf[*out_row_ctr + 1];\n    } else {\n      work_ptrs[1] = upsample->spare_row;\n      upsample->spare_full = TRUE;\n    }\n    /* Now do the upsampling. */\n    (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);\n  }\n\n  /* Adjust counts */\n  *out_row_ctr += num_rows;\n  upsample->rows_to_go -= num_rows;\n  /* When the buffer is emptied, declare this input row group consumed */\n  if (! upsample->spare_full)\n    (*in_row_group_ctr)++;\n}\n\n\nMETHODDEF(void)\nmerged_1v_upsample (j_decompress_ptr cinfo,\n\t\t    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t\t    JDIMENSION in_row_groups_avail,\n\t\t    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t    JDIMENSION out_rows_avail)\n/* 1:1 vertical sampling case: much easier, never need a spare row. */\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n\n  /* Just do the upsampling. */\n  (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,\n\t\t\t output_buf + *out_row_ctr);\n  /* Adjust counts */\n  (*out_row_ctr)++;\n  (*in_row_group_ctr)++;\n}\n\n\n/*\n * These are the routines invoked by the control routines to do\n * the actual upsampling/conversion.  One row group is processed per call.\n *\n * Note: since we may be writing directly into application-supplied buffers,\n * we have to be honest about the output width; we can't assume the buffer\n * has been rounded up to an even width.\n */\n\n\n/*\n * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.\n */\n\nMETHODDEF(void)\nh2v1_merged_upsample (j_decompress_ptr cinfo,\n\t\t      JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n\t\t      JSAMPARRAY output_buf)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  register int y, cred, cgreen, cblue;\n  int cb, cr;\n  register JSAMPROW outptr;\n  JSAMPROW inptr0, inptr1, inptr2;\n  JDIMENSION col;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  int * Crrtab = upsample->Cr_r_tab;\n  int * Cbbtab = upsample->Cb_b_tab;\n  INT32 * Crgtab = upsample->Cr_g_tab;\n  INT32 * Cbgtab = upsample->Cb_g_tab;\n  SHIFT_TEMPS\n\n  inptr0 = input_buf[0][in_row_group_ctr];\n  inptr1 = input_buf[1][in_row_group_ctr];\n  inptr2 = input_buf[2][in_row_group_ctr];\n  outptr = output_buf[0];\n  /* Loop for each pair of output pixels */\n  for (col = cinfo->output_width >> 1; col > 0; col--) {\n    /* Do the chroma part of the calculation */\n    cb = GETJSAMPLE(*inptr1++);\n    cr = GETJSAMPLE(*inptr2++);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    /* Fetch 2 Y values and emit 2 pixels */\n    y  = GETJSAMPLE(*inptr0++);\n    outptr[RGB_RED] =   range_limit[y + cred];\n    outptr[RGB_GREEN] = range_limit[y + cgreen];\n    outptr[RGB_BLUE] =  range_limit[y + cblue];\n    outptr += RGB_PIXELSIZE;\n    y  = GETJSAMPLE(*inptr0++);\n    outptr[RGB_RED] =   range_limit[y + cred];\n    outptr[RGB_GREEN] = range_limit[y + cgreen];\n    outptr[RGB_BLUE] =  range_limit[y + cblue];\n    outptr += RGB_PIXELSIZE;\n  }\n  /* If image width is odd, do the last output column separately */\n  if (cinfo->output_width & 1) {\n    cb = GETJSAMPLE(*inptr1);\n    cr = GETJSAMPLE(*inptr2);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    y  = GETJSAMPLE(*inptr0);\n    outptr[RGB_RED] =   range_limit[y + cred];\n    outptr[RGB_GREEN] = range_limit[y + cgreen];\n    outptr[RGB_BLUE] =  range_limit[y + cblue];\n  }\n}\n\n\n/*\n * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.\n */\n\nMETHODDEF(void)\nh2v2_merged_upsample (j_decompress_ptr cinfo,\n\t\t      JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n\t\t      JSAMPARRAY output_buf)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  register int y, cred, cgreen, cblue;\n  int cb, cr;\n  register JSAMPROW outptr0, outptr1;\n  JSAMPROW inptr00, inptr01, inptr1, inptr2;\n  JDIMENSION col;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  int * Crrtab = upsample->Cr_r_tab;\n  int * Cbbtab = upsample->Cb_b_tab;\n  INT32 * Crgtab = upsample->Cr_g_tab;\n  INT32 * Cbgtab = upsample->Cb_g_tab;\n  SHIFT_TEMPS\n\n  inptr00 = input_buf[0][in_row_group_ctr*2];\n  inptr01 = input_buf[0][in_row_group_ctr*2 + 1];\n  inptr1 = input_buf[1][in_row_group_ctr];\n  inptr2 = input_buf[2][in_row_group_ctr];\n  outptr0 = output_buf[0];\n  outptr1 = output_buf[1];\n  /* Loop for each group of output pixels */\n  for (col = cinfo->output_width >> 1; col > 0; col--) {\n    /* Do the chroma part of the calculation */\n    cb = GETJSAMPLE(*inptr1++);\n    cr = GETJSAMPLE(*inptr2++);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    /* Fetch 4 Y values and emit 4 pixels */\n    y  = GETJSAMPLE(*inptr00++);\n    outptr0[RGB_RED] =   range_limit[y + cred];\n    outptr0[RGB_GREEN] = range_limit[y + cgreen];\n    outptr0[RGB_BLUE] =  range_limit[y + cblue];\n    outptr0 += RGB_PIXELSIZE;\n    y  = GETJSAMPLE(*inptr00++);\n    outptr0[RGB_RED] =   range_limit[y + cred];\n    outptr0[RGB_GREEN] = range_limit[y + cgreen];\n    outptr0[RGB_BLUE] =  range_limit[y + cblue];\n    outptr0 += RGB_PIXELSIZE;\n    y  = GETJSAMPLE(*inptr01++);\n    outptr1[RGB_RED] =   range_limit[y + cred];\n    outptr1[RGB_GREEN] = range_limit[y + cgreen];\n    outptr1[RGB_BLUE] =  range_limit[y + cblue];\n    outptr1 += RGB_PIXELSIZE;\n    y  = GETJSAMPLE(*inptr01++);\n    outptr1[RGB_RED] =   range_limit[y + cred];\n    outptr1[RGB_GREEN] = range_limit[y + cgreen];\n    outptr1[RGB_BLUE] =  range_limit[y + cblue];\n    outptr1 += RGB_PIXELSIZE;\n  }\n  /* If image width is odd, do the last output column separately */\n  if (cinfo->output_width & 1) {\n    cb = GETJSAMPLE(*inptr1);\n    cr = GETJSAMPLE(*inptr2);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    y  = GETJSAMPLE(*inptr00);\n    outptr0[RGB_RED] =   range_limit[y + cred];\n    outptr0[RGB_GREEN] = range_limit[y + cgreen];\n    outptr0[RGB_BLUE] =  range_limit[y + cblue];\n    y  = GETJSAMPLE(*inptr01);\n    outptr1[RGB_RED] =   range_limit[y + cred];\n    outptr1[RGB_GREEN] = range_limit[y + cgreen];\n    outptr1[RGB_BLUE] =  range_limit[y + cblue];\n  }\n}\n\n\n/*\n * Module initialization routine for merged upsampling/color conversion.\n *\n * NB: this is called under the conditions determined by use_merged_upsample()\n * in jdmaster.c.  That routine MUST correspond to the actual capabilities\n * of this module; no safety checks are made here.\n */\n\nGLOBAL(void)\njinit_merged_upsampler (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample;\n\n  upsample = (my_upsample_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_upsampler));\n  cinfo->upsample = (struct jpeg_upsampler *) upsample;\n  upsample->pub.start_pass = start_pass_merged_upsample;\n  upsample->pub.need_context_rows = FALSE;\n\n  upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;\n\n  if (cinfo->max_v_samp_factor == 2) {\n    upsample->pub.upsample = merged_2v_upsample;\n    upsample->upmethod = h2v2_merged_upsample;\n    /* Allocate a spare row buffer */\n    upsample->spare_row = (JSAMPROW)\n      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t(size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));\n  } else {\n    upsample->pub.upsample = merged_1v_upsample;\n    upsample->upmethod = h2v1_merged_upsample;\n    /* No spare row needed */\n    upsample->spare_row = NULL;\n  }\n\n  build_ycc_rgb_table(cinfo);\n}\n\n#endif /* UPSAMPLE_MERGING_SUPPORTED */\n"
  },
  {
    "path": "jdpostct.c",
    "content": "/*\n * jdpostct.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the decompression postprocessing controller.\n * This controller manages the upsampling, color conversion, and color\n * quantization/reduction steps; specifically, it controls the buffering\n * between upsample/color conversion and color quantization/reduction.\n *\n * If no color quantization/reduction is required, then this module has no\n * work to do, and it just hands off to the upsample/color conversion code.\n * An integrated upsample/convert/quantize process would replace this module\n * entirely.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_d_post_controller pub; /* public fields */\n\n  /* Color quantization source buffer: this holds output data from\n   * the upsample/color conversion step to be passed to the quantizer.\n   * For two-pass color quantization, we need a full-image buffer;\n   * for one-pass operation, a strip buffer is sufficient.\n   */\n  jvirt_sarray_ptr whole_image;\t/* virtual array, or NULL if one-pass */\n  JSAMPARRAY buffer;\t\t/* strip buffer, or current strip of virtual */\n  JDIMENSION strip_height;\t/* buffer size in rows */\n  /* for two-pass mode only: */\n  JDIMENSION starting_row;\t/* row # of first row in current strip */\n  JDIMENSION next_row;\t\t/* index of next row to fill/empty in strip */\n} my_post_controller;\n\ntypedef my_post_controller * my_post_ptr;\n\n\n/* Forward declarations */\nMETHODDEF(void) post_process_1pass\n\tJPP((j_decompress_ptr cinfo,\n\t     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t     JDIMENSION in_row_groups_avail,\n\t     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t     JDIMENSION out_rows_avail));\n#ifdef QUANT_2PASS_SUPPORTED\nMETHODDEF(void) post_process_prepass\n\tJPP((j_decompress_ptr cinfo,\n\t     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t     JDIMENSION in_row_groups_avail,\n\t     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t     JDIMENSION out_rows_avail));\nMETHODDEF(void) post_process_2pass\n\tJPP((j_decompress_ptr cinfo,\n\t     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t     JDIMENSION in_row_groups_avail,\n\t     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t     JDIMENSION out_rows_avail));\n#endif\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_post_ptr post = (my_post_ptr) cinfo->post;\n\n  switch (pass_mode) {\n  case JBUF_PASS_THRU:\n    if (cinfo->quantize_colors) {\n      /* Single-pass processing with color quantization. */\n      post->pub.post_process_data = post_process_1pass;\n      /* We could be doing buffered-image output before starting a 2-pass\n       * color quantization; in that case, jinit_d_post_controller did not\n       * allocate a strip buffer.  Use the virtual-array buffer as workspace.\n       */\n      if (post->buffer == NULL) {\n\tpost->buffer = (*cinfo->mem->access_virt_sarray)\n\t  ((j_common_ptr) cinfo, post->whole_image,\n\t   (JDIMENSION) 0, post->strip_height, TRUE);\n      }\n    } else {\n      /* For single-pass processing without color quantization,\n       * I have no work to do; just call the upsampler directly.\n       */\n      post->pub.post_process_data = cinfo->upsample->upsample;\n    }\n    break;\n#ifdef QUANT_2PASS_SUPPORTED\n  case JBUF_SAVE_AND_PASS:\n    /* First pass of 2-pass quantization */\n    if (post->whole_image == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    post->pub.post_process_data = post_process_prepass;\n    break;\n  case JBUF_CRANK_DEST:\n    /* Second pass of 2-pass quantization */\n    if (post->whole_image == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    post->pub.post_process_data = post_process_2pass;\n    break;\n#endif /* QUANT_2PASS_SUPPORTED */\n  default:\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    break;\n  }\n  post->starting_row = post->next_row = 0;\n}\n\n\n/*\n * Process some data in the one-pass (strip buffer) case.\n * This is used for color precision reduction as well as one-pass quantization.\n */\n\nMETHODDEF(void)\npost_process_1pass (j_decompress_ptr cinfo,\n\t\t    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t\t    JDIMENSION in_row_groups_avail,\n\t\t    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t    JDIMENSION out_rows_avail)\n{\n  my_post_ptr post = (my_post_ptr) cinfo->post;\n  JDIMENSION num_rows, max_rows;\n\n  /* Fill the buffer, but not more than what we can dump out in one go. */\n  /* Note we rely on the upsampler to detect bottom of image. */\n  max_rows = out_rows_avail - *out_row_ctr;\n  if (max_rows > post->strip_height)\n    max_rows = post->strip_height;\n  num_rows = 0;\n  (*cinfo->upsample->upsample) (cinfo,\n\t\tinput_buf, in_row_group_ctr, in_row_groups_avail,\n\t\tpost->buffer, &num_rows, max_rows);\n  /* Quantize and emit data. */\n  (*cinfo->cquantize->color_quantize) (cinfo,\n\t\tpost->buffer, output_buf + *out_row_ctr, (int) num_rows);\n  *out_row_ctr += num_rows;\n}\n\n\n#ifdef QUANT_2PASS_SUPPORTED\n\n/*\n * Process some data in the first pass of 2-pass quantization.\n */\n\nMETHODDEF(void)\npost_process_prepass (j_decompress_ptr cinfo,\n\t\t      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t\t      JDIMENSION in_row_groups_avail,\n\t\t      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t      JDIMENSION out_rows_avail)\n{\n  my_post_ptr post = (my_post_ptr) cinfo->post;\n  JDIMENSION old_next_row, num_rows;\n\n  /* Reposition virtual buffer if at start of strip. */\n  if (post->next_row == 0) {\n    post->buffer = (*cinfo->mem->access_virt_sarray)\n\t((j_common_ptr) cinfo, post->whole_image,\n\t post->starting_row, post->strip_height, TRUE);\n  }\n\n  /* Upsample some data (up to a strip height's worth). */\n  old_next_row = post->next_row;\n  (*cinfo->upsample->upsample) (cinfo,\n\t\tinput_buf, in_row_group_ctr, in_row_groups_avail,\n\t\tpost->buffer, &post->next_row, post->strip_height);\n\n  /* Allow quantizer to scan new data.  No data is emitted, */\n  /* but we advance out_row_ctr so outer loop can tell when we're done. */\n  if (post->next_row > old_next_row) {\n    num_rows = post->next_row - old_next_row;\n    (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row,\n\t\t\t\t\t (JSAMPARRAY) NULL, (int) num_rows);\n    *out_row_ctr += num_rows;\n  }\n\n  /* Advance if we filled the strip. */\n  if (post->next_row >= post->strip_height) {\n    post->starting_row += post->strip_height;\n    post->next_row = 0;\n  }\n}\n\n\n/*\n * Process some data in the second pass of 2-pass quantization.\n */\n\nMETHODDEF(void)\npost_process_2pass (j_decompress_ptr cinfo,\n\t\t    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t\t    JDIMENSION in_row_groups_avail,\n\t\t    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t    JDIMENSION out_rows_avail)\n{\n  my_post_ptr post = (my_post_ptr) cinfo->post;\n  JDIMENSION num_rows, max_rows;\n\n  /* Reposition virtual buffer if at start of strip. */\n  if (post->next_row == 0) {\n    post->buffer = (*cinfo->mem->access_virt_sarray)\n\t((j_common_ptr) cinfo, post->whole_image,\n\t post->starting_row, post->strip_height, FALSE);\n  }\n\n  /* Determine number of rows to emit. */\n  num_rows = post->strip_height - post->next_row; /* available in strip */\n  max_rows = out_rows_avail - *out_row_ctr; /* available in output area */\n  if (num_rows > max_rows)\n    num_rows = max_rows;\n  /* We have to check bottom of image here, can't depend on upsampler. */\n  max_rows = cinfo->output_height - post->starting_row;\n  if (num_rows > max_rows)\n    num_rows = max_rows;\n\n  /* Quantize and emit data. */\n  (*cinfo->cquantize->color_quantize) (cinfo,\n\t\tpost->buffer + post->next_row, output_buf + *out_row_ctr,\n\t\t(int) num_rows);\n  *out_row_ctr += num_rows;\n\n  /* Advance if we filled the strip. */\n  post->next_row += num_rows;\n  if (post->next_row >= post->strip_height) {\n    post->starting_row += post->strip_height;\n    post->next_row = 0;\n  }\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n\n\n/*\n * Initialize postprocessing controller.\n */\n\nGLOBAL(void)\njinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer)\n{\n  my_post_ptr post;\n\n  post = (my_post_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_post_controller));\n  cinfo->post = (struct jpeg_d_post_controller *) post;\n  post->pub.start_pass = start_pass_dpost;\n  post->whole_image = NULL;\t/* flag for no virtual arrays */\n  post->buffer = NULL;\t\t/* flag for no strip buffer */\n\n  /* Create the quantization buffer, if needed */\n  if (cinfo->quantize_colors) {\n    /* The buffer strip height is max_v_samp_factor, which is typically\n     * an efficient number of rows for upsampling to return.\n     * (In the presence of output rescaling, we might want to be smarter?)\n     */\n    post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor;\n    if (need_full_buffer) {\n      /* Two-pass color quantization: need full-image storage. */\n      /* We round up the number of rows to a multiple of the strip height. */\n#ifdef QUANT_2PASS_SUPPORTED\n      post->whole_image = (*cinfo->mem->request_virt_sarray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n\t cinfo->output_width * cinfo->out_color_components,\n\t (JDIMENSION) jround_up((long) cinfo->output_height,\n\t\t\t\t(long) post->strip_height),\n\t post->strip_height);\n#else\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n#endif /* QUANT_2PASS_SUPPORTED */\n    } else {\n      /* One-pass color quantization: just make a strip buffer. */\n      post->buffer = (*cinfo->mem->alloc_sarray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t cinfo->output_width * cinfo->out_color_components,\n\t post->strip_height);\n    }\n  }\n}\n"
  },
  {
    "path": "jdsample.c",
    "content": "/*\n * jdsample.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * Modified 2002-2008 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains upsampling routines.\n *\n * Upsampling input data is counted in \"row groups\".  A row group\n * is defined to be (v_samp_factor * DCT_v_scaled_size / min_DCT_v_scaled_size)\n * sample rows of each component.  Upsampling will normally produce\n * max_v_samp_factor pixel rows from each row group (but this could vary\n * if the upsampler is applying a scale factor of its own).\n *\n * An excellent reference for image resampling is\n *   Digital Image Warping, George Wolberg, 1990.\n *   Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Pointer to routine to upsample a single component */\ntypedef JMETHOD(void, upsample1_ptr,\n\t\t(j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_upsampler pub;\t/* public fields */\n\n  /* Color conversion buffer.  When using separate upsampling and color\n   * conversion steps, this buffer holds one upsampled row group until it\n   * has been color converted and output.\n   * Note: we do not allocate any storage for component(s) which are full-size,\n   * ie do not need rescaling.  The corresponding entry of color_buf[] is\n   * simply set to point to the input data array, thereby avoiding copying.\n   */\n  JSAMPARRAY color_buf[MAX_COMPONENTS];\n\n  /* Per-component upsampling method pointers */\n  upsample1_ptr methods[MAX_COMPONENTS];\n\n  int next_row_out;\t\t/* counts rows emitted from color_buf */\n  JDIMENSION rows_to_go;\t/* counts rows remaining in image */\n\n  /* Height of an input row group for each component. */\n  int rowgroup_height[MAX_COMPONENTS];\n\n  /* These arrays save pixel expansion factors so that int_expand need not\n   * recompute them each time.  They are unused for other upsampling methods.\n   */\n  UINT8 h_expand[MAX_COMPONENTS];\n  UINT8 v_expand[MAX_COMPONENTS];\n} my_upsampler;\n\ntypedef my_upsampler * my_upsample_ptr;\n\n\n/*\n * Initialize for an upsampling pass.\n */\n\nMETHODDEF(void)\nstart_pass_upsample (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n\n  /* Mark the conversion buffer empty */\n  upsample->next_row_out = cinfo->max_v_samp_factor;\n  /* Initialize total-height counter for detecting bottom of image */\n  upsample->rows_to_go = cinfo->output_height;\n}\n\n\n/*\n * Control routine to do upsampling (and color conversion).\n *\n * In this version we upsample each component independently.\n * We upsample one row group into the conversion buffer, then apply\n * color conversion a row at a time.\n */\n\nMETHODDEF(void)\nsep_upsample (j_decompress_ptr cinfo,\n\t      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t      JDIMENSION in_row_groups_avail,\n\t      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t      JDIMENSION out_rows_avail)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  int ci;\n  jpeg_component_info * compptr;\n  JDIMENSION num_rows;\n\n  /* Fill the conversion buffer, if it's empty */\n  if (upsample->next_row_out >= cinfo->max_v_samp_factor) {\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      /* Invoke per-component upsample method.  Notice we pass a POINTER\n       * to color_buf[ci], so that fullsize_upsample can change it.\n       */\n      (*upsample->methods[ci]) (cinfo, compptr,\n\tinput_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]),\n\tupsample->color_buf + ci);\n    }\n    upsample->next_row_out = 0;\n  }\n\n  /* Color-convert and emit rows */\n\n  /* How many we have in the buffer: */\n  num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out);\n  /* Not more than the distance to the end of the image.  Need this test\n   * in case the image height is not a multiple of max_v_samp_factor:\n   */\n  if (num_rows > upsample->rows_to_go) \n    num_rows = upsample->rows_to_go;\n  /* And not more than what the client can accept: */\n  out_rows_avail -= *out_row_ctr;\n  if (num_rows > out_rows_avail)\n    num_rows = out_rows_avail;\n\n  (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf,\n\t\t\t\t     (JDIMENSION) upsample->next_row_out,\n\t\t\t\t     output_buf + *out_row_ctr,\n\t\t\t\t     (int) num_rows);\n\n  /* Adjust counts */\n  *out_row_ctr += num_rows;\n  upsample->rows_to_go -= num_rows;\n  upsample->next_row_out += num_rows;\n  /* When the buffer is emptied, declare this input row group consumed */\n  if (upsample->next_row_out >= cinfo->max_v_samp_factor)\n    (*in_row_group_ctr)++;\n}\n\n\n/*\n * These are the routines invoked by sep_upsample to upsample pixel values\n * of a single component.  One row group is processed per call.\n */\n\n\n/*\n * For full-size components, we just make color_buf[ci] point at the\n * input buffer, and thus avoid copying any data.  Note that this is\n * safe only because sep_upsample doesn't declare the input row group\n * \"consumed\" until we are done color converting and emitting it.\n */\n\nMETHODDEF(void)\nfullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t   JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)\n{\n  *output_data_ptr = input_data;\n}\n\n\n/*\n * This is a no-op version used for \"uninteresting\" components.\n * These components will not be referenced by color conversion.\n */\n\nMETHODDEF(void)\nnoop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)\n{\n  *output_data_ptr = NULL;\t/* safety check */\n}\n\n\n/*\n * This version handles any integral sampling ratios.\n * This is not used for typical JPEG files, so it need not be fast.\n * Nor, for that matter, is it particularly accurate: the algorithm is\n * simple replication of the input pixel onto the corresponding output\n * pixels.  The hi-falutin sampling literature refers to this as a\n * \"box filter\".  A box filter tends to introduce visible artifacts,\n * so if you are actually going to use 3:1 or 4:1 sampling ratios\n * you would be well advised to improve this code.\n */\n\nMETHODDEF(void)\nint_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t      JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr, outptr;\n  register JSAMPLE invalue;\n  register int h;\n  JSAMPROW outend;\n  int h_expand, v_expand;\n  int inrow, outrow;\n\n  h_expand = upsample->h_expand[compptr->component_index];\n  v_expand = upsample->v_expand[compptr->component_index];\n\n  inrow = outrow = 0;\n  while (outrow < cinfo->max_v_samp_factor) {\n    /* Generate one output row with proper horizontal expansion */\n    inptr = input_data[inrow];\n    outptr = output_data[outrow];\n    outend = outptr + cinfo->output_width;\n    while (outptr < outend) {\n      invalue = *inptr++;\t/* don't need GETJSAMPLE() here */\n      for (h = h_expand; h > 0; h--) {\n\t*outptr++ = invalue;\n      }\n    }\n    /* Generate any additional output rows by duplicating the first one */\n    if (v_expand > 1) {\n      jcopy_sample_rows(output_data, outrow, output_data, outrow+1,\n\t\t\tv_expand-1, cinfo->output_width);\n    }\n    inrow++;\n    outrow += v_expand;\n  }\n}\n\n\n/*\n * Fast processing for the common case of 2:1 horizontal and 1:1 vertical.\n * It's still a box filter.\n */\n\nMETHODDEF(void)\nh2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr, outptr;\n  register JSAMPLE invalue;\n  JSAMPROW outend;\n  int outrow;\n\n  for (outrow = 0; outrow < cinfo->max_v_samp_factor; outrow++) {\n    inptr = input_data[outrow];\n    outptr = output_data[outrow];\n    outend = outptr + cinfo->output_width;\n    while (outptr < outend) {\n      invalue = *inptr++;\t/* don't need GETJSAMPLE() here */\n      *outptr++ = invalue;\n      *outptr++ = invalue;\n    }\n  }\n}\n\n\n/*\n * Fast processing for the common case of 2:1 horizontal and 2:1 vertical.\n * It's still a box filter.\n */\n\nMETHODDEF(void)\nh2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr, outptr;\n  register JSAMPLE invalue;\n  JSAMPROW outend;\n  int inrow, outrow;\n\n  inrow = outrow = 0;\n  while (outrow < cinfo->max_v_samp_factor) {\n    inptr = input_data[inrow];\n    outptr = output_data[outrow];\n    outend = outptr + cinfo->output_width;\n    while (outptr < outend) {\n      invalue = *inptr++;\t/* don't need GETJSAMPLE() here */\n      *outptr++ = invalue;\n      *outptr++ = invalue;\n    }\n    jcopy_sample_rows(output_data, outrow, output_data, outrow+1,\n\t\t      1, cinfo->output_width);\n    inrow++;\n    outrow += 2;\n  }\n}\n\n\n/*\n * Module initialization routine for upsampling.\n */\n\nGLOBAL(void)\njinit_upsampler (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample;\n  int ci;\n  jpeg_component_info * compptr;\n  boolean need_buffer;\n  int h_in_group, v_in_group, h_out_group, v_out_group;\n\n  upsample = (my_upsample_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_upsampler));\n  cinfo->upsample = (struct jpeg_upsampler *) upsample;\n  upsample->pub.start_pass = start_pass_upsample;\n  upsample->pub.upsample = sep_upsample;\n  upsample->pub.need_context_rows = FALSE; /* until we find out differently */\n\n  if (cinfo->CCIR601_sampling)\t/* this isn't supported */\n    ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);\n\n  /* Verify we can handle the sampling factors, select per-component methods,\n   * and create storage as needed.\n   */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Compute size of an \"input group\" after IDCT scaling.  This many samples\n     * are to be converted to max_h_samp_factor * max_v_samp_factor pixels.\n     */\n    h_in_group = (compptr->h_samp_factor * compptr->DCT_h_scaled_size) /\n\t\t cinfo->min_DCT_h_scaled_size;\n    v_in_group = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /\n\t\t cinfo->min_DCT_v_scaled_size;\n    h_out_group = cinfo->max_h_samp_factor;\n    v_out_group = cinfo->max_v_samp_factor;\n    upsample->rowgroup_height[ci] = v_in_group; /* save for use later */\n    need_buffer = TRUE;\n    if (! compptr->component_needed) {\n      /* Don't bother to upsample an uninteresting component. */\n      upsample->methods[ci] = noop_upsample;\n      need_buffer = FALSE;\n    } else if (h_in_group == h_out_group && v_in_group == v_out_group) {\n      /* Fullsize components can be processed without any work. */\n      upsample->methods[ci] = fullsize_upsample;\n      need_buffer = FALSE;\n    } else if (h_in_group * 2 == h_out_group &&\n\t       v_in_group == v_out_group) {\n      /* Special case for 2h1v upsampling */\n      upsample->methods[ci] = h2v1_upsample;\n    } else if (h_in_group * 2 == h_out_group &&\n\t       v_in_group * 2 == v_out_group) {\n      /* Special case for 2h2v upsampling */\n      upsample->methods[ci] = h2v2_upsample;\n    } else if ((h_out_group % h_in_group) == 0 &&\n\t       (v_out_group % v_in_group) == 0) {\n      /* Generic integral-factors upsampling method */\n      upsample->methods[ci] = int_upsample;\n      upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group);\n      upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);\n    } else\n      ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);\n    if (need_buffer) {\n      upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t (JDIMENSION) jround_up((long) cinfo->output_width,\n\t\t\t\t(long) cinfo->max_h_samp_factor),\n\t (JDIMENSION) cinfo->max_v_samp_factor);\n    }\n  }\n}\n"
  },
  {
    "path": "jdtrans.c",
    "content": "/*\n * jdtrans.c\n *\n * Copyright (C) 1995-1997, Thomas G. Lane.\n * Modified 2000-2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains library routines for transcoding decompression,\n * that is, reading raw DCT coefficient arrays from an input JPEG file.\n * The routines in jdapimin.c will also be needed by a transcoder.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Forward declarations */\nLOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo));\n\n\n/*\n * Read the coefficient arrays from a JPEG file.\n * jpeg_read_header must be completed before calling this.\n *\n * The entire image is read into a set of virtual coefficient-block arrays,\n * one per component.  The return value is a pointer to the array of\n * virtual-array descriptors.  These can be manipulated directly via the\n * JPEG memory manager, or handed off to jpeg_write_coefficients().\n * To release the memory occupied by the virtual arrays, call\n * jpeg_finish_decompress() when done with the data.\n *\n * An alternative usage is to simply obtain access to the coefficient arrays\n * during a buffered-image-mode decompression operation.  This is allowed\n * after any jpeg_finish_output() call.  The arrays can be accessed until\n * jpeg_finish_decompress() is called.  (Note that any call to the library\n * may reposition the arrays, so don't rely on access_virt_barray() results\n * to stay valid across library calls.)\n *\n * Returns NULL if suspended.  This case need be checked only if\n * a suspending data source is used.\n */\n\nGLOBAL(jvirt_barray_ptr *)\njpeg_read_coefficients (j_decompress_ptr cinfo)\n{\n  if (cinfo->global_state == DSTATE_READY) {\n    /* First call: initialize active modules */\n    transdecode_master_selection(cinfo);\n    cinfo->global_state = DSTATE_RDCOEFS;\n  }\n  if (cinfo->global_state == DSTATE_RDCOEFS) {\n    /* Absorb whole file into the coef buffer */\n    for (;;) {\n      int retcode;\n      /* Call progress monitor hook if present */\n      if (cinfo->progress != NULL)\n\t(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n      /* Absorb some more input */\n      retcode = (*cinfo->inputctl->consume_input) (cinfo);\n      if (retcode == JPEG_SUSPENDED)\n\treturn NULL;\n      if (retcode == JPEG_REACHED_EOI)\n\tbreak;\n      /* Advance progress counter if appropriate */\n      if (cinfo->progress != NULL &&\n\t  (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {\n\tif (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {\n\t  /* startup underestimated number of scans; ratchet up one scan */\n\t  cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;\n\t}\n      }\n    }\n    /* Set state so that jpeg_finish_decompress does the right thing */\n    cinfo->global_state = DSTATE_STOPPING;\n  }\n  /* At this point we should be in state DSTATE_STOPPING if being used\n   * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access\n   * to the coefficients during a full buffered-image-mode decompression.\n   */\n  if ((cinfo->global_state == DSTATE_STOPPING ||\n       cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) {\n    return cinfo->coef->coef_arrays;\n  }\n  /* Oops, improper usage */\n  ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  return NULL;\t\t\t/* keep compiler happy */\n}\n\n\n/*\n * Master selection of decompression modules for transcoding.\n * This substitutes for jdmaster.c's initialization of the full decompressor.\n */\n\nLOCAL(void)\ntransdecode_master_selection (j_decompress_ptr cinfo)\n{\n  /* This is effectively a buffered-image operation. */\n  cinfo->buffered_image = TRUE;\n\n  /* Compute output image dimensions and related values. */\n  jpeg_core_output_dimensions(cinfo);\n\n  /* Entropy decoding: either Huffman or arithmetic coding. */\n  if (cinfo->arith_code)\n    jinit_arith_decoder(cinfo);\n  else {\n    jinit_huff_decoder(cinfo);\n  }\n\n  /* Always get a full-image coefficient buffer. */\n  jinit_d_coef_controller(cinfo, TRUE);\n\n  /* We can now tell the memory manager to allocate virtual arrays. */\n  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);\n\n  /* Initialize input side of decompressor to consume first scan. */\n  (*cinfo->inputctl->start_input_pass) (cinfo);\n\n  /* Initialize progress monitoring. */\n  if (cinfo->progress != NULL) {\n    int nscans;\n    /* Estimate number of scans to set pass_limit. */\n    if (cinfo->progressive_mode) {\n      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */\n      nscans = 2 + 3 * cinfo->num_components;\n    } else if (cinfo->inputctl->has_multiple_scans) {\n      /* For a nonprogressive multiscan file, estimate 1 scan per component. */\n      nscans = cinfo->num_components;\n    } else {\n      nscans = 1;\n    }\n    cinfo->progress->pass_counter = 0L;\n    cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;\n    cinfo->progress->completed_passes = 0;\n    cinfo->progress->total_passes = 1;\n  }\n}\n"
  },
  {
    "path": "jerror.c",
    "content": "/*\n * jerror.c\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains simple error-reporting and trace-message routines.\n * These are suitable for Unix-like systems and others where writing to\n * stderr is the right thing to do.  Many applications will want to replace\n * some or all of these routines.\n *\n * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile,\n * you get a Windows-specific hack to display error messages in a dialog box.\n * It ain't much, but it beats dropping error messages into the bit bucket,\n * which is what happens to output to stderr under most Windows C compilers.\n *\n * These routines are used by both the compression and decompression code.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jversion.h\"\n#include \"jerror.h\"\n\n#ifdef USE_WINDOWS_MESSAGEBOX\n#include <windows.h>\n#endif\n\n#ifndef EXIT_FAILURE\t\t/* define exit() codes if not provided */\n#define EXIT_FAILURE  1\n#endif\n\n\n/*\n * Create the message string table.\n * We do this from the master message list in jerror.h by re-reading\n * jerror.h with a suitable definition for macro JMESSAGE.\n * The message table is made an external symbol just in case any applications\n * want to refer to it directly.\n */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_std_message_table\tjMsgTable\n#endif\n\n#define JMESSAGE(code,string)\tstring ,\n\nconst char * const jpeg_std_message_table[] = {\n#include \"jerror.h\"\n  NULL\n};\n\n\n/*\n * Error exit handler: must not return to caller.\n *\n * Applications may override this if they want to get control back after\n * an error.  Typically one would longjmp somewhere instead of exiting.\n * The setjmp buffer can be made a private field within an expanded error\n * handler object.  Note that the info needed to generate an error message\n * is stored in the error object, so you can generate the message now or\n * later, at your convenience.\n * You should make sure that the JPEG object is cleaned up (with jpeg_abort\n * or jpeg_destroy) at some point.\n */\n\nMETHODDEF(noreturn_t)\nerror_exit (j_common_ptr cinfo)\n{\n  /* Always display the message */\n  (*cinfo->err->output_message) (cinfo);\n\n  /* Let the memory manager delete any temp files before we die */\n  jpeg_destroy(cinfo);\n\n  exit(EXIT_FAILURE);\n}\n\n\n/*\n * Actual output of an error or trace message.\n * Applications may override this method to send JPEG messages somewhere\n * other than stderr.\n *\n * On Windows, printing to stderr is generally completely useless,\n * so we provide optional code to produce an error-dialog popup.\n * Most Windows applications will still prefer to override this routine,\n * but if they don't, it'll do something at least marginally useful.\n *\n * NOTE: to use the library in an environment that doesn't support the\n * C stdio library, you may have to delete the call to fprintf() entirely,\n * not just not use this routine.\n */\n\nMETHODDEF(void)\noutput_message (j_common_ptr cinfo)\n{\n  char buffer[JMSG_LENGTH_MAX];\n\n  /* Create the message */\n  (*cinfo->err->format_message) (cinfo, buffer);\n\n#ifdef USE_WINDOWS_MESSAGEBOX\n  /* Display it in a message dialog box */\n  MessageBox(GetActiveWindow(), buffer, \"JPEG Library Error\",\n\t     MB_OK | MB_ICONERROR);\n#else\n  /* Send it to stderr, adding a newline */\n  fprintf(stderr, \"%s\\n\", buffer);\n#endif\n}\n\n\n/*\n * Decide whether to emit a trace or warning message.\n * msg_level is one of:\n *   -1: recoverable corrupt-data warning, may want to abort.\n *    0: important advisory messages (always display to user).\n *    1: first level of tracing detail.\n *    2,3,...: successively more detailed tracing messages.\n * An application might override this method if it wanted to abort on warnings\n * or change the policy about which messages to display.\n */\n\nMETHODDEF(void)\nemit_message (j_common_ptr cinfo, int msg_level)\n{\n  struct jpeg_error_mgr * err = cinfo->err;\n\n  if (msg_level < 0) {\n    /* It's a warning message.  Since corrupt files may generate many warnings,\n     * the policy implemented here is to show only the first warning,\n     * unless trace_level >= 3.\n     */\n    if (err->num_warnings == 0 || err->trace_level >= 3)\n      (*err->output_message) (cinfo);\n    /* Always count warnings in num_warnings. */\n    err->num_warnings++;\n  } else {\n    /* It's a trace message.  Show it if trace_level >= msg_level. */\n    if (err->trace_level >= msg_level)\n      (*err->output_message) (cinfo);\n  }\n}\n\n\n/*\n * Format a message string for the most recent JPEG error or message.\n * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX\n * characters.  Note that no '\\n' character is added to the string.\n * Few applications should need to override this method.\n */\n\nMETHODDEF(void)\nformat_message (j_common_ptr cinfo, char * buffer)\n{\n  struct jpeg_error_mgr * err = cinfo->err;\n  int msg_code = err->msg_code;\n  const char * msgtext = NULL;\n  const char * msgptr;\n  char ch;\n  boolean isstring;\n\n  /* Look up message string in proper table */\n  if (msg_code > 0 && msg_code <= err->last_jpeg_message) {\n    msgtext = err->jpeg_message_table[msg_code];\n  } else if (err->addon_message_table != NULL &&\n\t     msg_code >= err->first_addon_message &&\n\t     msg_code <= err->last_addon_message) {\n    msgtext = err->addon_message_table[msg_code - err->first_addon_message];\n  }\n\n  /* Defend against bogus message number */\n  if (msgtext == NULL) {\n    err->msg_parm.i[0] = msg_code;\n    msgtext = err->jpeg_message_table[0];\n  }\n\n  /* Check for string parameter, as indicated by %s in the message text */\n  isstring = FALSE;\n  msgptr = msgtext;\n  while ((ch = *msgptr++) != '\\0') {\n    if (ch == '%') {\n      if (*msgptr == 's') isstring = TRUE;\n      break;\n    }\n  }\n\n  /* Format the message into the passed buffer */\n  if (isstring)\n    sprintf(buffer, msgtext, err->msg_parm.s);\n  else\n    sprintf(buffer, msgtext,\n\t    err->msg_parm.i[0], err->msg_parm.i[1],\n\t    err->msg_parm.i[2], err->msg_parm.i[3],\n\t    err->msg_parm.i[4], err->msg_parm.i[5],\n\t    err->msg_parm.i[6], err->msg_parm.i[7]);\n}\n\n\n/*\n * Reset error state variables at start of a new image.\n * This is called during compression startup to reset trace/error\n * processing to default state, without losing any application-specific\n * method pointers.  An application might possibly want to override\n * this method if it has additional error processing state.\n */\n\nMETHODDEF(void)\nreset_error_mgr (j_common_ptr cinfo)\n{\n  cinfo->err->num_warnings = 0;\n  /* trace_level is not reset since it is an application-supplied parameter */\n  cinfo->err->msg_code = 0;\t/* may be useful as a flag for \"no error\" */\n}\n\n\n/*\n * Fill in the standard error-handling methods in a jpeg_error_mgr object.\n * Typical call is:\n *\tstruct jpeg_compress_struct cinfo;\n *\tstruct jpeg_error_mgr err;\n *\n *\tcinfo.err = jpeg_std_error(&err);\n * after which the application may override some of the methods.\n */\n\nGLOBAL(struct jpeg_error_mgr *)\njpeg_std_error (struct jpeg_error_mgr * err)\n{\n  err->error_exit = error_exit;\n  err->emit_message = emit_message;\n  err->output_message = output_message;\n  err->format_message = format_message;\n  err->reset_error_mgr = reset_error_mgr;\n\n  err->trace_level = 0;\t\t/* default = no tracing */\n  err->num_warnings = 0;\t/* no warnings emitted yet */\n  err->msg_code = 0;\t\t/* may be useful as a flag for \"no error\" */\n\n  /* Initialize message table pointers */\n  err->jpeg_message_table = jpeg_std_message_table;\n  err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1;\n\n  err->addon_message_table = NULL;\n  err->first_addon_message = 0;\t/* for safety */\n  err->last_addon_message = 0;\n\n  return err;\n}\n"
  },
  {
    "path": "jerror.h",
    "content": "/*\n * jerror.h\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * Modified 1997-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file defines the error and message codes for the JPEG library.\n * Edit this file to add new codes, or to translate the message strings to\n * some other language.\n * A set of error-reporting macros are defined too.  Some applications using\n * the JPEG library may wish to include this file to get the error codes\n * and/or the macros.\n */\n\n/*\n * To define the enum list of message codes, include this file without\n * defining macro JMESSAGE.  To create a message string table, include it\n * again with a suitable JMESSAGE definition (see jerror.c for an example).\n */\n#ifndef JMESSAGE\n#ifndef JERROR_H\n/* First time through, define the enum list */\n#define JMAKE_ENUM_LIST\n#else\n/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */\n#define JMESSAGE(code,string)\n#endif /* JERROR_H */\n#endif /* JMESSAGE */\n\n#ifdef JMAKE_ENUM_LIST\n\ntypedef enum {\n\n#define JMESSAGE(code,string)\tcode ,\n\n#endif /* JMAKE_ENUM_LIST */\n\nJMESSAGE(JMSG_NOMESSAGE, \"Bogus message code %d\") /* Must be first entry! */\n\n/* For maintenance convenience, list is alphabetical by message code name */\nJMESSAGE(JERR_BAD_ALIGN_TYPE, \"ALIGN_TYPE is wrong, please fix\")\nJMESSAGE(JERR_BAD_ALLOC_CHUNK, \"MAX_ALLOC_CHUNK is wrong, please fix\")\nJMESSAGE(JERR_BAD_BUFFER_MODE, \"Bogus buffer control mode\")\nJMESSAGE(JERR_BAD_COMPONENT_ID, \"Invalid component ID %d in SOS\")\nJMESSAGE(JERR_BAD_CROP_SPEC, \"Invalid crop request\")\nJMESSAGE(JERR_BAD_DCT_COEF, \"DCT coefficient out of range\")\nJMESSAGE(JERR_BAD_DCTSIZE, \"DCT scaled block size %dx%d not supported\")\nJMESSAGE(JERR_BAD_DROP_SAMPLING,\n\t \"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c\")\nJMESSAGE(JERR_BAD_HUFF_TABLE, \"Bogus Huffman table definition\")\nJMESSAGE(JERR_BAD_IN_COLORSPACE, \"Bogus input colorspace\")\nJMESSAGE(JERR_BAD_J_COLORSPACE, \"Bogus JPEG colorspace\")\nJMESSAGE(JERR_BAD_LENGTH, \"Bogus marker length\")\nJMESSAGE(JERR_BAD_LIB_VERSION,\n\t \"Wrong JPEG library version: library is %d, caller expects %d\")\nJMESSAGE(JERR_BAD_MCU_SIZE, \"Sampling factors too large for interleaved scan\")\nJMESSAGE(JERR_BAD_POOL_ID, \"Invalid memory pool code %d\")\nJMESSAGE(JERR_BAD_PRECISION, \"Unsupported JPEG data precision %d\")\nJMESSAGE(JERR_BAD_PROGRESSION,\n\t \"Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d\")\nJMESSAGE(JERR_BAD_PROG_SCRIPT,\n\t \"Invalid progressive parameters at scan script entry %d\")\nJMESSAGE(JERR_BAD_SAMPLING, \"Bogus sampling factors\")\nJMESSAGE(JERR_BAD_SCAN_SCRIPT, \"Invalid scan script at entry %d\")\nJMESSAGE(JERR_BAD_STATE, \"Improper call to JPEG library in state %d\")\nJMESSAGE(JERR_BAD_STRUCT_SIZE,\n\t \"JPEG parameter struct mismatch: library thinks size is %u, caller expects %u\")\nJMESSAGE(JERR_BAD_VIRTUAL_ACCESS, \"Bogus virtual array access\")\nJMESSAGE(JERR_BUFFER_SIZE, \"Buffer passed to JPEG library is too small\")\nJMESSAGE(JERR_CANT_SUSPEND, \"Suspension not allowed here\")\nJMESSAGE(JERR_CCIR601_NOTIMPL, \"CCIR601 sampling not implemented yet\")\nJMESSAGE(JERR_COMPONENT_COUNT, \"Too many color components: %d, max %d\")\nJMESSAGE(JERR_CONVERSION_NOTIMPL, \"Unsupported color conversion request\")\nJMESSAGE(JERR_DAC_INDEX, \"Bogus DAC index %d\")\nJMESSAGE(JERR_DAC_VALUE, \"Bogus DAC value 0x%x\")\nJMESSAGE(JERR_DHT_INDEX, \"Bogus DHT index %d\")\nJMESSAGE(JERR_DQT_INDEX, \"Bogus DQT index %d\")\nJMESSAGE(JERR_EMPTY_IMAGE, \"Empty JPEG image (DNL not supported)\")\nJMESSAGE(JERR_EMS_READ, \"Read from EMS failed\")\nJMESSAGE(JERR_EMS_WRITE, \"Write to EMS failed\")\nJMESSAGE(JERR_EOI_EXPECTED, \"Didn't expect more than one scan\")\nJMESSAGE(JERR_FILE_READ, \"Input file read error\")\nJMESSAGE(JERR_FILE_WRITE, \"Output file write error --- out of disk space?\")\nJMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, \"Fractional sampling not implemented yet\")\nJMESSAGE(JERR_HUFF_CLEN_OVERFLOW, \"Huffman code size table overflow\")\nJMESSAGE(JERR_HUFF_MISSING_CODE, \"Missing Huffman code table entry\")\nJMESSAGE(JERR_IMAGE_TOO_BIG, \"Maximum supported image dimension is %u pixels\")\nJMESSAGE(JERR_INPUT_EMPTY, \"Empty input file\")\nJMESSAGE(JERR_INPUT_EOF, \"Premature end of input file\")\nJMESSAGE(JERR_MISMATCHED_QUANT_TABLE,\n\t \"Cannot transcode due to multiple use of quantization table %d\")\nJMESSAGE(JERR_MISSING_DATA, \"Scan script does not transmit all data\")\nJMESSAGE(JERR_MODE_CHANGE, \"Invalid color quantization mode change\")\nJMESSAGE(JERR_NOTIMPL, \"Not implemented yet\")\nJMESSAGE(JERR_NOT_COMPILED, \"Requested feature was omitted at compile time\")\nJMESSAGE(JERR_NO_ARITH_TABLE, \"Arithmetic table 0x%02x was not defined\")\nJMESSAGE(JERR_NO_BACKING_STORE, \"Backing store not supported\")\nJMESSAGE(JERR_NO_HUFF_TABLE, \"Huffman table 0x%02x was not defined\")\nJMESSAGE(JERR_NO_IMAGE, \"JPEG datastream contains no image\")\nJMESSAGE(JERR_NO_QUANT_TABLE, \"Quantization table 0x%02x was not defined\")\nJMESSAGE(JERR_NO_SOI, \"Not a JPEG file: starts with 0x%02x 0x%02x\")\nJMESSAGE(JERR_OUT_OF_MEMORY, \"Insufficient memory (case %d)\")\nJMESSAGE(JERR_QUANT_COMPONENTS,\n\t \"Cannot quantize more than %d color components\")\nJMESSAGE(JERR_QUANT_FEW_COLORS, \"Cannot quantize to fewer than %d colors\")\nJMESSAGE(JERR_QUANT_MANY_COLORS, \"Cannot quantize to more than %d colors\")\nJMESSAGE(JERR_SOF_BEFORE, \"Invalid JPEG file structure: %s before SOF\")\nJMESSAGE(JERR_SOF_DUPLICATE, \"Invalid JPEG file structure: two SOF markers\")\nJMESSAGE(JERR_SOF_NO_SOS, \"Invalid JPEG file structure: missing SOS marker\")\nJMESSAGE(JERR_SOF_UNSUPPORTED, \"Unsupported JPEG process: SOF type 0x%02x\")\nJMESSAGE(JERR_SOI_DUPLICATE, \"Invalid JPEG file structure: two SOI markers\")\nJMESSAGE(JERR_TFILE_CREATE, \"Failed to create temporary file %s\")\nJMESSAGE(JERR_TFILE_READ, \"Read failed on temporary file\")\nJMESSAGE(JERR_TFILE_SEEK, \"Seek failed on temporary file\")\nJMESSAGE(JERR_TFILE_WRITE,\n\t \"Write failed on temporary file --- out of disk space?\")\nJMESSAGE(JERR_TOO_LITTLE_DATA, \"Application transferred too few scanlines\")\nJMESSAGE(JERR_UNKNOWN_MARKER, \"Unsupported marker type 0x%02x\")\nJMESSAGE(JERR_VIRTUAL_BUG, \"Virtual array controller messed up\")\nJMESSAGE(JERR_WIDTH_OVERFLOW, \"Image too wide for this implementation\")\nJMESSAGE(JERR_XMS_READ, \"Read from XMS failed\")\nJMESSAGE(JERR_XMS_WRITE, \"Write to XMS failed\")\nJMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)\nJMESSAGE(JMSG_VERSION, JVERSION)\nJMESSAGE(JTRC_16BIT_TABLES,\n\t \"Caution: quantization tables are too coarse for baseline JPEG\")\nJMESSAGE(JTRC_ADOBE,\n\t \"Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d\")\nJMESSAGE(JTRC_APP0, \"Unknown APP0 marker (not JFIF), length %u\")\nJMESSAGE(JTRC_APP14, \"Unknown APP14 marker (not Adobe), length %u\")\nJMESSAGE(JTRC_DAC, \"Define Arithmetic Table 0x%02x: 0x%02x\")\nJMESSAGE(JTRC_DHT, \"Define Huffman Table 0x%02x\")\nJMESSAGE(JTRC_DQT, \"Define Quantization Table %d  precision %d\")\nJMESSAGE(JTRC_DRI, \"Define Restart Interval %u\")\nJMESSAGE(JTRC_EMS_CLOSE, \"Freed EMS handle %u\")\nJMESSAGE(JTRC_EMS_OPEN, \"Obtained EMS handle %u\")\nJMESSAGE(JTRC_EOI, \"End Of Image\")\nJMESSAGE(JTRC_HUFFBITS, \"        %3d %3d %3d %3d %3d %3d %3d %3d\")\nJMESSAGE(JTRC_JFIF, \"JFIF APP0 marker: version %d.%02d, density %dx%d  %d\")\nJMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,\n\t \"Warning: thumbnail image size does not match data length %u\")\nJMESSAGE(JTRC_JFIF_EXTENSION,\n\t \"JFIF extension marker: type 0x%02x, length %u\")\nJMESSAGE(JTRC_JFIF_THUMBNAIL, \"    with %d x %d thumbnail image\")\nJMESSAGE(JTRC_MISC_MARKER, \"Miscellaneous marker 0x%02x, length %u\")\nJMESSAGE(JTRC_PARMLESS_MARKER, \"Unexpected marker 0x%02x\")\nJMESSAGE(JTRC_QUANTVALS, \"        %4u %4u %4u %4u %4u %4u %4u %4u\")\nJMESSAGE(JTRC_QUANT_3_NCOLORS, \"Quantizing to %d = %d*%d*%d colors\")\nJMESSAGE(JTRC_QUANT_NCOLORS, \"Quantizing to %d colors\")\nJMESSAGE(JTRC_QUANT_SELECTED, \"Selected %d colors for quantization\")\nJMESSAGE(JTRC_RECOVERY_ACTION, \"At marker 0x%02x, recovery action %d\")\nJMESSAGE(JTRC_RST, \"RST%d\")\nJMESSAGE(JTRC_SMOOTH_NOTIMPL,\n\t \"Smoothing not supported with nonstandard sampling ratios\")\nJMESSAGE(JTRC_SOF, \"Start Of Frame 0x%02x: width=%u, height=%u, components=%d\")\nJMESSAGE(JTRC_SOF_COMPONENT, \"    Component %d: %dhx%dv q=%d\")\nJMESSAGE(JTRC_SOI, \"Start of Image\")\nJMESSAGE(JTRC_SOS, \"Start Of Scan: %d components\")\nJMESSAGE(JTRC_SOS_COMPONENT, \"    Component %d: dc=%d ac=%d\")\nJMESSAGE(JTRC_SOS_PARAMS, \"  Ss=%d, Se=%d, Ah=%d, Al=%d\")\nJMESSAGE(JTRC_TFILE_CLOSE, \"Closed temporary file %s\")\nJMESSAGE(JTRC_TFILE_OPEN, \"Opened temporary file %s\")\nJMESSAGE(JTRC_THUMB_JPEG,\n\t \"JFIF extension marker: JPEG-compressed thumbnail image, length %u\")\nJMESSAGE(JTRC_THUMB_PALETTE,\n\t \"JFIF extension marker: palette thumbnail image, length %u\")\nJMESSAGE(JTRC_THUMB_RGB,\n\t \"JFIF extension marker: RGB thumbnail image, length %u\")\nJMESSAGE(JTRC_UNKNOWN_IDS,\n\t \"Unrecognized component IDs %d %d %d, assuming YCbCr\")\nJMESSAGE(JTRC_XMS_CLOSE, \"Freed XMS handle %u\")\nJMESSAGE(JTRC_XMS_OPEN, \"Obtained XMS handle %u\")\nJMESSAGE(JWRN_ADOBE_XFORM, \"Unknown Adobe color transform code %d\")\nJMESSAGE(JWRN_ARITH_BAD_CODE, \"Corrupt JPEG data: bad arithmetic code\")\nJMESSAGE(JWRN_BOGUS_PROGRESSION,\n\t \"Inconsistent progression sequence for component %d coefficient %d\")\nJMESSAGE(JWRN_EXTRANEOUS_DATA,\n\t \"Corrupt JPEG data: %u extraneous bytes before marker 0x%02x\")\nJMESSAGE(JWRN_HIT_MARKER, \"Corrupt JPEG data: premature end of data segment\")\nJMESSAGE(JWRN_HUFF_BAD_CODE, \"Corrupt JPEG data: bad Huffman code\")\nJMESSAGE(JWRN_JFIF_MAJOR, \"Warning: unknown JFIF revision number %d.%02d\")\nJMESSAGE(JWRN_JPEG_EOF, \"Premature end of JPEG file\")\nJMESSAGE(JWRN_MUST_RESYNC,\n\t \"Corrupt JPEG data: found marker 0x%02x instead of RST%d\")\nJMESSAGE(JWRN_NOT_SEQUENTIAL, \"Invalid SOS parameters for sequential JPEG\")\nJMESSAGE(JWRN_TOO_MUCH_DATA, \"Application transferred too many scanlines\")\n\n#ifdef JMAKE_ENUM_LIST\n\n  JMSG_LASTMSGCODE\n} J_MESSAGE_CODE;\n\n#undef JMAKE_ENUM_LIST\n#endif /* JMAKE_ENUM_LIST */\n\n/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */\n#undef JMESSAGE\n\n\n#ifndef JERROR_H\n#define JERROR_H\n\n/* Macros to simplify using the error and trace message stuff */\n/* The first parameter is either type of cinfo pointer */\n\n/* Fatal errors (print message and exit) */\n#define ERREXIT(cinfo,code)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT1(cinfo,code,p1)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT2(cinfo,code,p1,p2)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT3(cinfo,code,p1,p2,p3)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (cinfo)->err->msg_parm.i[2] = (p3), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT4(cinfo,code,p1,p2,p3,p4)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (cinfo)->err->msg_parm.i[2] = (p3), \\\n   (cinfo)->err->msg_parm.i[3] = (p4), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (cinfo)->err->msg_parm.i[2] = (p3), \\\n   (cinfo)->err->msg_parm.i[3] = (p4), \\\n   (cinfo)->err->msg_parm.i[4] = (p5), \\\n   (cinfo)->err->msg_parm.i[5] = (p6), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXITS(cinfo,code,str)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n\n#define MAKESTMT(stuff)\t\tdo { stuff } while (0)\n\n/* Nonfatal errors (we can keep going, but the data is probably corrupt) */\n#define WARNMS(cinfo,code)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))\n#define WARNMS1(cinfo,code,p1)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))\n#define WARNMS2(cinfo,code,p1,p2)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))\n\n/* Informational/debugging messages */\n#define TRACEMS(cinfo,lvl,code)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n#define TRACEMS1(cinfo,lvl,code,p1)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n#define TRACEMS2(cinfo,lvl,code,p1,p2)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n#define TRACEMS3(cinfo,lvl,code,p1,p2,p3)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n\t   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \\\n\t   (cinfo)->err->msg_code = (code); \\\n\t   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n\t   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \\\n\t   (cinfo)->err->msg_code = (code); \\\n\t   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n\t   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \\\n\t   _mp[4] = (p5); \\\n\t   (cinfo)->err->msg_code = (code); \\\n\t   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n\t   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \\\n\t   _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \\\n\t   (cinfo)->err->msg_code = (code); \\\n\t   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMSS(cinfo,lvl,code,str)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n\n#endif /* JERROR_H */\n"
  },
  {
    "path": "jfdctflt.c",
    "content": "/*\n * jfdctflt.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2003-2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a floating-point implementation of the\n * forward DCT (Discrete Cosine Transform).\n *\n * This implementation should be more accurate than either of the integer\n * DCT implementations.  However, it may not give the same results on all\n * machines because of differences in roundoff behavior.  Speed will depend\n * on the hardware's floating point capacity.\n *\n * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT\n * on each column.  Direct algorithms are also available, but they are\n * much more complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README).  The following code\n * is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with a fixed-point\n * implementation, accuracy is lost due to imprecise representation of the\n * scaled quantization values.  However, that problem does not arise if\n * we use floating point arithmetic.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef DCT_FLOAT_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/*\n * Perform the forward DCT on one block of samples.\n */\n\nGLOBAL(void)\njpeg_fdct_float (FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  FAST_FLOAT tmp10, tmp11, tmp12, tmp13;\n  FAST_FLOAT z1, z2, z3, z4, z5, z11, z13;\n  FAST_FLOAT *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n\n  /* Pass 1: process rows. */\n\n  dataptr = data;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Load data into workspace */\n    tmp0 = (FAST_FLOAT) (GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]));\n    tmp7 = (FAST_FLOAT) (GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]));\n    tmp1 = (FAST_FLOAT) (GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]));\n    tmp6 = (FAST_FLOAT) (GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]));\n    tmp2 = (FAST_FLOAT) (GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]));\n    tmp5 = (FAST_FLOAT) (GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]));\n    tmp3 = (FAST_FLOAT) (GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]));\n    tmp4 = (FAST_FLOAT) (GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]));\n\n    /* Even part */\n\n    tmp10 = tmp0 + tmp3;\t/* phase 2 */\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */\n    dataptr[4] = tmp10 - tmp11;\n\n    z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */\n    dataptr[2] = tmp13 + z1;\t/* phase 5 */\n    dataptr[6] = tmp13 - z1;\n\n    /* Odd part */\n\n    tmp10 = tmp4 + tmp5;\t/* phase 2 */\n    tmp11 = tmp5 + tmp6;\n    tmp12 = tmp6 + tmp7;\n\n    /* The rotator is modified from fig 4-8 to avoid extra negations. */\n    z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */\n    z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */\n    z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */\n    z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */\n\n    z11 = tmp7 + z3;\t\t/* phase 5 */\n    z13 = tmp7 - z3;\n\n    dataptr[5] = z13 + z2;\t/* phase 6 */\n    dataptr[3] = z13 - z2;\n    dataptr[1] = z11 + z4;\n    dataptr[7] = z11 - z4;\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns. */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];\n    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];\n    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];\n    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];\n    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];\n\n    /* Even part */\n\n    tmp10 = tmp0 + tmp3;\t/* phase 2 */\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n\n    dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */\n    dataptr[DCTSIZE*4] = tmp10 - tmp11;\n\n    z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */\n    dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */\n    dataptr[DCTSIZE*6] = tmp13 - z1;\n\n    /* Odd part */\n\n    tmp10 = tmp4 + tmp5;\t/* phase 2 */\n    tmp11 = tmp5 + tmp6;\n    tmp12 = tmp6 + tmp7;\n\n    /* The rotator is modified from fig 4-8 to avoid extra negations. */\n    z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */\n    z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */\n    z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */\n    z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */\n\n    z11 = tmp7 + z3;\t\t/* phase 5 */\n    z13 = tmp7 - z3;\n\n    dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */\n    dataptr[DCTSIZE*3] = z13 - z2;\n    dataptr[DCTSIZE*1] = z11 + z4;\n    dataptr[DCTSIZE*7] = z11 - z4;\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n#endif /* DCT_FLOAT_SUPPORTED */\n"
  },
  {
    "path": "jfdctfst.c",
    "content": "/*\n * jfdctfst.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2003-2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a fast, not so accurate integer implementation of the\n * forward DCT (Discrete Cosine Transform).\n *\n * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT\n * on each column.  Direct algorithms are also available, but they are\n * much more complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README).  The following code\n * is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with fixed-point math,\n * accuracy is lost due to imprecise representation of the scaled\n * quantization values.  The smaller the quantization table entry, the less\n * precise the scaled value, so this implementation does worse with high-\n * quality-setting files than with low-quality ones.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef DCT_IFAST_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/* Scaling decisions are generally the same as in the LL&M algorithm;\n * see jfdctint.c for more details.  However, we choose to descale\n * (right shift) multiplication products as soon as they are formed,\n * rather than carrying additional fractional bits into subsequent additions.\n * This compromises accuracy slightly, but it lets us save a few shifts.\n * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)\n * everywhere except in the multiplications proper; this saves a good deal\n * of work on 16-bit-int machines.\n *\n * Again to save a few shifts, the intermediate results between pass 1 and\n * pass 2 are not upscaled, but are represented only to integral precision.\n *\n * A final compromise is to represent the multiplicative constants to only\n * 8 fractional bits, rather than 13.  This saves some shifting work on some\n * machines, and may also reduce the cost of multiplication (since there\n * are fewer one-bits in the constants).\n */\n\n#define CONST_BITS  8\n\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 8\n#define FIX_0_382683433  ((INT32)   98)\t\t/* FIX(0.382683433) */\n#define FIX_0_541196100  ((INT32)  139)\t\t/* FIX(0.541196100) */\n#define FIX_0_707106781  ((INT32)  181)\t\t/* FIX(0.707106781) */\n#define FIX_1_306562965  ((INT32)  334)\t\t/* FIX(1.306562965) */\n#else\n#define FIX_0_382683433  FIX(0.382683433)\n#define FIX_0_541196100  FIX(0.541196100)\n#define FIX_0_707106781  FIX(0.707106781)\n#define FIX_1_306562965  FIX(1.306562965)\n#endif\n\n\n/* We can gain a little more speed, with a further compromise in accuracy,\n * by omitting the addition in a descaling shift.  This yields an incorrectly\n * rounded result half the time...\n */\n\n#ifndef USE_ACCURATE_ROUNDING\n#undef DESCALE\n#define DESCALE(x,n)  RIGHT_SHIFT(x, n)\n#endif\n\n\n/* Multiply a DCTELEM variable by an INT32 constant, and immediately\n * descale to yield a DCTELEM result.\n */\n\n#define MULTIPLY(var,const)  ((DCTELEM) DESCALE((var) * (const), CONST_BITS))\n\n\n/*\n * Perform the forward DCT on one block of samples.\n */\n\nGLOBAL(void)\njpeg_fdct_ifast (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  DCTELEM tmp10, tmp11, tmp12, tmp13;\n  DCTELEM z1, z2, z3, z4, z5, z11, z13;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows. */\n\n  dataptr = data;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Load data into workspace */\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]);\n    tmp7 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]);\n    tmp6 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]);\n    tmp5 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]);\n    tmp4 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);\n\n    /* Even part */\n\n    tmp10 = tmp0 + tmp3;\t/* phase 2 */\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */\n    dataptr[4] = tmp10 - tmp11;\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */\n    dataptr[2] = tmp13 + z1;\t/* phase 5 */\n    dataptr[6] = tmp13 - z1;\n\n    /* Odd part */\n\n    tmp10 = tmp4 + tmp5;\t/* phase 2 */\n    tmp11 = tmp5 + tmp6;\n    tmp12 = tmp6 + tmp7;\n\n    /* The rotator is modified from fig 4-8 to avoid extra negations. */\n    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */\n    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */\n    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */\n    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */\n\n    z11 = tmp7 + z3;\t\t/* phase 5 */\n    z13 = tmp7 - z3;\n\n    dataptr[5] = z13 + z2;\t/* phase 6 */\n    dataptr[3] = z13 - z2;\n    dataptr[1] = z11 + z4;\n    dataptr[7] = z11 - z4;\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns. */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];\n    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];\n    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];\n    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];\n    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];\n\n    /* Even part */\n\n    tmp10 = tmp0 + tmp3;\t/* phase 2 */\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n\n    dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */\n    dataptr[DCTSIZE*4] = tmp10 - tmp11;\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */\n    dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */\n    dataptr[DCTSIZE*6] = tmp13 - z1;\n\n    /* Odd part */\n\n    tmp10 = tmp4 + tmp5;\t/* phase 2 */\n    tmp11 = tmp5 + tmp6;\n    tmp12 = tmp6 + tmp7;\n\n    /* The rotator is modified from fig 4-8 to avoid extra negations. */\n    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */\n    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */\n    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */\n    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */\n\n    z11 = tmp7 + z3;\t\t/* phase 5 */\n    z13 = tmp7 - z3;\n\n    dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */\n    dataptr[DCTSIZE*3] = z13 - z2;\n    dataptr[DCTSIZE*1] = z11 + z4;\n    dataptr[DCTSIZE*7] = z11 - z4;\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n#endif /* DCT_IFAST_SUPPORTED */\n"
  },
  {
    "path": "jfdctint.c",
    "content": "/*\n * jfdctint.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * Modification developed 2003-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a slow-but-accurate integer implementation of the\n * forward DCT (Discrete Cosine Transform).\n *\n * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT\n * on each column.  Direct algorithms are also available, but they are\n * much more complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on an algorithm described in\n *   C. Loeffler, A. Ligtenberg and G. Moschytz, \"Practical Fast 1-D DCT\n *   Algorithms with 11 Multiplications\", Proc. Int'l. Conf. on Acoustics,\n *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.\n * The primary algorithm described there uses 11 multiplies and 29 adds.\n * We use their alternate method with 12 multiplies and 32 adds.\n * The advantage of this method is that no data path contains more than one\n * multiplication; this allows a very simple and accurate implementation in\n * scaled fixed-point arithmetic, with a minimal number of shifts.\n *\n * We also provide FDCT routines with various input sample block sizes for\n * direct resolution reduction or enlargement and for direct resolving the\n * common 2x1 and 1x2 subsampling cases without additional resampling: NxN\n * (N=1...16), 2NxN, and Nx2N (N=1...8) pixels for one 8x8 output DCT block.\n *\n * For N<8 we fill the remaining block coefficients with zero.\n * For N>8 we apply a partial N-point FDCT on the input samples, computing\n * just the lower 8 frequency coefficients and discarding the rest.\n *\n * We must scale the output coefficients of the N-point FDCT appropriately\n * to the standard 8-point FDCT level by 8/N per 1-D pass.  This scaling\n * is folded into the constant multipliers (pass 2) and/or final/initial\n * shifting.\n *\n * CAUTION: We rely on the FIX() macro except for the N=1,2,4,8 cases\n * since there would be too many additional constants to pre-calculate.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef DCT_ISLOW_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */\n#endif\n\n\n/*\n * The poop on this scaling stuff is as follows:\n *\n * Each 1-D DCT step produces outputs which are a factor of sqrt(N)\n * larger than the true DCT outputs.  The final outputs are therefore\n * a factor of N larger than desired; since N=8 this can be cured by\n * a simple right shift at the end of the algorithm.  The advantage of\n * this arrangement is that we save two multiplications per 1-D DCT,\n * because the y0 and y4 outputs need not be divided by sqrt(N).\n * In the IJG code, this factor of 8 is removed by the quantization step\n * (in jcdctmgr.c), NOT in this module.\n *\n * We have to do addition and subtraction of the integer inputs, which\n * is no problem, and multiplication by fractional constants, which is\n * a problem to do in integer arithmetic.  We multiply all the constants\n * by CONST_SCALE and convert them to integer constants (thus retaining\n * CONST_BITS bits of precision in the constants).  After doing a\n * multiplication we have to divide the product by CONST_SCALE, with proper\n * rounding, to produce the correct output.  This division can be done\n * cheaply as a right shift of CONST_BITS bits.  We postpone shifting\n * as long as possible so that partial sums can be added together with\n * full fractional precision.\n *\n * The outputs of the first pass are scaled up by PASS1_BITS bits so that\n * they are represented to better-than-integral precision.  These outputs\n * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word\n * with the recommended scaling.  (For 12-bit sample data, the intermediate\n * array is INT32 anyway.)\n *\n * To avoid overflow of the 32-bit intermediate results in pass 2, we must\n * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis\n * shows that the values given below are the most effective.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define CONST_BITS  13\n#define PASS1_BITS  2\n#else\n#define CONST_BITS  13\n#define PASS1_BITS  1\t\t/* lose a little precision to avoid overflow */\n#endif\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 13\n#define FIX_0_298631336  ((INT32)  2446)\t/* FIX(0.298631336) */\n#define FIX_0_390180644  ((INT32)  3196)\t/* FIX(0.390180644) */\n#define FIX_0_541196100  ((INT32)  4433)\t/* FIX(0.541196100) */\n#define FIX_0_765366865  ((INT32)  6270)\t/* FIX(0.765366865) */\n#define FIX_0_899976223  ((INT32)  7373)\t/* FIX(0.899976223) */\n#define FIX_1_175875602  ((INT32)  9633)\t/* FIX(1.175875602) */\n#define FIX_1_501321110  ((INT32)  12299)\t/* FIX(1.501321110) */\n#define FIX_1_847759065  ((INT32)  15137)\t/* FIX(1.847759065) */\n#define FIX_1_961570560  ((INT32)  16069)\t/* FIX(1.961570560) */\n#define FIX_2_053119869  ((INT32)  16819)\t/* FIX(2.053119869) */\n#define FIX_2_562915447  ((INT32)  20995)\t/* FIX(2.562915447) */\n#define FIX_3_072711026  ((INT32)  25172)\t/* FIX(3.072711026) */\n#else\n#define FIX_0_298631336  FIX(0.298631336)\n#define FIX_0_390180644  FIX(0.390180644)\n#define FIX_0_541196100  FIX(0.541196100)\n#define FIX_0_765366865  FIX(0.765366865)\n#define FIX_0_899976223  FIX(0.899976223)\n#define FIX_1_175875602  FIX(1.175875602)\n#define FIX_1_501321110  FIX(1.501321110)\n#define FIX_1_847759065  FIX(1.847759065)\n#define FIX_1_961570560  FIX(1.961570560)\n#define FIX_2_053119869  FIX(2.053119869)\n#define FIX_2_562915447  FIX(2.562915447)\n#define FIX_3_072711026  FIX(3.072711026)\n#endif\n\n\n/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.\n * For 8-bit samples with the recommended scaling, all the variable\n * and constant values involved are no more than 16 bits wide, so a\n * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.\n * For 12-bit samples, a full 32-bit multiplication will be needed.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)\n#else\n#define MULTIPLY(var,const)  ((var) * (const))\n#endif\n\n\n/*\n * Perform the forward DCT on one block of samples.\n */\n\nGLOBAL(void)\njpeg_fdct_islow (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3;\n  INT32 tmp10, tmp11, tmp12, tmp13;\n  INT32 z1;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * cK represents sqrt(2) * cos(K*pi/16).\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part per LL&M figure 1 --- note that published figure is faulty;\n     * rotator \"c1\" should be \"c6\".\n     */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]);\n\n    tmp10 = tmp0 + tmp3;\n    tmp12 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp13 = tmp1 - tmp2;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);\n    tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS);\n    dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);       /* c6 */\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    dataptr[2] = (DCTELEM)\n      RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), /* c2-c6 */\n\t\t  CONST_BITS-PASS1_BITS);\n    dataptr[6] = (DCTELEM)\n      RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), /* c2+c6 */\n\t\t  CONST_BITS-PASS1_BITS);\n\n    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).\n     * i0..i3 in the paper are tmp0..tmp3 here.\n     */\n\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp1 + tmp3;\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602);       /*  c3 */\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    tmp12 = MULTIPLY(tmp12, - FIX_0_390180644);          /* -c3+c5 */\n    tmp13 = MULTIPLY(tmp13, - FIX_1_961570560);          /* -c3-c5 */\n    tmp12 += z1;\n    tmp13 += z1;\n\n    z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223);       /* -c3+c7 */\n    tmp0 = MULTIPLY(tmp0, FIX_1_501321110);              /*  c1+c3-c5-c7 */\n    tmp3 = MULTIPLY(tmp3, FIX_0_298631336);              /* -c1+c3+c5-c7 */\n    tmp0 += z1 + tmp12;\n    tmp3 += z1 + tmp13;\n\n    z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447);       /* -c1-c3 */\n    tmp1 = MULTIPLY(tmp1, FIX_3_072711026);              /*  c1+c3+c5-c7 */\n    tmp2 = MULTIPLY(tmp2, FIX_2_053119869);              /*  c1+c3-c5+c7 */\n    tmp1 += z1 + tmp13;\n    tmp2 += z1 + tmp12;\n\n    dataptr[1] = (DCTELEM) RIGHT_SHIFT(tmp0, CONST_BITS-PASS1_BITS);\n    dataptr[3] = (DCTELEM) RIGHT_SHIFT(tmp1, CONST_BITS-PASS1_BITS);\n    dataptr[5] = (DCTELEM) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS);\n    dataptr[7] = (DCTELEM) RIGHT_SHIFT(tmp3, CONST_BITS-PASS1_BITS);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * cK represents sqrt(2) * cos(K*pi/16).\n   */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part per LL&M figure 1 --- note that published figure is faulty;\n     * rotator \"c1\" should be \"c6\".\n     */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];\n\n    /* Add fudge factor here for final descale. */\n    tmp10 = tmp0 + tmp3 + (ONE << (PASS1_BITS-1));\n    tmp12 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp13 = tmp1 - tmp2;\n\n    tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];\n\n    dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp10 + tmp11, PASS1_BITS);\n    dataptr[DCTSIZE*4] = (DCTELEM) RIGHT_SHIFT(tmp10 - tmp11, PASS1_BITS);\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);       /* c6 */\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS+PASS1_BITS-1);\n\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), /* c2-c6 */\n\t\t  CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), /* c2+c6 */\n\t\t  CONST_BITS+PASS1_BITS);\n\n    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).\n     * i0..i3 in the paper are tmp0..tmp3 here.\n     */\n\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp1 + tmp3;\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602);       /*  c3 */\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS+PASS1_BITS-1);\n\n    tmp12 = MULTIPLY(tmp12, - FIX_0_390180644);          /* -c3+c5 */\n    tmp13 = MULTIPLY(tmp13, - FIX_1_961570560);          /* -c3-c5 */\n    tmp12 += z1;\n    tmp13 += z1;\n\n    z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223);       /* -c3+c7 */\n    tmp0 = MULTIPLY(tmp0, FIX_1_501321110);              /*  c1+c3-c5-c7 */\n    tmp3 = MULTIPLY(tmp3, FIX_0_298631336);              /* -c1+c3+c5-c7 */\n    tmp0 += z1 + tmp12;\n    tmp3 += z1 + tmp13;\n\n    z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447);       /* -c1-c3 */\n    tmp1 = MULTIPLY(tmp1, FIX_3_072711026);              /*  c1+c3+c5-c7 */\n    tmp2 = MULTIPLY(tmp2, FIX_2_053119869);              /*  c1+c3-c5+c7 */\n    tmp1 += z1 + tmp13;\n    tmp2 += z1 + tmp12;\n\n    dataptr[DCTSIZE*1] = (DCTELEM) RIGHT_SHIFT(tmp0, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM) RIGHT_SHIFT(tmp1, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*5] = (DCTELEM) RIGHT_SHIFT(tmp2, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*7] = (DCTELEM) RIGHT_SHIFT(tmp3, CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n#ifdef DCT_SCALING_SUPPORTED\n\n\n/*\n * Perform the forward DCT on a 7x7 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_7x7 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3;\n  INT32 tmp10, tmp11, tmp12;\n  INT32 z1, z2, z3;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * cK represents sqrt(2) * cos(K*pi/14).\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 7; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[6]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[5]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[4]);\n    tmp3 = GETJSAMPLE(elemptr[3]);\n\n    tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[6]);\n    tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[5]);\n    tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]);\n\n    z1 = tmp0 + tmp2;\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS);\n    tmp3 += tmp3;\n    z1 -= tmp3;\n    z1 -= tmp3;\n    z1 = MULTIPLY(z1, FIX(0.353553391));                /* (c2+c6-c4)/2 */\n    z2 = MULTIPLY(tmp0 - tmp2, FIX(0.920609002));       /* (c2+c4-c6)/2 */\n    z3 = MULTIPLY(tmp1 - tmp2, FIX(0.314692123));       /* c6 */\n    dataptr[2] = (DCTELEM) DESCALE(z1 + z2 + z3, CONST_BITS-PASS1_BITS);\n    z1 -= z2;\n    z2 = MULTIPLY(tmp0 - tmp1, FIX(0.881747734));       /* c4 */\n    dataptr[4] = (DCTELEM)\n      DESCALE(z2 + z3 - MULTIPLY(tmp1 - tmp3, FIX(0.707106781)), /* c2+c6-c4 */\n\t      CONST_BITS-PASS1_BITS);\n    dataptr[6] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS-PASS1_BITS);\n\n    /* Odd part */\n\n    tmp1 = MULTIPLY(tmp10 + tmp11, FIX(0.935414347));   /* (c3+c1-c5)/2 */\n    tmp2 = MULTIPLY(tmp10 - tmp11, FIX(0.170262339));   /* (c3+c5-c1)/2 */\n    tmp0 = tmp1 - tmp2;\n    tmp1 += tmp2;\n    tmp2 = MULTIPLY(tmp11 + tmp12, - FIX(1.378756276)); /* -c1 */\n    tmp1 += tmp2;\n    tmp3 = MULTIPLY(tmp10 + tmp12, FIX(0.613604268));   /* c5 */\n    tmp0 += tmp3;\n    tmp2 += tmp3 + MULTIPLY(tmp12, FIX(1.870828693));   /* c3+c1-c5 */\n\n    dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS-PASS1_BITS);\n    dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS-PASS1_BITS);\n    dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS-PASS1_BITS);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/7)**2 = 64/49, which we fold\n   * into the constant multipliers:\n   * cK now represents sqrt(2) * cos(K*pi/14) * 64/49.\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 7; ctr++) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*6];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*5];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*4];\n    tmp3 = dataptr[DCTSIZE*3];\n\n    tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*6];\n    tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*5];\n    tmp12 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*4];\n\n    z1 = tmp0 + tmp2;\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(z1 + tmp1 + tmp3, FIX(1.306122449)), /* 64/49 */\n\t      CONST_BITS+PASS1_BITS);\n    tmp3 += tmp3;\n    z1 -= tmp3;\n    z1 -= tmp3;\n    z1 = MULTIPLY(z1, FIX(0.461784020));                /* (c2+c6-c4)/2 */\n    z2 = MULTIPLY(tmp0 - tmp2, FIX(1.202428084));       /* (c2+c4-c6)/2 */\n    z3 = MULTIPLY(tmp1 - tmp2, FIX(0.411026446));       /* c6 */\n    dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + z2 + z3, CONST_BITS+PASS1_BITS);\n    z1 -= z2;\n    z2 = MULTIPLY(tmp0 - tmp1, FIX(1.151670509));       /* c4 */\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(z2 + z3 - MULTIPLY(tmp1 - tmp3, FIX(0.923568041)), /* c2+c6-c4 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS+PASS1_BITS);\n\n    /* Odd part */\n\n    tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.221765677));   /* (c3+c1-c5)/2 */\n    tmp2 = MULTIPLY(tmp10 - tmp11, FIX(0.222383464));   /* (c3+c5-c1)/2 */\n    tmp0 = tmp1 - tmp2;\n    tmp1 += tmp2;\n    tmp2 = MULTIPLY(tmp11 + tmp12, - FIX(1.800824523)); /* -c1 */\n    tmp1 += tmp2;\n    tmp3 = MULTIPLY(tmp10 + tmp12, FIX(0.801442310));   /* c5 */\n    tmp0 += tmp3;\n    tmp2 += tmp3 + MULTIPLY(tmp12, FIX(2.443531355));   /* c3+c1-c5 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 6x6 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_6x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2;\n  INT32 tmp10, tmp11, tmp12;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * cK represents sqrt(2) * cos(K*pi/12).\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 6; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[5]);\n    tmp11 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[4]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[3]);\n\n    tmp10 = tmp0 + tmp2;\n    tmp12 = tmp0 - tmp2;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[5]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS);\n    dataptr[2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp12, FIX(1.224744871)),                 /* c2 */\n\t      CONST_BITS-PASS1_BITS);\n    dataptr[4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(0.707106781)), /* c4 */\n\t      CONST_BITS-PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = DESCALE(MULTIPLY(tmp0 + tmp2, FIX(0.366025404)),     /* c5 */\n\t\t    CONST_BITS-PASS1_BITS);\n\n    dataptr[1] = (DCTELEM) (tmp10 + ((tmp0 + tmp1) << PASS1_BITS));\n    dataptr[3] = (DCTELEM) ((tmp0 - tmp1 - tmp2) << PASS1_BITS);\n    dataptr[5] = (DCTELEM) (tmp10 + ((tmp2 - tmp1) << PASS1_BITS));\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/6)**2 = 16/9, which we fold\n   * into the constant multipliers:\n   * cK now represents sqrt(2) * cos(K*pi/12) * 16/9.\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 6; ctr++) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*5];\n    tmp11 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*4];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3];\n\n    tmp10 = tmp0 + tmp2;\n    tmp12 = tmp0 - tmp2;\n\n    tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*5];\n    tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*4];\n    tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 + tmp11, FIX(1.777777778)),         /* 16/9 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp12, FIX(2.177324216)),                 /* c2 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(1.257078722)), /* c4 */\n\t      CONST_BITS+PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = MULTIPLY(tmp0 + tmp2, FIX(0.650711829));             /* c5 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp0 + tmp1, FIX(1.777777778)),   /* 16/9 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 - tmp1 - tmp2, FIX(1.777777778)),    /* 16/9 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*5] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp2 - tmp1, FIX(1.777777778)),   /* 16/9 */\n\t      CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 5x5 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_5x5 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2;\n  INT32 tmp10, tmp11;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * We scale the results further by 2 as part of output adaption\n   * scaling for different DCT size.\n   * cK represents sqrt(2) * cos(K*pi/10).\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 5; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[4]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[3]);\n    tmp2 = GETJSAMPLE(elemptr[2]);\n\n    tmp10 = tmp0 + tmp1;\n    tmp11 = tmp0 - tmp1;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << (PASS1_BITS+1));\n    tmp11 = MULTIPLY(tmp11, FIX(0.790569415));          /* (c2+c4)/2 */\n    tmp10 -= tmp2 << 2;\n    tmp10 = MULTIPLY(tmp10, FIX(0.353553391));          /* (c2-c4)/2 */\n    dataptr[2] = (DCTELEM) DESCALE(tmp11 + tmp10, CONST_BITS-PASS1_BITS-1);\n    dataptr[4] = (DCTELEM) DESCALE(tmp11 - tmp10, CONST_BITS-PASS1_BITS-1);\n\n    /* Odd part */\n\n    tmp10 = MULTIPLY(tmp0 + tmp1, FIX(0.831253876));    /* c3 */\n\n    dataptr[1] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp0, FIX(0.513743148)), /* c1-c3 */\n\t      CONST_BITS-PASS1_BITS-1);\n    dataptr[3] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp1, FIX(2.176250899)), /* c1+c3 */\n\t      CONST_BITS-PASS1_BITS-1);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/5)**2 = 64/25, which we partially\n   * fold into the constant multipliers (other part was done in pass 1):\n   * cK now represents sqrt(2) * cos(K*pi/10) * 32/25.\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 5; ctr++) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*4];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*3];\n    tmp2 = dataptr[DCTSIZE*2];\n\n    tmp10 = tmp0 + tmp1;\n    tmp11 = tmp0 - tmp1;\n\n    tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*4];\n    tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*3];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 + tmp2, FIX(1.28)),        /* 32/25 */\n\t      CONST_BITS+PASS1_BITS);\n    tmp11 = MULTIPLY(tmp11, FIX(1.011928851));          /* (c2+c4)/2 */\n    tmp10 -= tmp2 << 2;\n    tmp10 = MULTIPLY(tmp10, FIX(0.452548340));          /* (c2-c4)/2 */\n    dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp11 + tmp10, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp11 - tmp10, CONST_BITS+PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = MULTIPLY(tmp0 + tmp1, FIX(1.064004961));    /* c3 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp0, FIX(0.657591230)), /* c1-c3 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp1, FIX(2.785601151)), /* c1+c3 */\n\t      CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 4x4 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_4x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1;\n  INT32 tmp10, tmp11;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * We must also scale the output by (8/4)**2 = 2**2, which we add here.\n   * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 4; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);\n\n    tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);\n    tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+2));\n    dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+2));\n\n    /* Odd part */\n\n    tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100);       /* c6 */\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-3);\n\n    dataptr[1] = (DCTELEM)\n      RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */\n\t\t  CONST_BITS-PASS1_BITS-2);\n    dataptr[3] = (DCTELEM)\n      RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */\n\t\t  CONST_BITS-PASS1_BITS-2);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 4; ctr++) {\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*3] + (ONE << (PASS1_BITS-1));\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*2];\n\n    tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3];\n    tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2];\n\n    dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp0 + tmp1, PASS1_BITS);\n    dataptr[DCTSIZE*2] = (DCTELEM) RIGHT_SHIFT(tmp0 - tmp1, PASS1_BITS);\n\n    /* Odd part */\n\n    tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100);       /* c6 */\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS+PASS1_BITS-1);\n\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */\n\t\t  CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM)\n      RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */\n\t\t  CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 3x3 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_3x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * We scale the results further by 2**2 as part of output adaption\n   * scaling for different DCT size.\n   * cK represents sqrt(2) * cos(K*pi/6).\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 3; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[2]);\n    tmp1 = GETJSAMPLE(elemptr[1]);\n\n    tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+2));\n    dataptr[2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 - tmp1 - tmp1, FIX(0.707106781)), /* c2 */\n\t      CONST_BITS-PASS1_BITS-2);\n\n    /* Odd part */\n\n    dataptr[1] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp2, FIX(1.224744871)),               /* c1 */\n\t      CONST_BITS-PASS1_BITS-2);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/3)**2 = 64/9, which we partially\n   * fold into the constant multipliers (other part was done in pass 1):\n   * cK now represents sqrt(2) * cos(K*pi/6) * 16/9.\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 3; ctr++) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*2];\n    tmp1 = dataptr[DCTSIZE*1];\n\n    tmp2 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*2];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 + tmp1, FIX(1.777777778)),        /* 16/9 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 - tmp1 - tmp1, FIX(1.257078722)), /* c2 */\n\t      CONST_BITS+PASS1_BITS);\n\n    /* Odd part */\n\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp2, FIX(2.177324216)),               /* c1 */\n\t      CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 2x2 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_2x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3;\n  JSAMPROW elemptr;\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT.\n   */\n\n  /* Row 0 */\n  elemptr = sample_data[0] + start_col;\n\n  tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[1]);\n  tmp1 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[1]);\n\n  /* Row 1 */\n  elemptr = sample_data[1] + start_col;\n\n  tmp2 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[1]);\n  tmp3 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[1]);\n\n  /* Pass 2: process columns.\n   * We leave the results scaled up by an overall factor of 8.\n   * We must also scale the output by (8/2)**2 = 2**4.\n   */\n\n  /* Column 0 */\n  /* Apply unsigned->signed conversion */\n  data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp2 - 4 * CENTERJSAMPLE) << 4);\n  data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp2) << 4);\n\n  /* Column 1 */\n  data[DCTSIZE*0+1] = (DCTELEM) ((tmp1 + tmp3) << 4);\n  data[DCTSIZE*1+1] = (DCTELEM) ((tmp1 - tmp3) << 4);\n}\n\n\n/*\n * Perform the forward DCT on a 1x1 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_1x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* We leave the result scaled up by an overall factor of 8. */\n  /* We must also scale the output by (8/1)**2 = 2**6. */\n  /* Apply unsigned->signed conversion */\n  data[0] = (DCTELEM)\n    ((GETJSAMPLE(sample_data[0][start_col]) - CENTERJSAMPLE) << 6);\n}\n\n\n/*\n * Perform the forward DCT on a 9x9 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_9x9 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4;\n  INT32 tmp10, tmp11, tmp12, tmp13;\n  INT32 z1, z2;\n  DCTELEM workspace[8];\n  DCTELEM *dataptr;\n  DCTELEM *wsptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * we scale the results further by 2 as part of output adaption\n   * scaling for different DCT size.\n   * cK represents sqrt(2) * cos(K*pi/18).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (;;) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[8]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[7]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[6]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[5]);\n    tmp4 = GETJSAMPLE(elemptr[4]);\n\n    tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[8]);\n    tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[7]);\n    tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[6]);\n    tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[5]);\n\n    z1 = tmp0 + tmp2 + tmp3;\n    z2 = tmp1 + tmp4;\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM) ((z1 + z2 - 9 * CENTERJSAMPLE) << 1);\n    dataptr[6] = (DCTELEM)\n      DESCALE(MULTIPLY(z1 - z2 - z2, FIX(0.707106781)),  /* c6 */\n\t      CONST_BITS-1);\n    z1 = MULTIPLY(tmp0 - tmp2, FIX(1.328926049));        /* c2 */\n    z2 = MULTIPLY(tmp1 - tmp4 - tmp4, FIX(0.707106781)); /* c6 */\n    dataptr[2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp2 - tmp3, FIX(1.083350441))    /* c4 */\n\t      + z1 + z2, CONST_BITS-1);\n    dataptr[4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp3 - tmp0, FIX(0.245575608))    /* c8 */\n\t      + z1 - z2, CONST_BITS-1);\n\n    /* Odd part */\n\n    dataptr[3] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp12 - tmp13, FIX(1.224744871)), /* c3 */\n\t      CONST_BITS-1);\n\n    tmp11 = MULTIPLY(tmp11, FIX(1.224744871));        /* c3 */\n    tmp0 = MULTIPLY(tmp10 + tmp12, FIX(0.909038955)); /* c5 */\n    tmp1 = MULTIPLY(tmp10 + tmp13, FIX(0.483689525)); /* c7 */\n\n    dataptr[1] = (DCTELEM) DESCALE(tmp11 + tmp0 + tmp1, CONST_BITS-1);\n\n    tmp2 = MULTIPLY(tmp12 - tmp13, FIX(1.392728481)); /* c1 */\n\n    dataptr[5] = (DCTELEM) DESCALE(tmp0 - tmp11 - tmp2, CONST_BITS-1);\n    dataptr[7] = (DCTELEM) DESCALE(tmp1 - tmp11 + tmp2, CONST_BITS-1);\n\n    ctr++;\n\n    if (ctr != DCTSIZE) {\n      if (ctr == 9)\n\tbreak;\t\t\t/* Done. */\n      dataptr += DCTSIZE;\t/* advance pointer to next row */\n    } else\n      dataptr = workspace;\t/* switch pointer to extended workspace */\n  }\n\n  /* Pass 2: process columns.\n   * We leave the results scaled up by an overall factor of 8.\n   * We must also scale the output by (8/9)**2 = 64/81, which we partially\n   * fold into the constant multipliers and final/initial shifting:\n   * cK now represents sqrt(2) * cos(K*pi/18) * 128/81.\n   */\n\n  dataptr = data;\n  wsptr = workspace;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*0];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*7];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*6];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*5];\n    tmp4 = dataptr[DCTSIZE*4];\n\n    tmp10 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*0];\n    tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*7];\n    tmp12 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*6];\n    tmp13 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*5];\n\n    z1 = tmp0 + tmp2 + tmp3;\n    z2 = tmp1 + tmp4;\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(z1 + z2, FIX(1.580246914)),       /* 128/81 */\n\t      CONST_BITS+2);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      DESCALE(MULTIPLY(z1 - z2 - z2, FIX(1.117403309)),  /* c6 */\n\t      CONST_BITS+2);\n    z1 = MULTIPLY(tmp0 - tmp2, FIX(2.100031287));        /* c2 */\n    z2 = MULTIPLY(tmp1 - tmp4 - tmp4, FIX(1.117403309)); /* c6 */\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp2 - tmp3, FIX(1.711961190))    /* c4 */\n\t      + z1 + z2, CONST_BITS+2);\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp3 - tmp0, FIX(0.388070096))    /* c8 */\n\t      + z1 - z2, CONST_BITS+2);\n\n    /* Odd part */\n\n    dataptr[DCTSIZE*3] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp12 - tmp13, FIX(1.935399303)), /* c3 */\n\t      CONST_BITS+2);\n\n    tmp11 = MULTIPLY(tmp11, FIX(1.935399303));        /* c3 */\n    tmp0 = MULTIPLY(tmp10 + tmp12, FIX(1.436506004)); /* c5 */\n    tmp1 = MULTIPLY(tmp10 + tmp13, FIX(0.764348879)); /* c7 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      DESCALE(tmp11 + tmp0 + tmp1, CONST_BITS+2);\n\n    tmp2 = MULTIPLY(tmp12 - tmp13, FIX(2.200854883)); /* c1 */\n\n    dataptr[DCTSIZE*5] = (DCTELEM)\n      DESCALE(tmp0 - tmp11 - tmp2, CONST_BITS+2);\n    dataptr[DCTSIZE*7] = (DCTELEM)\n      DESCALE(tmp1 - tmp11 + tmp2, CONST_BITS+2);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n    wsptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 10x10 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_10x10 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14;\n  DCTELEM workspace[8*2];\n  DCTELEM *dataptr;\n  DCTELEM *wsptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * we scale the results further by 2 as part of output adaption\n   * scaling for different DCT size.\n   * cK represents sqrt(2) * cos(K*pi/20).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (;;) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[9]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[8]);\n    tmp12 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[7]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[6]);\n    tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[5]);\n\n    tmp10 = tmp0 + tmp4;\n    tmp13 = tmp0 - tmp4;\n    tmp11 = tmp1 + tmp3;\n    tmp14 = tmp1 - tmp3;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[9]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[8]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[7]);\n    tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]);\n    tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << 1);\n    tmp12 += tmp12;\n    dataptr[4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.144122806)) - /* c4 */\n\t      MULTIPLY(tmp11 - tmp12, FIX(0.437016024)),  /* c8 */\n\t      CONST_BITS-1);\n    tmp10 = MULTIPLY(tmp13 + tmp14, FIX(0.831253876));    /* c6 */\n    dataptr[2] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp13, FIX(0.513743148)),  /* c2-c6 */\n\t      CONST_BITS-1);\n    dataptr[6] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp14, FIX(2.176250899)),  /* c2+c6 */\n\t      CONST_BITS-1);\n\n    /* Odd part */\n\n    tmp10 = tmp0 + tmp4;\n    tmp11 = tmp1 - tmp3;\n    dataptr[5] = (DCTELEM) ((tmp10 - tmp11 - tmp2) << 1);\n    tmp2 <<= CONST_BITS;\n    dataptr[1] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0, FIX(1.396802247)) +          /* c1 */\n\t      MULTIPLY(tmp1, FIX(1.260073511)) + tmp2 +   /* c3 */\n\t      MULTIPLY(tmp3, FIX(0.642039522)) +          /* c7 */\n\t      MULTIPLY(tmp4, FIX(0.221231742)),           /* c9 */\n\t      CONST_BITS-1);\n    tmp12 = MULTIPLY(tmp0 - tmp4, FIX(0.951056516)) -     /* (c3+c7)/2 */\n\t    MULTIPLY(tmp1 + tmp3, FIX(0.587785252));      /* (c1-c9)/2 */\n    tmp13 = MULTIPLY(tmp10 + tmp11, FIX(0.309016994)) +   /* (c3-c7)/2 */\n\t    (tmp11 << (CONST_BITS - 1)) - tmp2;\n    dataptr[3] = (DCTELEM) DESCALE(tmp12 + tmp13, CONST_BITS-1);\n    dataptr[7] = (DCTELEM) DESCALE(tmp12 - tmp13, CONST_BITS-1);\n\n    ctr++;\n\n    if (ctr != DCTSIZE) {\n      if (ctr == 10)\n\tbreak;\t\t\t/* Done. */\n      dataptr += DCTSIZE;\t/* advance pointer to next row */\n    } else\n      dataptr = workspace;\t/* switch pointer to extended workspace */\n  }\n\n  /* Pass 2: process columns.\n   * We leave the results scaled up by an overall factor of 8.\n   * We must also scale the output by (8/10)**2 = 16/25, which we partially\n   * fold into the constant multipliers and final/initial shifting:\n   * cK now represents sqrt(2) * cos(K*pi/20) * 32/25.\n   */\n\n  dataptr = data;\n  wsptr = workspace;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*1];\n    tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*0];\n    tmp12 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*7];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*6];\n    tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*5];\n\n    tmp10 = tmp0 + tmp4;\n    tmp13 = tmp0 - tmp4;\n    tmp11 = tmp1 + tmp3;\n    tmp14 = tmp1 - tmp3;\n\n    tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*1];\n    tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*0];\n    tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*7];\n    tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*6];\n    tmp4 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*5];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12, FIX(1.28)), /* 32/25 */\n\t      CONST_BITS+2);\n    tmp12 += tmp12;\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.464477191)) - /* c4 */\n\t      MULTIPLY(tmp11 - tmp12, FIX(0.559380511)),  /* c8 */\n\t      CONST_BITS+2);\n    tmp10 = MULTIPLY(tmp13 + tmp14, FIX(1.064004961));    /* c6 */\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp13, FIX(0.657591230)),  /* c2-c6 */\n\t      CONST_BITS+2);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp14, FIX(2.785601151)),  /* c2+c6 */\n\t      CONST_BITS+2);\n\n    /* Odd part */\n\n    tmp10 = tmp0 + tmp4;\n    tmp11 = tmp1 - tmp3;\n    dataptr[DCTSIZE*5] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp11 - tmp2, FIX(1.28)),  /* 32/25 */\n\t      CONST_BITS+2);\n    tmp2 = MULTIPLY(tmp2, FIX(1.28));                     /* 32/25 */\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0, FIX(1.787906876)) +          /* c1 */\n\t      MULTIPLY(tmp1, FIX(1.612894094)) + tmp2 +   /* c3 */\n\t      MULTIPLY(tmp3, FIX(0.821810588)) +          /* c7 */\n\t      MULTIPLY(tmp4, FIX(0.283176630)),           /* c9 */\n\t      CONST_BITS+2);\n    tmp12 = MULTIPLY(tmp0 - tmp4, FIX(1.217352341)) -     /* (c3+c7)/2 */\n\t    MULTIPLY(tmp1 + tmp3, FIX(0.752365123));      /* (c1-c9)/2 */\n    tmp13 = MULTIPLY(tmp10 + tmp11, FIX(0.395541753)) +   /* (c3-c7)/2 */\n\t    MULTIPLY(tmp11, FIX(0.64)) - tmp2;            /* 16/25 */\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp12 + tmp13, CONST_BITS+2);\n    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp12 - tmp13, CONST_BITS+2);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n    wsptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on an 11x11 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_11x11 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14;\n  INT32 z1, z2, z3;\n  DCTELEM workspace[8*3];\n  DCTELEM *dataptr;\n  DCTELEM *wsptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * we scale the results further by 2 as part of output adaption\n   * scaling for different DCT size.\n   * cK represents sqrt(2) * cos(K*pi/22).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (;;) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[10]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[9]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[8]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[7]);\n    tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[6]);\n    tmp5 = GETJSAMPLE(elemptr[5]);\n\n    tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[10]);\n    tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[9]);\n    tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[8]);\n    tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[7]);\n    tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[6]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 - 11 * CENTERJSAMPLE) << 1);\n    tmp5 += tmp5;\n    tmp0 -= tmp5;\n    tmp1 -= tmp5;\n    tmp2 -= tmp5;\n    tmp3 -= tmp5;\n    tmp4 -= tmp5;\n    z1 = MULTIPLY(tmp0 + tmp3, FIX(1.356927976)) +       /* c2 */\n\t MULTIPLY(tmp2 + tmp4, FIX(0.201263574));        /* c10 */\n    z2 = MULTIPLY(tmp1 - tmp3, FIX(0.926112931));        /* c6 */\n    z3 = MULTIPLY(tmp0 - tmp1, FIX(1.189712156));        /* c4 */\n    dataptr[2] = (DCTELEM)\n      DESCALE(z1 + z2 - MULTIPLY(tmp3, FIX(1.018300590)) /* c2+c8-c6 */\n\t      - MULTIPLY(tmp4, FIX(1.390975730)),        /* c4+c10 */\n\t      CONST_BITS-1);\n    dataptr[4] = (DCTELEM)\n      DESCALE(z2 + z3 + MULTIPLY(tmp1, FIX(0.062335650)) /* c4-c6-c10 */\n\t      - MULTIPLY(tmp2, FIX(1.356927976))         /* c2 */\n\t      + MULTIPLY(tmp4, FIX(0.587485545)),        /* c8 */\n\t      CONST_BITS-1);\n    dataptr[6] = (DCTELEM)\n      DESCALE(z1 + z3 - MULTIPLY(tmp0, FIX(1.620527200)) /* c2+c4-c6 */\n\t      - MULTIPLY(tmp2, FIX(0.788749120)),        /* c8+c10 */\n\t      CONST_BITS-1);\n\n    /* Odd part */\n\n    tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.286413905));    /* c3 */\n    tmp2 = MULTIPLY(tmp10 + tmp12, FIX(1.068791298));    /* c5 */\n    tmp3 = MULTIPLY(tmp10 + tmp13, FIX(0.764581576));    /* c7 */\n    tmp0 = tmp1 + tmp2 + tmp3 - MULTIPLY(tmp10, FIX(1.719967871)) /* c7+c5+c3-c1 */\n\t   + MULTIPLY(tmp14, FIX(0.398430003));          /* c9 */\n    tmp4 = MULTIPLY(tmp11 + tmp12, - FIX(0.764581576));  /* -c7 */\n    tmp5 = MULTIPLY(tmp11 + tmp13, - FIX(1.399818907));  /* -c1 */\n    tmp1 += tmp4 + tmp5 + MULTIPLY(tmp11, FIX(1.276416582)) /* c9+c7+c1-c3 */\n\t    - MULTIPLY(tmp14, FIX(1.068791298));         /* c5 */\n    tmp10 = MULTIPLY(tmp12 + tmp13, FIX(0.398430003));   /* c9 */\n    tmp2 += tmp4 + tmp10 - MULTIPLY(tmp12, FIX(1.989053629)) /* c9+c5+c3-c7 */\n\t    + MULTIPLY(tmp14, FIX(1.399818907));         /* c1 */\n    tmp3 += tmp5 + tmp10 + MULTIPLY(tmp13, FIX(1.305598626)) /* c1+c5-c9-c7 */\n\t    - MULTIPLY(tmp14, FIX(1.286413905));         /* c3 */\n\n    dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS-1);\n    dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS-1);\n    dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS-1);\n    dataptr[7] = (DCTELEM) DESCALE(tmp3, CONST_BITS-1);\n\n    ctr++;\n\n    if (ctr != DCTSIZE) {\n      if (ctr == 11)\n\tbreak;\t\t\t/* Done. */\n      dataptr += DCTSIZE;\t/* advance pointer to next row */\n    } else\n      dataptr = workspace;\t/* switch pointer to extended workspace */\n  }\n\n  /* Pass 2: process columns.\n   * We leave the results scaled up by an overall factor of 8.\n   * We must also scale the output by (8/11)**2 = 64/121, which we partially\n   * fold into the constant multipliers and final/initial shifting:\n   * cK now represents sqrt(2) * cos(K*pi/22) * 128/121.\n   */\n\n  dataptr = data;\n  wsptr = workspace;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*2];\n    tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*1];\n    tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*0];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*7];\n    tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*6];\n    tmp5 = dataptr[DCTSIZE*5];\n\n    tmp10 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*2];\n    tmp11 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*1];\n    tmp12 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*0];\n    tmp13 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*7];\n    tmp14 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*6];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5,\n\t\t       FIX(1.057851240)),                /* 128/121 */\n\t      CONST_BITS+2);\n    tmp5 += tmp5;\n    tmp0 -= tmp5;\n    tmp1 -= tmp5;\n    tmp2 -= tmp5;\n    tmp3 -= tmp5;\n    tmp4 -= tmp5;\n    z1 = MULTIPLY(tmp0 + tmp3, FIX(1.435427942)) +       /* c2 */\n\t MULTIPLY(tmp2 + tmp4, FIX(0.212906922));        /* c10 */\n    z2 = MULTIPLY(tmp1 - tmp3, FIX(0.979689713));        /* c6 */\n    z3 = MULTIPLY(tmp0 - tmp1, FIX(1.258538479));        /* c4 */\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(z1 + z2 - MULTIPLY(tmp3, FIX(1.077210542)) /* c2+c8-c6 */\n\t      - MULTIPLY(tmp4, FIX(1.471445400)),        /* c4+c10 */\n\t      CONST_BITS+2);\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(z2 + z3 + MULTIPLY(tmp1, FIX(0.065941844)) /* c4-c6-c10 */\n\t      - MULTIPLY(tmp2, FIX(1.435427942))         /* c2 */\n\t      + MULTIPLY(tmp4, FIX(0.621472312)),        /* c8 */\n\t      CONST_BITS+2);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      DESCALE(z1 + z3 - MULTIPLY(tmp0, FIX(1.714276708)) /* c2+c4-c6 */\n\t      - MULTIPLY(tmp2, FIX(0.834379234)),        /* c8+c10 */\n\t      CONST_BITS+2);\n\n    /* Odd part */\n\n    tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.360834544));    /* c3 */\n    tmp2 = MULTIPLY(tmp10 + tmp12, FIX(1.130622199));    /* c5 */\n    tmp3 = MULTIPLY(tmp10 + tmp13, FIX(0.808813568));    /* c7 */\n    tmp0 = tmp1 + tmp2 + tmp3 - MULTIPLY(tmp10, FIX(1.819470145)) /* c7+c5+c3-c1 */\n\t   + MULTIPLY(tmp14, FIX(0.421479672));          /* c9 */\n    tmp4 = MULTIPLY(tmp11 + tmp12, - FIX(0.808813568));  /* -c7 */\n    tmp5 = MULTIPLY(tmp11 + tmp13, - FIX(1.480800167));  /* -c1 */\n    tmp1 += tmp4 + tmp5 + MULTIPLY(tmp11, FIX(1.350258864)) /* c9+c7+c1-c3 */\n\t    - MULTIPLY(tmp14, FIX(1.130622199));         /* c5 */\n    tmp10 = MULTIPLY(tmp12 + tmp13, FIX(0.421479672));   /* c9 */\n    tmp2 += tmp4 + tmp10 - MULTIPLY(tmp12, FIX(2.104122847)) /* c9+c5+c3-c7 */\n\t    + MULTIPLY(tmp14, FIX(1.480800167));         /* c1 */\n    tmp3 += tmp5 + tmp10 + MULTIPLY(tmp13, FIX(1.381129125)) /* c1+c5-c9-c7 */\n\t    - MULTIPLY(tmp14, FIX(1.360834544));         /* c3 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+2);\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+2);\n    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+2);\n    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3, CONST_BITS+2);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n    wsptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 12x12 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_12x12 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;\n  DCTELEM workspace[8*4];\n  DCTELEM *dataptr;\n  DCTELEM *wsptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT.\n   * cK represents sqrt(2) * cos(K*pi/24).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (;;) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[11]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[10]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[9]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[8]);\n    tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[7]);\n    tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[6]);\n\n    tmp10 = tmp0 + tmp5;\n    tmp13 = tmp0 - tmp5;\n    tmp11 = tmp1 + tmp4;\n    tmp14 = tmp1 - tmp4;\n    tmp12 = tmp2 + tmp3;\n    tmp15 = tmp2 - tmp3;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[11]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[10]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[9]);\n    tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[8]);\n    tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]);\n    tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM) (tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE);\n    dataptr[6] = (DCTELEM) (tmp13 - tmp14 - tmp15);\n    dataptr[4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.224744871)), /* c4 */\n\t      CONST_BITS);\n    dataptr[2] = (DCTELEM)\n      DESCALE(tmp14 - tmp15 + MULTIPLY(tmp13 + tmp15, FIX(1.366025404)), /* c2 */\n\t      CONST_BITS);\n\n    /* Odd part */\n\n    tmp10 = MULTIPLY(tmp1 + tmp4, FIX_0_541196100);    /* c9 */\n    tmp14 = tmp10 + MULTIPLY(tmp1, FIX_0_765366865);   /* c3-c9 */\n    tmp15 = tmp10 - MULTIPLY(tmp4, FIX_1_847759065);   /* c3+c9 */\n    tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.121971054));   /* c5 */\n    tmp13 = MULTIPLY(tmp0 + tmp3, FIX(0.860918669));   /* c7 */\n    tmp10 = tmp12 + tmp13 + tmp14 - MULTIPLY(tmp0, FIX(0.580774953)) /* c5+c7-c1 */\n\t    + MULTIPLY(tmp5, FIX(0.184591911));        /* c11 */\n    tmp11 = MULTIPLY(tmp2 + tmp3, - FIX(0.184591911)); /* -c11 */\n    tmp12 += tmp11 - tmp15 - MULTIPLY(tmp2, FIX(2.339493912)) /* c1+c5-c11 */\n\t    + MULTIPLY(tmp5, FIX(0.860918669));        /* c7 */\n    tmp13 += tmp11 - tmp14 + MULTIPLY(tmp3, FIX(0.725788011)) /* c1+c11-c7 */\n\t    - MULTIPLY(tmp5, FIX(1.121971054));        /* c5 */\n    tmp11 = tmp15 + MULTIPLY(tmp0 - tmp3, FIX(1.306562965)) /* c3 */\n\t    - MULTIPLY(tmp2 + tmp5, FIX_0_541196100);  /* c9 */\n\n    dataptr[1] = (DCTELEM) DESCALE(tmp10, CONST_BITS);\n    dataptr[3] = (DCTELEM) DESCALE(tmp11, CONST_BITS);\n    dataptr[5] = (DCTELEM) DESCALE(tmp12, CONST_BITS);\n    dataptr[7] = (DCTELEM) DESCALE(tmp13, CONST_BITS);\n\n    ctr++;\n\n    if (ctr != DCTSIZE) {\n      if (ctr == 12)\n\tbreak;\t\t\t/* Done. */\n      dataptr += DCTSIZE;\t/* advance pointer to next row */\n    } else\n      dataptr = workspace;\t/* switch pointer to extended workspace */\n  }\n\n  /* Pass 2: process columns.\n   * We leave the results scaled up by an overall factor of 8.\n   * We must also scale the output by (8/12)**2 = 4/9, which we partially\n   * fold into the constant multipliers and final shifting:\n   * cK now represents sqrt(2) * cos(K*pi/24) * 8/9.\n   */\n\n  dataptr = data;\n  wsptr = workspace;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*3];\n    tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*2];\n    tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*1];\n    tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*0];\n    tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*7];\n    tmp5 = dataptr[DCTSIZE*5] + dataptr[DCTSIZE*6];\n\n    tmp10 = tmp0 + tmp5;\n    tmp13 = tmp0 - tmp5;\n    tmp11 = tmp1 + tmp4;\n    tmp14 = tmp1 - tmp4;\n    tmp12 = tmp2 + tmp3;\n    tmp15 = tmp2 - tmp3;\n\n    tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*3];\n    tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*2];\n    tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*1];\n    tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*0];\n    tmp4 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*7];\n    tmp5 = dataptr[DCTSIZE*5] - dataptr[DCTSIZE*6];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12, FIX(0.888888889)), /* 8/9 */\n\t      CONST_BITS+1);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp13 - tmp14 - tmp15, FIX(0.888888889)), /* 8/9 */\n\t      CONST_BITS+1);\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.088662108)),         /* c4 */\n\t      CONST_BITS+1);\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp14 - tmp15, FIX(0.888888889)) +        /* 8/9 */\n\t      MULTIPLY(tmp13 + tmp15, FIX(1.214244803)),         /* c2 */\n\t      CONST_BITS+1);\n\n    /* Odd part */\n\n    tmp10 = MULTIPLY(tmp1 + tmp4, FIX(0.481063200));   /* c9 */\n    tmp14 = tmp10 + MULTIPLY(tmp1, FIX(0.680326102));  /* c3-c9 */\n    tmp15 = tmp10 - MULTIPLY(tmp4, FIX(1.642452502));  /* c3+c9 */\n    tmp12 = MULTIPLY(tmp0 + tmp2, FIX(0.997307603));   /* c5 */\n    tmp13 = MULTIPLY(tmp0 + tmp3, FIX(0.765261039));   /* c7 */\n    tmp10 = tmp12 + tmp13 + tmp14 - MULTIPLY(tmp0, FIX(0.516244403)) /* c5+c7-c1 */\n\t    + MULTIPLY(tmp5, FIX(0.164081699));        /* c11 */\n    tmp11 = MULTIPLY(tmp2 + tmp3, - FIX(0.164081699)); /* -c11 */\n    tmp12 += tmp11 - tmp15 - MULTIPLY(tmp2, FIX(2.079550144)) /* c1+c5-c11 */\n\t    + MULTIPLY(tmp5, FIX(0.765261039));        /* c7 */\n    tmp13 += tmp11 - tmp14 + MULTIPLY(tmp3, FIX(0.645144899)) /* c1+c11-c7 */\n\t    - MULTIPLY(tmp5, FIX(0.997307603));        /* c5 */\n    tmp11 = tmp15 + MULTIPLY(tmp0 - tmp3, FIX(1.161389302)) /* c3 */\n\t    - MULTIPLY(tmp2 + tmp5, FIX(0.481063200)); /* c9 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10, CONST_BITS+1);\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp11, CONST_BITS+1);\n    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12, CONST_BITS+1);\n    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp13, CONST_BITS+1);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n    wsptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 13x13 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_13x13 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;\n  INT32 z1, z2;\n  DCTELEM workspace[8*5];\n  DCTELEM *dataptr;\n  DCTELEM *wsptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT.\n   * cK represents sqrt(2) * cos(K*pi/26).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (;;) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[12]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[11]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[10]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[9]);\n    tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[8]);\n    tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[7]);\n    tmp6 = GETJSAMPLE(elemptr[6]);\n\n    tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[12]);\n    tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[11]);\n    tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[10]);\n    tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[9]);\n    tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[8]);\n    tmp15 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[7]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      (tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 - 13 * CENTERJSAMPLE);\n    tmp6 += tmp6;\n    tmp0 -= tmp6;\n    tmp1 -= tmp6;\n    tmp2 -= tmp6;\n    tmp3 -= tmp6;\n    tmp4 -= tmp6;\n    tmp5 -= tmp6;\n    dataptr[2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0, FIX(1.373119086)) +   /* c2 */\n\t      MULTIPLY(tmp1, FIX(1.058554052)) +   /* c6 */\n\t      MULTIPLY(tmp2, FIX(0.501487041)) -   /* c10 */\n\t      MULTIPLY(tmp3, FIX(0.170464608)) -   /* c12 */\n\t      MULTIPLY(tmp4, FIX(0.803364869)) -   /* c8 */\n\t      MULTIPLY(tmp5, FIX(1.252223920)),    /* c4 */\n\t      CONST_BITS);\n    z1 = MULTIPLY(tmp0 - tmp2, FIX(1.155388986)) - /* (c4+c6)/2 */\n\t MULTIPLY(tmp3 - tmp4, FIX(0.435816023)) - /* (c2-c10)/2 */\n\t MULTIPLY(tmp1 - tmp5, FIX(0.316450131));  /* (c8-c12)/2 */\n    z2 = MULTIPLY(tmp0 + tmp2, FIX(0.096834934)) - /* (c4-c6)/2 */\n\t MULTIPLY(tmp3 + tmp4, FIX(0.937303064)) + /* (c2+c10)/2 */\n\t MULTIPLY(tmp1 + tmp5, FIX(0.486914739));  /* (c8+c12)/2 */\n\n    dataptr[4] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS);\n    dataptr[6] = (DCTELEM) DESCALE(z1 - z2, CONST_BITS);\n\n    /* Odd part */\n\n    tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.322312651));   /* c3 */\n    tmp2 = MULTIPLY(tmp10 + tmp12, FIX(1.163874945));   /* c5 */\n    tmp3 = MULTIPLY(tmp10 + tmp13, FIX(0.937797057)) +  /* c7 */\n\t   MULTIPLY(tmp14 + tmp15, FIX(0.338443458));   /* c11 */\n    tmp0 = tmp1 + tmp2 + tmp3 -\n\t   MULTIPLY(tmp10, FIX(2.020082300)) +          /* c3+c5+c7-c1 */\n\t   MULTIPLY(tmp14, FIX(0.318774355));           /* c9-c11 */\n    tmp4 = MULTIPLY(tmp14 - tmp15, FIX(0.937797057)) -  /* c7 */\n\t   MULTIPLY(tmp11 + tmp12, FIX(0.338443458));   /* c11 */\n    tmp5 = MULTIPLY(tmp11 + tmp13, - FIX(1.163874945)); /* -c5 */\n    tmp1 += tmp4 + tmp5 +\n\t    MULTIPLY(tmp11, FIX(0.837223564)) -         /* c5+c9+c11-c3 */\n\t    MULTIPLY(tmp14, FIX(2.341699410));          /* c1+c7 */\n    tmp6 = MULTIPLY(tmp12 + tmp13, - FIX(0.657217813)); /* -c9 */\n    tmp2 += tmp4 + tmp6 -\n\t    MULTIPLY(tmp12, FIX(1.572116027)) +         /* c1+c5-c9-c11 */\n\t    MULTIPLY(tmp15, FIX(2.260109708));          /* c3+c7 */\n    tmp3 += tmp5 + tmp6 +\n\t    MULTIPLY(tmp13, FIX(2.205608352)) -         /* c3+c5+c9-c7 */\n\t    MULTIPLY(tmp15, FIX(1.742345811));          /* c1+c11 */\n\n    dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS);\n    dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS);\n    dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS);\n    dataptr[7] = (DCTELEM) DESCALE(tmp3, CONST_BITS);\n\n    ctr++;\n\n    if (ctr != DCTSIZE) {\n      if (ctr == 13)\n\tbreak;\t\t\t/* Done. */\n      dataptr += DCTSIZE;\t/* advance pointer to next row */\n    } else\n      dataptr = workspace;\t/* switch pointer to extended workspace */\n  }\n\n  /* Pass 2: process columns.\n   * We leave the results scaled up by an overall factor of 8.\n   * We must also scale the output by (8/13)**2 = 64/169, which we partially\n   * fold into the constant multipliers and final shifting:\n   * cK now represents sqrt(2) * cos(K*pi/26) * 128/169.\n   */\n\n  dataptr = data;\n  wsptr = workspace;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*4];\n    tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*3];\n    tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*2];\n    tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*1];\n    tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*0];\n    tmp5 = dataptr[DCTSIZE*5] + dataptr[DCTSIZE*7];\n    tmp6 = dataptr[DCTSIZE*6];\n\n    tmp10 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*4];\n    tmp11 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*3];\n    tmp12 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*2];\n    tmp13 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*1];\n    tmp14 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*0];\n    tmp15 = dataptr[DCTSIZE*5] - dataptr[DCTSIZE*7];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6,\n\t\t       FIX(0.757396450)),          /* 128/169 */\n\t      CONST_BITS+1);\n    tmp6 += tmp6;\n    tmp0 -= tmp6;\n    tmp1 -= tmp6;\n    tmp2 -= tmp6;\n    tmp3 -= tmp6;\n    tmp4 -= tmp6;\n    tmp5 -= tmp6;\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0, FIX(1.039995521)) +   /* c2 */\n\t      MULTIPLY(tmp1, FIX(0.801745081)) +   /* c6 */\n\t      MULTIPLY(tmp2, FIX(0.379824504)) -   /* c10 */\n\t      MULTIPLY(tmp3, FIX(0.129109289)) -   /* c12 */\n\t      MULTIPLY(tmp4, FIX(0.608465700)) -   /* c8 */\n\t      MULTIPLY(tmp5, FIX(0.948429952)),    /* c4 */\n\t      CONST_BITS+1);\n    z1 = MULTIPLY(tmp0 - tmp2, FIX(0.875087516)) - /* (c4+c6)/2 */\n\t MULTIPLY(tmp3 - tmp4, FIX(0.330085509)) - /* (c2-c10)/2 */\n\t MULTIPLY(tmp1 - tmp5, FIX(0.239678205));  /* (c8-c12)/2 */\n    z2 = MULTIPLY(tmp0 + tmp2, FIX(0.073342435)) - /* (c4-c6)/2 */\n\t MULTIPLY(tmp3 + tmp4, FIX(0.709910013)) + /* (c2+c10)/2 */\n\t MULTIPLY(tmp1 + tmp5, FIX(0.368787494));  /* (c8+c12)/2 */\n\n    dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS+1);\n    dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 - z2, CONST_BITS+1);\n\n    /* Odd part */\n\n    tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.001514908));   /* c3 */\n    tmp2 = MULTIPLY(tmp10 + tmp12, FIX(0.881514751));   /* c5 */\n    tmp3 = MULTIPLY(tmp10 + tmp13, FIX(0.710284161)) +  /* c7 */\n\t   MULTIPLY(tmp14 + tmp15, FIX(0.256335874));   /* c11 */\n    tmp0 = tmp1 + tmp2 + tmp3 -\n\t   MULTIPLY(tmp10, FIX(1.530003162)) +          /* c3+c5+c7-c1 */\n\t   MULTIPLY(tmp14, FIX(0.241438564));           /* c9-c11 */\n    tmp4 = MULTIPLY(tmp14 - tmp15, FIX(0.710284161)) -  /* c7 */\n\t   MULTIPLY(tmp11 + tmp12, FIX(0.256335874));   /* c11 */\n    tmp5 = MULTIPLY(tmp11 + tmp13, - FIX(0.881514751)); /* -c5 */\n    tmp1 += tmp4 + tmp5 +\n\t    MULTIPLY(tmp11, FIX(0.634110155)) -         /* c5+c9+c11-c3 */\n\t    MULTIPLY(tmp14, FIX(1.773594819));          /* c1+c7 */\n    tmp6 = MULTIPLY(tmp12 + tmp13, - FIX(0.497774438)); /* -c9 */\n    tmp2 += tmp4 + tmp6 -\n\t    MULTIPLY(tmp12, FIX(1.190715098)) +         /* c1+c5-c9-c11 */\n\t    MULTIPLY(tmp15, FIX(1.711799069));          /* c3+c7 */\n    tmp3 += tmp5 + tmp6 +\n\t    MULTIPLY(tmp13, FIX(1.670519935)) -         /* c3+c5+c9-c7 */\n\t    MULTIPLY(tmp15, FIX(1.319646532));          /* c1+c11 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+1);\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+1);\n    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+1);\n    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3, CONST_BITS+1);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n    wsptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 14x14 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_14x14 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;\n  DCTELEM workspace[8*6];\n  DCTELEM *dataptr;\n  DCTELEM *wsptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT.\n   * cK represents sqrt(2) * cos(K*pi/28).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (;;) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[13]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[12]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[11]);\n    tmp13 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[10]);\n    tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[9]);\n    tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[8]);\n    tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[7]);\n\n    tmp10 = tmp0 + tmp6;\n    tmp14 = tmp0 - tmp6;\n    tmp11 = tmp1 + tmp5;\n    tmp15 = tmp1 - tmp5;\n    tmp12 = tmp2 + tmp4;\n    tmp16 = tmp2 - tmp4;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[13]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[12]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[11]);\n    tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[10]);\n    tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[9]);\n    tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]);\n    tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      (tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE);\n    tmp13 += tmp13;\n    dataptr[4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.274162392)) + /* c4 */\n\t      MULTIPLY(tmp11 - tmp13, FIX(0.314692123)) - /* c12 */\n\t      MULTIPLY(tmp12 - tmp13, FIX(0.881747734)),  /* c8 */\n\t      CONST_BITS);\n\n    tmp10 = MULTIPLY(tmp14 + tmp15, FIX(1.105676686));    /* c6 */\n\n    dataptr[2] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp14, FIX(0.273079590))   /* c2-c6 */\n\t      + MULTIPLY(tmp16, FIX(0.613604268)),        /* c10 */\n\t      CONST_BITS);\n    dataptr[6] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp15, FIX(1.719280954))   /* c6+c10 */\n\t      - MULTIPLY(tmp16, FIX(1.378756276)),        /* c2 */\n\t      CONST_BITS);\n\n    /* Odd part */\n\n    tmp10 = tmp1 + tmp2;\n    tmp11 = tmp5 - tmp4;\n    dataptr[7] = (DCTELEM) (tmp0 - tmp10 + tmp3 - tmp11 - tmp6);\n    tmp3 <<= CONST_BITS;\n    tmp10 = MULTIPLY(tmp10, - FIX(0.158341681));          /* -c13 */\n    tmp11 = MULTIPLY(tmp11, FIX(1.405321284));            /* c1 */\n    tmp10 += tmp11 - tmp3;\n    tmp11 = MULTIPLY(tmp0 + tmp2, FIX(1.197448846)) +     /* c5 */\n\t    MULTIPLY(tmp4 + tmp6, FIX(0.752406978));      /* c9 */\n    dataptr[5] = (DCTELEM)\n      DESCALE(tmp10 + tmp11 - MULTIPLY(tmp2, FIX(2.373959773)) /* c3+c5-c13 */\n\t      + MULTIPLY(tmp4, FIX(1.119999435)),         /* c1+c11-c9 */\n\t      CONST_BITS);\n    tmp12 = MULTIPLY(tmp0 + tmp1, FIX(1.334852607)) +     /* c3 */\n\t    MULTIPLY(tmp5 - tmp6, FIX(0.467085129));      /* c11 */\n    dataptr[3] = (DCTELEM)\n      DESCALE(tmp10 + tmp12 - MULTIPLY(tmp1, FIX(0.424103948)) /* c3-c9-c13 */\n\t      - MULTIPLY(tmp5, FIX(3.069855259)),         /* c1+c5+c11 */\n\t      CONST_BITS);\n    dataptr[1] = (DCTELEM)\n      DESCALE(tmp11 + tmp12 + tmp3 + tmp6 -\n\t      MULTIPLY(tmp0 + tmp6, FIX(1.126980169)),    /* c3+c5-c1 */\n\t      CONST_BITS);\n\n    ctr++;\n\n    if (ctr != DCTSIZE) {\n      if (ctr == 14)\n\tbreak;\t\t\t/* Done. */\n      dataptr += DCTSIZE;\t/* advance pointer to next row */\n    } else\n      dataptr = workspace;\t/* switch pointer to extended workspace */\n  }\n\n  /* Pass 2: process columns.\n   * We leave the results scaled up by an overall factor of 8.\n   * We must also scale the output by (8/14)**2 = 16/49, which we partially\n   * fold into the constant multipliers and final shifting:\n   * cK now represents sqrt(2) * cos(K*pi/28) * 32/49.\n   */\n\n  dataptr = data;\n  wsptr = workspace;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*5];\n    tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*4];\n    tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*3];\n    tmp13 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*2];\n    tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*1];\n    tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*0];\n    tmp6 = dataptr[DCTSIZE*6] + dataptr[DCTSIZE*7];\n\n    tmp10 = tmp0 + tmp6;\n    tmp14 = tmp0 - tmp6;\n    tmp11 = tmp1 + tmp5;\n    tmp15 = tmp1 - tmp5;\n    tmp12 = tmp2 + tmp4;\n    tmp16 = tmp2 - tmp4;\n\n    tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*5];\n    tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*4];\n    tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*3];\n    tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*2];\n    tmp4 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*1];\n    tmp5 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*0];\n    tmp6 = dataptr[DCTSIZE*6] - dataptr[DCTSIZE*7];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12 + tmp13,\n\t\t       FIX(0.653061224)),                 /* 32/49 */\n\t      CONST_BITS+1);\n    tmp13 += tmp13;\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp13, FIX(0.832106052)) + /* c4 */\n\t      MULTIPLY(tmp11 - tmp13, FIX(0.205513223)) - /* c12 */\n\t      MULTIPLY(tmp12 - tmp13, FIX(0.575835255)),  /* c8 */\n\t      CONST_BITS+1);\n\n    tmp10 = MULTIPLY(tmp14 + tmp15, FIX(0.722074570));    /* c6 */\n\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp14, FIX(0.178337691))   /* c2-c6 */\n\t      + MULTIPLY(tmp16, FIX(0.400721155)),        /* c10 */\n\t      CONST_BITS+1);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp15, FIX(1.122795725))   /* c6+c10 */\n\t      - MULTIPLY(tmp16, FIX(0.900412262)),        /* c2 */\n\t      CONST_BITS+1);\n\n    /* Odd part */\n\n    tmp10 = tmp1 + tmp2;\n    tmp11 = tmp5 - tmp4;\n    dataptr[DCTSIZE*7] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 - tmp10 + tmp3 - tmp11 - tmp6,\n\t\t       FIX(0.653061224)),                 /* 32/49 */\n\t      CONST_BITS+1);\n    tmp3  = MULTIPLY(tmp3 , FIX(0.653061224));            /* 32/49 */\n    tmp10 = MULTIPLY(tmp10, - FIX(0.103406812));          /* -c13 */\n    tmp11 = MULTIPLY(tmp11, FIX(0.917760839));            /* c1 */\n    tmp10 += tmp11 - tmp3;\n    tmp11 = MULTIPLY(tmp0 + tmp2, FIX(0.782007410)) +     /* c5 */\n\t    MULTIPLY(tmp4 + tmp6, FIX(0.491367823));      /* c9 */\n    dataptr[DCTSIZE*5] = (DCTELEM)\n      DESCALE(tmp10 + tmp11 - MULTIPLY(tmp2, FIX(1.550341076)) /* c3+c5-c13 */\n\t      + MULTIPLY(tmp4, FIX(0.731428202)),         /* c1+c11-c9 */\n\t      CONST_BITS+1);\n    tmp12 = MULTIPLY(tmp0 + tmp1, FIX(0.871740478)) +     /* c3 */\n\t    MULTIPLY(tmp5 - tmp6, FIX(0.305035186));      /* c11 */\n    dataptr[DCTSIZE*3] = (DCTELEM)\n      DESCALE(tmp10 + tmp12 - MULTIPLY(tmp1, FIX(0.276965844)) /* c3-c9-c13 */\n\t      - MULTIPLY(tmp5, FIX(2.004803435)),         /* c1+c5+c11 */\n\t      CONST_BITS+1);\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      DESCALE(tmp11 + tmp12 + tmp3\n\t      - MULTIPLY(tmp0, FIX(0.735987049))          /* c3+c5-c1 */\n\t      - MULTIPLY(tmp6, FIX(0.082925825)),         /* c9-c11-c13 */\n\t      CONST_BITS+1);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n    wsptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 15x15 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_15x15 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;\n  INT32 z1, z2, z3;\n  DCTELEM workspace[8*7];\n  DCTELEM *dataptr;\n  DCTELEM *wsptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT.\n   * cK represents sqrt(2) * cos(K*pi/30).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (;;) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[14]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[13]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[12]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[11]);\n    tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[10]);\n    tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[9]);\n    tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[8]);\n    tmp7 = GETJSAMPLE(elemptr[7]);\n\n    tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[14]);\n    tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[13]);\n    tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[12]);\n    tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[11]);\n    tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[10]);\n    tmp15 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[9]);\n    tmp16 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[8]);\n\n    z1 = tmp0 + tmp4 + tmp5;\n    z2 = tmp1 + tmp3 + tmp6;\n    z3 = tmp2 + tmp7;\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM) (z1 + z2 + z3 - 15 * CENTERJSAMPLE);\n    z3 += z3;\n    dataptr[6] = (DCTELEM)\n      DESCALE(MULTIPLY(z1 - z3, FIX(1.144122806)) - /* c6 */\n\t      MULTIPLY(z2 - z3, FIX(0.437016024)),  /* c12 */\n\t      CONST_BITS);\n    tmp2 += ((tmp1 + tmp4) >> 1) - tmp7 - tmp7;\n    z1 = MULTIPLY(tmp3 - tmp2, FIX(1.531135173)) -  /* c2+c14 */\n         MULTIPLY(tmp6 - tmp2, FIX(2.238241955));   /* c4+c8 */\n    z2 = MULTIPLY(tmp5 - tmp2, FIX(0.798468008)) -  /* c8-c14 */\n\t MULTIPLY(tmp0 - tmp2, FIX(0.091361227));   /* c2-c4 */\n    z3 = MULTIPLY(tmp0 - tmp3, FIX(1.383309603)) +  /* c2 */\n\t MULTIPLY(tmp6 - tmp5, FIX(0.946293579)) +  /* c8 */\n\t MULTIPLY(tmp1 - tmp4, FIX(0.790569415));   /* (c6+c12)/2 */\n\n    dataptr[2] = (DCTELEM) DESCALE(z1 + z3, CONST_BITS);\n    dataptr[4] = (DCTELEM) DESCALE(z2 + z3, CONST_BITS);\n\n    /* Odd part */\n\n    tmp2 = MULTIPLY(tmp10 - tmp12 - tmp13 + tmp15 + tmp16,\n\t\t    FIX(1.224744871));                         /* c5 */\n    tmp1 = MULTIPLY(tmp10 - tmp14 - tmp15, FIX(1.344997024)) + /* c3 */\n\t   MULTIPLY(tmp11 - tmp13 - tmp16, FIX(0.831253876));  /* c9 */\n    tmp12 = MULTIPLY(tmp12, FIX(1.224744871));                 /* c5 */\n    tmp4 = MULTIPLY(tmp10 - tmp16, FIX(1.406466353)) +         /* c1 */\n\t   MULTIPLY(tmp11 + tmp14, FIX(1.344997024)) +         /* c3 */\n\t   MULTIPLY(tmp13 + tmp15, FIX(0.575212477));          /* c11 */\n    tmp0 = MULTIPLY(tmp13, FIX(0.475753014)) -                 /* c7-c11 */\n\t   MULTIPLY(tmp14, FIX(0.513743148)) +                 /* c3-c9 */\n\t   MULTIPLY(tmp16, FIX(1.700497885)) + tmp4 + tmp12;   /* c1+c13 */\n    tmp3 = MULTIPLY(tmp10, - FIX(0.355500862)) -               /* -(c1-c7) */\n\t   MULTIPLY(tmp11, FIX(2.176250899)) -                 /* c3+c9 */\n\t   MULTIPLY(tmp15, FIX(0.869244010)) + tmp4 - tmp12;   /* c11+c13 */\n\n    dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS);\n    dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS);\n    dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS);\n    dataptr[7] = (DCTELEM) DESCALE(tmp3, CONST_BITS);\n\n    ctr++;\n\n    if (ctr != DCTSIZE) {\n      if (ctr == 15)\n\tbreak;\t\t\t/* Done. */\n      dataptr += DCTSIZE;\t/* advance pointer to next row */\n    } else\n      dataptr = workspace;\t/* switch pointer to extended workspace */\n  }\n\n  /* Pass 2: process columns.\n   * We leave the results scaled up by an overall factor of 8.\n   * We must also scale the output by (8/15)**2 = 64/225, which we partially\n   * fold into the constant multipliers and final shifting:\n   * cK now represents sqrt(2) * cos(K*pi/30) * 256/225.\n   */\n\n  dataptr = data;\n  wsptr = workspace;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*6];\n    tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*5];\n    tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*4];\n    tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*3];\n    tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*2];\n    tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*1];\n    tmp6 = dataptr[DCTSIZE*6] + wsptr[DCTSIZE*0];\n    tmp7 = dataptr[DCTSIZE*7];\n\n    tmp10 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*6];\n    tmp11 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*5];\n    tmp12 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*4];\n    tmp13 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*3];\n    tmp14 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*2];\n    tmp15 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*1];\n    tmp16 = dataptr[DCTSIZE*6] - wsptr[DCTSIZE*0];\n\n    z1 = tmp0 + tmp4 + tmp5;\n    z2 = tmp1 + tmp3 + tmp6;\n    z3 = tmp2 + tmp7;\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(z1 + z2 + z3, FIX(1.137777778)), /* 256/225 */\n\t      CONST_BITS+2);\n    z3 += z3;\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      DESCALE(MULTIPLY(z1 - z3, FIX(1.301757503)) - /* c6 */\n\t      MULTIPLY(z2 - z3, FIX(0.497227121)),  /* c12 */\n\t      CONST_BITS+2);\n    tmp2 += ((tmp1 + tmp4) >> 1) - tmp7 - tmp7;\n    z1 = MULTIPLY(tmp3 - tmp2, FIX(1.742091575)) -  /* c2+c14 */\n         MULTIPLY(tmp6 - tmp2, FIX(2.546621957));   /* c4+c8 */\n    z2 = MULTIPLY(tmp5 - tmp2, FIX(0.908479156)) -  /* c8-c14 */\n\t MULTIPLY(tmp0 - tmp2, FIX(0.103948774));   /* c2-c4 */\n    z3 = MULTIPLY(tmp0 - tmp3, FIX(1.573898926)) +  /* c2 */\n\t MULTIPLY(tmp6 - tmp5, FIX(1.076671805)) +  /* c8 */\n\t MULTIPLY(tmp1 - tmp4, FIX(0.899492312));   /* (c6+c12)/2 */\n\n    dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + z3, CONST_BITS+2);\n    dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(z2 + z3, CONST_BITS+2);\n\n    /* Odd part */\n\n    tmp2 = MULTIPLY(tmp10 - tmp12 - tmp13 + tmp15 + tmp16,\n\t\t    FIX(1.393487498));                         /* c5 */\n    tmp1 = MULTIPLY(tmp10 - tmp14 - tmp15, FIX(1.530307725)) + /* c3 */\n\t   MULTIPLY(tmp11 - tmp13 - tmp16, FIX(0.945782187));  /* c9 */\n    tmp12 = MULTIPLY(tmp12, FIX(1.393487498));                 /* c5 */\n    tmp4 = MULTIPLY(tmp10 - tmp16, FIX(1.600246161)) +         /* c1 */\n\t   MULTIPLY(tmp11 + tmp14, FIX(1.530307725)) +         /* c3 */\n\t   MULTIPLY(tmp13 + tmp15, FIX(0.654463974));          /* c11 */\n    tmp0 = MULTIPLY(tmp13, FIX(0.541301207)) -                 /* c7-c11 */\n\t   MULTIPLY(tmp14, FIX(0.584525538)) +                 /* c3-c9 */\n\t   MULTIPLY(tmp16, FIX(1.934788705)) + tmp4 + tmp12;   /* c1+c13 */\n    tmp3 = MULTIPLY(tmp10, - FIX(0.404480980)) -               /* -(c1-c7) */\n\t   MULTIPLY(tmp11, FIX(2.476089912)) -                 /* c3+c9 */\n\t   MULTIPLY(tmp15, FIX(0.989006518)) + tmp4 - tmp12;   /* c11+c13 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+2);\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+2);\n    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+2);\n    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3, CONST_BITS+2);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n    wsptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 16x16 sample block.\n */\n\nGLOBAL(void)\njpeg_fdct_16x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16, tmp17;\n  DCTELEM workspace[DCTSIZE2];\n  DCTELEM *dataptr;\n  DCTELEM *wsptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * cK represents sqrt(2) * cos(K*pi/32).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (;;) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[15]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[14]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[13]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[12]);\n    tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[11]);\n    tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[10]);\n    tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[9]);\n    tmp7 = GETJSAMPLE(elemptr[7]) + GETJSAMPLE(elemptr[8]);\n\n    tmp10 = tmp0 + tmp7;\n    tmp14 = tmp0 - tmp7;\n    tmp11 = tmp1 + tmp6;\n    tmp15 = tmp1 - tmp6;\n    tmp12 = tmp2 + tmp5;\n    tmp16 = tmp2 - tmp5;\n    tmp13 = tmp3 + tmp4;\n    tmp17 = tmp3 - tmp4;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[15]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[14]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[13]);\n    tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[12]);\n    tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[11]);\n    tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[10]);\n    tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]);\n    tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS);\n    dataptr[4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.306562965)) + /* c4[16] = c2[8] */\n\t      MULTIPLY(tmp11 - tmp12, FIX_0_541196100),   /* c12[16] = c6[8] */\n\t      CONST_BITS-PASS1_BITS);\n\n    tmp10 = MULTIPLY(tmp17 - tmp15, FIX(0.275899379)) +   /* c14[16] = c7[8] */\n\t    MULTIPLY(tmp14 - tmp16, FIX(1.387039845));    /* c2[16] = c1[8] */\n\n    dataptr[2] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp15, FIX(1.451774982))   /* c6+c14 */\n\t      + MULTIPLY(tmp16, FIX(2.172734804)),        /* c2+c10 */\n\t      CONST_BITS-PASS1_BITS);\n    dataptr[6] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp14, FIX(0.211164243))   /* c2-c6 */\n\t      - MULTIPLY(tmp17, FIX(1.061594338)),        /* c10+c14 */\n\t      CONST_BITS-PASS1_BITS);\n\n    /* Odd part */\n\n    tmp11 = MULTIPLY(tmp0 + tmp1, FIX(1.353318001)) +         /* c3 */\n\t    MULTIPLY(tmp6 - tmp7, FIX(0.410524528));          /* c13 */\n    tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.247225013)) +         /* c5 */\n\t    MULTIPLY(tmp5 + tmp7, FIX(0.666655658));          /* c11 */\n    tmp13 = MULTIPLY(tmp0 + tmp3, FIX(1.093201867)) +         /* c7 */\n\t    MULTIPLY(tmp4 - tmp7, FIX(0.897167586));          /* c9 */\n    tmp14 = MULTIPLY(tmp1 + tmp2, FIX(0.138617169)) +         /* c15 */\n\t    MULTIPLY(tmp6 - tmp5, FIX(1.407403738));          /* c1 */\n    tmp15 = MULTIPLY(tmp1 + tmp3, - FIX(0.666655658)) +       /* -c11 */\n\t    MULTIPLY(tmp4 + tmp6, - FIX(1.247225013));        /* -c5 */\n    tmp16 = MULTIPLY(tmp2 + tmp3, - FIX(1.353318001)) +       /* -c3 */\n\t    MULTIPLY(tmp5 - tmp4, FIX(0.410524528));          /* c13 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n\t    MULTIPLY(tmp0, FIX(2.286341144)) +                /* c7+c5+c3-c1 */\n\t    MULTIPLY(tmp7, FIX(0.779653625));                 /* c15+c13-c11+c9 */\n    tmp11 += tmp14 + tmp15 + MULTIPLY(tmp1, FIX(0.071888074)) /* c9-c3-c15+c11 */\n\t     - MULTIPLY(tmp6, FIX(1.663905119));              /* c7+c13+c1-c5 */\n    tmp12 += tmp14 + tmp16 - MULTIPLY(tmp2, FIX(1.125726048)) /* c7+c5+c15-c3 */\n\t     + MULTIPLY(tmp5, FIX(1.227391138));              /* c9-c11+c1-c13 */\n    tmp13 += tmp15 + tmp16 + MULTIPLY(tmp3, FIX(1.065388962)) /* c15+c3+c11-c7 */\n\t     + MULTIPLY(tmp4, FIX(2.167985692));              /* c1+c13+c5-c9 */\n\n    dataptr[1] = (DCTELEM) DESCALE(tmp10, CONST_BITS-PASS1_BITS);\n    dataptr[3] = (DCTELEM) DESCALE(tmp11, CONST_BITS-PASS1_BITS);\n    dataptr[5] = (DCTELEM) DESCALE(tmp12, CONST_BITS-PASS1_BITS);\n    dataptr[7] = (DCTELEM) DESCALE(tmp13, CONST_BITS-PASS1_BITS);\n\n    ctr++;\n\n    if (ctr != DCTSIZE) {\n      if (ctr == DCTSIZE * 2)\n\tbreak;\t\t\t/* Done. */\n      dataptr += DCTSIZE;\t/* advance pointer to next row */\n    } else\n      dataptr = workspace;\t/* switch pointer to extended workspace */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/16)**2 = 1/2**2.\n   * cK represents sqrt(2) * cos(K*pi/32).\n   */\n\n  dataptr = data;\n  wsptr = workspace;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*4];\n    tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*3];\n    tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*2];\n    tmp6 = dataptr[DCTSIZE*6] + wsptr[DCTSIZE*1];\n    tmp7 = dataptr[DCTSIZE*7] + wsptr[DCTSIZE*0];\n\n    tmp10 = tmp0 + tmp7;\n    tmp14 = tmp0 - tmp7;\n    tmp11 = tmp1 + tmp6;\n    tmp15 = tmp1 - tmp6;\n    tmp12 = tmp2 + tmp5;\n    tmp16 = tmp2 - tmp5;\n    tmp13 = tmp3 + tmp4;\n    tmp17 = tmp3 - tmp4;\n\n    tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*4];\n    tmp4 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*3];\n    tmp5 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*2];\n    tmp6 = dataptr[DCTSIZE*6] - wsptr[DCTSIZE*1];\n    tmp7 = dataptr[DCTSIZE*7] - wsptr[DCTSIZE*0];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(tmp10 + tmp11 + tmp12 + tmp13, PASS1_BITS+2);\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.306562965)) + /* c4[16] = c2[8] */\n\t      MULTIPLY(tmp11 - tmp12, FIX_0_541196100),   /* c12[16] = c6[8] */\n\t      CONST_BITS+PASS1_BITS+2);\n\n    tmp10 = MULTIPLY(tmp17 - tmp15, FIX(0.275899379)) +   /* c14[16] = c7[8] */\n\t    MULTIPLY(tmp14 - tmp16, FIX(1.387039845));    /* c2[16] = c1[8] */\n\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp15, FIX(1.451774982))   /* c6+c14 */\n\t      + MULTIPLY(tmp16, FIX(2.172734804)),        /* c2+10 */\n\t      CONST_BITS+PASS1_BITS+2);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp14, FIX(0.211164243))   /* c2-c6 */\n\t      - MULTIPLY(tmp17, FIX(1.061594338)),        /* c10+c14 */\n\t      CONST_BITS+PASS1_BITS+2);\n\n    /* Odd part */\n\n    tmp11 = MULTIPLY(tmp0 + tmp1, FIX(1.353318001)) +         /* c3 */\n\t    MULTIPLY(tmp6 - tmp7, FIX(0.410524528));          /* c13 */\n    tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.247225013)) +         /* c5 */\n\t    MULTIPLY(tmp5 + tmp7, FIX(0.666655658));          /* c11 */\n    tmp13 = MULTIPLY(tmp0 + tmp3, FIX(1.093201867)) +         /* c7 */\n\t    MULTIPLY(tmp4 - tmp7, FIX(0.897167586));          /* c9 */\n    tmp14 = MULTIPLY(tmp1 + tmp2, FIX(0.138617169)) +         /* c15 */\n\t    MULTIPLY(tmp6 - tmp5, FIX(1.407403738));          /* c1 */\n    tmp15 = MULTIPLY(tmp1 + tmp3, - FIX(0.666655658)) +       /* -c11 */\n\t    MULTIPLY(tmp4 + tmp6, - FIX(1.247225013));        /* -c5 */\n    tmp16 = MULTIPLY(tmp2 + tmp3, - FIX(1.353318001)) +       /* -c3 */\n\t    MULTIPLY(tmp5 - tmp4, FIX(0.410524528));          /* c13 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n\t    MULTIPLY(tmp0, FIX(2.286341144)) +                /* c7+c5+c3-c1 */\n\t    MULTIPLY(tmp7, FIX(0.779653625));                 /* c15+c13-c11+c9 */\n    tmp11 += tmp14 + tmp15 + MULTIPLY(tmp1, FIX(0.071888074)) /* c9-c3-c15+c11 */\n\t     - MULTIPLY(tmp6, FIX(1.663905119));              /* c7+c13+c1-c5 */\n    tmp12 += tmp14 + tmp16 - MULTIPLY(tmp2, FIX(1.125726048)) /* c7+c5+c15-c3 */\n\t     + MULTIPLY(tmp5, FIX(1.227391138));              /* c9-c11+c1-c13 */\n    tmp13 += tmp15 + tmp16 + MULTIPLY(tmp3, FIX(1.065388962)) /* c15+c3+c11-c7 */\n\t     + MULTIPLY(tmp4, FIX(2.167985692));              /* c1+c13+c5-c9 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10, CONST_BITS+PASS1_BITS+2);\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp11, CONST_BITS+PASS1_BITS+2);\n    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12, CONST_BITS+PASS1_BITS+2);\n    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp13, CONST_BITS+PASS1_BITS+2);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n    wsptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 16x8 sample block.\n *\n * 16-point FDCT in pass 1 (rows), 8-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_16x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16, tmp17;\n  INT32 z1;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * 16-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/32).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[15]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[14]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[13]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[12]);\n    tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[11]);\n    tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[10]);\n    tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[9]);\n    tmp7 = GETJSAMPLE(elemptr[7]) + GETJSAMPLE(elemptr[8]);\n\n    tmp10 = tmp0 + tmp7;\n    tmp14 = tmp0 - tmp7;\n    tmp11 = tmp1 + tmp6;\n    tmp15 = tmp1 - tmp6;\n    tmp12 = tmp2 + tmp5;\n    tmp16 = tmp2 - tmp5;\n    tmp13 = tmp3 + tmp4;\n    tmp17 = tmp3 - tmp4;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[15]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[14]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[13]);\n    tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[12]);\n    tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[11]);\n    tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[10]);\n    tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]);\n    tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS);\n    dataptr[4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.306562965)) + /* c4[16] = c2[8] */\n\t      MULTIPLY(tmp11 - tmp12, FIX_0_541196100),   /* c12[16] = c6[8] */\n\t      CONST_BITS-PASS1_BITS);\n\n    tmp10 = MULTIPLY(tmp17 - tmp15, FIX(0.275899379)) +   /* c14[16] = c7[8] */\n\t    MULTIPLY(tmp14 - tmp16, FIX(1.387039845));    /* c2[16] = c1[8] */\n\n    dataptr[2] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp15, FIX(1.451774982))   /* c6+c14 */\n\t      + MULTIPLY(tmp16, FIX(2.172734804)),        /* c2+c10 */\n\t      CONST_BITS-PASS1_BITS);\n    dataptr[6] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp14, FIX(0.211164243))   /* c2-c6 */\n\t      - MULTIPLY(tmp17, FIX(1.061594338)),        /* c10+c14 */\n\t      CONST_BITS-PASS1_BITS);\n\n    /* Odd part */\n\n    tmp11 = MULTIPLY(tmp0 + tmp1, FIX(1.353318001)) +         /* c3 */\n\t    MULTIPLY(tmp6 - tmp7, FIX(0.410524528));          /* c13 */\n    tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.247225013)) +         /* c5 */\n\t    MULTIPLY(tmp5 + tmp7, FIX(0.666655658));          /* c11 */\n    tmp13 = MULTIPLY(tmp0 + tmp3, FIX(1.093201867)) +         /* c7 */\n\t    MULTIPLY(tmp4 - tmp7, FIX(0.897167586));          /* c9 */\n    tmp14 = MULTIPLY(tmp1 + tmp2, FIX(0.138617169)) +         /* c15 */\n\t    MULTIPLY(tmp6 - tmp5, FIX(1.407403738));          /* c1 */\n    tmp15 = MULTIPLY(tmp1 + tmp3, - FIX(0.666655658)) +       /* -c11 */\n\t    MULTIPLY(tmp4 + tmp6, - FIX(1.247225013));        /* -c5 */\n    tmp16 = MULTIPLY(tmp2 + tmp3, - FIX(1.353318001)) +       /* -c3 */\n\t    MULTIPLY(tmp5 - tmp4, FIX(0.410524528));          /* c13 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n\t    MULTIPLY(tmp0, FIX(2.286341144)) +                /* c7+c5+c3-c1 */\n\t    MULTIPLY(tmp7, FIX(0.779653625));                 /* c15+c13-c11+c9 */\n    tmp11 += tmp14 + tmp15 + MULTIPLY(tmp1, FIX(0.071888074)) /* c9-c3-c15+c11 */\n\t     - MULTIPLY(tmp6, FIX(1.663905119));              /* c7+c13+c1-c5 */\n    tmp12 += tmp14 + tmp16 - MULTIPLY(tmp2, FIX(1.125726048)) /* c7+c5+c15-c3 */\n\t     + MULTIPLY(tmp5, FIX(1.227391138));              /* c9-c11+c1-c13 */\n    tmp13 += tmp15 + tmp16 + MULTIPLY(tmp3, FIX(1.065388962)) /* c15+c3+c11-c7 */\n\t     + MULTIPLY(tmp4, FIX(2.167985692));              /* c1+c13+c5-c9 */\n\n    dataptr[1] = (DCTELEM) DESCALE(tmp10, CONST_BITS-PASS1_BITS);\n    dataptr[3] = (DCTELEM) DESCALE(tmp11, CONST_BITS-PASS1_BITS);\n    dataptr[5] = (DCTELEM) DESCALE(tmp12, CONST_BITS-PASS1_BITS);\n    dataptr[7] = (DCTELEM) DESCALE(tmp13, CONST_BITS-PASS1_BITS);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by 8/16 = 1/2.\n   * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16).\n   */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part per LL&M figure 1 --- note that published figure is faulty;\n     * rotator \"c1\" should be \"c6\".\n     */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];\n\n    tmp10 = tmp0 + tmp3;\n    tmp12 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp13 = tmp1 - tmp2;\n\n    tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];\n\n    dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS+1);\n    dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS+1);\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);   /* c6 */\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(z1 + MULTIPLY(tmp12, FIX_0_765366865), /* c2-c6 */\n\t      CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      DESCALE(z1 - MULTIPLY(tmp13, FIX_1_847759065), /* c2+c6 */\n\t      CONST_BITS+PASS1_BITS+1);\n\n    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).\n     * i0..i3 in the paper are tmp0..tmp3 here.\n     */\n\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp1 + tmp3;\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602);   /*  c3 */\n    tmp12 = MULTIPLY(tmp12, - FIX_0_390180644);      /* -c3+c5 */\n    tmp13 = MULTIPLY(tmp13, - FIX_1_961570560);      /* -c3-c5 */\n    tmp12 += z1;\n    tmp13 += z1;\n\n    z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223);   /* -c3+c7 */\n    tmp0 = MULTIPLY(tmp0, FIX_1_501321110);          /*  c1+c3-c5-c7 */\n    tmp3 = MULTIPLY(tmp3, FIX_0_298631336);          /* -c1+c3+c5-c7 */\n    tmp0 += z1 + tmp12;\n    tmp3 += z1 + tmp13;\n\n    z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447);   /* -c1-c3 */\n    tmp1 = MULTIPLY(tmp1, FIX_3_072711026);          /*  c1+c3+c5-c7 */\n    tmp2 = MULTIPLY(tmp2, FIX_2_053119869);          /*  c1+c3-c5+c7 */\n    tmp1 += z1 + tmp13;\n    tmp2 += z1 + tmp12;\n\n    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3, CONST_BITS+PASS1_BITS+1);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 14x7 sample block.\n *\n * 14-point FDCT in pass 1 (rows), 7-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_14x7 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;\n  INT32 z1, z2, z3;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Zero bottom row of output coefficient block. */\n  MEMZERO(&data[DCTSIZE*7], SIZEOF(DCTELEM) * DCTSIZE);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * 14-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/28).\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 7; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[13]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[12]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[11]);\n    tmp13 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[10]);\n    tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[9]);\n    tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[8]);\n    tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[7]);\n\n    tmp10 = tmp0 + tmp6;\n    tmp14 = tmp0 - tmp6;\n    tmp11 = tmp1 + tmp5;\n    tmp15 = tmp1 - tmp5;\n    tmp12 = tmp2 + tmp4;\n    tmp16 = tmp2 - tmp4;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[13]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[12]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[11]);\n    tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[10]);\n    tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[9]);\n    tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]);\n    tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE) << PASS1_BITS);\n    tmp13 += tmp13;\n    dataptr[4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.274162392)) + /* c4 */\n\t      MULTIPLY(tmp11 - tmp13, FIX(0.314692123)) - /* c12 */\n\t      MULTIPLY(tmp12 - tmp13, FIX(0.881747734)),  /* c8 */\n\t      CONST_BITS-PASS1_BITS);\n\n    tmp10 = MULTIPLY(tmp14 + tmp15, FIX(1.105676686));    /* c6 */\n\n    dataptr[2] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp14, FIX(0.273079590))   /* c2-c6 */\n\t      + MULTIPLY(tmp16, FIX(0.613604268)),        /* c10 */\n\t      CONST_BITS-PASS1_BITS);\n    dataptr[6] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp15, FIX(1.719280954))   /* c6+c10 */\n\t      - MULTIPLY(tmp16, FIX(1.378756276)),        /* c2 */\n\t      CONST_BITS-PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = tmp1 + tmp2;\n    tmp11 = tmp5 - tmp4;\n    dataptr[7] = (DCTELEM) ((tmp0 - tmp10 + tmp3 - tmp11 - tmp6) << PASS1_BITS);\n    tmp3 <<= CONST_BITS;\n    tmp10 = MULTIPLY(tmp10, - FIX(0.158341681));          /* -c13 */\n    tmp11 = MULTIPLY(tmp11, FIX(1.405321284));            /* c1 */\n    tmp10 += tmp11 - tmp3;\n    tmp11 = MULTIPLY(tmp0 + tmp2, FIX(1.197448846)) +     /* c5 */\n\t    MULTIPLY(tmp4 + tmp6, FIX(0.752406978));      /* c9 */\n    dataptr[5] = (DCTELEM)\n      DESCALE(tmp10 + tmp11 - MULTIPLY(tmp2, FIX(2.373959773)) /* c3+c5-c13 */\n\t      + MULTIPLY(tmp4, FIX(1.119999435)),         /* c1+c11-c9 */\n\t      CONST_BITS-PASS1_BITS);\n    tmp12 = MULTIPLY(tmp0 + tmp1, FIX(1.334852607)) +     /* c3 */\n\t    MULTIPLY(tmp5 - tmp6, FIX(0.467085129));      /* c11 */\n    dataptr[3] = (DCTELEM)\n      DESCALE(tmp10 + tmp12 - MULTIPLY(tmp1, FIX(0.424103948)) /* c3-c9-c13 */\n\t      - MULTIPLY(tmp5, FIX(3.069855259)),         /* c1+c5+c11 */\n\t      CONST_BITS-PASS1_BITS);\n    dataptr[1] = (DCTELEM)\n      DESCALE(tmp11 + tmp12 + tmp3 + tmp6 -\n\t      MULTIPLY(tmp0 + tmp6, FIX(1.126980169)),    /* c3+c5-c1 */\n\t      CONST_BITS-PASS1_BITS);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/14)*(8/7) = 32/49, which we\n   * partially fold into the constant multipliers and final shifting:\n   * 7-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/14) * 64/49.\n   */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*6];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*5];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*4];\n    tmp3 = dataptr[DCTSIZE*3];\n\n    tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*6];\n    tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*5];\n    tmp12 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*4];\n\n    z1 = tmp0 + tmp2;\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(z1 + tmp1 + tmp3, FIX(1.306122449)), /* 64/49 */\n\t      CONST_BITS+PASS1_BITS+1);\n    tmp3 += tmp3;\n    z1 -= tmp3;\n    z1 -= tmp3;\n    z1 = MULTIPLY(z1, FIX(0.461784020));                /* (c2+c6-c4)/2 */\n    z2 = MULTIPLY(tmp0 - tmp2, FIX(1.202428084));       /* (c2+c4-c6)/2 */\n    z3 = MULTIPLY(tmp1 - tmp2, FIX(0.411026446));       /* c6 */\n    dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + z2 + z3, CONST_BITS+PASS1_BITS+1);\n    z1 -= z2;\n    z2 = MULTIPLY(tmp0 - tmp1, FIX(1.151670509));       /* c4 */\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(z2 + z3 - MULTIPLY(tmp1 - tmp3, FIX(0.923568041)), /* c2+c6-c4 */\n\t      CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS+PASS1_BITS+1);\n\n    /* Odd part */\n\n    tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.221765677));   /* (c3+c1-c5)/2 */\n    tmp2 = MULTIPLY(tmp10 - tmp11, FIX(0.222383464));   /* (c3+c5-c1)/2 */\n    tmp0 = tmp1 - tmp2;\n    tmp1 += tmp2;\n    tmp2 = MULTIPLY(tmp11 + tmp12, - FIX(1.800824523)); /* -c1 */\n    tmp1 += tmp2;\n    tmp3 = MULTIPLY(tmp10 + tmp12, FIX(0.801442310));   /* c5 */\n    tmp0 += tmp3;\n    tmp2 += tmp3 + MULTIPLY(tmp12, FIX(2.443531355));   /* c3+c1-c5 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+PASS1_BITS+1);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 12x6 sample block.\n *\n * 12-point FDCT in pass 1 (rows), 6-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_12x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Zero 2 bottom rows of output coefficient block. */\n  MEMZERO(&data[DCTSIZE*6], SIZEOF(DCTELEM) * DCTSIZE * 2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * 12-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/24).\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 6; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[11]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[10]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[9]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[8]);\n    tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[7]);\n    tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[6]);\n\n    tmp10 = tmp0 + tmp5;\n    tmp13 = tmp0 - tmp5;\n    tmp11 = tmp1 + tmp4;\n    tmp14 = tmp1 - tmp4;\n    tmp12 = tmp2 + tmp3;\n    tmp15 = tmp2 - tmp3;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[11]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[10]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[9]);\n    tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[8]);\n    tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]);\n    tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE) << PASS1_BITS);\n    dataptr[6] = (DCTELEM) ((tmp13 - tmp14 - tmp15) << PASS1_BITS);\n    dataptr[4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.224744871)), /* c4 */\n\t      CONST_BITS-PASS1_BITS);\n    dataptr[2] = (DCTELEM)\n      DESCALE(tmp14 - tmp15 + MULTIPLY(tmp13 + tmp15, FIX(1.366025404)), /* c2 */\n\t      CONST_BITS-PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = MULTIPLY(tmp1 + tmp4, FIX_0_541196100);    /* c9 */\n    tmp14 = tmp10 + MULTIPLY(tmp1, FIX_0_765366865);   /* c3-c9 */\n    tmp15 = tmp10 - MULTIPLY(tmp4, FIX_1_847759065);   /* c3+c9 */\n    tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.121971054));   /* c5 */\n    tmp13 = MULTIPLY(tmp0 + tmp3, FIX(0.860918669));   /* c7 */\n    tmp10 = tmp12 + tmp13 + tmp14 - MULTIPLY(tmp0, FIX(0.580774953)) /* c5+c7-c1 */\n\t    + MULTIPLY(tmp5, FIX(0.184591911));        /* c11 */\n    tmp11 = MULTIPLY(tmp2 + tmp3, - FIX(0.184591911)); /* -c11 */\n    tmp12 += tmp11 - tmp15 - MULTIPLY(tmp2, FIX(2.339493912)) /* c1+c5-c11 */\n\t    + MULTIPLY(tmp5, FIX(0.860918669));        /* c7 */\n    tmp13 += tmp11 - tmp14 + MULTIPLY(tmp3, FIX(0.725788011)) /* c1+c11-c7 */\n\t    - MULTIPLY(tmp5, FIX(1.121971054));        /* c5 */\n    tmp11 = tmp15 + MULTIPLY(tmp0 - tmp3, FIX(1.306562965)) /* c3 */\n\t    - MULTIPLY(tmp2 + tmp5, FIX_0_541196100);  /* c9 */\n\n    dataptr[1] = (DCTELEM) DESCALE(tmp10, CONST_BITS-PASS1_BITS);\n    dataptr[3] = (DCTELEM) DESCALE(tmp11, CONST_BITS-PASS1_BITS);\n    dataptr[5] = (DCTELEM) DESCALE(tmp12, CONST_BITS-PASS1_BITS);\n    dataptr[7] = (DCTELEM) DESCALE(tmp13, CONST_BITS-PASS1_BITS);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/12)*(8/6) = 8/9, which we\n   * partially fold into the constant multipliers and final shifting:\n   * 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12) * 16/9.\n   */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*5];\n    tmp11 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*4];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3];\n\n    tmp10 = tmp0 + tmp2;\n    tmp12 = tmp0 - tmp2;\n\n    tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*5];\n    tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*4];\n    tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 + tmp11, FIX(1.777777778)),         /* 16/9 */\n\t      CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp12, FIX(2.177324216)),                 /* c2 */\n\t      CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(1.257078722)), /* c4 */\n\t      CONST_BITS+PASS1_BITS+1);\n\n    /* Odd part */\n\n    tmp10 = MULTIPLY(tmp0 + tmp2, FIX(0.650711829));             /* c5 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp0 + tmp1, FIX(1.777777778)),   /* 16/9 */\n\t      CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*3] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 - tmp1 - tmp2, FIX(1.777777778)),    /* 16/9 */\n\t      CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*5] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp2 - tmp1, FIX(1.777777778)),   /* 16/9 */\n\t      CONST_BITS+PASS1_BITS+1);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 10x5 sample block.\n *\n * 10-point FDCT in pass 1 (rows), 5-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_10x5 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Zero 3 bottom rows of output coefficient block. */\n  MEMZERO(&data[DCTSIZE*5], SIZEOF(DCTELEM) * DCTSIZE * 3);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * 10-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/20).\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 5; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[9]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[8]);\n    tmp12 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[7]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[6]);\n    tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[5]);\n\n    tmp10 = tmp0 + tmp4;\n    tmp13 = tmp0 - tmp4;\n    tmp11 = tmp1 + tmp3;\n    tmp14 = tmp1 - tmp3;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[9]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[8]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[7]);\n    tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]);\n    tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << PASS1_BITS);\n    tmp12 += tmp12;\n    dataptr[4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.144122806)) - /* c4 */\n\t      MULTIPLY(tmp11 - tmp12, FIX(0.437016024)),  /* c8 */\n\t      CONST_BITS-PASS1_BITS);\n    tmp10 = MULTIPLY(tmp13 + tmp14, FIX(0.831253876));    /* c6 */\n    dataptr[2] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp13, FIX(0.513743148)),  /* c2-c6 */\n\t      CONST_BITS-PASS1_BITS);\n    dataptr[6] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp14, FIX(2.176250899)),  /* c2+c6 */\n\t      CONST_BITS-PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = tmp0 + tmp4;\n    tmp11 = tmp1 - tmp3;\n    dataptr[5] = (DCTELEM) ((tmp10 - tmp11 - tmp2) << PASS1_BITS);\n    tmp2 <<= CONST_BITS;\n    dataptr[1] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0, FIX(1.396802247)) +          /* c1 */\n\t      MULTIPLY(tmp1, FIX(1.260073511)) + tmp2 +   /* c3 */\n\t      MULTIPLY(tmp3, FIX(0.642039522)) +          /* c7 */\n\t      MULTIPLY(tmp4, FIX(0.221231742)),           /* c9 */\n\t      CONST_BITS-PASS1_BITS);\n    tmp12 = MULTIPLY(tmp0 - tmp4, FIX(0.951056516)) -     /* (c3+c7)/2 */\n\t    MULTIPLY(tmp1 + tmp3, FIX(0.587785252));      /* (c1-c9)/2 */\n    tmp13 = MULTIPLY(tmp10 + tmp11, FIX(0.309016994)) +   /* (c3-c7)/2 */\n\t    (tmp11 << (CONST_BITS - 1)) - tmp2;\n    dataptr[3] = (DCTELEM) DESCALE(tmp12 + tmp13, CONST_BITS-PASS1_BITS);\n    dataptr[7] = (DCTELEM) DESCALE(tmp12 - tmp13, CONST_BITS-PASS1_BITS);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/10)*(8/5) = 32/25, which we\n   * fold into the constant multipliers:\n   * 5-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/10) * 32/25.\n   */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*4];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*3];\n    tmp2 = dataptr[DCTSIZE*2];\n\n    tmp10 = tmp0 + tmp1;\n    tmp11 = tmp0 - tmp1;\n\n    tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*4];\n    tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*3];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 + tmp2, FIX(1.28)),        /* 32/25 */\n\t      CONST_BITS+PASS1_BITS);\n    tmp11 = MULTIPLY(tmp11, FIX(1.011928851));          /* (c2+c4)/2 */\n    tmp10 -= tmp2 << 2;\n    tmp10 = MULTIPLY(tmp10, FIX(0.452548340));          /* (c2-c4)/2 */\n    dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp11 + tmp10, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp11 - tmp10, CONST_BITS+PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = MULTIPLY(tmp0 + tmp1, FIX(1.064004961));    /* c3 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp0, FIX(0.657591230)), /* c1-c3 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp1, FIX(2.785601151)), /* c1+c3 */\n\t      CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on an 8x4 sample block.\n *\n * 8-point FDCT in pass 1 (rows), 4-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_8x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3;\n  INT32 tmp10, tmp11, tmp12, tmp13;\n  INT32 z1;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Zero 4 bottom rows of output coefficient block. */\n  MEMZERO(&data[DCTSIZE*4], SIZEOF(DCTELEM) * DCTSIZE * 4);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * We must also scale the output by 8/4 = 2, which we add here.\n   * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16).\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 4; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part per LL&M figure 1 --- note that published figure is faulty;\n     * rotator \"c1\" should be \"c6\".\n     */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]);\n\n    tmp10 = tmp0 + tmp3;\n    tmp12 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp13 = tmp1 - tmp2;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);\n    tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << (PASS1_BITS+1));\n    dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << (PASS1_BITS+1));\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);       /* c6 */\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-2);\n\n    dataptr[2] = (DCTELEM)\n      RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), /* c2-c6 */\n\t\t  CONST_BITS-PASS1_BITS-1);\n    dataptr[6] = (DCTELEM)\n      RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), /* c2+c6 */\n\t\t  CONST_BITS-PASS1_BITS-1);\n\n    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).\n     * i0..i3 in the paper are tmp0..tmp3 here.\n     */\n\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp1 + tmp3;\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602);       /*  c3 */\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-2);\n\n    tmp12 = MULTIPLY(tmp12, - FIX_0_390180644);          /* -c3+c5 */\n    tmp13 = MULTIPLY(tmp13, - FIX_1_961570560);          /* -c3-c5 */\n    tmp12 += z1;\n    tmp13 += z1;\n\n    z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223);       /* -c3+c7 */\n    tmp0 = MULTIPLY(tmp0, FIX_1_501321110);              /*  c1+c3-c5-c7 */\n    tmp3 = MULTIPLY(tmp3, FIX_0_298631336);              /* -c1+c3+c5-c7 */\n    tmp0 += z1 + tmp12;\n    tmp3 += z1 + tmp13;\n\n    z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447);       /* -c1-c3 */\n    tmp1 = MULTIPLY(tmp1, FIX_3_072711026);              /*  c1+c3+c5-c7 */\n    tmp2 = MULTIPLY(tmp2, FIX_2_053119869);              /*  c1+c3-c5+c7 */\n    tmp1 += z1 + tmp13;\n    tmp2 += z1 + tmp12;\n\n    dataptr[1] = (DCTELEM) RIGHT_SHIFT(tmp0, CONST_BITS-PASS1_BITS-1);\n    dataptr[3] = (DCTELEM) RIGHT_SHIFT(tmp1, CONST_BITS-PASS1_BITS-1);\n    dataptr[5] = (DCTELEM) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS-1);\n    dataptr[7] = (DCTELEM) RIGHT_SHIFT(tmp3, CONST_BITS-PASS1_BITS-1);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * 4-point FDCT kernel,\n   * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].\n   */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*3] + (ONE << (PASS1_BITS-1));\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*2];\n\n    tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3];\n    tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2];\n\n    dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp0 + tmp1, PASS1_BITS);\n    dataptr[DCTSIZE*2] = (DCTELEM) RIGHT_SHIFT(tmp0 - tmp1, PASS1_BITS);\n\n    /* Odd part */\n\n    tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100);       /* c6 */\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS+PASS1_BITS-1);\n\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */\n\t\t  CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM)\n      RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */\n\t\t  CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 6x3 sample block.\n *\n * 6-point FDCT in pass 1 (rows), 3-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_6x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2;\n  INT32 tmp10, tmp11, tmp12;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * We scale the results further by 2 as part of output adaption\n   * scaling for different DCT size.\n   * 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12).\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 3; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[5]);\n    tmp11 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[4]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[3]);\n\n    tmp10 = tmp0 + tmp2;\n    tmp12 = tmp0 - tmp2;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[5]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << (PASS1_BITS+1));\n    dataptr[2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp12, FIX(1.224744871)),                 /* c2 */\n\t      CONST_BITS-PASS1_BITS-1);\n    dataptr[4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(0.707106781)), /* c4 */\n\t      CONST_BITS-PASS1_BITS-1);\n\n    /* Odd part */\n\n    tmp10 = DESCALE(MULTIPLY(tmp0 + tmp2, FIX(0.366025404)),     /* c5 */\n\t\t    CONST_BITS-PASS1_BITS-1);\n\n    dataptr[1] = (DCTELEM) (tmp10 + ((tmp0 + tmp1) << (PASS1_BITS+1)));\n    dataptr[3] = (DCTELEM) ((tmp0 - tmp1 - tmp2) << (PASS1_BITS+1));\n    dataptr[5] = (DCTELEM) (tmp10 + ((tmp2 - tmp1) << (PASS1_BITS+1)));\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/6)*(8/3) = 32/9, which we partially\n   * fold into the constant multipliers (other part was done in pass 1):\n   * 3-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/6) * 16/9.\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 6; ctr++) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*2];\n    tmp1 = dataptr[DCTSIZE*1];\n\n    tmp2 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*2];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 + tmp1, FIX(1.777777778)),        /* 16/9 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 - tmp1 - tmp1, FIX(1.257078722)), /* c2 */\n\t      CONST_BITS+PASS1_BITS);\n\n    /* Odd part */\n\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp2, FIX(2.177324216)),               /* c1 */\n\t      CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 4x2 sample block.\n *\n * 4-point FDCT in pass 1 (rows), 2-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_4x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1;\n  INT32 tmp10, tmp11;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * We must also scale the output by (8/4)*(8/2) = 2**3, which we add here.\n   * 4-point FDCT kernel,\n   * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 2; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);\n\n    tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);\n    tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+3));\n    dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+3));\n\n    /* Odd part */\n\n    tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100);       /* c6 */\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-4);\n\n    dataptr[1] = (DCTELEM)\n      RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */\n\t\t  CONST_BITS-PASS1_BITS-3);\n    dataptr[3] = (DCTELEM)\n      RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */\n\t\t  CONST_BITS-PASS1_BITS-3);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 4; ctr++) {\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = dataptr[DCTSIZE*0] + (ONE << (PASS1_BITS-1));\n    tmp1 = dataptr[DCTSIZE*1];\n\n    dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp0 + tmp1, PASS1_BITS);\n\n    /* Odd part */\n\n    dataptr[DCTSIZE*1] = (DCTELEM) RIGHT_SHIFT(tmp0 - tmp1, PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 2x1 sample block.\n *\n * 2-point FDCT in pass 1 (rows), 1-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_2x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1;\n  JSAMPROW elemptr;\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  elemptr = sample_data[0] + start_col;\n\n  tmp0 = GETJSAMPLE(elemptr[0]);\n  tmp1 = GETJSAMPLE(elemptr[1]);\n\n  /* We leave the results scaled up by an overall factor of 8.\n   * We must also scale the output by (8/2)*(8/1) = 2**5.\n   */\n\n  /* Even part */\n\n  /* Apply unsigned->signed conversion */\n  data[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5);\n\n  /* Odd part */\n\n  data[1] = (DCTELEM) ((tmp0 - tmp1) << 5);\n}\n\n\n/*\n * Perform the forward DCT on an 8x16 sample block.\n *\n * 8-point FDCT in pass 1 (rows), 16-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_8x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16, tmp17;\n  INT32 z1;\n  DCTELEM workspace[DCTSIZE2];\n  DCTELEM *dataptr;\n  DCTELEM *wsptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (;;) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part per LL&M figure 1 --- note that published figure is faulty;\n     * rotator \"c1\" should be \"c6\".\n     */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]);\n    tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]);\n\n    tmp10 = tmp0 + tmp3;\n    tmp12 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp13 = tmp1 - tmp2;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);\n    tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS);\n    dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);   /* c6 */\n    dataptr[2] = (DCTELEM)\n      DESCALE(z1 + MULTIPLY(tmp12, FIX_0_765366865), /* c2-c6 */\n\t      CONST_BITS-PASS1_BITS);\n    dataptr[6] = (DCTELEM)\n      DESCALE(z1 - MULTIPLY(tmp13, FIX_1_847759065), /* c2+c6 */\n\t      CONST_BITS-PASS1_BITS);\n\n    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).\n     * i0..i3 in the paper are tmp0..tmp3 here.\n     */\n\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp1 + tmp3;\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602);   /*  c3 */\n    tmp12 = MULTIPLY(tmp12, - FIX_0_390180644);      /* -c3+c5 */\n    tmp13 = MULTIPLY(tmp13, - FIX_1_961570560);      /* -c3-c5 */\n    tmp12 += z1;\n    tmp13 += z1;\n\n    z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223);   /* -c3+c7 */\n    tmp0 = MULTIPLY(tmp0, FIX_1_501321110);          /*  c1+c3-c5-c7 */\n    tmp3 = MULTIPLY(tmp3, FIX_0_298631336);          /* -c1+c3+c5-c7 */\n    tmp0 += z1 + tmp12;\n    tmp3 += z1 + tmp13;\n\n    z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447);   /* -c1-c3 */\n    tmp1 = MULTIPLY(tmp1, FIX_3_072711026);          /*  c1+c3+c5-c7 */\n    tmp2 = MULTIPLY(tmp2, FIX_2_053119869);          /*  c1+c3-c5+c7 */\n    tmp1 += z1 + tmp13;\n    tmp2 += z1 + tmp12;\n\n    dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS-PASS1_BITS);\n    dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS-PASS1_BITS);\n    dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS-PASS1_BITS);\n    dataptr[7] = (DCTELEM) DESCALE(tmp3, CONST_BITS-PASS1_BITS);\n\n    ctr++;\n\n    if (ctr != DCTSIZE) {\n      if (ctr == DCTSIZE * 2)\n\tbreak;\t\t\t/* Done. */\n      dataptr += DCTSIZE;\t/* advance pointer to next row */\n    } else\n      dataptr = workspace;\t/* switch pointer to extended workspace */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by 8/16 = 1/2.\n   * 16-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/32).\n   */\n\n  dataptr = data;\n  wsptr = workspace;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*4];\n    tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*3];\n    tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*2];\n    tmp6 = dataptr[DCTSIZE*6] + wsptr[DCTSIZE*1];\n    tmp7 = dataptr[DCTSIZE*7] + wsptr[DCTSIZE*0];\n\n    tmp10 = tmp0 + tmp7;\n    tmp14 = tmp0 - tmp7;\n    tmp11 = tmp1 + tmp6;\n    tmp15 = tmp1 - tmp6;\n    tmp12 = tmp2 + tmp5;\n    tmp16 = tmp2 - tmp5;\n    tmp13 = tmp3 + tmp4;\n    tmp17 = tmp3 - tmp4;\n\n    tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*4];\n    tmp4 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*3];\n    tmp5 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*2];\n    tmp6 = dataptr[DCTSIZE*6] - wsptr[DCTSIZE*1];\n    tmp7 = dataptr[DCTSIZE*7] - wsptr[DCTSIZE*0];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(tmp10 + tmp11 + tmp12 + tmp13, PASS1_BITS+1);\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.306562965)) + /* c4[16] = c2[8] */\n\t      MULTIPLY(tmp11 - tmp12, FIX_0_541196100),   /* c12[16] = c6[8] */\n\t      CONST_BITS+PASS1_BITS+1);\n\n    tmp10 = MULTIPLY(tmp17 - tmp15, FIX(0.275899379)) +   /* c14[16] = c7[8] */\n\t    MULTIPLY(tmp14 - tmp16, FIX(1.387039845));    /* c2[16] = c1[8] */\n\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp15, FIX(1.451774982))   /* c6+c14 */\n\t      + MULTIPLY(tmp16, FIX(2.172734804)),        /* c2+c10 */\n\t      CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp14, FIX(0.211164243))   /* c2-c6 */\n\t      - MULTIPLY(tmp17, FIX(1.061594338)),        /* c10+c14 */\n\t      CONST_BITS+PASS1_BITS+1);\n\n    /* Odd part */\n\n    tmp11 = MULTIPLY(tmp0 + tmp1, FIX(1.353318001)) +         /* c3 */\n\t    MULTIPLY(tmp6 - tmp7, FIX(0.410524528));          /* c13 */\n    tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.247225013)) +         /* c5 */\n\t    MULTIPLY(tmp5 + tmp7, FIX(0.666655658));          /* c11 */\n    tmp13 = MULTIPLY(tmp0 + tmp3, FIX(1.093201867)) +         /* c7 */\n\t    MULTIPLY(tmp4 - tmp7, FIX(0.897167586));          /* c9 */\n    tmp14 = MULTIPLY(tmp1 + tmp2, FIX(0.138617169)) +         /* c15 */\n\t    MULTIPLY(tmp6 - tmp5, FIX(1.407403738));          /* c1 */\n    tmp15 = MULTIPLY(tmp1 + tmp3, - FIX(0.666655658)) +       /* -c11 */\n\t    MULTIPLY(tmp4 + tmp6, - FIX(1.247225013));        /* -c5 */\n    tmp16 = MULTIPLY(tmp2 + tmp3, - FIX(1.353318001)) +       /* -c3 */\n\t    MULTIPLY(tmp5 - tmp4, FIX(0.410524528));          /* c13 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n\t    MULTIPLY(tmp0, FIX(2.286341144)) +                /* c7+c5+c3-c1 */\n\t    MULTIPLY(tmp7, FIX(0.779653625));                 /* c15+c13-c11+c9 */\n    tmp11 += tmp14 + tmp15 + MULTIPLY(tmp1, FIX(0.071888074)) /* c9-c3-c15+c11 */\n\t     - MULTIPLY(tmp6, FIX(1.663905119));              /* c7+c13+c1-c5 */\n    tmp12 += tmp14 + tmp16 - MULTIPLY(tmp2, FIX(1.125726048)) /* c7+c5+c15-c3 */\n\t     + MULTIPLY(tmp5, FIX(1.227391138));              /* c9-c11+c1-c13 */\n    tmp13 += tmp15 + tmp16 + MULTIPLY(tmp3, FIX(1.065388962)) /* c15+c3+c11-c7 */\n\t     + MULTIPLY(tmp4, FIX(2.167985692));              /* c1+c13+c5-c9 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10, CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp11, CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12, CONST_BITS+PASS1_BITS+1);\n    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp13, CONST_BITS+PASS1_BITS+1);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n    wsptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 7x14 sample block.\n *\n * 7-point FDCT in pass 1 (rows), 14-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_7x14 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;\n  INT32 z1, z2, z3;\n  DCTELEM workspace[8*6];\n  DCTELEM *dataptr;\n  DCTELEM *wsptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * 7-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/14).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (;;) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[6]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[5]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[4]);\n    tmp3 = GETJSAMPLE(elemptr[3]);\n\n    tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[6]);\n    tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[5]);\n    tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]);\n\n    z1 = tmp0 + tmp2;\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS);\n    tmp3 += tmp3;\n    z1 -= tmp3;\n    z1 -= tmp3;\n    z1 = MULTIPLY(z1, FIX(0.353553391));                /* (c2+c6-c4)/2 */\n    z2 = MULTIPLY(tmp0 - tmp2, FIX(0.920609002));       /* (c2+c4-c6)/2 */\n    z3 = MULTIPLY(tmp1 - tmp2, FIX(0.314692123));       /* c6 */\n    dataptr[2] = (DCTELEM) DESCALE(z1 + z2 + z3, CONST_BITS-PASS1_BITS);\n    z1 -= z2;\n    z2 = MULTIPLY(tmp0 - tmp1, FIX(0.881747734));       /* c4 */\n    dataptr[4] = (DCTELEM)\n      DESCALE(z2 + z3 - MULTIPLY(tmp1 - tmp3, FIX(0.707106781)), /* c2+c6-c4 */\n\t      CONST_BITS-PASS1_BITS);\n    dataptr[6] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS-PASS1_BITS);\n\n    /* Odd part */\n\n    tmp1 = MULTIPLY(tmp10 + tmp11, FIX(0.935414347));   /* (c3+c1-c5)/2 */\n    tmp2 = MULTIPLY(tmp10 - tmp11, FIX(0.170262339));   /* (c3+c5-c1)/2 */\n    tmp0 = tmp1 - tmp2;\n    tmp1 += tmp2;\n    tmp2 = MULTIPLY(tmp11 + tmp12, - FIX(1.378756276)); /* -c1 */\n    tmp1 += tmp2;\n    tmp3 = MULTIPLY(tmp10 + tmp12, FIX(0.613604268));   /* c5 */\n    tmp0 += tmp3;\n    tmp2 += tmp3 + MULTIPLY(tmp12, FIX(1.870828693));   /* c3+c1-c5 */\n\n    dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS-PASS1_BITS);\n    dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS-PASS1_BITS);\n    dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS-PASS1_BITS);\n\n    ctr++;\n\n    if (ctr != DCTSIZE) {\n      if (ctr == 14)\n\tbreak;\t\t\t/* Done. */\n      dataptr += DCTSIZE;\t/* advance pointer to next row */\n    } else\n      dataptr = workspace;\t/* switch pointer to extended workspace */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/7)*(8/14) = 32/49, which we\n   * fold into the constant multipliers:\n   * 14-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/28) * 32/49.\n   */\n\n  dataptr = data;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 7; ctr++) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*5];\n    tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*4];\n    tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*3];\n    tmp13 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*2];\n    tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*1];\n    tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*0];\n    tmp6 = dataptr[DCTSIZE*6] + dataptr[DCTSIZE*7];\n\n    tmp10 = tmp0 + tmp6;\n    tmp14 = tmp0 - tmp6;\n    tmp11 = tmp1 + tmp5;\n    tmp15 = tmp1 - tmp5;\n    tmp12 = tmp2 + tmp4;\n    tmp16 = tmp2 - tmp4;\n\n    tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*5];\n    tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*4];\n    tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*3];\n    tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*2];\n    tmp4 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*1];\n    tmp5 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*0];\n    tmp6 = dataptr[DCTSIZE*6] - dataptr[DCTSIZE*7];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12 + tmp13,\n\t\t       FIX(0.653061224)),                 /* 32/49 */\n\t      CONST_BITS+PASS1_BITS);\n    tmp13 += tmp13;\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp13, FIX(0.832106052)) + /* c4 */\n\t      MULTIPLY(tmp11 - tmp13, FIX(0.205513223)) - /* c12 */\n\t      MULTIPLY(tmp12 - tmp13, FIX(0.575835255)),  /* c8 */\n\t      CONST_BITS+PASS1_BITS);\n\n    tmp10 = MULTIPLY(tmp14 + tmp15, FIX(0.722074570));    /* c6 */\n\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp14, FIX(0.178337691))   /* c2-c6 */\n\t      + MULTIPLY(tmp16, FIX(0.400721155)),        /* c10 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp15, FIX(1.122795725))   /* c6+c10 */\n\t      - MULTIPLY(tmp16, FIX(0.900412262)),        /* c2 */\n\t      CONST_BITS+PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = tmp1 + tmp2;\n    tmp11 = tmp5 - tmp4;\n    dataptr[DCTSIZE*7] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 - tmp10 + tmp3 - tmp11 - tmp6,\n\t\t       FIX(0.653061224)),                 /* 32/49 */\n\t      CONST_BITS+PASS1_BITS);\n    tmp3  = MULTIPLY(tmp3 , FIX(0.653061224));            /* 32/49 */\n    tmp10 = MULTIPLY(tmp10, - FIX(0.103406812));          /* -c13 */\n    tmp11 = MULTIPLY(tmp11, FIX(0.917760839));            /* c1 */\n    tmp10 += tmp11 - tmp3;\n    tmp11 = MULTIPLY(tmp0 + tmp2, FIX(0.782007410)) +     /* c5 */\n\t    MULTIPLY(tmp4 + tmp6, FIX(0.491367823));      /* c9 */\n    dataptr[DCTSIZE*5] = (DCTELEM)\n      DESCALE(tmp10 + tmp11 - MULTIPLY(tmp2, FIX(1.550341076)) /* c3+c5-c13 */\n\t      + MULTIPLY(tmp4, FIX(0.731428202)),         /* c1+c11-c9 */\n\t      CONST_BITS+PASS1_BITS);\n    tmp12 = MULTIPLY(tmp0 + tmp1, FIX(0.871740478)) +     /* c3 */\n\t    MULTIPLY(tmp5 - tmp6, FIX(0.305035186));      /* c11 */\n    dataptr[DCTSIZE*3] = (DCTELEM)\n      DESCALE(tmp10 + tmp12 - MULTIPLY(tmp1, FIX(0.276965844)) /* c3-c9-c13 */\n\t      - MULTIPLY(tmp5, FIX(2.004803435)),         /* c1+c5+c11 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      DESCALE(tmp11 + tmp12 + tmp3\n\t      - MULTIPLY(tmp0, FIX(0.735987049))          /* c3+c5-c1 */\n\t      - MULTIPLY(tmp6, FIX(0.082925825)),         /* c9-c11-c13 */\n\t      CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n    wsptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 6x12 sample block.\n *\n * 6-point FDCT in pass 1 (rows), 12-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_6x12 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;\n  DCTELEM workspace[8*4];\n  DCTELEM *dataptr;\n  DCTELEM *wsptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (;;) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[5]);\n    tmp11 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[4]);\n    tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[3]);\n\n    tmp10 = tmp0 + tmp2;\n    tmp12 = tmp0 - tmp2;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[5]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]);\n    tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS);\n    dataptr[2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp12, FIX(1.224744871)),                 /* c2 */\n\t      CONST_BITS-PASS1_BITS);\n    dataptr[4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(0.707106781)), /* c4 */\n\t      CONST_BITS-PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = DESCALE(MULTIPLY(tmp0 + tmp2, FIX(0.366025404)),     /* c5 */\n\t\t    CONST_BITS-PASS1_BITS);\n\n    dataptr[1] = (DCTELEM) (tmp10 + ((tmp0 + tmp1) << PASS1_BITS));\n    dataptr[3] = (DCTELEM) ((tmp0 - tmp1 - tmp2) << PASS1_BITS);\n    dataptr[5] = (DCTELEM) (tmp10 + ((tmp2 - tmp1) << PASS1_BITS));\n\n    ctr++;\n\n    if (ctr != DCTSIZE) {\n      if (ctr == 12)\n\tbreak;\t\t\t/* Done. */\n      dataptr += DCTSIZE;\t/* advance pointer to next row */\n    } else\n      dataptr = workspace;\t/* switch pointer to extended workspace */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/6)*(8/12) = 8/9, which we\n   * fold into the constant multipliers:\n   * 12-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/24) * 8/9.\n   */\n\n  dataptr = data;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 6; ctr++) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*3];\n    tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*2];\n    tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*1];\n    tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*0];\n    tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*7];\n    tmp5 = dataptr[DCTSIZE*5] + dataptr[DCTSIZE*6];\n\n    tmp10 = tmp0 + tmp5;\n    tmp13 = tmp0 - tmp5;\n    tmp11 = tmp1 + tmp4;\n    tmp14 = tmp1 - tmp4;\n    tmp12 = tmp2 + tmp3;\n    tmp15 = tmp2 - tmp3;\n\n    tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*3];\n    tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*2];\n    tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*1];\n    tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*0];\n    tmp4 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*7];\n    tmp5 = dataptr[DCTSIZE*5] - dataptr[DCTSIZE*6];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12, FIX(0.888888889)), /* 8/9 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp13 - tmp14 - tmp15, FIX(0.888888889)), /* 8/9 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.088662108)),         /* c4 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp14 - tmp15, FIX(0.888888889)) +        /* 8/9 */\n\t      MULTIPLY(tmp13 + tmp15, FIX(1.214244803)),         /* c2 */\n\t      CONST_BITS+PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = MULTIPLY(tmp1 + tmp4, FIX(0.481063200));   /* c9 */\n    tmp14 = tmp10 + MULTIPLY(tmp1, FIX(0.680326102));  /* c3-c9 */\n    tmp15 = tmp10 - MULTIPLY(tmp4, FIX(1.642452502));  /* c3+c9 */\n    tmp12 = MULTIPLY(tmp0 + tmp2, FIX(0.997307603));   /* c5 */\n    tmp13 = MULTIPLY(tmp0 + tmp3, FIX(0.765261039));   /* c7 */\n    tmp10 = tmp12 + tmp13 + tmp14 - MULTIPLY(tmp0, FIX(0.516244403)) /* c5+c7-c1 */\n\t    + MULTIPLY(tmp5, FIX(0.164081699));        /* c11 */\n    tmp11 = MULTIPLY(tmp2 + tmp3, - FIX(0.164081699)); /* -c11 */\n    tmp12 += tmp11 - tmp15 - MULTIPLY(tmp2, FIX(2.079550144)) /* c1+c5-c11 */\n\t    + MULTIPLY(tmp5, FIX(0.765261039));        /* c7 */\n    tmp13 += tmp11 - tmp14 + MULTIPLY(tmp3, FIX(0.645144899)) /* c1+c11-c7 */\n\t    - MULTIPLY(tmp5, FIX(0.997307603));        /* c5 */\n    tmp11 = tmp15 + MULTIPLY(tmp0 - tmp3, FIX(1.161389302)) /* c3 */\n\t    - MULTIPLY(tmp2 + tmp5, FIX(0.481063200)); /* c9 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp11, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp13, CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n    wsptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 5x10 sample block.\n *\n * 5-point FDCT in pass 1 (rows), 10-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_5x10 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4;\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14;\n  DCTELEM workspace[8*2];\n  DCTELEM *dataptr;\n  DCTELEM *wsptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * 5-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/10).\n   */\n\n  dataptr = data;\n  ctr = 0;\n  for (;;) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[4]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[3]);\n    tmp2 = GETJSAMPLE(elemptr[2]);\n\n    tmp10 = tmp0 + tmp1;\n    tmp11 = tmp0 - tmp1;\n\n    tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]);\n    tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << PASS1_BITS);\n    tmp11 = MULTIPLY(tmp11, FIX(0.790569415));          /* (c2+c4)/2 */\n    tmp10 -= tmp2 << 2;\n    tmp10 = MULTIPLY(tmp10, FIX(0.353553391));          /* (c2-c4)/2 */\n    dataptr[2] = (DCTELEM) DESCALE(tmp11 + tmp10, CONST_BITS-PASS1_BITS);\n    dataptr[4] = (DCTELEM) DESCALE(tmp11 - tmp10, CONST_BITS-PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = MULTIPLY(tmp0 + tmp1, FIX(0.831253876));    /* c3 */\n\n    dataptr[1] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp0, FIX(0.513743148)), /* c1-c3 */\n\t      CONST_BITS-PASS1_BITS);\n    dataptr[3] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp1, FIX(2.176250899)), /* c1+c3 */\n\t      CONST_BITS-PASS1_BITS);\n\n    ctr++;\n\n    if (ctr != DCTSIZE) {\n      if (ctr == 10)\n\tbreak;\t\t\t/* Done. */\n      dataptr += DCTSIZE;\t/* advance pointer to next row */\n    } else\n      dataptr = workspace;\t/* switch pointer to extended workspace */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/5)*(8/10) = 32/25, which we\n   * fold into the constant multipliers:\n   * 10-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/20) * 32/25.\n   */\n\n  dataptr = data;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 5; ctr++) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*1];\n    tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*0];\n    tmp12 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*7];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*6];\n    tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*5];\n\n    tmp10 = tmp0 + tmp4;\n    tmp13 = tmp0 - tmp4;\n    tmp11 = tmp1 + tmp3;\n    tmp14 = tmp1 - tmp3;\n\n    tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*1];\n    tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*0];\n    tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*7];\n    tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*6];\n    tmp4 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*5];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12, FIX(1.28)), /* 32/25 */\n\t      CONST_BITS+PASS1_BITS);\n    tmp12 += tmp12;\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.464477191)) - /* c4 */\n\t      MULTIPLY(tmp11 - tmp12, FIX(0.559380511)),  /* c8 */\n\t      CONST_BITS+PASS1_BITS);\n    tmp10 = MULTIPLY(tmp13 + tmp14, FIX(1.064004961));    /* c6 */\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp13, FIX(0.657591230)),  /* c2-c6 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      DESCALE(tmp10 - MULTIPLY(tmp14, FIX(2.785601151)),  /* c2+c6 */\n\t      CONST_BITS+PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = tmp0 + tmp4;\n    tmp11 = tmp1 - tmp3;\n    dataptr[DCTSIZE*5] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp11 - tmp2, FIX(1.28)),  /* 32/25 */\n\t      CONST_BITS+PASS1_BITS);\n    tmp2 = MULTIPLY(tmp2, FIX(1.28));                     /* 32/25 */\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0, FIX(1.787906876)) +          /* c1 */\n\t      MULTIPLY(tmp1, FIX(1.612894094)) + tmp2 +   /* c3 */\n\t      MULTIPLY(tmp3, FIX(0.821810588)) +          /* c7 */\n\t      MULTIPLY(tmp4, FIX(0.283176630)),           /* c9 */\n\t      CONST_BITS+PASS1_BITS);\n    tmp12 = MULTIPLY(tmp0 - tmp4, FIX(1.217352341)) -     /* (c3+c7)/2 */\n\t    MULTIPLY(tmp1 + tmp3, FIX(0.752365123));      /* (c1-c9)/2 */\n    tmp13 = MULTIPLY(tmp10 + tmp11, FIX(0.395541753)) +   /* (c3-c7)/2 */\n\t    MULTIPLY(tmp11, FIX(0.64)) - tmp2;            /* 16/25 */\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp12 + tmp13, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp12 - tmp13, CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n    wsptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 4x8 sample block.\n *\n * 4-point FDCT in pass 1 (rows), 8-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_4x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3;\n  INT32 tmp10, tmp11, tmp12, tmp13;\n  INT32 z1;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * We must also scale the output by 8/4 = 2, which we add here.\n   * 4-point FDCT kernel,\n   * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);\n    tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);\n\n    tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);\n    tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+1));\n    dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+1));\n\n    /* Odd part */\n\n    tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100);       /* c6 */\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-2);\n\n    dataptr[1] = (DCTELEM)\n      RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */\n\t\t  CONST_BITS-PASS1_BITS-1);\n    dataptr[3] = (DCTELEM)\n      RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */\n\t\t  CONST_BITS-PASS1_BITS-1);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16).\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 4; ctr++) {\n    /* Even part per LL&M figure 1 --- note that published figure is faulty;\n     * rotator \"c1\" should be \"c6\".\n     */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];\n\n    /* Add fudge factor here for final descale. */\n    tmp10 = tmp0 + tmp3 + (ONE << (PASS1_BITS-1));\n    tmp12 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp13 = tmp1 - tmp2;\n\n    tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];\n\n    dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp10 + tmp11, PASS1_BITS);\n    dataptr[DCTSIZE*4] = (DCTELEM) RIGHT_SHIFT(tmp10 - tmp11, PASS1_BITS);\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);       /* c6 */\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS+PASS1_BITS-1);\n\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), /* c2-c6 */\n\t\t  CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*6] = (DCTELEM)\n      RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), /* c2+c6 */\n\t\t  CONST_BITS+PASS1_BITS);\n\n    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).\n     * i0..i3 in the paper are tmp0..tmp3 here.\n     */\n\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp1 + tmp3;\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602);       /*  c3 */\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS+PASS1_BITS-1);\n\n    tmp12 = MULTIPLY(tmp12, - FIX_0_390180644);          /* -c3+c5 */\n    tmp13 = MULTIPLY(tmp13, - FIX_1_961570560);          /* -c3-c5 */\n    tmp12 += z1;\n    tmp13 += z1;\n\n    z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223);       /* -c3+c7 */\n    tmp0 = MULTIPLY(tmp0, FIX_1_501321110);              /*  c1+c3-c5-c7 */\n    tmp3 = MULTIPLY(tmp3, FIX_0_298631336);              /* -c1+c3+c5-c7 */\n    tmp0 += z1 + tmp12;\n    tmp3 += z1 + tmp13;\n\n    z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447);       /* -c1-c3 */\n    tmp1 = MULTIPLY(tmp1, FIX_3_072711026);              /*  c1+c3+c5-c7 */\n    tmp2 = MULTIPLY(tmp2, FIX_2_053119869);              /*  c1+c3-c5+c7 */\n    tmp1 += z1 + tmp13;\n    tmp2 += z1 + tmp12;\n\n    dataptr[DCTSIZE*1] = (DCTELEM) RIGHT_SHIFT(tmp0, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM) RIGHT_SHIFT(tmp1, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*5] = (DCTELEM) RIGHT_SHIFT(tmp2, CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*7] = (DCTELEM) RIGHT_SHIFT(tmp3, CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 3x6 sample block.\n *\n * 3-point FDCT in pass 1 (rows), 6-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_3x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1, tmp2;\n  INT32 tmp10, tmp11, tmp12;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * We scale the results further by 2 as part of output adaption\n   * scaling for different DCT size.\n   * 3-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/6).\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 6; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[2]);\n    tmp1 = GETJSAMPLE(elemptr[1]);\n\n    tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM)\n      ((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+1));\n    dataptr[2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 - tmp1 - tmp1, FIX(0.707106781)), /* c2 */\n\t      CONST_BITS-PASS1_BITS-1);\n\n    /* Odd part */\n\n    dataptr[1] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp2, FIX(1.224744871)),               /* c1 */\n\t      CONST_BITS-PASS1_BITS-1);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   * We must also scale the output by (8/6)*(8/3) = 32/9, which we partially\n   * fold into the constant multipliers (other part was done in pass 1):\n   * 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12) * 16/9.\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 3; ctr++) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*5];\n    tmp11 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*4];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3];\n\n    tmp10 = tmp0 + tmp2;\n    tmp12 = tmp0 - tmp2;\n\n    tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*5];\n    tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*4];\n    tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3];\n\n    dataptr[DCTSIZE*0] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 + tmp11, FIX(1.777777778)),         /* 16/9 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*2] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp12, FIX(2.177324216)),                 /* c2 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*4] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(1.257078722)), /* c4 */\n\t      CONST_BITS+PASS1_BITS);\n\n    /* Odd part */\n\n    tmp10 = MULTIPLY(tmp0 + tmp2, FIX(0.650711829));             /* c5 */\n\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp0 + tmp1, FIX(1.777777778)),   /* 16/9 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM)\n      DESCALE(MULTIPLY(tmp0 - tmp1 - tmp2, FIX(1.777777778)),    /* 16/9 */\n\t      CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*5] = (DCTELEM)\n      DESCALE(tmp10 + MULTIPLY(tmp2 - tmp1, FIX(1.777777778)),   /* 16/9 */\n\t      CONST_BITS+PASS1_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 2x4 sample block.\n *\n * 2-point FDCT in pass 1 (rows), 4-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1;\n  INT32 tmp10, tmp11;\n  DCTELEM *dataptr;\n  JSAMPROW elemptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: process rows.\n   * Note results are scaled up by sqrt(8) compared to a true DCT.\n   * We must also scale the output by (8/2)*(8/4) = 2**3, which we add here.\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 4; ctr++) {\n    elemptr = sample_data[ctr] + start_col;\n\n    /* Even part */\n\n    tmp0 = GETJSAMPLE(elemptr[0]);\n    tmp1 = GETJSAMPLE(elemptr[1]);\n\n    /* Apply unsigned->signed conversion */\n    dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 3);\n\n    /* Odd part */\n\n    dataptr[1] = (DCTELEM) ((tmp0 - tmp1) << 3);\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We leave the results scaled up by an overall factor of 8.\n   * 4-point FDCT kernel,\n   * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].\n   */\n\n  dataptr = data;\n  for (ctr = 0; ctr < 2; ctr++) {\n    /* Even part */\n\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*3];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*2];\n\n    tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3];\n    tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2];\n\n    dataptr[DCTSIZE*0] = (DCTELEM) (tmp0 + tmp1);\n    dataptr[DCTSIZE*2] = (DCTELEM) (tmp0 - tmp1);\n\n    /* Odd part */\n\n    tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100);       /* c6 */\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-1);\n\n    dataptr[DCTSIZE*1] = (DCTELEM)\n      RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */\n\t\t  CONST_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM)\n      RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */\n\t\t  CONST_BITS);\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n\n/*\n * Perform the forward DCT on a 1x2 sample block.\n *\n * 1-point FDCT in pass 1 (rows), 2-point in pass 2 (columns).\n */\n\nGLOBAL(void)\njpeg_fdct_1x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)\n{\n  INT32 tmp0, tmp1;\n\n  /* Pre-zero output coefficient block. */\n  MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Pass 1: empty. */\n\n  /* Pass 2: process columns.\n   * We leave the results scaled up by an overall factor of 8.\n   * We must also scale the output by (8/1)*(8/2) = 2**5.\n   */\n\n  /* Even part */\n\n  tmp0 = GETJSAMPLE(sample_data[0][start_col]);\n  tmp1 = GETJSAMPLE(sample_data[1][start_col]);\n\n  /* Apply unsigned->signed conversion */\n  data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5);\n\n  /* Odd part */\n\n  data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp1) << 5);\n}\n\n#endif /* DCT_SCALING_SUPPORTED */\n#endif /* DCT_ISLOW_SUPPORTED */\n"
  },
  {
    "path": "jidctflt.c",
    "content": "/*\n * jidctflt.c\n *\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * Modified 2010 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a floating-point implementation of the\n * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine\n * must also perform dequantization of the input coefficients.\n *\n * This implementation should be more accurate than either of the integer\n * IDCT implementations.  However, it may not give the same results on all\n * machines because of differences in roundoff behavior.  Speed will depend\n * on the hardware's floating point capacity.\n *\n * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT\n * on each row (or vice versa, but it's more convenient to emit a row at\n * a time).  Direct algorithms are also available, but they are much more\n * complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README).  The following code\n * is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with a fixed-point\n * implementation, accuracy is lost due to imprecise representation of the\n * scaled quantization values.  However, that problem does not arise if\n * we use floating point arithmetic.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef DCT_FLOAT_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/* Dequantize a coefficient by multiplying it by the multiplier-table\n * entry; produce a float result.\n */\n\n#define DEQUANTIZE(coef,quantval)  (((FAST_FLOAT) (coef)) * (quantval))\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\n */\n\nGLOBAL(void)\njpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  FAST_FLOAT tmp10, tmp11, tmp12, tmp13;\n  FAST_FLOAT z5, z10, z11, z12, z13;\n  JCOEFPTR inptr;\n  FLOAT_MULT_TYPE * quantptr;\n  FAST_FLOAT * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = cinfo->sample_range_limit;\n  int ctr;\n  FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (FLOAT_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; ctr--) {\n    /* Due to quantization, we will usually find that many of the input\n     * coefficients are zero, especially the AC terms.  We can exploit this\n     * by short-circuiting the IDCT calculation for any column in which all\n     * the AC terms are zero.  In that case each output is equal to the\n     * DC coefficient (with scale factor as needed).\n     * With typical images and quantization tables, half or more of the\n     * column DCT calculations can be simplified this way.\n     */\n    \n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n\tinptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&\n\tinptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&\n\tinptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero */\n      FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n      \n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n      wsptr[DCTSIZE*4] = dcval;\n      wsptr[DCTSIZE*5] = dcval;\n      wsptr[DCTSIZE*6] = dcval;\n      wsptr[DCTSIZE*7] = dcval;\n      \n      inptr++;\t\t\t/* advance pointers to next column */\n      quantptr++;\n      wsptr++;\n      continue;\n    }\n    \n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = tmp0 + tmp2;\t/* phase 3 */\n    tmp11 = tmp0 - tmp2;\n\n    tmp13 = tmp1 + tmp3;\t/* phases 5-3 */\n    tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */\n\n    tmp0 = tmp10 + tmp13;\t/* phase 2 */\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n    \n    /* Odd part */\n\n    tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    z13 = tmp6 + tmp5;\t\t/* phase 6 */\n    z10 = tmp6 - tmp5;\n    z11 = tmp4 + tmp7;\n    z12 = tmp4 - tmp7;\n\n    tmp7 = z11 + z13;\t\t/* phase 5 */\n    tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */\n\n    z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */\n    tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */\n    tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;\t/* phase 2 */\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 - tmp5;\n\n    wsptr[DCTSIZE*0] = tmp0 + tmp7;\n    wsptr[DCTSIZE*7] = tmp0 - tmp7;\n    wsptr[DCTSIZE*1] = tmp1 + tmp6;\n    wsptr[DCTSIZE*6] = tmp1 - tmp6;\n    wsptr[DCTSIZE*2] = tmp2 + tmp5;\n    wsptr[DCTSIZE*5] = tmp2 - tmp5;\n    wsptr[DCTSIZE*3] = tmp3 + tmp4;\n    wsptr[DCTSIZE*4] = tmp3 - tmp4;\n\n    inptr++;\t\t\t/* advance pointers to next column */\n    quantptr++;\n    wsptr++;\n  }\n  \n  /* Pass 2: process rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* Rows of zeroes can be exploited in the same way as we did with columns.\n     * However, the column calculation has created many nonzero AC terms, so\n     * the simplification applies less often (typically 5% to 10% of the time).\n     * And testing floats for zero is relatively expensive, so we don't bother.\n     */\n    \n    /* Even part */\n\n    /* Apply signed->unsigned and prepare float->int conversion */\n    z5 = wsptr[0] + ((FAST_FLOAT) CENTERJSAMPLE + (FAST_FLOAT) 0.5);\n    tmp10 = z5 + wsptr[4];\n    tmp11 = z5 - wsptr[4];\n\n    tmp13 = wsptr[2] + wsptr[6];\n    tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13;\n\n    tmp0 = tmp10 + tmp13;\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z13 = wsptr[5] + wsptr[3];\n    z10 = wsptr[5] - wsptr[3];\n    z11 = wsptr[1] + wsptr[7];\n    z12 = wsptr[1] - wsptr[7];\n\n    tmp7 = z11 + z13;\n    tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562);\n\n    z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */\n    tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */\n    tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 - tmp5;\n\n    /* Final output stage: float->int conversion and range-limit */\n\n    outptr[0] = range_limit[((int) (tmp0 + tmp7)) & RANGE_MASK];\n    outptr[7] = range_limit[((int) (tmp0 - tmp7)) & RANGE_MASK];\n    outptr[1] = range_limit[((int) (tmp1 + tmp6)) & RANGE_MASK];\n    outptr[6] = range_limit[((int) (tmp1 - tmp6)) & RANGE_MASK];\n    outptr[2] = range_limit[((int) (tmp2 + tmp5)) & RANGE_MASK];\n    outptr[5] = range_limit[((int) (tmp2 - tmp5)) & RANGE_MASK];\n    outptr[3] = range_limit[((int) (tmp3 + tmp4)) & RANGE_MASK];\n    outptr[4] = range_limit[((int) (tmp3 - tmp4)) & RANGE_MASK];\n    \n    wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n}\n\n#endif /* DCT_FLOAT_SUPPORTED */\n"
  },
  {
    "path": "jidctfst.c",
    "content": "/*\n * jidctfst.c\n *\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a fast, not so accurate integer implementation of the\n * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine\n * must also perform dequantization of the input coefficients.\n *\n * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT\n * on each row (or vice versa, but it's more convenient to emit a row at\n * a time).  Direct algorithms are also available, but they are much more\n * complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README).  The following code\n * is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with fixed-point math,\n * accuracy is lost due to imprecise representation of the scaled\n * quantization values.  The smaller the quantization table entry, the less\n * precise the scaled value, so this implementation does worse with high-\n * quality-setting files than with low-quality ones.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef DCT_IFAST_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/* Scaling decisions are generally the same as in the LL&M algorithm;\n * see jidctint.c for more details.  However, we choose to descale\n * (right shift) multiplication products as soon as they are formed,\n * rather than carrying additional fractional bits into subsequent additions.\n * This compromises accuracy slightly, but it lets us save a few shifts.\n * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)\n * everywhere except in the multiplications proper; this saves a good deal\n * of work on 16-bit-int machines.\n *\n * The dequantized coefficients are not integers because the AA&N scaling\n * factors have been incorporated.  We represent them scaled up by PASS1_BITS,\n * so that the first and second IDCT rounds have the same input scaling.\n * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to\n * avoid a descaling shift; this compromises accuracy rather drastically\n * for small quantization table entries, but it saves a lot of shifts.\n * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway,\n * so we use a much larger scaling factor to preserve accuracy.\n *\n * A final compromise is to represent the multiplicative constants to only\n * 8 fractional bits, rather than 13.  This saves some shifting work on some\n * machines, and may also reduce the cost of multiplication (since there\n * are fewer one-bits in the constants).\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define CONST_BITS  8\n#define PASS1_BITS  2\n#else\n#define CONST_BITS  8\n#define PASS1_BITS  1\t\t/* lose a little precision to avoid overflow */\n#endif\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 8\n#define FIX_1_082392200  ((INT32)  277)\t\t/* FIX(1.082392200) */\n#define FIX_1_414213562  ((INT32)  362)\t\t/* FIX(1.414213562) */\n#define FIX_1_847759065  ((INT32)  473)\t\t/* FIX(1.847759065) */\n#define FIX_2_613125930  ((INT32)  669)\t\t/* FIX(2.613125930) */\n#else\n#define FIX_1_082392200  FIX(1.082392200)\n#define FIX_1_414213562  FIX(1.414213562)\n#define FIX_1_847759065  FIX(1.847759065)\n#define FIX_2_613125930  FIX(2.613125930)\n#endif\n\n\n/* We can gain a little more speed, with a further compromise in accuracy,\n * by omitting the addition in a descaling shift.  This yields an incorrectly\n * rounded result half the time...\n */\n\n#ifndef USE_ACCURATE_ROUNDING\n#undef DESCALE\n#define DESCALE(x,n)  RIGHT_SHIFT(x, n)\n#endif\n\n\n/* Multiply a DCTELEM variable by an INT32 constant, and immediately\n * descale to yield a DCTELEM result.\n */\n\n#define MULTIPLY(var,const)  ((DCTELEM) DESCALE((var) * (const), CONST_BITS))\n\n\n/* Dequantize a coefficient by multiplying it by the multiplier-table\n * entry; produce a DCTELEM result.  For 8-bit data a 16x16->16\n * multiplication will do.  For 12-bit data, the multiplier table is\n * declared INT32, so a 32-bit multiply will be used.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define DEQUANTIZE(coef,quantval)  (((IFAST_MULT_TYPE) (coef)) * (quantval))\n#else\n#define DEQUANTIZE(coef,quantval)  \\\n\tDESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS)\n#endif\n\n\n/* Like DESCALE, but applies to a DCTELEM and produces an int.\n * We assume that int right shift is unsigned if INT32 right shift is.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define ISHIFT_TEMPS\tDCTELEM ishift_temp;\n#if BITS_IN_JSAMPLE == 8\n#define DCTELEMBITS  16\t\t/* DCTELEM may be 16 or 32 bits */\n#else\n#define DCTELEMBITS  32\t\t/* DCTELEM must be 32 bits */\n#endif\n#define IRIGHT_SHIFT(x,shft)  \\\n    ((ishift_temp = (x)) < 0 ? \\\n     (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \\\n     (ishift_temp >> (shft)))\n#else\n#define ISHIFT_TEMPS\n#define IRIGHT_SHIFT(x,shft)\t((x) >> (shft))\n#endif\n\n#ifdef USE_ACCURATE_ROUNDING\n#define IDESCALE(x,n)  ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n))\n#else\n#define IDESCALE(x,n)  ((int) IRIGHT_SHIFT(x, n))\n#endif\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\n */\n\nGLOBAL(void)\njpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  DCTELEM tmp10, tmp11, tmp12, tmp13;\n  DCTELEM z5, z10, z11, z12, z13;\n  JCOEFPTR inptr;\n  IFAST_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[DCTSIZE2];\t/* buffers data between passes */\n  SHIFT_TEMPS\t\t\t/* for DESCALE */\n  ISHIFT_TEMPS\t\t\t/* for IDESCALE */\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (IFAST_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; ctr--) {\n    /* Due to quantization, we will usually find that many of the input\n     * coefficients are zero, especially the AC terms.  We can exploit this\n     * by short-circuiting the IDCT calculation for any column in which all\n     * the AC terms are zero.  In that case each output is equal to the\n     * DC coefficient (with scale factor as needed).\n     * With typical images and quantization tables, half or more of the\n     * column DCT calculations can be simplified this way.\n     */\n    \n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n\tinptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&\n\tinptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&\n\tinptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero */\n      int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n\n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n      wsptr[DCTSIZE*4] = dcval;\n      wsptr[DCTSIZE*5] = dcval;\n      wsptr[DCTSIZE*6] = dcval;\n      wsptr[DCTSIZE*7] = dcval;\n      \n      inptr++;\t\t\t/* advance pointers to next column */\n      quantptr++;\n      wsptr++;\n      continue;\n    }\n    \n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = tmp0 + tmp2;\t/* phase 3 */\n    tmp11 = tmp0 - tmp2;\n\n    tmp13 = tmp1 + tmp3;\t/* phases 5-3 */\n    tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */\n\n    tmp0 = tmp10 + tmp13;\t/* phase 2 */\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n    \n    /* Odd part */\n\n    tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    z13 = tmp6 + tmp5;\t\t/* phase 6 */\n    z10 = tmp6 - tmp5;\n    z11 = tmp4 + tmp7;\n    z12 = tmp4 - tmp7;\n\n    tmp7 = z11 + z13;\t\t/* phase 5 */\n    tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */\n\n    z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */\n    tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */\n    tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;\t/* phase 2 */\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 + tmp5;\n\n    wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);\n    wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);\n    wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6);\n    wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);\n    wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5);\n    wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);\n    wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4);\n    wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4);\n\n    inptr++;\t\t\t/* advance pointers to next column */\n    quantptr++;\n    wsptr++;\n  }\n  \n  /* Pass 2: process rows from work array, store into output array. */\n  /* Note that we must descale the results by a factor of 8 == 2**3, */\n  /* and also undo the PASS1_BITS scaling. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* Rows of zeroes can be exploited in the same way as we did with columns.\n     * However, the column calculation has created many nonzero AC terms, so\n     * the simplification applies less often (typically 5% to 10% of the time).\n     * On machines with very fast multiplication, it's possible that the\n     * test takes more time than it's worth.  In that case this section\n     * may be commented out.\n     */\n    \n#ifndef NO_ZERO_ROW_TEST\n    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&\n\twsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {\n      /* AC terms all zero */\n      JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3)\n\t\t\t\t  & RANGE_MASK];\n      \n      outptr[0] = dcval;\n      outptr[1] = dcval;\n      outptr[2] = dcval;\n      outptr[3] = dcval;\n      outptr[4] = dcval;\n      outptr[5] = dcval;\n      outptr[6] = dcval;\n      outptr[7] = dcval;\n\n      wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n      continue;\n    }\n#endif\n    \n    /* Even part */\n\n    tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);\n    tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]);\n\n    tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]);\n    tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562)\n\t    - tmp13;\n\n    tmp0 = tmp10 + tmp13;\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3];\n    z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3];\n    z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7];\n    z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7];\n\n    tmp7 = z11 + z13;\t\t/* phase 5 */\n    tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */\n\n    z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */\n    tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */\n    tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;\t/* phase 2 */\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 + tmp5;\n\n    /* Final output stage: scale down by a factor of 8 and range-limit */\n\n    outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n}\n\n#endif /* DCT_IFAST_SUPPORTED */\n"
  },
  {
    "path": "jidctint.c",
    "content": "/*\n * jidctint.c\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modification developed 2002-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a slow-but-accurate integer implementation of the\n * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine\n * must also perform dequantization of the input coefficients.\n *\n * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT\n * on each row (or vice versa, but it's more convenient to emit a row at\n * a time).  Direct algorithms are also available, but they are much more\n * complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on an algorithm described in\n *   C. Loeffler, A. Ligtenberg and G. Moschytz, \"Practical Fast 1-D DCT\n *   Algorithms with 11 Multiplications\", Proc. Int'l. Conf. on Acoustics,\n *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.\n * The primary algorithm described there uses 11 multiplies and 29 adds.\n * We use their alternate method with 12 multiplies and 32 adds.\n * The advantage of this method is that no data path contains more than one\n * multiplication; this allows a very simple and accurate implementation in\n * scaled fixed-point arithmetic, with a minimal number of shifts.\n *\n * We also provide IDCT routines with various output sample block sizes for\n * direct resolution reduction or enlargement and for direct resolving the\n * common 2x1 and 1x2 subsampling cases without additional resampling: NxN\n * (N=1...16), 2NxN, and Nx2N (N=1...8) pixels for one 8x8 input DCT block.\n *\n * For N<8 we simply take the corresponding low-frequency coefficients of\n * the 8x8 input DCT block and apply an NxN point IDCT on the sub-block\n * to yield the downscaled outputs.\n * This can be seen as direct low-pass downsampling from the DCT domain\n * point of view rather than the usual spatial domain point of view,\n * yielding significant computational savings and results at least\n * as good as common bilinear (averaging) spatial downsampling.\n *\n * For N>8 we apply a partial NxN IDCT on the 8 input coefficients as\n * lower frequencies and higher frequencies assumed to be zero.\n * It turns out that the computational effort is similar to the 8x8 IDCT\n * regarding the output size.\n * Furthermore, the scaling and descaling is the same for all IDCT sizes.\n *\n * CAUTION: We rely on the FIX() macro except for the N=1,2,4,8 cases\n * since there would be too many additional constants to pre-calculate.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef DCT_ISLOW_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */\n#endif\n\n\n/*\n * The poop on this scaling stuff is as follows:\n *\n * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)\n * larger than the true IDCT outputs.  The final outputs are therefore\n * a factor of N larger than desired; since N=8 this can be cured by\n * a simple right shift at the end of the algorithm.  The advantage of\n * this arrangement is that we save two multiplications per 1-D IDCT,\n * because the y0 and y4 inputs need not be divided by sqrt(N).\n *\n * We have to do addition and subtraction of the integer inputs, which\n * is no problem, and multiplication by fractional constants, which is\n * a problem to do in integer arithmetic.  We multiply all the constants\n * by CONST_SCALE and convert them to integer constants (thus retaining\n * CONST_BITS bits of precision in the constants).  After doing a\n * multiplication we have to divide the product by CONST_SCALE, with proper\n * rounding, to produce the correct output.  This division can be done\n * cheaply as a right shift of CONST_BITS bits.  We postpone shifting\n * as long as possible so that partial sums can be added together with\n * full fractional precision.\n *\n * The outputs of the first pass are scaled up by PASS1_BITS bits so that\n * they are represented to better-than-integral precision.  These outputs\n * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word\n * with the recommended scaling.  (To scale up 12-bit sample data further, an\n * intermediate INT32 array would be needed.)\n *\n * To avoid overflow of the 32-bit intermediate results in pass 2, we must\n * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis\n * shows that the values given below are the most effective.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define CONST_BITS  13\n#define PASS1_BITS  2\n#else\n#define CONST_BITS  13\n#define PASS1_BITS  1\t\t/* lose a little precision to avoid overflow */\n#endif\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 13\n#define FIX_0_298631336  ((INT32)  2446)\t/* FIX(0.298631336) */\n#define FIX_0_390180644  ((INT32)  3196)\t/* FIX(0.390180644) */\n#define FIX_0_541196100  ((INT32)  4433)\t/* FIX(0.541196100) */\n#define FIX_0_765366865  ((INT32)  6270)\t/* FIX(0.765366865) */\n#define FIX_0_899976223  ((INT32)  7373)\t/* FIX(0.899976223) */\n#define FIX_1_175875602  ((INT32)  9633)\t/* FIX(1.175875602) */\n#define FIX_1_501321110  ((INT32)  12299)\t/* FIX(1.501321110) */\n#define FIX_1_847759065  ((INT32)  15137)\t/* FIX(1.847759065) */\n#define FIX_1_961570560  ((INT32)  16069)\t/* FIX(1.961570560) */\n#define FIX_2_053119869  ((INT32)  16819)\t/* FIX(2.053119869) */\n#define FIX_2_562915447  ((INT32)  20995)\t/* FIX(2.562915447) */\n#define FIX_3_072711026  ((INT32)  25172)\t/* FIX(3.072711026) */\n#else\n#define FIX_0_298631336  FIX(0.298631336)\n#define FIX_0_390180644  FIX(0.390180644)\n#define FIX_0_541196100  FIX(0.541196100)\n#define FIX_0_765366865  FIX(0.765366865)\n#define FIX_0_899976223  FIX(0.899976223)\n#define FIX_1_175875602  FIX(1.175875602)\n#define FIX_1_501321110  FIX(1.501321110)\n#define FIX_1_847759065  FIX(1.847759065)\n#define FIX_1_961570560  FIX(1.961570560)\n#define FIX_2_053119869  FIX(2.053119869)\n#define FIX_2_562915447  FIX(2.562915447)\n#define FIX_3_072711026  FIX(3.072711026)\n#endif\n\n\n/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.\n * For 8-bit samples with the recommended scaling, all the variable\n * and constant values involved are no more than 16 bits wide, so a\n * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.\n * For 12-bit samples, a full 32-bit multiplication will be needed.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)\n#else\n#define MULTIPLY(var,const)  ((var) * (const))\n#endif\n\n\n/* Dequantize a coefficient by multiplying it by the multiplier-table\n * entry; produce an int result.  In this module, both inputs and result\n * are 16 bits or less, so either int or short multiply will work.\n */\n\n#define DEQUANTIZE(coef,quantval)  (((ISLOW_MULT_TYPE) (coef)) * (quantval))\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\n *\n * cK represents sqrt(2) * cos(K*pi/16).\n */\n\nGLOBAL(void)\njpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3;\n  INT32 tmp10, tmp11, tmp12, tmp13;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[DCTSIZE2];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * Note results are scaled up by sqrt(8) compared to a true IDCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; ctr--) {\n    /* Due to quantization, we will usually find that many of the input\n     * coefficients are zero, especially the AC terms.  We can exploit this\n     * by short-circuiting the IDCT calculation for any column in which all\n     * the AC terms are zero.  In that case each output is equal to the\n     * DC coefficient (with scale factor as needed).\n     * With typical images and quantization tables, half or more of the\n     * column DCT calculations can be simplified this way.\n     */\n\n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n\tinptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&\n\tinptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&\n\tinptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero */\n      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;\n\n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n      wsptr[DCTSIZE*4] = dcval;\n      wsptr[DCTSIZE*5] = dcval;\n      wsptr[DCTSIZE*6] = dcval;\n      wsptr[DCTSIZE*7] = dcval;\n\n      inptr++;\t\t\t/* advance pointers to next column */\n      quantptr++;\n      wsptr++;\n      continue;\n    }\n\n    /* Even part: reverse the even part of the forward DCT.\n     * The rotator is c(-6).\n     */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);       /* c6 */\n    tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);     /* c2-c6 */\n    tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);     /* c2+c6 */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z2 <<= CONST_BITS;\n    z3 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z2 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    tmp0 = z2 + z3;\n    tmp1 = z2 - z3;\n\n    tmp10 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n    tmp11 = tmp1 + tmp3;\n    tmp12 = tmp1 - tmp3;\n\n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n\n    z2 = tmp0 + tmp2;\n    z3 = tmp1 + tmp3;\n\n    z1 = MULTIPLY(z2 + z3, FIX_1_175875602);       /*  c3 */\n    z2 = MULTIPLY(z2, - FIX_1_961570560);          /* -c3-c5 */\n    z3 = MULTIPLY(z3, - FIX_0_390180644);          /* -c3+c5 */\n    z2 += z1;\n    z3 += z1;\n\n    z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */\n    tmp0 = MULTIPLY(tmp0, FIX_0_298631336);        /* -c1+c3+c5-c7 */\n    tmp3 = MULTIPLY(tmp3, FIX_1_501321110);        /*  c1+c3-c5-c7 */\n    tmp0 += z1 + z2;\n    tmp3 += z1 + z3;\n\n    z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */\n    tmp1 = MULTIPLY(tmp1, FIX_2_053119869);        /*  c1+c3-c5+c7 */\n    tmp2 = MULTIPLY(tmp2, FIX_3_072711026);        /*  c1+c3+c5-c7 */\n    tmp1 += z1 + z3;\n    tmp2 += z1 + z2;\n\n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n\n    wsptr[DCTSIZE*0] = (int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*7] = (int) RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*1] = (int) RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*6] = (int) RIGHT_SHIFT(tmp11 - tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*2] = (int) RIGHT_SHIFT(tmp12 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS);\n\n    inptr++;\t\t\t/* advance pointers to next column */\n    quantptr++;\n    wsptr++;\n  }\n\n  /* Pass 2: process rows from work array, store into output array.\n   * Note that we must descale the results by a factor of 8 == 2**3,\n   * and also undo the PASS1_BITS scaling.\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* Rows of zeroes can be exploited in the same way as we did with columns.\n     * However, the column calculation has created many nonzero AC terms, so\n     * the simplification applies less often (typically 5% to 10% of the time).\n     * On machines with very fast multiplication, it's possible that the\n     * test takes more time than it's worth.  In that case this section\n     * may be commented out.\n     */\n\n#ifndef NO_ZERO_ROW_TEST\n    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&\n\twsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {\n      /* AC terms all zero */\n      JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)\n\t\t\t\t  & RANGE_MASK];\n\n      outptr[0] = dcval;\n      outptr[1] = dcval;\n      outptr[2] = dcval;\n      outptr[3] = dcval;\n      outptr[4] = dcval;\n      outptr[5] = dcval;\n      outptr[6] = dcval;\n      outptr[7] = dcval;\n\n      wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n      continue;\n    }\n#endif\n\n    /* Even part: reverse the even part of the forward DCT.\n     * The rotator is c(-6).\n     */\n\n    z2 = (INT32) wsptr[2];\n    z3 = (INT32) wsptr[6];\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);       /* c6 */\n    tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);     /* c2-c6 */\n    tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);     /* c2+c6 */\n\n    /* Add fudge factor here for final descale. */\n    z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z3 = (INT32) wsptr[4];\n\n    tmp0 = (z2 + z3) << CONST_BITS;\n    tmp1 = (z2 - z3) << CONST_BITS;\n\n    tmp10 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n    tmp11 = tmp1 + tmp3;\n    tmp12 = tmp1 - tmp3;\n\n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n\n    tmp0 = (INT32) wsptr[7];\n    tmp1 = (INT32) wsptr[5];\n    tmp2 = (INT32) wsptr[3];\n    tmp3 = (INT32) wsptr[1];\n\n    z2 = tmp0 + tmp2;\n    z3 = tmp1 + tmp3;\n\n    z1 = MULTIPLY(z2 + z3, FIX_1_175875602);       /*  c3 */\n    z2 = MULTIPLY(z2, - FIX_1_961570560);          /* -c3-c5 */\n    z3 = MULTIPLY(z3, - FIX_0_390180644);          /* -c3+c5 */\n    z2 += z1;\n    z3 += z1;\n\n    z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */\n    tmp0 = MULTIPLY(tmp0, FIX_0_298631336);        /* -c1+c3+c5-c7 */\n    tmp3 = MULTIPLY(tmp3, FIX_1_501321110);        /*  c1+c3-c5-c7 */\n    tmp0 += z1 + z2;\n    tmp3 += z1 + z3;\n\n    z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */\n    tmp1 = MULTIPLY(tmp1, FIX_2_053119869);        /*  c1+c3-c5+c7 */\n    tmp2 = MULTIPLY(tmp2, FIX_3_072711026);        /*  c1+c3+c5-c7 */\n    tmp1 += z1 + z3;\n    tmp2 += z1 + z2;\n\n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp3,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp3,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n}\n\n#ifdef IDCT_SCALING_SUPPORTED\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 7x7 output block.\n *\n * Optimized algorithm with 12 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/14).\n */\n\nGLOBAL(void)\njpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12, tmp13;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[7*7];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 7; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp13 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp13 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp13 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734));     /* c4 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123));     /* c6 */\n    tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */\n    tmp0 = z1 + z3;\n    z2 -= tmp0;\n    tmp0 = MULTIPLY(tmp0, FIX(1.274162392)) + tmp13; /* c2 */\n    tmp10 += tmp0 - MULTIPLY(z3, FIX(0.077722536));  /* c2-c4-c6 */\n    tmp12 += tmp0 - MULTIPLY(z1, FIX(2.470602249));  /* c2+c4+c6 */\n    tmp13 += MULTIPLY(z2, FIX(1.414213562));         /* c0 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n\n    tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347));      /* (c3+c1-c5)/2 */\n    tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339));      /* (c3+c5-c1)/2 */\n    tmp0 = tmp1 - tmp2;\n    tmp1 += tmp2;\n    tmp2 = MULTIPLY(z2 + z3, - FIX(1.378756276));    /* -c1 */\n    tmp1 += tmp2;\n    z2 = MULTIPLY(z1 + z3, FIX(0.613604268));        /* c5 */\n    tmp0 += z2;\n    tmp2 += z2 + MULTIPLY(z3, FIX(1.870828693));     /* c3+c1-c5 */\n\n    /* Final output stage */\n\n    wsptr[7*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[7*6] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[7*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[7*5] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[7*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[7*4] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[7*3] = (int) RIGHT_SHIFT(tmp13, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 7 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 7; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp13 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp13 <<= CONST_BITS;\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[4];\n    z3 = (INT32) wsptr[6];\n\n    tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734));     /* c4 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123));     /* c6 */\n    tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */\n    tmp0 = z1 + z3;\n    z2 -= tmp0;\n    tmp0 = MULTIPLY(tmp0, FIX(1.274162392)) + tmp13; /* c2 */\n    tmp10 += tmp0 - MULTIPLY(z3, FIX(0.077722536));  /* c2-c4-c6 */\n    tmp12 += tmp0 - MULTIPLY(z1, FIX(2.470602249));  /* c2+c4+c6 */\n    tmp13 += MULTIPLY(z2, FIX(1.414213562));         /* c0 */\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n\n    tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347));      /* (c3+c1-c5)/2 */\n    tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339));      /* (c3+c5-c1)/2 */\n    tmp0 = tmp1 - tmp2;\n    tmp1 += tmp2;\n    tmp2 = MULTIPLY(z2 + z3, - FIX(1.378756276));    /* -c1 */\n    tmp1 += tmp2;\n    z2 = MULTIPLY(z1 + z3, FIX(0.613604268));        /* c5 */\n    tmp0 += z2;\n    tmp2 += z2 + MULTIPLY(z3, FIX(1.870828693));     /* c3+c1-c5 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 7;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 6x6 output block.\n *\n * Optimized algorithm with 3 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/12).\n */\n\nGLOBAL(void)\njpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[6*6];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp10 = MULTIPLY(tmp2, FIX(0.707106781));   /* c4 */\n    tmp1 = tmp0 + tmp10;\n    tmp11 = RIGHT_SHIFT(tmp0 - tmp10 - tmp10, CONST_BITS-PASS1_BITS);\n    tmp10 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp0 = MULTIPLY(tmp10, FIX(1.224744871));   /* c2 */\n    tmp10 = tmp1 + tmp0;\n    tmp12 = tmp1 - tmp0;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */\n    tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);\n    tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);\n    tmp1 = (z1 - z2 - z3) << PASS1_BITS;\n\n    /* Final output stage */\n\n    wsptr[6*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[6*5] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[6*1] = (int) (tmp11 + tmp1);\n    wsptr[6*4] = (int) (tmp11 - tmp1);\n    wsptr[6*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[6*3] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 6 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 6; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 <<= CONST_BITS;\n    tmp2 = (INT32) wsptr[4];\n    tmp10 = MULTIPLY(tmp2, FIX(0.707106781));   /* c4 */\n    tmp1 = tmp0 + tmp10;\n    tmp11 = tmp0 - tmp10 - tmp10;\n    tmp10 = (INT32) wsptr[2];\n    tmp0 = MULTIPLY(tmp10, FIX(1.224744871));   /* c2 */\n    tmp10 = tmp1 + tmp0;\n    tmp12 = tmp1 - tmp0;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */\n    tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);\n    tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);\n    tmp1 = (z1 - z2 - z3) << CONST_BITS;\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 6;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 5x5 output block.\n *\n * Optimized algorithm with 5 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/10).\n */\n\nGLOBAL(void)\njpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp10, tmp11, tmp12;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[5*5];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 5; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp12 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp12 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp12 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */\n    z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */\n    z3 = tmp12 + z2;\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z1;\n    tmp12 -= z2 << 2;\n\n    /* Odd part */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));     /* c3 */\n    tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148));   /* c1-c3 */\n    tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899));   /* c1+c3 */\n\n    /* Final output stage */\n\n    wsptr[5*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[5*4] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[5*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[5*3] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[5*2] = (int) RIGHT_SHIFT(tmp12, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 5 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 5; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp12 <<= CONST_BITS;\n    tmp0 = (INT32) wsptr[2];\n    tmp1 = (INT32) wsptr[4];\n    z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */\n    z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */\n    z3 = tmp12 + z2;\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z1;\n    tmp12 -= z2 << 2;\n\n    /* Odd part */\n\n    z2 = (INT32) wsptr[1];\n    z3 = (INT32) wsptr[3];\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));     /* c3 */\n    tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148));   /* c1-c3 */\n    tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899));   /* c1+c3 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 5;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 4x4 output block.\n *\n * Optimized algorithm with 3 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT].\n */\n\nGLOBAL(void)\njpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp2, tmp10, tmp12;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[4*4];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 4; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    \n    tmp10 = (tmp0 + tmp2) << PASS1_BITS;\n    tmp12 = (tmp0 - tmp2) << PASS1_BITS;\n\n    /* Odd part */\n    /* Same rotation as in the even part of the 8x8 LL&M IDCT */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);               /* c6 */\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp0 = RIGHT_SHIFT(z1 + MULTIPLY(z2, FIX_0_765366865), /* c2-c6 */\n\t\t       CONST_BITS-PASS1_BITS);\n    tmp2 = RIGHT_SHIFT(z1 - MULTIPLY(z3, FIX_1_847759065), /* c2+c6 */\n\t\t       CONST_BITS-PASS1_BITS);\n\n    /* Final output stage */\n\n    wsptr[4*0] = (int) (tmp10 + tmp0);\n    wsptr[4*3] = (int) (tmp10 - tmp0);\n    wsptr[4*1] = (int) (tmp12 + tmp2);\n    wsptr[4*2] = (int) (tmp12 - tmp2);\n  }\n\n  /* Pass 2: process 4 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 4; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp2 = (INT32) wsptr[2];\n\n    tmp10 = (tmp0 + tmp2) << CONST_BITS;\n    tmp12 = (tmp0 - tmp2) << CONST_BITS;\n\n    /* Odd part */\n    /* Same rotation as in the even part of the 8x8 LL&M IDCT */\n\n    z2 = (INT32) wsptr[1];\n    z3 = (INT32) wsptr[3];\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);   /* c6 */\n    tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */\n    tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 4;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 3x3 output block.\n *\n * Optimized algorithm with 2 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/6).\n */\n\nGLOBAL(void)\njpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp2, tmp10, tmp12;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[3*3];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 3; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */\n    tmp10 = tmp0 + tmp12;\n    tmp2 = tmp0 - tmp12 - tmp12;\n\n    /* Odd part */\n\n    tmp12 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */\n\n    /* Final output stage */\n\n    wsptr[3*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[3*2] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[3*1] = (int) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 3 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 3; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 <<= CONST_BITS;\n    tmp2 = (INT32) wsptr[2];\n    tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */\n    tmp10 = tmp0 + tmp12;\n    tmp2 = tmp0 - tmp12 - tmp12;\n\n    /* Odd part */\n\n    tmp12 = (INT32) wsptr[1];\n    tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 3;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 2x2 output block.\n *\n * Multiplication-less algorithm.\n */\n\nGLOBAL(void)\njpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;\n  ISLOW_MULT_TYPE * quantptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input. */\n\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n\n  /* Column 0 */\n  tmp4 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]);\n  tmp5 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]);\n  /* Add fudge factor here for final descale. */\n  tmp4 += ONE << 2;\n\n  tmp0 = tmp4 + tmp5;\n  tmp2 = tmp4 - tmp5;\n\n  /* Column 1 */\n  tmp4 = DEQUANTIZE(coef_block[DCTSIZE*0+1], quantptr[DCTSIZE*0+1]);\n  tmp5 = DEQUANTIZE(coef_block[DCTSIZE*1+1], quantptr[DCTSIZE*1+1]);\n\n  tmp1 = tmp4 + tmp5;\n  tmp3 = tmp4 - tmp5;\n\n  /* Pass 2: process 2 rows, store into output array. */\n\n  /* Row 0 */\n  outptr = output_buf[0] + output_col;\n\n  outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];\n  outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];\n\n  /* Row 1 */\n  outptr = output_buf[1] + output_col;\n\n  outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp2 + tmp3, 3) & RANGE_MASK];\n  outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2 - tmp3, 3) & RANGE_MASK];\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 1x1 output block.\n *\n * We hardly need an inverse DCT routine for this: just take the\n * average pixel value, which is one-eighth of the DC coefficient.\n */\n\nGLOBAL(void)\njpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  int dcval;\n  ISLOW_MULT_TYPE * quantptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  SHIFT_TEMPS\n\n  /* 1x1 is trivial: just take the DC coefficient divided by 8. */\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  dcval = DEQUANTIZE(coef_block[0], quantptr[0]);\n  dcval = (int) DESCALE((INT32) dcval, 3);\n\n  output_buf[0][output_col] = range_limit[dcval & RANGE_MASK];\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 9x9 output block.\n *\n * Optimized algorithm with 10 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/18).\n */\n\nGLOBAL(void)\njpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13, tmp14;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*9];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp3 = MULTIPLY(z3, FIX(0.707106781));      /* c6 */\n    tmp1 = tmp0 + tmp3;\n    tmp2 = tmp0 - tmp3 - tmp3;\n\n    tmp0 = MULTIPLY(z1 - z2, FIX(0.707106781)); /* c6 */\n    tmp11 = tmp2 + tmp0;\n    tmp14 = tmp2 - tmp0 - tmp0;\n\n    tmp0 = MULTIPLY(z1 + z2, FIX(1.328926049)); /* c2 */\n    tmp2 = MULTIPLY(z1, FIX(1.083350441));      /* c4 */\n    tmp3 = MULTIPLY(z2, FIX(0.245575608));      /* c8 */\n\n    tmp10 = tmp1 + tmp0 - tmp3;\n    tmp12 = tmp1 - tmp0 + tmp2;\n    tmp13 = tmp1 - tmp2 + tmp3;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    z2 = MULTIPLY(z2, - FIX(1.224744871));           /* -c3 */\n\n    tmp2 = MULTIPLY(z1 + z3, FIX(0.909038955));      /* c5 */\n    tmp3 = MULTIPLY(z1 + z4, FIX(0.483689525));      /* c7 */\n    tmp0 = tmp2 + tmp3 - z2;\n    tmp1 = MULTIPLY(z3 - z4, FIX(1.392728481));      /* c1 */\n    tmp2 += z2 - tmp1;\n    tmp3 += z2 + tmp1;\n    tmp1 = MULTIPLY(z1 - z3 - z4, FIX(1.224744871)); /* c3 */\n\n    /* Final output stage */\n\n    wsptr[8*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[8*8] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[8*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[8*7] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[8*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[8*6] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[8*3] = (int) RIGHT_SHIFT(tmp13 + tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[8*5] = (int) RIGHT_SHIFT(tmp13 - tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[8*4] = (int) RIGHT_SHIFT(tmp14, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 9 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 9; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 <<= CONST_BITS;\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[4];\n    z3 = (INT32) wsptr[6];\n\n    tmp3 = MULTIPLY(z3, FIX(0.707106781));      /* c6 */\n    tmp1 = tmp0 + tmp3;\n    tmp2 = tmp0 - tmp3 - tmp3;\n\n    tmp0 = MULTIPLY(z1 - z2, FIX(0.707106781)); /* c6 */\n    tmp11 = tmp2 + tmp0;\n    tmp14 = tmp2 - tmp0 - tmp0;\n\n    tmp0 = MULTIPLY(z1 + z2, FIX(1.328926049)); /* c2 */\n    tmp2 = MULTIPLY(z1, FIX(1.083350441));      /* c4 */\n    tmp3 = MULTIPLY(z2, FIX(0.245575608));      /* c8 */\n\n    tmp10 = tmp1 + tmp0 - tmp3;\n    tmp12 = tmp1 - tmp0 + tmp2;\n    tmp13 = tmp1 - tmp2 + tmp3;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n\n    z2 = MULTIPLY(z2, - FIX(1.224744871));           /* -c3 */\n\n    tmp2 = MULTIPLY(z1 + z3, FIX(0.909038955));      /* c5 */\n    tmp3 = MULTIPLY(z1 + z4, FIX(0.483689525));      /* c7 */\n    tmp0 = tmp2 + tmp3 - z2;\n    tmp1 = MULTIPLY(z3 - z4, FIX(1.392728481));      /* c1 */\n    tmp2 += z2 - tmp1;\n    tmp3 += z2 + tmp1;\n    tmp1 = MULTIPLY(z1 - z3 - z4, FIX(1.224744871)); /* c3 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp3,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp3,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp14,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 10x10 output block.\n *\n * Optimized algorithm with 12 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/20).\n */\n\nGLOBAL(void)\njpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24;\n  INT32 z1, z2, z3, z4, z5;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*10];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z3 += ONE << (CONST_BITS-PASS1_BITS-1);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z1 = MULTIPLY(z4, FIX(1.144122806));         /* c4 */\n    z2 = MULTIPLY(z4, FIX(0.437016024));         /* c8 */\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z2;\n\n    tmp22 = RIGHT_SHIFT(z3 - ((z1 - z2) << 1),   /* c0 = (c4-c8)*2 */\n\t\t\tCONST_BITS-PASS1_BITS);\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));    /* c6 */\n    tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */\n    tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */\n\n    tmp20 = tmp10 + tmp12;\n    tmp24 = tmp10 - tmp12;\n    tmp21 = tmp11 + tmp13;\n    tmp23 = tmp11 - tmp13;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = z2 + z4;\n    tmp13 = z2 - z4;\n\n    tmp12 = MULTIPLY(tmp13, FIX(0.309016994));        /* (c3-c7)/2 */\n    z5 = z3 << CONST_BITS;\n\n    z2 = MULTIPLY(tmp11, FIX(0.951056516));           /* (c3+c7)/2 */\n    z4 = z5 + tmp12;\n\n    tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */\n    tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */\n\n    z2 = MULTIPLY(tmp11, FIX(0.587785252));           /* (c1-c9)/2 */\n    z4 = z5 - tmp12 - (tmp13 << (CONST_BITS - 1));\n\n    tmp12 = (z1 - tmp13 - z3) << PASS1_BITS;\n\n    tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */\n    tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */\n\n    /* Final output stage */\n\n    wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*9] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*8] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2] = (int) (tmp22 + tmp12);\n    wsptr[8*7] = (int) (tmp22 - tmp12);\n    wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*6] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 10 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 10; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z3 <<= CONST_BITS;\n    z4 = (INT32) wsptr[4];\n    z1 = MULTIPLY(z4, FIX(1.144122806));         /* c4 */\n    z2 = MULTIPLY(z4, FIX(0.437016024));         /* c8 */\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z2;\n\n    tmp22 = z3 - ((z1 - z2) << 1);               /* c0 = (c4-c8)*2 */\n\n    z2 = (INT32) wsptr[2];\n    z3 = (INT32) wsptr[6];\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));    /* c6 */\n    tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */\n    tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */\n\n    tmp20 = tmp10 + tmp12;\n    tmp24 = tmp10 - tmp12;\n    tmp21 = tmp11 + tmp13;\n    tmp23 = tmp11 - tmp13;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z3 <<= CONST_BITS;\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = z2 + z4;\n    tmp13 = z2 - z4;\n\n    tmp12 = MULTIPLY(tmp13, FIX(0.309016994));        /* (c3-c7)/2 */\n\n    z2 = MULTIPLY(tmp11, FIX(0.951056516));           /* (c3+c7)/2 */\n    z4 = z3 + tmp12;\n\n    tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */\n    tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */\n\n    z2 = MULTIPLY(tmp11, FIX(0.587785252));           /* (c1-c9)/2 */\n    z4 = z3 - tmp12 - (tmp13 << (CONST_BITS - 1));\n\n    tmp12 = ((z1 - tmp13) << CONST_BITS) - z3;\n\n    tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */\n    tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 11x11 output block.\n *\n * Optimized algorithm with 24 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/22).\n */\n\nGLOBAL(void)\njpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*11];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp10 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp10 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp10 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132));     /* c2+c4 */\n    tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045));     /* c2-c6 */\n    z4 = z1 + z3;\n    tmp24 = MULTIPLY(z4, - FIX(1.155664402));        /* -(c2-c10) */\n    z4 -= z2;\n    tmp25 = tmp10 + MULTIPLY(z4, FIX(1.356927976));  /* c2 */\n    tmp21 = tmp20 + tmp23 + tmp25 -\n\t    MULTIPLY(z2, FIX(1.821790775));          /* c2+c4+c10-c6 */\n    tmp20 += tmp25 + MULTIPLY(z3, FIX(2.115825087)); /* c4+c6 */\n    tmp23 += tmp25 - MULTIPLY(z1, FIX(1.513598477)); /* c6+c8 */\n    tmp24 += tmp25;\n    tmp22 = tmp24 - MULTIPLY(z3, FIX(0.788749120));  /* c8+c10 */\n    tmp24 += MULTIPLY(z2, FIX(1.944413522)) -        /* c2+c8 */\n\t     MULTIPLY(z1, FIX(1.390975730));         /* c4+c10 */\n    tmp25 = tmp10 - MULTIPLY(z4, FIX(1.414213562));  /* c0 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = z1 + z2;\n    tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */\n    tmp11 = MULTIPLY(tmp11, FIX(0.887983902));           /* c3-c9 */\n    tmp12 = MULTIPLY(z1 + z3, FIX(0.670361295));         /* c5-c9 */\n    tmp13 = tmp14 + MULTIPLY(z1 + z4, FIX(0.366151574)); /* c7-c9 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n\t    MULTIPLY(z1, FIX(0.923107866));              /* c7+c5+c3-c1-2*c9 */\n    z1    = tmp14 - MULTIPLY(z2 + z3, FIX(1.163011579)); /* c7+c9 */\n    tmp11 += z1 + MULTIPLY(z2, FIX(2.073276588));        /* c1+c7+3*c9-c3 */\n    tmp12 += z1 - MULTIPLY(z3, FIX(1.192193623));        /* c3+c5-c7-c9 */\n    z1    = MULTIPLY(z2 + z4, - FIX(1.798248910));       /* -(c1+c9) */\n    tmp11 += z1;\n    tmp13 += z1 + MULTIPLY(z4, FIX(2.102458632));        /* c1+c5+c9-c7 */\n    tmp14 += MULTIPLY(z2, - FIX(1.467221301)) +          /* -(c5+c9) */\n\t     MULTIPLY(z3, FIX(1.001388905)) -            /* c1-c9 */\n\t     MULTIPLY(z4, FIX(1.684843907));             /* c3+c9 */\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 11 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 11; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp10 <<= CONST_BITS;\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[4];\n    z3 = (INT32) wsptr[6];\n\n    tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132));     /* c2+c4 */\n    tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045));     /* c2-c6 */\n    z4 = z1 + z3;\n    tmp24 = MULTIPLY(z4, - FIX(1.155664402));        /* -(c2-c10) */\n    z4 -= z2;\n    tmp25 = tmp10 + MULTIPLY(z4, FIX(1.356927976));  /* c2 */\n    tmp21 = tmp20 + tmp23 + tmp25 -\n\t    MULTIPLY(z2, FIX(1.821790775));          /* c2+c4+c10-c6 */\n    tmp20 += tmp25 + MULTIPLY(z3, FIX(2.115825087)); /* c4+c6 */\n    tmp23 += tmp25 - MULTIPLY(z1, FIX(1.513598477)); /* c6+c8 */\n    tmp24 += tmp25;\n    tmp22 = tmp24 - MULTIPLY(z3, FIX(0.788749120));  /* c8+c10 */\n    tmp24 += MULTIPLY(z2, FIX(1.944413522)) -        /* c2+c8 */\n\t     MULTIPLY(z1, FIX(1.390975730));         /* c4+c10 */\n    tmp25 = tmp10 - MULTIPLY(z4, FIX(1.414213562));  /* c0 */\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = z1 + z2;\n    tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */\n    tmp11 = MULTIPLY(tmp11, FIX(0.887983902));           /* c3-c9 */\n    tmp12 = MULTIPLY(z1 + z3, FIX(0.670361295));         /* c5-c9 */\n    tmp13 = tmp14 + MULTIPLY(z1 + z4, FIX(0.366151574)); /* c7-c9 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n\t    MULTIPLY(z1, FIX(0.923107866));              /* c7+c5+c3-c1-2*c9 */\n    z1    = tmp14 - MULTIPLY(z2 + z3, FIX(1.163011579)); /* c7+c9 */\n    tmp11 += z1 + MULTIPLY(z2, FIX(2.073276588));        /* c1+c7+3*c9-c3 */\n    tmp12 += z1 - MULTIPLY(z3, FIX(1.192193623));        /* c3+c5-c7-c9 */\n    z1    = MULTIPLY(z2 + z4, - FIX(1.798248910));       /* -(c1+c9) */\n    tmp11 += z1;\n    tmp13 += z1 + MULTIPLY(z4, FIX(2.102458632));        /* c1+c5+c9-c7 */\n    tmp14 += MULTIPLY(z2, - FIX(1.467221301)) +          /* -(c5+c9) */\n\t     MULTIPLY(z3, FIX(1.001388905)) -            /* c1-c9 */\n\t     MULTIPLY(z4, FIX(1.684843907));             /* c3+c9 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 12x12 output block.\n *\n * Optimized algorithm with 15 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/24).\n */\n\nGLOBAL(void)\njpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*12];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z3 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */\n    z1 <<= CONST_BITS;\n    z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n    z2 <<= CONST_BITS;\n\n    tmp12 = z1 - z2;\n\n    tmp21 = z3 + tmp12;\n    tmp24 = z3 - tmp12;\n\n    tmp12 = z4 + z2;\n\n    tmp20 = tmp10 + tmp12;\n    tmp25 = tmp10 - tmp12;\n\n    tmp12 = z4 - z1 - z2;\n\n    tmp22 = tmp11 + tmp12;\n    tmp23 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = MULTIPLY(z2, FIX(1.306562965));                  /* c3 */\n    tmp14 = MULTIPLY(z2, - FIX_0_541196100);                 /* -c9 */\n\n    tmp10 = z1 + z3;\n    tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669));          /* c7 */\n    tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384));       /* c5-c7 */\n    tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716));  /* c1-c5 */\n    tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580));           /* -(c7+c11) */\n    tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */\n    tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */\n    tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) -        /* c7-c11 */\n\t     MULTIPLY(z4, FIX(1.982889723));                 /* c5+c7 */\n\n    z1 -= z4;\n    z2 -= z3;\n    z3 = MULTIPLY(z1 + z2, FIX_0_541196100);                 /* c9 */\n    tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);              /* c3-c9 */\n    tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);              /* c3+c9 */\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 12 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 12; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z3 <<= CONST_BITS;\n\n    z4 = (INT32) wsptr[4];\n    z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    z1 = (INT32) wsptr[2];\n    z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */\n    z1 <<= CONST_BITS;\n    z2 = (INT32) wsptr[6];\n    z2 <<= CONST_BITS;\n\n    tmp12 = z1 - z2;\n\n    tmp21 = z3 + tmp12;\n    tmp24 = z3 - tmp12;\n\n    tmp12 = z4 + z2;\n\n    tmp20 = tmp10 + tmp12;\n    tmp25 = tmp10 - tmp12;\n\n    tmp12 = z4 - z1 - z2;\n\n    tmp22 = tmp11 + tmp12;\n    tmp23 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = MULTIPLY(z2, FIX(1.306562965));                  /* c3 */\n    tmp14 = MULTIPLY(z2, - FIX_0_541196100);                 /* -c9 */\n\n    tmp10 = z1 + z3;\n    tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669));          /* c7 */\n    tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384));       /* c5-c7 */\n    tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716));  /* c1-c5 */\n    tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580));           /* -(c7+c11) */\n    tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */\n    tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */\n    tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) -        /* c7-c11 */\n\t     MULTIPLY(z4, FIX(1.982889723));                 /* c5+c7 */\n\n    z1 -= z4;\n    z2 -= z3;\n    z3 = MULTIPLY(z1 + z2, FIX_0_541196100);                 /* c9 */\n    tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);              /* c3-c9 */\n    tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);              /* c3+c9 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 13x13 output block.\n *\n * Optimized algorithm with 29 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/26).\n */\n\nGLOBAL(void)\njpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*13];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z1 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    tmp12 = MULTIPLY(tmp10, FIX(1.155388986));                /* (c4+c6)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.096834934)) + z1;           /* (c4-c6)/2 */\n\n    tmp20 = MULTIPLY(z2, FIX(1.373119086)) + tmp12 + tmp13;   /* c2 */\n    tmp22 = MULTIPLY(z2, FIX(0.501487041)) - tmp12 + tmp13;   /* c10 */\n\n    tmp12 = MULTIPLY(tmp10, FIX(0.316450131));                /* (c8-c12)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.486914739)) + z1;           /* (c8+c12)/2 */\n\n    tmp21 = MULTIPLY(z2, FIX(1.058554052)) - tmp12 + tmp13;   /* c6 */\n    tmp25 = MULTIPLY(z2, - FIX(1.252223920)) + tmp12 + tmp13; /* c4 */\n\n    tmp12 = MULTIPLY(tmp10, FIX(0.435816023));                /* (c2-c10)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.937303064)) - z1;           /* (c2+c10)/2 */\n\n    tmp23 = MULTIPLY(z2, - FIX(0.170464608)) - tmp12 - tmp13; /* c12 */\n    tmp24 = MULTIPLY(z2, - FIX(0.803364869)) + tmp12 - tmp13; /* c8 */\n\n    tmp26 = MULTIPLY(tmp11 - z2, FIX(1.414213562)) + z1;      /* c0 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651));     /* c3 */\n    tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945));     /* c5 */\n    tmp15 = z1 + z4;\n    tmp13 = MULTIPLY(tmp15, FIX(0.937797057));       /* c7 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n\t    MULTIPLY(z1, FIX(2.020082300));          /* c7+c5+c3-c1 */\n    tmp14 = MULTIPLY(z2 + z3, - FIX(0.338443458));   /* -c11 */\n    tmp11 += tmp14 + MULTIPLY(z2, FIX(0.837223564)); /* c5+c9+c11-c3 */\n    tmp12 += tmp14 - MULTIPLY(z3, FIX(1.572116027)); /* c1+c5-c9-c11 */\n    tmp14 = MULTIPLY(z2 + z4, - FIX(1.163874945));   /* -c5 */\n    tmp11 += tmp14;\n    tmp13 += tmp14 + MULTIPLY(z4, FIX(2.205608352)); /* c3+c5+c9-c7 */\n    tmp14 = MULTIPLY(z3 + z4, - FIX(0.657217813));   /* -c9 */\n    tmp12 += tmp14;\n    tmp13 += tmp14;\n    tmp15 = MULTIPLY(tmp15, FIX(0.338443458));       /* c11 */\n    tmp14 = tmp15 + MULTIPLY(z1, FIX(0.318774355)) - /* c9-c11 */\n\t    MULTIPLY(z2, FIX(0.466105296));          /* c1-c7 */\n    z1    = MULTIPLY(z3 - z2, FIX(0.937797057));     /* c7 */\n    tmp14 += z1;\n    tmp15 += z1 + MULTIPLY(z3, FIX(0.384515595)) -   /* c3-c7 */\n\t     MULTIPLY(z4, FIX(1.742345811));         /* c1+c11 */\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 13 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 13; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z1 <<= CONST_BITS;\n\n    z2 = (INT32) wsptr[2];\n    z3 = (INT32) wsptr[4];\n    z4 = (INT32) wsptr[6];\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    tmp12 = MULTIPLY(tmp10, FIX(1.155388986));                /* (c4+c6)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.096834934)) + z1;           /* (c4-c6)/2 */\n\n    tmp20 = MULTIPLY(z2, FIX(1.373119086)) + tmp12 + tmp13;   /* c2 */\n    tmp22 = MULTIPLY(z2, FIX(0.501487041)) - tmp12 + tmp13;   /* c10 */\n\n    tmp12 = MULTIPLY(tmp10, FIX(0.316450131));                /* (c8-c12)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.486914739)) + z1;           /* (c8+c12)/2 */\n\n    tmp21 = MULTIPLY(z2, FIX(1.058554052)) - tmp12 + tmp13;   /* c6 */\n    tmp25 = MULTIPLY(z2, - FIX(1.252223920)) + tmp12 + tmp13; /* c4 */\n\n    tmp12 = MULTIPLY(tmp10, FIX(0.435816023));                /* (c2-c10)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.937303064)) - z1;           /* (c2+c10)/2 */\n\n    tmp23 = MULTIPLY(z2, - FIX(0.170464608)) - tmp12 - tmp13; /* c12 */\n    tmp24 = MULTIPLY(z2, - FIX(0.803364869)) + tmp12 - tmp13; /* c8 */\n\n    tmp26 = MULTIPLY(tmp11 - z2, FIX(1.414213562)) + z1;      /* c0 */\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651));     /* c3 */\n    tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945));     /* c5 */\n    tmp15 = z1 + z4;\n    tmp13 = MULTIPLY(tmp15, FIX(0.937797057));       /* c7 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n\t    MULTIPLY(z1, FIX(2.020082300));          /* c7+c5+c3-c1 */\n    tmp14 = MULTIPLY(z2 + z3, - FIX(0.338443458));   /* -c11 */\n    tmp11 += tmp14 + MULTIPLY(z2, FIX(0.837223564)); /* c5+c9+c11-c3 */\n    tmp12 += tmp14 - MULTIPLY(z3, FIX(1.572116027)); /* c1+c5-c9-c11 */\n    tmp14 = MULTIPLY(z2 + z4, - FIX(1.163874945));   /* -c5 */\n    tmp11 += tmp14;\n    tmp13 += tmp14 + MULTIPLY(z4, FIX(2.205608352)); /* c3+c5+c9-c7 */\n    tmp14 = MULTIPLY(z3 + z4, - FIX(0.657217813));   /* -c9 */\n    tmp12 += tmp14;\n    tmp13 += tmp14;\n    tmp15 = MULTIPLY(tmp15, FIX(0.338443458));       /* c11 */\n    tmp14 = tmp15 + MULTIPLY(z1, FIX(0.318774355)) - /* c9-c11 */\n\t    MULTIPLY(z2, FIX(0.466105296));          /* c1-c7 */\n    z1    = MULTIPLY(z3 - z2, FIX(0.937797057));     /* c7 */\n    tmp14 += z1;\n    tmp15 += z1 + MULTIPLY(z3, FIX(0.384515595)) -   /* c3-c7 */\n\t     MULTIPLY(z4, FIX(1.742345811));         /* c1+c11 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 14x14 output block.\n *\n * Optimized algorithm with 20 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/28).\n */\n\nGLOBAL(void)\njpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*14];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z1 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z2 = MULTIPLY(z4, FIX(1.274162392));         /* c4 */\n    z3 = MULTIPLY(z4, FIX(0.314692123));         /* c12 */\n    z4 = MULTIPLY(z4, FIX(0.881747734));         /* c8 */\n\n    tmp10 = z1 + z2;\n    tmp11 = z1 + z3;\n    tmp12 = z1 - z4;\n\n    tmp23 = RIGHT_SHIFT(z1 - ((z2 + z3 - z4) << 1), /* c0 = (c4+c12-c8)*2 */\n\t\t\tCONST_BITS-PASS1_BITS);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    z3 = MULTIPLY(z1 + z2, FIX(1.105676686));    /* c6 */\n\n    tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */\n    tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */\n    tmp15 = MULTIPLY(z1, FIX(0.613604268)) -     /* c10 */\n\t    MULTIPLY(z2, FIX(1.378756276));      /* c2 */\n\n    tmp20 = tmp10 + tmp13;\n    tmp26 = tmp10 - tmp13;\n    tmp21 = tmp11 + tmp14;\n    tmp25 = tmp11 - tmp14;\n    tmp22 = tmp12 + tmp15;\n    tmp24 = tmp12 - tmp15;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    tmp13 = z4 << CONST_BITS;\n\n    tmp14 = z1 + z3;\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607));           /* c3 */\n    tmp12 = MULTIPLY(tmp14, FIX(1.197448846));             /* c5 */\n    tmp10 = tmp11 + tmp12 + tmp13 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */\n    tmp14 = MULTIPLY(tmp14, FIX(0.752406978));             /* c9 */\n    tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426));        /* c9+c11-c13 */\n    z1    -= z2;\n    tmp15 = MULTIPLY(z1, FIX(0.467085129)) - tmp13;        /* c11 */\n    tmp16 += tmp15;\n    z1    += z4;\n    z4    = MULTIPLY(z2 + z3, - FIX(0.158341681)) - tmp13; /* -c13 */\n    tmp11 += z4 - MULTIPLY(z2, FIX(0.424103948));          /* c3-c9-c13 */\n    tmp12 += z4 - MULTIPLY(z3, FIX(2.373959773));          /* c3+c5-c13 */\n    z4    = MULTIPLY(z3 - z2, FIX(1.405321284));           /* c1 */\n    tmp14 += z4 + tmp13 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */\n    tmp15 += z4 + MULTIPLY(z2, FIX(0.674957567));          /* c1+c11-c5 */\n\n    tmp13 = (z1 - z3) << PASS1_BITS;\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*13] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) (tmp23 + tmp13);\n    wsptr[8*10] = (int) (tmp23 - tmp13);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 14 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 14; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z1 <<= CONST_BITS;\n    z4 = (INT32) wsptr[4];\n    z2 = MULTIPLY(z4, FIX(1.274162392));         /* c4 */\n    z3 = MULTIPLY(z4, FIX(0.314692123));         /* c12 */\n    z4 = MULTIPLY(z4, FIX(0.881747734));         /* c8 */\n\n    tmp10 = z1 + z2;\n    tmp11 = z1 + z3;\n    tmp12 = z1 - z4;\n\n    tmp23 = z1 - ((z2 + z3 - z4) << 1);          /* c0 = (c4+c12-c8)*2 */\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[6];\n\n    z3 = MULTIPLY(z1 + z2, FIX(1.105676686));    /* c6 */\n\n    tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */\n    tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */\n    tmp15 = MULTIPLY(z1, FIX(0.613604268)) -     /* c10 */\n\t    MULTIPLY(z2, FIX(1.378756276));      /* c2 */\n\n    tmp20 = tmp10 + tmp13;\n    tmp26 = tmp10 - tmp13;\n    tmp21 = tmp11 + tmp14;\n    tmp25 = tmp11 - tmp14;\n    tmp22 = tmp12 + tmp15;\n    tmp24 = tmp12 - tmp15;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n    z4 <<= CONST_BITS;\n\n    tmp14 = z1 + z3;\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607));           /* c3 */\n    tmp12 = MULTIPLY(tmp14, FIX(1.197448846));             /* c5 */\n    tmp10 = tmp11 + tmp12 + z4 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */\n    tmp14 = MULTIPLY(tmp14, FIX(0.752406978));             /* c9 */\n    tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426));        /* c9+c11-c13 */\n    z1    -= z2;\n    tmp15 = MULTIPLY(z1, FIX(0.467085129)) - z4;           /* c11 */\n    tmp16 += tmp15;\n    tmp13 = MULTIPLY(z2 + z3, - FIX(0.158341681)) - z4;    /* -c13 */\n    tmp11 += tmp13 - MULTIPLY(z2, FIX(0.424103948));       /* c3-c9-c13 */\n    tmp12 += tmp13 - MULTIPLY(z3, FIX(2.373959773));       /* c3+c5-c13 */\n    tmp13 = MULTIPLY(z3 - z2, FIX(1.405321284));           /* c1 */\n    tmp14 += tmp13 + z4 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */\n    tmp15 += tmp13 + MULTIPLY(z2, FIX(0.674957567));       /* c1+c11-c5 */\n\n    tmp13 = ((z1 - z3) << CONST_BITS) + z4;\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 15x15 output block.\n *\n * Optimized algorithm with 22 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/30).\n */\n\nGLOBAL(void)\njpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*15];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z1 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */\n    tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */\n\n    tmp12 = z1 - tmp10;\n    tmp13 = z1 + tmp11;\n    z1 -= (tmp11 - tmp10) << 1;             /* c0 = (c6-c12)*2 */\n\n    z4 = z2 - z3;\n    z3 += z2;\n    tmp10 = MULTIPLY(z3, FIX(1.337628990)); /* (c2+c4)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.045680613)); /* (c2-c4)/2 */\n    z2 = MULTIPLY(z2, FIX(1.439773946));    /* c4+c14 */\n\n    tmp20 = tmp13 + tmp10 + tmp11;\n    tmp23 = tmp12 - tmp10 + tmp11 + z2;\n\n    tmp10 = MULTIPLY(z3, FIX(0.547059574)); /* (c8+c14)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.399234004)); /* (c8-c14)/2 */\n\n    tmp25 = tmp13 - tmp10 - tmp11;\n    tmp26 = tmp12 + tmp10 - tmp11 - z2;\n\n    tmp10 = MULTIPLY(z3, FIX(0.790569415)); /* (c6+c12)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.353553391)); /* (c6-c12)/2 */\n\n    tmp21 = tmp12 + tmp10 + tmp11;\n    tmp24 = tmp13 - tmp10 + tmp11;\n    tmp11 += tmp11;\n    tmp22 = z1 + tmp11;                     /* c10 = c6-c12 */\n    tmp27 = z1 - tmp11 - tmp11;             /* c0 = (c6-c12)*2 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z3 = MULTIPLY(z4, FIX(1.224744871));                    /* c5 */\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp13 = z2 - z4;\n    tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876));         /* c9 */\n    tmp11 = tmp15 + MULTIPLY(z1, FIX(0.513743148));         /* c3-c9 */\n    tmp14 = tmp15 - MULTIPLY(tmp13, FIX(2.176250899));      /* c3+c9 */\n\n    tmp13 = MULTIPLY(z2, - FIX(0.831253876));               /* -c9 */\n    tmp15 = MULTIPLY(z2, - FIX(1.344997024));               /* -c3 */\n    z2 = z1 - z4;\n    tmp12 = z3 + MULTIPLY(z2, FIX(1.406466353));            /* c1 */\n\n    tmp10 = tmp12 + MULTIPLY(z4, FIX(2.457431844)) - tmp15; /* c1+c7 */\n    tmp16 = tmp12 - MULTIPLY(z1, FIX(1.112434820)) + tmp13; /* c1-c13 */\n    tmp12 = MULTIPLY(z2, FIX(1.224744871)) - z3;            /* c5 */\n    z2 = MULTIPLY(z1 + z4, FIX(0.575212477));               /* c11 */\n    tmp13 += z2 + MULTIPLY(z1, FIX(0.475753014)) - z3;      /* c7-c11 */\n    tmp15 += z2 - MULTIPLY(z4, FIX(0.869244010)) + z3;      /* c11+c13 */\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*14] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*13] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp27, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 15 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 15; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z1 <<= CONST_BITS;\n\n    z2 = (INT32) wsptr[2];\n    z3 = (INT32) wsptr[4];\n    z4 = (INT32) wsptr[6];\n\n    tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */\n    tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */\n\n    tmp12 = z1 - tmp10;\n    tmp13 = z1 + tmp11;\n    z1 -= (tmp11 - tmp10) << 1;             /* c0 = (c6-c12)*2 */\n\n    z4 = z2 - z3;\n    z3 += z2;\n    tmp10 = MULTIPLY(z3, FIX(1.337628990)); /* (c2+c4)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.045680613)); /* (c2-c4)/2 */\n    z2 = MULTIPLY(z2, FIX(1.439773946));    /* c4+c14 */\n\n    tmp20 = tmp13 + tmp10 + tmp11;\n    tmp23 = tmp12 - tmp10 + tmp11 + z2;\n\n    tmp10 = MULTIPLY(z3, FIX(0.547059574)); /* (c8+c14)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.399234004)); /* (c8-c14)/2 */\n\n    tmp25 = tmp13 - tmp10 - tmp11;\n    tmp26 = tmp12 + tmp10 - tmp11 - z2;\n\n    tmp10 = MULTIPLY(z3, FIX(0.790569415)); /* (c6+c12)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.353553391)); /* (c6-c12)/2 */\n\n    tmp21 = tmp12 + tmp10 + tmp11;\n    tmp24 = tmp13 - tmp10 + tmp11;\n    tmp11 += tmp11;\n    tmp22 = z1 + tmp11;                     /* c10 = c6-c12 */\n    tmp27 = z1 - tmp11 - tmp11;             /* c0 = (c6-c12)*2 */\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z4 = (INT32) wsptr[5];\n    z3 = MULTIPLY(z4, FIX(1.224744871));                    /* c5 */\n    z4 = (INT32) wsptr[7];\n\n    tmp13 = z2 - z4;\n    tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876));         /* c9 */\n    tmp11 = tmp15 + MULTIPLY(z1, FIX(0.513743148));         /* c3-c9 */\n    tmp14 = tmp15 - MULTIPLY(tmp13, FIX(2.176250899));      /* c3+c9 */\n\n    tmp13 = MULTIPLY(z2, - FIX(0.831253876));               /* -c9 */\n    tmp15 = MULTIPLY(z2, - FIX(1.344997024));               /* -c3 */\n    z2 = z1 - z4;\n    tmp12 = z3 + MULTIPLY(z2, FIX(1.406466353));            /* c1 */\n\n    tmp10 = tmp12 + MULTIPLY(z4, FIX(2.457431844)) - tmp15; /* c1+c7 */\n    tmp16 = tmp12 - MULTIPLY(z1, FIX(1.112434820)) + tmp13; /* c1-c13 */\n    tmp12 = MULTIPLY(z2, FIX(1.224744871)) - z3;            /* c5 */\n    z2 = MULTIPLY(z1 + z4, FIX(0.575212477));               /* c11 */\n    tmp13 += z2 + MULTIPLY(z1, FIX(0.475753014)) - z3;      /* c7-c11 */\n    tmp15 += z2 - MULTIPLY(z4, FIX(0.869244010)) + z3;      /* c11+c13 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp27,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 16x16 output block.\n *\n * Optimized algorithm with 28 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/32).\n */\n\nGLOBAL(void)\njpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*16];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp0 += 1 << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp1 = MULTIPLY(z1, FIX(1.306562965));      /* c4[16] = c2[8] */\n    tmp2 = MULTIPLY(z1, FIX_0_541196100);       /* c12[16] = c6[8] */\n\n    tmp10 = tmp0 + tmp1;\n    tmp11 = tmp0 - tmp1;\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n    z3 = z1 - z2;\n    z4 = MULTIPLY(z3, FIX(0.275899379));        /* c14[16] = c7[8] */\n    z3 = MULTIPLY(z3, FIX(1.387039845));        /* c2[16] = c1[8] */\n\n    tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);  /* (c6+c2)[16] = (c3+c1)[8] */\n    tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);  /* (c6-c14)[16] = (c3-c7)[8] */\n    tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */\n    tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */\n\n    tmp20 = tmp10 + tmp0;\n    tmp27 = tmp10 - tmp0;\n    tmp21 = tmp12 + tmp1;\n    tmp26 = tmp12 - tmp1;\n    tmp22 = tmp13 + tmp2;\n    tmp25 = tmp13 - tmp2;\n    tmp23 = tmp11 + tmp3;\n    tmp24 = tmp11 - tmp3;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = z1 + z3;\n\n    tmp1  = MULTIPLY(z1 + z2, FIX(1.353318001));   /* c3 */\n    tmp2  = MULTIPLY(tmp11,   FIX(1.247225013));   /* c5 */\n    tmp3  = MULTIPLY(z1 + z4, FIX(1.093201867));   /* c7 */\n    tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586));   /* c9 */\n    tmp11 = MULTIPLY(tmp11,   FIX(0.666655658));   /* c11 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528));   /* c13 */\n    tmp0  = tmp1 + tmp2 + tmp3 -\n\t    MULTIPLY(z1, FIX(2.286341144));        /* c7+c5+c3-c1 */\n    tmp13 = tmp10 + tmp11 + tmp12 -\n\t    MULTIPLY(z1, FIX(1.835730603));        /* c9+c11+c13-c15 */\n    z1    = MULTIPLY(z2 + z3, FIX(0.138617169));   /* c15 */\n    tmp1  += z1 + MULTIPLY(z2, FIX(0.071888074));  /* c9+c11-c3-c15 */\n    tmp2  += z1 - MULTIPLY(z3, FIX(1.125726048));  /* c5+c7+c15-c3 */\n    z1    = MULTIPLY(z3 - z2, FIX(1.407403738));   /* c1 */\n    tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282));  /* c1+c11-c9-c13 */\n    tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411));  /* c1+c5+c13-c7 */\n    z2    += z4;\n    z1    = MULTIPLY(z2, - FIX(0.666655658));      /* -c11 */\n    tmp1  += z1;\n    tmp3  += z1 + MULTIPLY(z4, FIX(1.065388962));  /* c3+c11+c15-c7 */\n    z2    = MULTIPLY(z2, - FIX(1.247225013));      /* -c5 */\n    tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809));  /* c1+c5+c9-c13 */\n    tmp12 += z2;\n    z2    = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */\n    tmp2  += z2;\n    tmp3  += z2;\n    z2    = MULTIPLY(z4 - z3, FIX(0.410524528));   /* c13 */\n    tmp10 += z2;\n    tmp11 += z2;\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp0,  CONST_BITS-PASS1_BITS);\n    wsptr[8*15] = (int) RIGHT_SHIFT(tmp20 - tmp0,  CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp1,  CONST_BITS-PASS1_BITS);\n    wsptr[8*14] = (int) RIGHT_SHIFT(tmp21 - tmp1,  CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp2,  CONST_BITS-PASS1_BITS);\n    wsptr[8*13] = (int) RIGHT_SHIFT(tmp22 - tmp2,  CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp3,  CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp23 - tmp3,  CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp24 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp25 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp26 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 16 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 16; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 <<= CONST_BITS;\n\n    z1 = (INT32) wsptr[4];\n    tmp1 = MULTIPLY(z1, FIX(1.306562965));      /* c4[16] = c2[8] */\n    tmp2 = MULTIPLY(z1, FIX_0_541196100);       /* c12[16] = c6[8] */\n\n    tmp10 = tmp0 + tmp1;\n    tmp11 = tmp0 - tmp1;\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[6];\n    z3 = z1 - z2;\n    z4 = MULTIPLY(z3, FIX(0.275899379));        /* c14[16] = c7[8] */\n    z3 = MULTIPLY(z3, FIX(1.387039845));        /* c2[16] = c1[8] */\n\n    tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);  /* (c6+c2)[16] = (c3+c1)[8] */\n    tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);  /* (c6-c14)[16] = (c3-c7)[8] */\n    tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */\n    tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */\n\n    tmp20 = tmp10 + tmp0;\n    tmp27 = tmp10 - tmp0;\n    tmp21 = tmp12 + tmp1;\n    tmp26 = tmp12 - tmp1;\n    tmp22 = tmp13 + tmp2;\n    tmp25 = tmp13 - tmp2;\n    tmp23 = tmp11 + tmp3;\n    tmp24 = tmp11 - tmp3;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = z1 + z3;\n\n    tmp1  = MULTIPLY(z1 + z2, FIX(1.353318001));   /* c3 */\n    tmp2  = MULTIPLY(tmp11,   FIX(1.247225013));   /* c5 */\n    tmp3  = MULTIPLY(z1 + z4, FIX(1.093201867));   /* c7 */\n    tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586));   /* c9 */\n    tmp11 = MULTIPLY(tmp11,   FIX(0.666655658));   /* c11 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528));   /* c13 */\n    tmp0  = tmp1 + tmp2 + tmp3 -\n\t    MULTIPLY(z1, FIX(2.286341144));        /* c7+c5+c3-c1 */\n    tmp13 = tmp10 + tmp11 + tmp12 -\n\t    MULTIPLY(z1, FIX(1.835730603));        /* c9+c11+c13-c15 */\n    z1    = MULTIPLY(z2 + z3, FIX(0.138617169));   /* c15 */\n    tmp1  += z1 + MULTIPLY(z2, FIX(0.071888074));  /* c9+c11-c3-c15 */\n    tmp2  += z1 - MULTIPLY(z3, FIX(1.125726048));  /* c5+c7+c15-c3 */\n    z1    = MULTIPLY(z3 - z2, FIX(1.407403738));   /* c1 */\n    tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282));  /* c1+c11-c9-c13 */\n    tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411));  /* c1+c5+c13-c7 */\n    z2    += z4;\n    z1    = MULTIPLY(z2, - FIX(0.666655658));      /* -c11 */\n    tmp1  += z1;\n    tmp3  += z1 + MULTIPLY(z4, FIX(1.065388962));  /* c3+c11+c15-c7 */\n    z2    = MULTIPLY(z2, - FIX(1.247225013));      /* -c5 */\n    tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809));  /* c1+c5+c9-c13 */\n    tmp12 += z2;\n    z2    = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */\n    tmp2  += z2;\n    tmp3  += z2;\n    z2    = MULTIPLY(z4 - z3, FIX(0.410524528));   /* c13 */\n    tmp10 += z2;\n    tmp11 += z2;\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp0,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[15] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp0,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp1,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp1,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp2,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp2,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp3,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp3,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp27 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp27 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 16x8 output block.\n *\n * 8-point IDCT in pass 1 (columns), 16-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\tJCOEFPTR coef_block,\n\t\tJSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*8];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * Note results are scaled up by sqrt(8) compared to a true IDCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * 8-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16).\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; ctr--) {\n    /* Due to quantization, we will usually find that many of the input\n     * coefficients are zero, especially the AC terms.  We can exploit this\n     * by short-circuiting the IDCT calculation for any column in which all\n     * the AC terms are zero.  In that case each output is equal to the\n     * DC coefficient (with scale factor as needed).\n     * With typical images and quantization tables, half or more of the\n     * column DCT calculations can be simplified this way.\n     */\n\n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n\tinptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&\n\tinptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&\n\tinptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero */\n      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;\n\n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n      wsptr[DCTSIZE*4] = dcval;\n      wsptr[DCTSIZE*5] = dcval;\n      wsptr[DCTSIZE*6] = dcval;\n      wsptr[DCTSIZE*7] = dcval;\n\n      inptr++;\t\t\t/* advance pointers to next column */\n      quantptr++;\n      wsptr++;\n      continue;\n    }\n\n    /* Even part: reverse the even part of the forward DCT.\n     * The rotator is c(-6).\n     */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);       /* c6 */\n    tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);     /* c2-c6 */\n    tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);     /* c2+c6 */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z2 <<= CONST_BITS;\n    z3 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z2 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    tmp0 = z2 + z3;\n    tmp1 = z2 - z3;\n\n    tmp10 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n    tmp11 = tmp1 + tmp3;\n    tmp12 = tmp1 - tmp3;\n\n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n\n    z2 = tmp0 + tmp2;\n    z3 = tmp1 + tmp3;\n\n    z1 = MULTIPLY(z2 + z3, FIX_1_175875602);       /*  c3 */\n    z2 = MULTIPLY(z2, - FIX_1_961570560);          /* -c3-c5 */\n    z3 = MULTIPLY(z3, - FIX_0_390180644);          /* -c3+c5 */\n    z2 += z1;\n    z3 += z1;\n\n    z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */\n    tmp0 = MULTIPLY(tmp0, FIX_0_298631336);        /* -c1+c3+c5-c7 */\n    tmp3 = MULTIPLY(tmp3, FIX_1_501321110);        /*  c1+c3-c5-c7 */\n    tmp0 += z1 + z2;\n    tmp3 += z1 + z3;\n\n    z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */\n    tmp1 = MULTIPLY(tmp1, FIX_2_053119869);        /*  c1+c3-c5+c7 */\n    tmp2 = MULTIPLY(tmp2, FIX_3_072711026);        /*  c1+c3+c5-c7 */\n    tmp1 += z1 + z3;\n    tmp2 += z1 + z2;\n\n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n\n    wsptr[DCTSIZE*0] = (int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*7] = (int) RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*1] = (int) RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*6] = (int) RIGHT_SHIFT(tmp11 - tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*2] = (int) RIGHT_SHIFT(tmp12 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS);\n\n    inptr++;\t\t\t/* advance pointers to next column */\n    quantptr++;\n    wsptr++;\n  }\n\n  /* Pass 2: process 8 rows from work array, store into output array.\n   * 16-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/32).\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 <<= CONST_BITS;\n\n    z1 = (INT32) wsptr[4];\n    tmp1 = MULTIPLY(z1, FIX(1.306562965));      /* c4[16] = c2[8] */\n    tmp2 = MULTIPLY(z1, FIX_0_541196100);       /* c12[16] = c6[8] */\n\n    tmp10 = tmp0 + tmp1;\n    tmp11 = tmp0 - tmp1;\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[6];\n    z3 = z1 - z2;\n    z4 = MULTIPLY(z3, FIX(0.275899379));        /* c14[16] = c7[8] */\n    z3 = MULTIPLY(z3, FIX(1.387039845));        /* c2[16] = c1[8] */\n\n    tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);  /* (c6+c2)[16] = (c3+c1)[8] */\n    tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);  /* (c6-c14)[16] = (c3-c7)[8] */\n    tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */\n    tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */\n\n    tmp20 = tmp10 + tmp0;\n    tmp27 = tmp10 - tmp0;\n    tmp21 = tmp12 + tmp1;\n    tmp26 = tmp12 - tmp1;\n    tmp22 = tmp13 + tmp2;\n    tmp25 = tmp13 - tmp2;\n    tmp23 = tmp11 + tmp3;\n    tmp24 = tmp11 - tmp3;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = z1 + z3;\n\n    tmp1  = MULTIPLY(z1 + z2, FIX(1.353318001));   /* c3 */\n    tmp2  = MULTIPLY(tmp11,   FIX(1.247225013));   /* c5 */\n    tmp3  = MULTIPLY(z1 + z4, FIX(1.093201867));   /* c7 */\n    tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586));   /* c9 */\n    tmp11 = MULTIPLY(tmp11,   FIX(0.666655658));   /* c11 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528));   /* c13 */\n    tmp0  = tmp1 + tmp2 + tmp3 -\n\t    MULTIPLY(z1, FIX(2.286341144));        /* c7+c5+c3-c1 */\n    tmp13 = tmp10 + tmp11 + tmp12 -\n\t    MULTIPLY(z1, FIX(1.835730603));        /* c9+c11+c13-c15 */\n    z1    = MULTIPLY(z2 + z3, FIX(0.138617169));   /* c15 */\n    tmp1  += z1 + MULTIPLY(z2, FIX(0.071888074));  /* c9+c11-c3-c15 */\n    tmp2  += z1 - MULTIPLY(z3, FIX(1.125726048));  /* c5+c7+c15-c3 */\n    z1    = MULTIPLY(z3 - z2, FIX(1.407403738));   /* c1 */\n    tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282));  /* c1+c11-c9-c13 */\n    tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411));  /* c1+c5+c13-c7 */\n    z2    += z4;\n    z1    = MULTIPLY(z2, - FIX(0.666655658));      /* -c11 */\n    tmp1  += z1;\n    tmp3  += z1 + MULTIPLY(z4, FIX(1.065388962));  /* c3+c11+c15-c7 */\n    z2    = MULTIPLY(z2, - FIX(1.247225013));      /* -c5 */\n    tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809));  /* c1+c5+c9-c13 */\n    tmp12 += z2;\n    z2    = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */\n    tmp2  += z2;\n    tmp3  += z2;\n    z2    = MULTIPLY(z4 - z3, FIX(0.410524528));   /* c13 */\n    tmp10 += z2;\n    tmp11 += z2;\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp0,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[15] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp0,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp1,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp1,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp2,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp2,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp3,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp3,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp27 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp27 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 14x7 output block.\n *\n * 7-point IDCT in pass 1 (columns), 14-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_14x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\tJCOEFPTR coef_block,\n\t\tJSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*7];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * 7-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/14).\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp23 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp23 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp23 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp20 = MULTIPLY(z2 - z3, FIX(0.881747734));       /* c4 */\n    tmp22 = MULTIPLY(z1 - z2, FIX(0.314692123));       /* c6 */\n    tmp21 = tmp20 + tmp22 + tmp23 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */\n    tmp10 = z1 + z3;\n    z2 -= tmp10;\n    tmp10 = MULTIPLY(tmp10, FIX(1.274162392)) + tmp23; /* c2 */\n    tmp20 += tmp10 - MULTIPLY(z3, FIX(0.077722536));   /* c2-c4-c6 */\n    tmp22 += tmp10 - MULTIPLY(z1, FIX(2.470602249));   /* c2+c4+c6 */\n    tmp23 += MULTIPLY(z2, FIX(1.414213562));           /* c0 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n\n    tmp11 = MULTIPLY(z1 + z2, FIX(0.935414347));       /* (c3+c1-c5)/2 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.170262339));       /* (c3+c5-c1)/2 */\n    tmp10 = tmp11 - tmp12;\n    tmp11 += tmp12;\n    tmp12 = MULTIPLY(z2 + z3, - FIX(1.378756276));     /* -c1 */\n    tmp11 += tmp12;\n    z2 = MULTIPLY(z1 + z3, FIX(0.613604268));          /* c5 */\n    tmp10 += z2;\n    tmp12 += z2 + MULTIPLY(z3, FIX(1.870828693));      /* c3+c1-c5 */\n\n    /* Final output stage */\n\n    wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*6] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*5] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*4] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3] = (int) RIGHT_SHIFT(tmp23, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 7 rows from work array, store into output array.\n   * 14-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/28).\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 7; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z1 <<= CONST_BITS;\n    z4 = (INT32) wsptr[4];\n    z2 = MULTIPLY(z4, FIX(1.274162392));         /* c4 */\n    z3 = MULTIPLY(z4, FIX(0.314692123));         /* c12 */\n    z4 = MULTIPLY(z4, FIX(0.881747734));         /* c8 */\n\n    tmp10 = z1 + z2;\n    tmp11 = z1 + z3;\n    tmp12 = z1 - z4;\n\n    tmp23 = z1 - ((z2 + z3 - z4) << 1);          /* c0 = (c4+c12-c8)*2 */\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[6];\n\n    z3 = MULTIPLY(z1 + z2, FIX(1.105676686));    /* c6 */\n\n    tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */\n    tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */\n    tmp15 = MULTIPLY(z1, FIX(0.613604268)) -     /* c10 */\n\t    MULTIPLY(z2, FIX(1.378756276));      /* c2 */\n\n    tmp20 = tmp10 + tmp13;\n    tmp26 = tmp10 - tmp13;\n    tmp21 = tmp11 + tmp14;\n    tmp25 = tmp11 - tmp14;\n    tmp22 = tmp12 + tmp15;\n    tmp24 = tmp12 - tmp15;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n    z4 <<= CONST_BITS;\n\n    tmp14 = z1 + z3;\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607));           /* c3 */\n    tmp12 = MULTIPLY(tmp14, FIX(1.197448846));             /* c5 */\n    tmp10 = tmp11 + tmp12 + z4 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */\n    tmp14 = MULTIPLY(tmp14, FIX(0.752406978));             /* c9 */\n    tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426));        /* c9+c11-c13 */\n    z1    -= z2;\n    tmp15 = MULTIPLY(z1, FIX(0.467085129)) - z4;           /* c11 */\n    tmp16 += tmp15;\n    tmp13 = MULTIPLY(z2 + z3, - FIX(0.158341681)) - z4;    /* -c13 */\n    tmp11 += tmp13 - MULTIPLY(z2, FIX(0.424103948));       /* c3-c9-c13 */\n    tmp12 += tmp13 - MULTIPLY(z3, FIX(2.373959773));       /* c3+c5-c13 */\n    tmp13 = MULTIPLY(z3 - z2, FIX(1.405321284));           /* c1 */\n    tmp14 += tmp13 + z4 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */\n    tmp15 += tmp13 + MULTIPLY(z2, FIX(0.674957567));       /* c1+c11-c5 */\n\n    tmp13 = ((z1 - z3) << CONST_BITS) + z4;\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 12x6 output block.\n *\n * 6-point IDCT in pass 1 (columns), 12-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_12x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\tJCOEFPTR coef_block,\n\t\tJSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*6];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12).\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp10 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp10 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp10 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp12 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp20 = MULTIPLY(tmp12, FIX(0.707106781));   /* c4 */\n    tmp11 = tmp10 + tmp20;\n    tmp21 = RIGHT_SHIFT(tmp10 - tmp20 - tmp20, CONST_BITS-PASS1_BITS);\n    tmp20 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp10 = MULTIPLY(tmp20, FIX(1.224744871));   /* c2 */\n    tmp20 = tmp11 + tmp10;\n    tmp22 = tmp11 - tmp10;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp11 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */\n    tmp10 = tmp11 + ((z1 + z2) << CONST_BITS);\n    tmp12 = tmp11 + ((z3 - z2) << CONST_BITS);\n    tmp11 = (z1 - z2 - z3) << PASS1_BITS;\n\n    /* Final output stage */\n\n    wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*5] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1] = (int) (tmp21 + tmp11);\n    wsptr[8*4] = (int) (tmp21 - tmp11);\n    wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 6 rows from work array, store into output array.\n   * 12-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/24).\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 6; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z3 <<= CONST_BITS;\n\n    z4 = (INT32) wsptr[4];\n    z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    z1 = (INT32) wsptr[2];\n    z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */\n    z1 <<= CONST_BITS;\n    z2 = (INT32) wsptr[6];\n    z2 <<= CONST_BITS;\n\n    tmp12 = z1 - z2;\n\n    tmp21 = z3 + tmp12;\n    tmp24 = z3 - tmp12;\n\n    tmp12 = z4 + z2;\n\n    tmp20 = tmp10 + tmp12;\n    tmp25 = tmp10 - tmp12;\n\n    tmp12 = z4 - z1 - z2;\n\n    tmp22 = tmp11 + tmp12;\n    tmp23 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = MULTIPLY(z2, FIX(1.306562965));                  /* c3 */\n    tmp14 = MULTIPLY(z2, - FIX_0_541196100);                 /* -c9 */\n\n    tmp10 = z1 + z3;\n    tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669));          /* c7 */\n    tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384));       /* c5-c7 */\n    tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716));  /* c1-c5 */\n    tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580));           /* -(c7+c11) */\n    tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */\n    tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */\n    tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) -        /* c7-c11 */\n\t     MULTIPLY(z4, FIX(1.982889723));                 /* c5+c7 */\n\n    z1 -= z4;\n    z2 -= z3;\n    z3 = MULTIPLY(z1 + z2, FIX_0_541196100);                 /* c9 */\n    tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);              /* c3-c9 */\n    tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);              /* c3+c9 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 10x5 output block.\n *\n * 5-point IDCT in pass 1 (columns), 10-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_10x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\tJCOEFPTR coef_block,\n\t\tJSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*5];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * 5-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/10).\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp12 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp12 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp12 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp13 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp14 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z1 = MULTIPLY(tmp13 + tmp14, FIX(0.790569415)); /* (c2+c4)/2 */\n    z2 = MULTIPLY(tmp13 - tmp14, FIX(0.353553391)); /* (c2-c4)/2 */\n    z3 = tmp12 + z2;\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z1;\n    tmp12 -= z2 << 2;\n\n    /* Odd part */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));       /* c3 */\n    tmp13 = z1 + MULTIPLY(z2, FIX(0.513743148));    /* c1-c3 */\n    tmp14 = z1 - MULTIPLY(z3, FIX(2.176250899));    /* c1+c3 */\n\n    /* Final output stage */\n\n    wsptr[8*0] = (int) RIGHT_SHIFT(tmp10 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4] = (int) RIGHT_SHIFT(tmp10 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*1] = (int) RIGHT_SHIFT(tmp11 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*3] = (int) RIGHT_SHIFT(tmp11 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*2] = (int) RIGHT_SHIFT(tmp12, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 5 rows from work array, store into output array.\n   * 10-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/20).\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 5; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z3 <<= CONST_BITS;\n    z4 = (INT32) wsptr[4];\n    z1 = MULTIPLY(z4, FIX(1.144122806));         /* c4 */\n    z2 = MULTIPLY(z4, FIX(0.437016024));         /* c8 */\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z2;\n\n    tmp22 = z3 - ((z1 - z2) << 1);               /* c0 = (c4-c8)*2 */\n\n    z2 = (INT32) wsptr[2];\n    z3 = (INT32) wsptr[6];\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));    /* c6 */\n    tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */\n    tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */\n\n    tmp20 = tmp10 + tmp12;\n    tmp24 = tmp10 - tmp12;\n    tmp21 = tmp11 + tmp13;\n    tmp23 = tmp11 - tmp13;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z3 <<= CONST_BITS;\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = z2 + z4;\n    tmp13 = z2 - z4;\n\n    tmp12 = MULTIPLY(tmp13, FIX(0.309016994));        /* (c3-c7)/2 */\n\n    z2 = MULTIPLY(tmp11, FIX(0.951056516));           /* (c3+c7)/2 */\n    z4 = z3 + tmp12;\n\n    tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */\n    tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */\n\n    z2 = MULTIPLY(tmp11, FIX(0.587785252));           /* (c1-c9)/2 */\n    z4 = z3 - tmp12 - (tmp13 << (CONST_BITS - 1));\n\n    tmp12 = ((z1 - tmp13) << CONST_BITS) - z3;\n\n    tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */\n    tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 8x4 output block.\n *\n * 4-point IDCT in pass 1 (columns), 8-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3;\n  INT32 tmp10, tmp11, tmp12, tmp13;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*4];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * 4-point IDCT kernel,\n   * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT].\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n\n    tmp10 = (tmp0 + tmp2) << PASS1_BITS;\n    tmp12 = (tmp0 - tmp2) << PASS1_BITS;\n\n    /* Odd part */\n    /* Same rotation as in the even part of the 8x8 LL&M IDCT */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);               /* c6 */\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp0 = RIGHT_SHIFT(z1 + MULTIPLY(z2, FIX_0_765366865), /* c2-c6 */\n\t\t       CONST_BITS-PASS1_BITS);\n    tmp2 = RIGHT_SHIFT(z1 - MULTIPLY(z3, FIX_1_847759065), /* c2+c6 */\n\t\t       CONST_BITS-PASS1_BITS);\n\n    /* Final output stage */\n\n    wsptr[8*0] = (int) (tmp10 + tmp0);\n    wsptr[8*3] = (int) (tmp10 - tmp0);\n    wsptr[8*1] = (int) (tmp12 + tmp2);\n    wsptr[8*2] = (int) (tmp12 - tmp2);\n  }\n\n  /* Pass 2: process rows from work array, store into output array.\n   * Note that we must descale the results by a factor of 8 == 2**3,\n   * and also undo the PASS1_BITS scaling.\n   * 8-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16).\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 4; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part: reverse the even part of the forward DCT.\n     * The rotator is c(-6).\n     */\n\n    z2 = (INT32) wsptr[2];\n    z3 = (INT32) wsptr[6];\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);       /* c6 */\n    tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);     /* c2-c6 */\n    tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);     /* c2+c6 */\n\n    /* Add fudge factor here for final descale. */\n    z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z3 = (INT32) wsptr[4];\n\n    tmp0 = (z2 + z3) << CONST_BITS;\n    tmp1 = (z2 - z3) << CONST_BITS;\n\n    tmp10 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n    tmp11 = tmp1 + tmp3;\n    tmp12 = tmp1 - tmp3;\n\n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n\n    tmp0 = (INT32) wsptr[7];\n    tmp1 = (INT32) wsptr[5];\n    tmp2 = (INT32) wsptr[3];\n    tmp3 = (INT32) wsptr[1];\n\n    z2 = tmp0 + tmp2;\n    z3 = tmp1 + tmp3;\n\n    z1 = MULTIPLY(z2 + z3, FIX_1_175875602);       /*  c3 */\n    z2 = MULTIPLY(z2, - FIX_1_961570560);          /* -c3-c5 */\n    z3 = MULTIPLY(z3, - FIX_0_390180644);          /* -c3+c5 */\n    z2 += z1;\n    z3 += z1;\n\n    z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */\n    tmp0 = MULTIPLY(tmp0, FIX_0_298631336);        /* -c1+c3+c5-c7 */\n    tmp3 = MULTIPLY(tmp3, FIX_1_501321110);        /*  c1+c3-c5-c7 */\n    tmp0 += z1 + z2;\n    tmp3 += z1 + z3;\n\n    z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */\n    tmp1 = MULTIPLY(tmp1, FIX_2_053119869);        /*  c1+c3-c5+c7 */\n    tmp2 = MULTIPLY(tmp2, FIX_3_072711026);        /*  c1+c3+c5-c7 */\n    tmp1 += z1 + z3;\n    tmp2 += z1 + z2;\n\n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp3,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp3,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 6x3 output block.\n *\n * 3-point IDCT in pass 1 (columns), 6-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_6x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[6*3];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * 3-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/6).\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */\n    tmp10 = tmp0 + tmp12;\n    tmp2 = tmp0 - tmp12 - tmp12;\n\n    /* Odd part */\n\n    tmp12 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */\n\n    /* Final output stage */\n\n    wsptr[6*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[6*2] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[6*1] = (int) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS);\n  }\n  \n  /* Pass 2: process 3 rows from work array, store into output array.\n   * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12).\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 3; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 <<= CONST_BITS;\n    tmp2 = (INT32) wsptr[4];\n    tmp10 = MULTIPLY(tmp2, FIX(0.707106781));   /* c4 */\n    tmp1 = tmp0 + tmp10;\n    tmp11 = tmp0 - tmp10 - tmp10;\n    tmp10 = (INT32) wsptr[2];\n    tmp0 = MULTIPLY(tmp10, FIX(1.224744871));   /* c2 */\n    tmp10 = tmp1 + tmp0;\n    tmp12 = tmp1 - tmp0;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */\n    tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);\n    tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);\n    tmp1 = (z1 - z2 - z3) << CONST_BITS;\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 6;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 4x2 output block.\n *\n * 2-point IDCT in pass 1 (columns), 4-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_4x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp2, tmp10, tmp12;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  INT32 * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  INT32 workspace[4*2];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 4; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp10 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n\n    /* Odd part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n\n    /* Final output stage */\n\n    wsptr[4*0] = tmp10 + tmp0;\n    wsptr[4*1] = tmp10 - tmp0;\n  }\n\n  /* Pass 2: process 2 rows from work array, store into output array.\n   * 4-point IDCT kernel,\n   * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT].\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 2; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = wsptr[0] + (ONE << 2);\n    tmp2 = wsptr[2];\n\n    tmp10 = (tmp0 + tmp2) << CONST_BITS;\n    tmp12 = (tmp0 - tmp2) << CONST_BITS;\n\n    /* Odd part */\n    /* Same rotation as in the even part of the 8x8 LL&M IDCT */\n\n    z2 = wsptr[1];\n    z3 = wsptr[3];\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);   /* c6 */\n    tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */\n    tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n\t\t\t\t\t      CONST_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n\t\t\t\t\t      CONST_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 4;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 2x1 output block.\n *\n * 1-point IDCT in pass 1 (columns), 2-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1;\n  ISLOW_MULT_TYPE * quantptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  SHIFT_TEMPS\n\n  /* Pass 1: empty. */\n\n  /* Pass 2: process 1 row from input, store into output array. */\n\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  outptr = output_buf[0] + output_col;\n\n  /* Even part */\n\n  tmp0 = DEQUANTIZE(coef_block[0], quantptr[0]);\n  /* Add fudge factor here for final descale. */\n  tmp0 += ONE << 2;\n\n  /* Odd part */\n\n  tmp1 = DEQUANTIZE(coef_block[1], quantptr[1]);\n\n  /* Final output stage */\n\n  outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];\n  outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 8x16 output block.\n *\n * 16-point IDCT in pass 1 (columns), 8-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\tJCOEFPTR coef_block,\n\t\tJSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*16];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * 16-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/32).\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp1 = MULTIPLY(z1, FIX(1.306562965));      /* c4[16] = c2[8] */\n    tmp2 = MULTIPLY(z1, FIX_0_541196100);       /* c12[16] = c6[8] */\n\n    tmp10 = tmp0 + tmp1;\n    tmp11 = tmp0 - tmp1;\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n    z3 = z1 - z2;\n    z4 = MULTIPLY(z3, FIX(0.275899379));        /* c14[16] = c7[8] */\n    z3 = MULTIPLY(z3, FIX(1.387039845));        /* c2[16] = c1[8] */\n\n    tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);  /* (c6+c2)[16] = (c3+c1)[8] */\n    tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);  /* (c6-c14)[16] = (c3-c7)[8] */\n    tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */\n    tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */\n\n    tmp20 = tmp10 + tmp0;\n    tmp27 = tmp10 - tmp0;\n    tmp21 = tmp12 + tmp1;\n    tmp26 = tmp12 - tmp1;\n    tmp22 = tmp13 + tmp2;\n    tmp25 = tmp13 - tmp2;\n    tmp23 = tmp11 + tmp3;\n    tmp24 = tmp11 - tmp3;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = z1 + z3;\n\n    tmp1  = MULTIPLY(z1 + z2, FIX(1.353318001));   /* c3 */\n    tmp2  = MULTIPLY(tmp11,   FIX(1.247225013));   /* c5 */\n    tmp3  = MULTIPLY(z1 + z4, FIX(1.093201867));   /* c7 */\n    tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586));   /* c9 */\n    tmp11 = MULTIPLY(tmp11,   FIX(0.666655658));   /* c11 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528));   /* c13 */\n    tmp0  = tmp1 + tmp2 + tmp3 -\n\t    MULTIPLY(z1, FIX(2.286341144));        /* c7+c5+c3-c1 */\n    tmp13 = tmp10 + tmp11 + tmp12 -\n\t    MULTIPLY(z1, FIX(1.835730603));        /* c9+c11+c13-c15 */\n    z1    = MULTIPLY(z2 + z3, FIX(0.138617169));   /* c15 */\n    tmp1  += z1 + MULTIPLY(z2, FIX(0.071888074));  /* c9+c11-c3-c15 */\n    tmp2  += z1 - MULTIPLY(z3, FIX(1.125726048));  /* c5+c7+c15-c3 */\n    z1    = MULTIPLY(z3 - z2, FIX(1.407403738));   /* c1 */\n    tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282));  /* c1+c11-c9-c13 */\n    tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411));  /* c1+c5+c13-c7 */\n    z2    += z4;\n    z1    = MULTIPLY(z2, - FIX(0.666655658));      /* -c11 */\n    tmp1  += z1;\n    tmp3  += z1 + MULTIPLY(z4, FIX(1.065388962));  /* c3+c11+c15-c7 */\n    z2    = MULTIPLY(z2, - FIX(1.247225013));      /* -c5 */\n    tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809));  /* c1+c5+c9-c13 */\n    tmp12 += z2;\n    z2    = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */\n    tmp2  += z2;\n    tmp3  += z2;\n    z2    = MULTIPLY(z4 - z3, FIX(0.410524528));   /* c13 */\n    tmp10 += z2;\n    tmp11 += z2;\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp0,  CONST_BITS-PASS1_BITS);\n    wsptr[8*15] = (int) RIGHT_SHIFT(tmp20 - tmp0,  CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp1,  CONST_BITS-PASS1_BITS);\n    wsptr[8*14] = (int) RIGHT_SHIFT(tmp21 - tmp1,  CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp2,  CONST_BITS-PASS1_BITS);\n    wsptr[8*13] = (int) RIGHT_SHIFT(tmp22 - tmp2,  CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp3,  CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp23 - tmp3,  CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp24 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp25 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp26 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process rows from work array, store into output array.\n   * Note that we must descale the results by a factor of 8 == 2**3,\n   * and also undo the PASS1_BITS scaling.\n   * 8-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16).\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 16; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part: reverse the even part of the forward DCT.\n     * The rotator is c(-6).\n     */\n\n    z2 = (INT32) wsptr[2];\n    z3 = (INT32) wsptr[6];\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);       /* c6 */\n    tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);     /* c2-c6 */\n    tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);     /* c2+c6 */\n\n    /* Add fudge factor here for final descale. */\n    z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z3 = (INT32) wsptr[4];\n\n    tmp0 = (z2 + z3) << CONST_BITS;\n    tmp1 = (z2 - z3) << CONST_BITS;\n\n    tmp10 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n    tmp11 = tmp1 + tmp3;\n    tmp12 = tmp1 - tmp3;\n\n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n\n    tmp0 = (INT32) wsptr[7];\n    tmp1 = (INT32) wsptr[5];\n    tmp2 = (INT32) wsptr[3];\n    tmp3 = (INT32) wsptr[1];\n\n    z2 = tmp0 + tmp2;\n    z3 = tmp1 + tmp3;\n\n    z1 = MULTIPLY(z2 + z3, FIX_1_175875602);       /*  c3 */\n    z2 = MULTIPLY(z2, - FIX_1_961570560);          /* -c3-c5 */\n    z3 = MULTIPLY(z3, - FIX_0_390180644);          /* -c3+c5 */\n    z2 += z1;\n    z3 += z1;\n\n    z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */\n    tmp0 = MULTIPLY(tmp0, FIX_0_298631336);        /* -c1+c3+c5-c7 */\n    tmp3 = MULTIPLY(tmp3, FIX_1_501321110);        /*  c1+c3-c5-c7 */\n    tmp0 += z1 + z2;\n    tmp3 += z1 + z3;\n\n    z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */\n    tmp1 = MULTIPLY(tmp1, FIX_2_053119869);        /*  c1+c3-c5+c7 */\n    tmp2 = MULTIPLY(tmp2, FIX_3_072711026);        /*  c1+c3+c5-c7 */\n    tmp1 += z1 + z3;\n    tmp2 += z1 + z2;\n\n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp3,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp3,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 7x14 output block.\n *\n * 14-point IDCT in pass 1 (columns), 7-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_7x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\tJCOEFPTR coef_block,\n\t\tJSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[7*14];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * 14-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/28).\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 7; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z1 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z2 = MULTIPLY(z4, FIX(1.274162392));         /* c4 */\n    z3 = MULTIPLY(z4, FIX(0.314692123));         /* c12 */\n    z4 = MULTIPLY(z4, FIX(0.881747734));         /* c8 */\n\n    tmp10 = z1 + z2;\n    tmp11 = z1 + z3;\n    tmp12 = z1 - z4;\n\n    tmp23 = RIGHT_SHIFT(z1 - ((z2 + z3 - z4) << 1), /* c0 = (c4+c12-c8)*2 */\n\t\t\tCONST_BITS-PASS1_BITS);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    z3 = MULTIPLY(z1 + z2, FIX(1.105676686));    /* c6 */\n\n    tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */\n    tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */\n    tmp15 = MULTIPLY(z1, FIX(0.613604268)) -     /* c10 */\n\t    MULTIPLY(z2, FIX(1.378756276));      /* c2 */\n\n    tmp20 = tmp10 + tmp13;\n    tmp26 = tmp10 - tmp13;\n    tmp21 = tmp11 + tmp14;\n    tmp25 = tmp11 - tmp14;\n    tmp22 = tmp12 + tmp15;\n    tmp24 = tmp12 - tmp15;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    tmp13 = z4 << CONST_BITS;\n\n    tmp14 = z1 + z3;\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607));           /* c3 */\n    tmp12 = MULTIPLY(tmp14, FIX(1.197448846));             /* c5 */\n    tmp10 = tmp11 + tmp12 + tmp13 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */\n    tmp14 = MULTIPLY(tmp14, FIX(0.752406978));             /* c9 */\n    tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426));        /* c9+c11-c13 */\n    z1    -= z2;\n    tmp15 = MULTIPLY(z1, FIX(0.467085129)) - tmp13;        /* c11 */\n    tmp16 += tmp15;\n    z1    += z4;\n    z4    = MULTIPLY(z2 + z3, - FIX(0.158341681)) - tmp13; /* -c13 */\n    tmp11 += z4 - MULTIPLY(z2, FIX(0.424103948));          /* c3-c9-c13 */\n    tmp12 += z4 - MULTIPLY(z3, FIX(2.373959773));          /* c3+c5-c13 */\n    z4    = MULTIPLY(z3 - z2, FIX(1.405321284));           /* c1 */\n    tmp14 += z4 + tmp13 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */\n    tmp15 += z4 + MULTIPLY(z2, FIX(0.674957567));          /* c1+c11-c5 */\n\n    tmp13 = (z1 - z3) << PASS1_BITS;\n\n    /* Final output stage */\n\n    wsptr[7*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[7*13] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[7*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[7*12] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[7*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[7*11] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[7*3]  = (int) (tmp23 + tmp13);\n    wsptr[7*10] = (int) (tmp23 - tmp13);\n    wsptr[7*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[7*9]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[7*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[7*8]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[7*6]  = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);\n    wsptr[7*7]  = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 14 rows from work array, store into output array.\n   * 7-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/14).\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 14; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp23 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp23 <<= CONST_BITS;\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[4];\n    z3 = (INT32) wsptr[6];\n\n    tmp20 = MULTIPLY(z2 - z3, FIX(0.881747734));       /* c4 */\n    tmp22 = MULTIPLY(z1 - z2, FIX(0.314692123));       /* c6 */\n    tmp21 = tmp20 + tmp22 + tmp23 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */\n    tmp10 = z1 + z3;\n    z2 -= tmp10;\n    tmp10 = MULTIPLY(tmp10, FIX(1.274162392)) + tmp23; /* c2 */\n    tmp20 += tmp10 - MULTIPLY(z3, FIX(0.077722536));   /* c2-c4-c6 */\n    tmp22 += tmp10 - MULTIPLY(z1, FIX(2.470602249));   /* c2+c4+c6 */\n    tmp23 += MULTIPLY(z2, FIX(1.414213562));           /* c0 */\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n\n    tmp11 = MULTIPLY(z1 + z2, FIX(0.935414347));       /* (c3+c1-c5)/2 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.170262339));       /* (c3+c5-c1)/2 */\n    tmp10 = tmp11 - tmp12;\n    tmp11 += tmp12;\n    tmp12 = MULTIPLY(z2 + z3, - FIX(1.378756276));     /* -c1 */\n    tmp11 += tmp12;\n    z2 = MULTIPLY(z1 + z3, FIX(0.613604268));          /* c5 */\n    tmp10 += z2;\n    tmp12 += z2 + MULTIPLY(z3, FIX(1.870828693));      /* c3+c1-c5 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 7;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 6x12 output block.\n *\n * 12-point IDCT in pass 1 (columns), 6-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_6x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\tJCOEFPTR coef_block,\n\t\tJSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[6*12];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * 12-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/24).\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z3 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */\n    z1 <<= CONST_BITS;\n    z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n    z2 <<= CONST_BITS;\n\n    tmp12 = z1 - z2;\n\n    tmp21 = z3 + tmp12;\n    tmp24 = z3 - tmp12;\n\n    tmp12 = z4 + z2;\n\n    tmp20 = tmp10 + tmp12;\n    tmp25 = tmp10 - tmp12;\n\n    tmp12 = z4 - z1 - z2;\n\n    tmp22 = tmp11 + tmp12;\n    tmp23 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = MULTIPLY(z2, FIX(1.306562965));                  /* c3 */\n    tmp14 = MULTIPLY(z2, - FIX_0_541196100);                 /* -c9 */\n\n    tmp10 = z1 + z3;\n    tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669));          /* c7 */\n    tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384));       /* c5-c7 */\n    tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716));  /* c1-c5 */\n    tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580));           /* -(c7+c11) */\n    tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */\n    tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */\n    tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) -        /* c7-c11 */\n\t     MULTIPLY(z4, FIX(1.982889723));                 /* c5+c7 */\n\n    z1 -= z4;\n    z2 -= z3;\n    z3 = MULTIPLY(z1 + z2, FIX_0_541196100);                 /* c9 */\n    tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);              /* c3-c9 */\n    tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);              /* c3+c9 */\n\n    /* Final output stage */\n\n    wsptr[6*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[6*11] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[6*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[6*10] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[6*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[6*9]  = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[6*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[6*8]  = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[6*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[6*7]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[6*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[6*6]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 12 rows from work array, store into output array.\n   * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12).\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 12; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp10 <<= CONST_BITS;\n    tmp12 = (INT32) wsptr[4];\n    tmp20 = MULTIPLY(tmp12, FIX(0.707106781));   /* c4 */\n    tmp11 = tmp10 + tmp20;\n    tmp21 = tmp10 - tmp20 - tmp20;\n    tmp20 = (INT32) wsptr[2];\n    tmp10 = MULTIPLY(tmp20, FIX(1.224744871));   /* c2 */\n    tmp20 = tmp11 + tmp10;\n    tmp22 = tmp11 - tmp10;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    tmp11 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */\n    tmp10 = tmp11 + ((z1 + z2) << CONST_BITS);\n    tmp12 = tmp11 + ((z3 - z2) << CONST_BITS);\n    tmp11 = (z1 - z2 - z3) << CONST_BITS;\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 6;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 5x10 output block.\n *\n * 10-point IDCT in pass 1 (columns), 5-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_5x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\tJCOEFPTR coef_block,\n\t\tJSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24;\n  INT32 z1, z2, z3, z4, z5;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[5*10];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * 10-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/20).\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 5; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z3 += ONE << (CONST_BITS-PASS1_BITS-1);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z1 = MULTIPLY(z4, FIX(1.144122806));         /* c4 */\n    z2 = MULTIPLY(z4, FIX(0.437016024));         /* c8 */\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z2;\n\n    tmp22 = RIGHT_SHIFT(z3 - ((z1 - z2) << 1),   /* c0 = (c4-c8)*2 */\n\t\t\tCONST_BITS-PASS1_BITS);\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));    /* c6 */\n    tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */\n    tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */\n\n    tmp20 = tmp10 + tmp12;\n    tmp24 = tmp10 - tmp12;\n    tmp21 = tmp11 + tmp13;\n    tmp23 = tmp11 - tmp13;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = z2 + z4;\n    tmp13 = z2 - z4;\n\n    tmp12 = MULTIPLY(tmp13, FIX(0.309016994));        /* (c3-c7)/2 */\n    z5 = z3 << CONST_BITS;\n\n    z2 = MULTIPLY(tmp11, FIX(0.951056516));           /* (c3+c7)/2 */\n    z4 = z5 + tmp12;\n\n    tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */\n    tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */\n\n    z2 = MULTIPLY(tmp11, FIX(0.587785252));           /* (c1-c9)/2 */\n    z4 = z5 - tmp12 - (tmp13 << (CONST_BITS - 1));\n\n    tmp12 = (z1 - tmp13 - z3) << PASS1_BITS;\n\n    tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */\n    tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */\n\n    /* Final output stage */\n\n    wsptr[5*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[5*9] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[5*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[5*8] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[5*2] = (int) (tmp22 + tmp12);\n    wsptr[5*7] = (int) (tmp22 - tmp12);\n    wsptr[5*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[5*6] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[5*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[5*5] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 10 rows from work array, store into output array.\n   * 5-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/10).\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 10; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp12 <<= CONST_BITS;\n    tmp13 = (INT32) wsptr[2];\n    tmp14 = (INT32) wsptr[4];\n    z1 = MULTIPLY(tmp13 + tmp14, FIX(0.790569415)); /* (c2+c4)/2 */\n    z2 = MULTIPLY(tmp13 - tmp14, FIX(0.353553391)); /* (c2-c4)/2 */\n    z3 = tmp12 + z2;\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z1;\n    tmp12 -= z2 << 2;\n\n    /* Odd part */\n\n    z2 = (INT32) wsptr[1];\n    z3 = (INT32) wsptr[3];\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));       /* c3 */\n    tmp13 = z1 + MULTIPLY(z2, FIX(0.513743148));    /* c1-c3 */\n    tmp14 = z1 - MULTIPLY(z3, FIX(2.176250899));    /* c1+c3 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp13,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp13,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp14,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp14,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 5;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 4x8 output block.\n *\n * 8-point IDCT in pass 1 (columns), 4-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3;\n  INT32 tmp10, tmp11, tmp12, tmp13;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[4*8];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * Note results are scaled up by sqrt(8) compared to a true IDCT;\n   * furthermore, we scale the results by 2**PASS1_BITS.\n   * 8-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16).\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 4; ctr > 0; ctr--) {\n    /* Due to quantization, we will usually find that many of the input\n     * coefficients are zero, especially the AC terms.  We can exploit this\n     * by short-circuiting the IDCT calculation for any column in which all\n     * the AC terms are zero.  In that case each output is equal to the\n     * DC coefficient (with scale factor as needed).\n     * With typical images and quantization tables, half or more of the\n     * column DCT calculations can be simplified this way.\n     */\n\n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n\tinptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&\n\tinptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&\n\tinptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero */\n      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;\n\n      wsptr[4*0] = dcval;\n      wsptr[4*1] = dcval;\n      wsptr[4*2] = dcval;\n      wsptr[4*3] = dcval;\n      wsptr[4*4] = dcval;\n      wsptr[4*5] = dcval;\n      wsptr[4*6] = dcval;\n      wsptr[4*7] = dcval;\n\n      inptr++;\t\t\t/* advance pointers to next column */\n      quantptr++;\n      wsptr++;\n      continue;\n    }\n\n    /* Even part: reverse the even part of the forward DCT.\n     * The rotator is c(-6).\n     */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);       /* c6 */\n    tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);     /* c2-c6 */\n    tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);     /* c2+c6 */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z2 <<= CONST_BITS;\n    z3 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z2 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    tmp0 = z2 + z3;\n    tmp1 = z2 - z3;\n\n    tmp10 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n    tmp11 = tmp1 + tmp3;\n    tmp12 = tmp1 - tmp3;\n\n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n\n    z2 = tmp0 + tmp2;\n    z3 = tmp1 + tmp3;\n\n    z1 = MULTIPLY(z2 + z3, FIX_1_175875602);       /*  c3 */\n    z2 = MULTIPLY(z2, - FIX_1_961570560);          /* -c3-c5 */\n    z3 = MULTIPLY(z3, - FIX_0_390180644);          /* -c3+c5 */\n    z2 += z1;\n    z3 += z1;\n\n    z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */\n    tmp0 = MULTIPLY(tmp0, FIX_0_298631336);        /* -c1+c3+c5-c7 */\n    tmp3 = MULTIPLY(tmp3, FIX_1_501321110);        /*  c1+c3-c5-c7 */\n    tmp0 += z1 + z2;\n    tmp3 += z1 + z3;\n\n    z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */\n    tmp1 = MULTIPLY(tmp1, FIX_2_053119869);        /*  c1+c3-c5+c7 */\n    tmp2 = MULTIPLY(tmp2, FIX_3_072711026);        /*  c1+c3+c5-c7 */\n    tmp1 += z1 + z3;\n    tmp2 += z1 + z2;\n\n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n\n    wsptr[4*0] = (int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[4*7] = (int) RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[4*1] = (int) RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[4*6] = (int) RIGHT_SHIFT(tmp11 - tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[4*2] = (int) RIGHT_SHIFT(tmp12 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[4*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[4*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[4*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS);\n\n    inptr++;\t\t\t/* advance pointers to next column */\n    quantptr++;\n    wsptr++;\n  }\n\n  /* Pass 2: process 8 rows from work array, store into output array.\n   * 4-point IDCT kernel,\n   * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT].\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp2 = (INT32) wsptr[2];\n\n    tmp10 = (tmp0 + tmp2) << CONST_BITS;\n    tmp12 = (tmp0 - tmp2) << CONST_BITS;\n\n    /* Odd part */\n    /* Same rotation as in the even part of the 8x8 LL&M IDCT */\n\n    z2 = (INT32) wsptr[1];\n    z3 = (INT32) wsptr[3];\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);   /* c6 */\n    tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */\n    tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 4;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 3x6 output block.\n *\n * 6-point IDCT in pass 1 (columns), 3-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_3x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[3*6];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12).\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 3; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp10 = MULTIPLY(tmp2, FIX(0.707106781));   /* c4 */\n    tmp1 = tmp0 + tmp10;\n    tmp11 = RIGHT_SHIFT(tmp0 - tmp10 - tmp10, CONST_BITS-PASS1_BITS);\n    tmp10 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp0 = MULTIPLY(tmp10, FIX(1.224744871));   /* c2 */\n    tmp10 = tmp1 + tmp0;\n    tmp12 = tmp1 - tmp0;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */\n    tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);\n    tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);\n    tmp1 = (z1 - z2 - z3) << PASS1_BITS;\n\n    /* Final output stage */\n\n    wsptr[3*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[3*5] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[3*1] = (int) (tmp11 + tmp1);\n    wsptr[3*4] = (int) (tmp11 - tmp1);\n    wsptr[3*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[3*3] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 6 rows from work array, store into output array.\n   * 3-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/6).\n   */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 6; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 <<= CONST_BITS;\n    tmp2 = (INT32) wsptr[2];\n    tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */\n    tmp10 = tmp0 + tmp12;\n    tmp2 = tmp0 - tmp12 - tmp12;\n\n    /* Odd part */\n\n    tmp12 = (INT32) wsptr[1];\n    tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 3;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 2x4 output block.\n *\n * 4-point IDCT in pass 1 (columns), 2-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_2x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp2, tmp10, tmp12;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  INT32 * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  INT32 workspace[2*4];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array.\n   * 4-point IDCT kernel,\n   * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT].\n   */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 2; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n\n    tmp10 = (tmp0 + tmp2) << CONST_BITS;\n    tmp12 = (tmp0 - tmp2) << CONST_BITS;\n\n    /* Odd part */\n    /* Same rotation as in the even part of the 8x8 LL&M IDCT */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);   /* c6 */\n    tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */\n    tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */\n\n    /* Final output stage */\n\n    wsptr[2*0] = tmp10 + tmp0;\n    wsptr[2*3] = tmp10 - tmp0;\n    wsptr[2*1] = tmp12 + tmp2;\n    wsptr[2*2] = tmp12 - tmp2;\n  }\n\n  /* Pass 2: process 4 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 4; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp10 = wsptr[0] + (ONE << (CONST_BITS+2));\n\n    /* Odd part */\n\n    tmp0 = wsptr[1];\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 2;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 1x2 output block.\n *\n * 2-point IDCT in pass 1 (columns), 1-point in pass 2 (rows).\n */\n\nGLOBAL(void)\njpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1;\n  ISLOW_MULT_TYPE * quantptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  SHIFT_TEMPS\n\n  /* Process 1 column from input, store into output array. */\n\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n\n  /* Even part */\n    \n  tmp0 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]);\n  /* Add fudge factor here for final descale. */\n  tmp0 += ONE << 2;\n\n  /* Odd part */\n\n  tmp1 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]);\n\n  /* Final output stage */\n\n  output_buf[0][output_col] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3)\n\t\t\t\t\t  & RANGE_MASK];\n  output_buf[1][output_col] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3)\n\t\t\t\t\t  & RANGE_MASK];\n}\n\n#endif /* IDCT_SCALING_SUPPORTED */\n#endif /* DCT_ISLOW_SUPPORTED */\n"
  },
  {
    "path": "jinclude.h",
    "content": "/*\n * jinclude.h\n *\n * Copyright (C) 1991-1994, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file exists to provide a single place to fix any problems with\n * including the wrong system include files.  (Common problems are taken\n * care of by the standard jconfig symbols, but on really weird systems\n * you may have to edit this file.)\n *\n * NOTE: this file is NOT intended to be included by applications using the\n * JPEG library.  Most applications need only include jpeglib.h.\n */\n\n\n/* Include auto-config file to find out which system include files we need. */\n\n#include \"jconfig.h\"\t\t/* auto configuration options */\n#define JCONFIG_INCLUDED\t/* so that jpeglib.h doesn't do it again */\n\n/*\n * We need the NULL macro and size_t typedef.\n * On an ANSI-conforming system it is sufficient to include <stddef.h>.\n * Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to\n * pull in <sys/types.h> as well.\n * Note that the core JPEG library does not require <stdio.h>;\n * only the default error handler and data source/destination modules do.\n * But we must pull it in because of the references to FILE in jpeglib.h.\n * You can remove those references if you want to compile without <stdio.h>.\n */\n\n#ifdef HAVE_STDDEF_H\n#include <stddef.h>\n#endif\n\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n\n#ifdef NEED_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include <stdio.h>\n\n/*\n * We need memory copying and zeroing functions, plus strncpy().\n * ANSI and System V implementations declare these in <string.h>.\n * BSD doesn't have the mem() functions, but it does have bcopy()/bzero().\n * Some systems may declare memset and memcpy in <memory.h>.\n *\n * NOTE: we assume the size parameters to these functions are of type size_t.\n * Change the casts in these macros if not!\n */\n\n#ifdef NEED_BSD_STRINGS\n\n#include <strings.h>\n#define MEMZERO(target,size)\tbzero((void *)(target), (size_t)(size))\n#define MEMCOPY(dest,src,size)\tbcopy((const void *)(src), (void *)(dest), (size_t)(size))\n\n#else /* not BSD, assume ANSI/SysV string lib */\n\n#include <string.h>\n#define MEMZERO(target,size)\tmemset((void *)(target), 0, (size_t)(size))\n#define MEMCOPY(dest,src,size)\tmemcpy((void *)(dest), (const void *)(src), (size_t)(size))\n\n#endif\n\n/*\n * In ANSI C, and indeed any rational implementation, size_t is also the\n * type returned by sizeof().  However, it seems there are some irrational\n * implementations out there, in which sizeof() returns an int even though\n * size_t is defined as long or unsigned long.  To ensure consistent results\n * we always use this SIZEOF() macro in place of using sizeof() directly.\n */\n\n#define SIZEOF(object)\t((size_t) sizeof(object))\n\n/*\n * The modules that use fread() and fwrite() always invoke them through\n * these macros.  On some systems you may need to twiddle the argument casts.\n * CAUTION: argument order is different from underlying functions!\n */\n\n#define JFREAD(file,buf,sizeofbuf)  \\\n  ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))\n#define JFWRITE(file,buf,sizeofbuf)  \\\n  ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))\n"
  },
  {
    "path": "jmemansi.c",
    "content": "/*\n * jmemansi.c\n *\n * Copyright (C) 1992-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file provides a simple generic implementation of the system-\n * dependent portion of the JPEG memory manager.  This implementation\n * assumes that you have the ANSI-standard library routine tmpfile().\n * Also, the problem of determining the amount of memory available\n * is shoved onto the user.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jmemsys.h\"\t\t/* import the system-dependent declarations */\n\n#ifndef HAVE_STDLIB_H\t\t/* <stdlib.h> should declare malloc(),free() */\nextern void * malloc JPP((size_t size));\nextern void free JPP((void *ptr));\n#endif\n\n#ifndef SEEK_SET\t\t/* pre-ANSI systems may not define this; */\n#define SEEK_SET  0\t\t/* if not, assume 0 is correct */\n#endif\n\n\n/*\n * Memory allocation and freeing are controlled by the regular library\n * routines malloc() and free().\n */\n\nGLOBAL(void *)\njpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void *) malloc(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)\n{\n  free(object);\n}\n\n\n/*\n * \"Large\" objects are treated the same as \"small\" ones.\n * NB: although we include FAR keywords in the routine declarations,\n * this file won't actually work in 80x86 small/medium model; at least,\n * you probably won't be able to process useful-size images in only 64KB.\n */\n\nGLOBAL(void FAR *)\njpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void FAR *) malloc(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)\n{\n  free(object);\n}\n\n\n/*\n * This routine computes the total memory space available for allocation.\n * It's impossible to do this in a portable way; our current solution is\n * to make the user tell us (with a default value set at compile time).\n * If you can actually get the available space, it's a good idea to subtract\n * a slop factor of 5% or so.\n */\n\n#ifndef DEFAULT_MAX_MEM\t\t/* so can override from makefile */\n#define DEFAULT_MAX_MEM\t\t1000000L /* default: one megabyte */\n#endif\n\nGLOBAL(long)\njpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,\n\t\t    long max_bytes_needed, long already_allocated)\n{\n  return cinfo->mem->max_memory_to_use - already_allocated;\n}\n\n\n/*\n * Backing store (temporary file) management.\n * Backing store objects are only used when the value returned by\n * jpeg_mem_available is less than the total space needed.  You can dispense\n * with these routines if you have plenty of virtual memory; see jmemnobs.c.\n */\n\n\nMETHODDEF(void)\nread_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t    void FAR * buffer_address,\n\t\t    long file_offset, long byte_count)\n{\n  if (fseek(info->temp_file, file_offset, SEEK_SET))\n    ERREXIT(cinfo, JERR_TFILE_SEEK);\n  if (JFREAD(info->temp_file, buffer_address, byte_count)\n      != (size_t) byte_count)\n    ERREXIT(cinfo, JERR_TFILE_READ);\n}\n\n\nMETHODDEF(void)\nwrite_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t     void FAR * buffer_address,\n\t\t     long file_offset, long byte_count)\n{\n  if (fseek(info->temp_file, file_offset, SEEK_SET))\n    ERREXIT(cinfo, JERR_TFILE_SEEK);\n  if (JFWRITE(info->temp_file, buffer_address, byte_count)\n      != (size_t) byte_count)\n    ERREXIT(cinfo, JERR_TFILE_WRITE);\n}\n\n\nMETHODDEF(void)\nclose_backing_store (j_common_ptr cinfo, backing_store_ptr info)\n{\n  fclose(info->temp_file);\n  /* Since this implementation uses tmpfile() to create the file,\n   * no explicit file deletion is needed.\n   */\n}\n\n\n/*\n * Initial opening of a backing-store object.\n *\n * This version uses tmpfile(), which constructs a suitable file name\n * behind the scenes.  We don't have to use info->temp_name[] at all;\n * indeed, we can't even find out the actual name of the temp file.\n */\n\nGLOBAL(void)\njpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t\t long total_bytes_needed)\n{\n  if ((info->temp_file = tmpfile()) == NULL)\n    ERREXITS(cinfo, JERR_TFILE_CREATE, \"\");\n  info->read_backing_store = read_backing_store;\n  info->write_backing_store = write_backing_store;\n  info->close_backing_store = close_backing_store;\n}\n\n\n/*\n * These routines take care of any system-dependent initialization and\n * cleanup required.\n */\n\nGLOBAL(long)\njpeg_mem_init (j_common_ptr cinfo)\n{\n  return DEFAULT_MAX_MEM;\t/* default for max_memory_to_use */\n}\n\nGLOBAL(void)\njpeg_mem_term (j_common_ptr cinfo)\n{\n  /* no work */\n}\n"
  },
  {
    "path": "jmemdos.c",
    "content": "/*\n * jmemdos.c\n *\n * Copyright (C) 1992-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file provides an MS-DOS-compatible implementation of the system-\n * dependent portion of the JPEG memory manager.  Temporary data can be\n * stored in extended or expanded memory as well as in regular DOS files.\n *\n * If you use this file, you must be sure that NEED_FAR_POINTERS is defined\n * if you compile in a small-data memory model; it should NOT be defined if\n * you use a large-data memory model.  This file is not recommended if you\n * are using a flat-memory-space 386 environment such as DJGCC or Watcom C.\n * Also, this code will NOT work if struct fields are aligned on greater than\n * 2-byte boundaries.\n *\n * Based on code contributed by Ge' Weijers.\n */\n\n/*\n * If you have both extended and expanded memory, you may want to change the\n * order in which they are tried in jopen_backing_store.  On a 286 machine\n * expanded memory is usually faster, since extended memory access involves\n * an expensive protected-mode-and-back switch.  On 386 and better, extended\n * memory is usually faster.  As distributed, the code tries extended memory\n * first (what? not everyone has a 386? :-).\n *\n * You can disable use of extended/expanded memory entirely by altering these\n * definitions or overriding them from the Makefile (eg, -DEMS_SUPPORTED=0).\n */\n\n#ifndef XMS_SUPPORTED\n#define XMS_SUPPORTED  1\n#endif\n#ifndef EMS_SUPPORTED\n#define EMS_SUPPORTED  1\n#endif\n\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jmemsys.h\"\t\t/* import the system-dependent declarations */\n\n#ifndef HAVE_STDLIB_H\t\t/* <stdlib.h> should declare these */\nextern void * malloc JPP((size_t size));\nextern void free JPP((void *ptr));\nextern char * getenv JPP((const char * name));\n#endif\n\n#ifdef NEED_FAR_POINTERS\n\n#ifdef __TURBOC__\n/* These definitions work for Borland C (Turbo C) */\n#include <alloc.h>\t\t/* need farmalloc(), farfree() */\n#define far_malloc(x)\tfarmalloc(x)\n#define far_free(x)\tfarfree(x)\n#else\n/* These definitions work for Microsoft C and compatible compilers */\n#include <malloc.h>\t\t/* need _fmalloc(), _ffree() */\n#define far_malloc(x)\t_fmalloc(x)\n#define far_free(x)\t_ffree(x)\n#endif\n\n#else /* not NEED_FAR_POINTERS */\n\n#define far_malloc(x)\tmalloc(x)\n#define far_free(x)\tfree(x)\n\n#endif /* NEED_FAR_POINTERS */\n\n#ifdef DONT_USE_B_MODE\t\t/* define mode parameters for fopen() */\n#define READ_BINARY\t\"r\"\n#else\n#define READ_BINARY\t\"rb\"\n#endif\n\n#ifndef USE_MSDOS_MEMMGR\t/* make sure user got configuration right */\n  You forgot to define USE_MSDOS_MEMMGR in jconfig.h. /* deliberate syntax error */\n#endif\n\n#if MAX_ALLOC_CHUNK >= 65535L\t/* make sure jconfig.h got this right */\n  MAX_ALLOC_CHUNK should be less than 64K. /* deliberate syntax error */\n#endif\n\n\n/*\n * Declarations for assembly-language support routines (see jmemdosa.asm).\n *\n * The functions are declared \"far\" as are all their pointer arguments;\n * this ensures the assembly source code will work regardless of the\n * compiler memory model.  We assume \"short\" is 16 bits, \"long\" is 32.\n */\n\ntypedef void far * XMSDRIVER;\t/* actually a pointer to code */\ntypedef struct {\t\t/* registers for calling XMS driver */\n\tunsigned short ax, dx, bx;\n\tvoid far * ds_si;\n      } XMScontext;\ntypedef struct {\t\t/* registers for calling EMS driver */\n\tunsigned short ax, dx, bx;\n\tvoid far * ds_si;\n      } EMScontext;\n\nextern short far jdos_open JPP((short far * handle, char far * filename));\nextern short far jdos_close JPP((short handle));\nextern short far jdos_seek JPP((short handle, long offset));\nextern short far jdos_read JPP((short handle, void far * buffer,\n\t\t\t\tunsigned short count));\nextern short far jdos_write JPP((short handle, void far * buffer,\n\t\t\t\t unsigned short count));\nextern void far jxms_getdriver JPP((XMSDRIVER far *));\nextern void far jxms_calldriver JPP((XMSDRIVER, XMScontext far *));\nextern short far jems_available JPP((void));\nextern void far jems_calldriver JPP((EMScontext far *));\n\n\n/*\n * Selection of a file name for a temporary file.\n * This is highly system-dependent, and you may want to customize it.\n */\n\nstatic int next_file_num;\t/* to distinguish among several temp files */\n\nLOCAL(void)\nselect_file_name (char * fname)\n{\n  const char * env;\n  char * ptr;\n  FILE * tfile;\n\n  /* Keep generating file names till we find one that's not in use */\n  for (;;) {\n    /* Get temp directory name from environment TMP or TEMP variable;\n     * if none, use \".\"\n     */\n    if ((env = (const char *) getenv(\"TMP\")) == NULL)\n      if ((env = (const char *) getenv(\"TEMP\")) == NULL)\n\tenv = \".\";\n    if (*env == '\\0')\t\t/* null string means \".\" */\n      env = \".\";\n    ptr = fname;\t\t/* copy name to fname */\n    while (*env != '\\0')\n      *ptr++ = *env++;\n    if (ptr[-1] != '\\\\' && ptr[-1] != '/')\n      *ptr++ = '\\\\';\t\t/* append backslash if not in env variable */\n    /* Append a suitable file name */\n    next_file_num++;\t\t/* advance counter */\n    sprintf(ptr, \"JPG%03d.TMP\", next_file_num);\n    /* Probe to see if file name is already in use */\n    if ((tfile = fopen(fname, READ_BINARY)) == NULL)\n      break;\n    fclose(tfile);\t\t/* oops, it's there; close tfile & try again */\n  }\n}\n\n\n/*\n * Near-memory allocation and freeing are controlled by the regular library\n * routines malloc() and free().\n */\n\nGLOBAL(void *)\njpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void *) malloc(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)\n{\n  free(object);\n}\n\n\n/*\n * \"Large\" objects are allocated in far memory, if possible\n */\n\nGLOBAL(void FAR *)\njpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void FAR *) far_malloc(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)\n{\n  far_free(object);\n}\n\n\n/*\n * This routine computes the total memory space available for allocation.\n * It's impossible to do this in a portable way; our current solution is\n * to make the user tell us (with a default value set at compile time).\n * If you can actually get the available space, it's a good idea to subtract\n * a slop factor of 5% or so.\n */\n\n#ifndef DEFAULT_MAX_MEM\t\t/* so can override from makefile */\n#define DEFAULT_MAX_MEM\t\t300000L /* for total usage about 450K */\n#endif\n\nGLOBAL(long)\njpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,\n\t\t    long max_bytes_needed, long already_allocated)\n{\n  return cinfo->mem->max_memory_to_use - already_allocated;\n}\n\n\n/*\n * Backing store (temporary file) management.\n * Backing store objects are only used when the value returned by\n * jpeg_mem_available is less than the total space needed.  You can dispense\n * with these routines if you have plenty of virtual memory; see jmemnobs.c.\n */\n\n/*\n * For MS-DOS we support three types of backing storage:\n *   1. Conventional DOS files.  We access these by direct DOS calls rather\n *      than via the stdio package.  This provides a bit better performance,\n *      but the real reason is that the buffers to be read or written are FAR.\n *      The stdio library for small-data memory models can't cope with that.\n *   2. Extended memory, accessed per the XMS V2.0 specification.\n *   3. Expanded memory, accessed per the LIM/EMS 4.0 specification.\n * You'll need copies of those specs to make sense of the related code.\n * The specs are available by Internet FTP from the SIMTEL archives \n * (oak.oakland.edu and its various mirror sites).  See files\n * pub/msdos/microsoft/xms20.arc and pub/msdos/info/limems41.zip.\n */\n\n\n/*\n * Access methods for a DOS file.\n */\n\n\nMETHODDEF(void)\nread_file_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t void FAR * buffer_address,\n\t\t long file_offset, long byte_count)\n{\n  if (jdos_seek(info->handle.file_handle, file_offset))\n    ERREXIT(cinfo, JERR_TFILE_SEEK);\n  /* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */\n  if (byte_count > 65535L)\t/* safety check */\n    ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);\n  if (jdos_read(info->handle.file_handle, buffer_address,\n\t\t(unsigned short) byte_count))\n    ERREXIT(cinfo, JERR_TFILE_READ);\n}\n\n\nMETHODDEF(void)\nwrite_file_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t  void FAR * buffer_address,\n\t\t  long file_offset, long byte_count)\n{\n  if (jdos_seek(info->handle.file_handle, file_offset))\n    ERREXIT(cinfo, JERR_TFILE_SEEK);\n  /* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */\n  if (byte_count > 65535L)\t/* safety check */\n    ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);\n  if (jdos_write(info->handle.file_handle, buffer_address,\n\t\t (unsigned short) byte_count))\n    ERREXIT(cinfo, JERR_TFILE_WRITE);\n}\n\n\nMETHODDEF(void)\nclose_file_store (j_common_ptr cinfo, backing_store_ptr info)\n{\n  jdos_close(info->handle.file_handle);\t/* close the file */\n  remove(info->temp_name);\t/* delete the file */\n/* If your system doesn't have remove(), try unlink() instead.\n * remove() is the ANSI-standard name for this function, but\n * unlink() was more common in pre-ANSI systems.\n */\n  TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name);\n}\n\n\nLOCAL(boolean)\nopen_file_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t long total_bytes_needed)\n{\n  short handle;\n\n  select_file_name(info->temp_name);\n  if (jdos_open((short far *) & handle, (char far *) info->temp_name)) {\n    /* might as well exit since jpeg_open_backing_store will fail anyway */\n    ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);\n    return FALSE;\n  }\n  info->handle.file_handle = handle;\n  info->read_backing_store = read_file_store;\n  info->write_backing_store = write_file_store;\n  info->close_backing_store = close_file_store;\n  TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);\n  return TRUE;\t\t\t/* succeeded */\n}\n\n\n/*\n * Access methods for extended memory.\n */\n\n#if XMS_SUPPORTED\n\nstatic XMSDRIVER xms_driver;\t/* saved address of XMS driver */\n\ntypedef union {\t\t\t/* either long offset or real-mode pointer */\n\tlong offset;\n\tvoid far * ptr;\n      } XMSPTR;\n\ntypedef struct {\t\t/* XMS move specification structure */\n\tlong length;\n\tXMSH src_handle;\n\tXMSPTR src;\n\tXMSH dst_handle;\n\tXMSPTR dst;\n      } XMSspec;\n\n#define ODD(X)\t(((X) & 1L) != 0)\n\n\nMETHODDEF(void)\nread_xms_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\tvoid FAR * buffer_address,\n\t\tlong file_offset, long byte_count)\n{\n  XMScontext ctx;\n  XMSspec spec;\n  char endbuffer[2];\n\n  /* The XMS driver can't cope with an odd length, so handle the last byte\n   * specially if byte_count is odd.  We don't expect this to be common.\n   */\n\n  spec.length = byte_count & (~ 1L);\n  spec.src_handle = info->handle.xms_handle;\n  spec.src.offset = file_offset;\n  spec.dst_handle = 0;\n  spec.dst.ptr = buffer_address;\n  \n  ctx.ds_si = (void far *) & spec;\n  ctx.ax = 0x0b00;\t\t/* EMB move */\n  jxms_calldriver(xms_driver, (XMScontext far *) & ctx);\n  if (ctx.ax != 1)\n    ERREXIT(cinfo, JERR_XMS_READ);\n\n  if (ODD(byte_count)) {\n    read_xms_store(cinfo, info, (void FAR *) endbuffer,\n\t\t   file_offset + byte_count - 1L, 2L);\n    ((char FAR *) buffer_address)[byte_count - 1L] = endbuffer[0];\n  }\n}\n\n\nMETHODDEF(void)\nwrite_xms_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t void FAR * buffer_address,\n\t\t long file_offset, long byte_count)\n{\n  XMScontext ctx;\n  XMSspec spec;\n  char endbuffer[2];\n\n  /* The XMS driver can't cope with an odd length, so handle the last byte\n   * specially if byte_count is odd.  We don't expect this to be common.\n   */\n\n  spec.length = byte_count & (~ 1L);\n  spec.src_handle = 0;\n  spec.src.ptr = buffer_address;\n  spec.dst_handle = info->handle.xms_handle;\n  spec.dst.offset = file_offset;\n\n  ctx.ds_si = (void far *) & spec;\n  ctx.ax = 0x0b00;\t\t/* EMB move */\n  jxms_calldriver(xms_driver, (XMScontext far *) & ctx);\n  if (ctx.ax != 1)\n    ERREXIT(cinfo, JERR_XMS_WRITE);\n\n  if (ODD(byte_count)) {\n    read_xms_store(cinfo, info, (void FAR *) endbuffer,\n\t\t   file_offset + byte_count - 1L, 2L);\n    endbuffer[0] = ((char FAR *) buffer_address)[byte_count - 1L];\n    write_xms_store(cinfo, info, (void FAR *) endbuffer,\n\t\t    file_offset + byte_count - 1L, 2L);\n  }\n}\n\n\nMETHODDEF(void)\nclose_xms_store (j_common_ptr cinfo, backing_store_ptr info)\n{\n  XMScontext ctx;\n\n  ctx.dx = info->handle.xms_handle;\n  ctx.ax = 0x0a00;\n  jxms_calldriver(xms_driver, (XMScontext far *) & ctx);\n  TRACEMS1(cinfo, 1, JTRC_XMS_CLOSE, info->handle.xms_handle);\n  /* we ignore any error return from the driver */\n}\n\n\nLOCAL(boolean)\nopen_xms_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\tlong total_bytes_needed)\n{\n  XMScontext ctx;\n\n  /* Get address of XMS driver */\n  jxms_getdriver((XMSDRIVER far *) & xms_driver);\n  if (xms_driver == NULL)\n    return FALSE;\t\t/* no driver to be had */\n\n  /* Get version number, must be >= 2.00 */\n  ctx.ax = 0x0000;\n  jxms_calldriver(xms_driver, (XMScontext far *) & ctx);\n  if (ctx.ax < (unsigned short) 0x0200)\n    return FALSE;\n\n  /* Try to get space (expressed in kilobytes) */\n  ctx.dx = (unsigned short) ((total_bytes_needed + 1023L) >> 10);\n  ctx.ax = 0x0900;\n  jxms_calldriver(xms_driver, (XMScontext far *) & ctx);\n  if (ctx.ax != 1)\n    return FALSE;\n\n  /* Succeeded, save the handle and away we go */\n  info->handle.xms_handle = ctx.dx;\n  info->read_backing_store = read_xms_store;\n  info->write_backing_store = write_xms_store;\n  info->close_backing_store = close_xms_store;\n  TRACEMS1(cinfo, 1, JTRC_XMS_OPEN, ctx.dx);\n  return TRUE;\t\t\t/* succeeded */\n}\n\n#endif /* XMS_SUPPORTED */\n\n\n/*\n * Access methods for expanded memory.\n */\n\n#if EMS_SUPPORTED\n\n/* The EMS move specification structure requires word and long fields aligned\n * at odd byte boundaries.  Some compilers will align struct fields at even\n * byte boundaries.  While it's usually possible to force byte alignment,\n * that causes an overall performance penalty and may pose problems in merging\n * JPEG into a larger application.  Instead we accept some rather dirty code\n * here.  Note this code would fail if the hardware did not allow odd-byte\n * word & long accesses, but all 80x86 CPUs do.\n */\n\ntypedef void far * EMSPTR;\n\ntypedef union {\t\t\t/* EMS move specification structure */\n\tlong length;\t\t/* It's easy to access first 4 bytes */\n\tchar bytes[18];\t\t/* Misaligned fields in here! */\n      } EMSspec;\n\n/* Macros for accessing misaligned fields */\n#define FIELD_AT(spec,offset,type)  (*((type *) &(spec.bytes[offset])))\n#define SRC_TYPE(spec)\t\tFIELD_AT(spec,4,char)\n#define SRC_HANDLE(spec)\tFIELD_AT(spec,5,EMSH)\n#define SRC_OFFSET(spec)\tFIELD_AT(spec,7,unsigned short)\n#define SRC_PAGE(spec)\t\tFIELD_AT(spec,9,unsigned short)\n#define SRC_PTR(spec)\t\tFIELD_AT(spec,7,EMSPTR)\n#define DST_TYPE(spec)\t\tFIELD_AT(spec,11,char)\n#define DST_HANDLE(spec)\tFIELD_AT(spec,12,EMSH)\n#define DST_OFFSET(spec)\tFIELD_AT(spec,14,unsigned short)\n#define DST_PAGE(spec)\t\tFIELD_AT(spec,16,unsigned short)\n#define DST_PTR(spec)\t\tFIELD_AT(spec,14,EMSPTR)\n\n#define EMSPAGESIZE\t16384L\t/* gospel, see the EMS specs */\n\n#define HIBYTE(W)  (((W) >> 8) & 0xFF)\n#define LOBYTE(W)  ((W) & 0xFF)\n\n\nMETHODDEF(void)\nread_ems_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\tvoid FAR * buffer_address,\n\t\tlong file_offset, long byte_count)\n{\n  EMScontext ctx;\n  EMSspec spec;\n\n  spec.length = byte_count;\n  SRC_TYPE(spec) = 1;\n  SRC_HANDLE(spec) = info->handle.ems_handle;\n  SRC_PAGE(spec)   = (unsigned short) (file_offset / EMSPAGESIZE);\n  SRC_OFFSET(spec) = (unsigned short) (file_offset % EMSPAGESIZE);\n  DST_TYPE(spec) = 0;\n  DST_HANDLE(spec) = 0;\n  DST_PTR(spec)    = buffer_address;\n  \n  ctx.ds_si = (void far *) & spec;\n  ctx.ax = 0x5700;\t\t/* move memory region */\n  jems_calldriver((EMScontext far *) & ctx);\n  if (HIBYTE(ctx.ax) != 0)\n    ERREXIT(cinfo, JERR_EMS_READ);\n}\n\n\nMETHODDEF(void)\nwrite_ems_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t void FAR * buffer_address,\n\t\t long file_offset, long byte_count)\n{\n  EMScontext ctx;\n  EMSspec spec;\n\n  spec.length = byte_count;\n  SRC_TYPE(spec) = 0;\n  SRC_HANDLE(spec) = 0;\n  SRC_PTR(spec)    = buffer_address;\n  DST_TYPE(spec) = 1;\n  DST_HANDLE(spec) = info->handle.ems_handle;\n  DST_PAGE(spec)   = (unsigned short) (file_offset / EMSPAGESIZE);\n  DST_OFFSET(spec) = (unsigned short) (file_offset % EMSPAGESIZE);\n  \n  ctx.ds_si = (void far *) & spec;\n  ctx.ax = 0x5700;\t\t/* move memory region */\n  jems_calldriver((EMScontext far *) & ctx);\n  if (HIBYTE(ctx.ax) != 0)\n    ERREXIT(cinfo, JERR_EMS_WRITE);\n}\n\n\nMETHODDEF(void)\nclose_ems_store (j_common_ptr cinfo, backing_store_ptr info)\n{\n  EMScontext ctx;\n\n  ctx.ax = 0x4500;\n  ctx.dx = info->handle.ems_handle;\n  jems_calldriver((EMScontext far *) & ctx);\n  TRACEMS1(cinfo, 1, JTRC_EMS_CLOSE, info->handle.ems_handle);\n  /* we ignore any error return from the driver */\n}\n\n\nLOCAL(boolean)\nopen_ems_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\tlong total_bytes_needed)\n{\n  EMScontext ctx;\n\n  /* Is EMS driver there? */\n  if (! jems_available())\n    return FALSE;\n\n  /* Get status, make sure EMS is OK */\n  ctx.ax = 0x4000;\n  jems_calldriver((EMScontext far *) & ctx);\n  if (HIBYTE(ctx.ax) != 0)\n    return FALSE;\n\n  /* Get version, must be >= 4.0 */\n  ctx.ax = 0x4600;\n  jems_calldriver((EMScontext far *) & ctx);\n  if (HIBYTE(ctx.ax) != 0 || LOBYTE(ctx.ax) < 0x40)\n    return FALSE;\n\n  /* Try to allocate requested space */\n  ctx.ax = 0x4300;\n  ctx.bx = (unsigned short) ((total_bytes_needed + EMSPAGESIZE-1L) / EMSPAGESIZE);\n  jems_calldriver((EMScontext far *) & ctx);\n  if (HIBYTE(ctx.ax) != 0)\n    return FALSE;\n\n  /* Succeeded, save the handle and away we go */\n  info->handle.ems_handle = ctx.dx;\n  info->read_backing_store = read_ems_store;\n  info->write_backing_store = write_ems_store;\n  info->close_backing_store = close_ems_store;\n  TRACEMS1(cinfo, 1, JTRC_EMS_OPEN, ctx.dx);\n  return TRUE;\t\t\t/* succeeded */\n}\n\n#endif /* EMS_SUPPORTED */\n\n\n/*\n * Initial opening of a backing-store object.\n */\n\nGLOBAL(void)\njpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t\t long total_bytes_needed)\n{\n  /* Try extended memory, then expanded memory, then regular file. */\n#if XMS_SUPPORTED\n  if (open_xms_store(cinfo, info, total_bytes_needed))\n    return;\n#endif\n#if EMS_SUPPORTED\n  if (open_ems_store(cinfo, info, total_bytes_needed))\n    return;\n#endif\n  if (open_file_store(cinfo, info, total_bytes_needed))\n    return;\n  ERREXITS(cinfo, JERR_TFILE_CREATE, \"\");\n}\n\n\n/*\n * These routines take care of any system-dependent initialization and\n * cleanup required.\n */\n\nGLOBAL(long)\njpeg_mem_init (j_common_ptr cinfo)\n{\n  next_file_num = 0;\t\t/* initialize temp file name generator */\n  return DEFAULT_MAX_MEM;\t/* default for max_memory_to_use */\n}\n\nGLOBAL(void)\njpeg_mem_term (j_common_ptr cinfo)\n{\n  /* Microsoft C, at least in v6.00A, will not successfully reclaim freed\n   * blocks of size > 32Kbytes unless we give it a kick in the rear, like so:\n   */\n#ifdef NEED_FHEAPMIN\n  _fheapmin();\n#endif\n}\n"
  },
  {
    "path": "jmemdosa.asm",
    "content": ";\n; jmemdosa.asm\n;\n; Copyright (C) 1992, Thomas G. Lane.\n; This file is part of the Independent JPEG Group's software.\n; For conditions of distribution and use, see the accompanying README file.\n;\n; This file contains low-level interface routines to support the MS-DOS\n; backing store manager (jmemdos.c).  Routines are provided to access disk\n; files through direct DOS calls, and to access XMS and EMS drivers.\n;\n; This file should assemble with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).  If you haven't got\n; a compatible assembler, better fall back to jmemansi.c or jmemname.c.\n;\n; To minimize dependence on the C compiler's register usage conventions,\n; we save and restore all 8086 registers, even though most compilers only\n; require SI,DI,DS to be preserved.  Also, we use only 16-bit-wide return\n; values, which everybody returns in AX.\n;\n; Based on code contributed by Ge' Weijers.\n;\n\nJMEMDOSA_TXT\tsegment byte public 'CODE'\n\n\t\tassume\tcs:JMEMDOSA_TXT\n\n\t\tpublic\t_jdos_open\n\t\tpublic\t_jdos_close\n\t\tpublic\t_jdos_seek\n\t\tpublic\t_jdos_read\n\t\tpublic\t_jdos_write\n\t\tpublic\t_jxms_getdriver\n\t\tpublic\t_jxms_calldriver\n\t\tpublic\t_jems_available\n\t\tpublic\t_jems_calldriver\n\n;\n; short far jdos_open (short far * handle, char far * filename)\n;\n; Create and open a temporary file\n;\n_jdos_open\tproc\tfar\n\t\tpush\tbp\t\t\t; linkage\n\t\tmov \tbp,sp\n\t\tpush\tsi\t\t\t; save all registers for safety\n\t\tpush\tdi\n\t\tpush\tbx\n\t\tpush\tcx\n\t\tpush\tdx\n\t\tpush\tes\n\t\tpush\tds\n\t\tmov\tcx,0\t\t\t; normal file attributes\n\t\tlds\tdx,dword ptr [bp+10]\t; get filename pointer\n\t\tmov\tah,3ch\t\t\t; create file\n\t\tint\t21h\n\t\tjc\topen_err\t\t; if failed, return error code\n\t\tlds\tbx,dword ptr [bp+6]\t; get handle pointer\n\t\tmov\tword ptr [bx],ax\t; save the handle\n\t\txor\tax,ax\t\t\t; return zero for OK\nopen_err:\tpop\tds\t\t\t; restore registers and exit\n\t\tpop\tes\n\t\tpop\tdx\n\t\tpop\tcx\n\t\tpop\tbx\n\t\tpop\tdi\n\t\tpop\tsi\n\t\tpop \tbp\n\t\tret\n_jdos_open\tendp\n\n\n;\n; short far jdos_close (short handle)\n;\n; Close the file handle\n;\n_jdos_close\tproc\tfar\n\t\tpush\tbp\t\t\t; linkage\n\t\tmov \tbp,sp\n\t\tpush\tsi\t\t\t; save all registers for safety\n\t\tpush\tdi\n\t\tpush\tbx\n\t\tpush\tcx\n\t\tpush\tdx\n\t\tpush\tes\n\t\tpush\tds\n\t\tmov\tbx,word ptr [bp+6]\t; file handle\n\t\tmov\tah,3eh\t\t\t; close file\n\t\tint\t21h\n\t\tjc\tclose_err\t\t; if failed, return error code\n\t\txor\tax,ax\t\t\t; return zero for OK\nclose_err:\tpop\tds\t\t\t; restore registers and exit\n\t\tpop\tes\n\t\tpop\tdx\n\t\tpop\tcx\n\t\tpop\tbx\n\t\tpop\tdi\n\t\tpop\tsi\n\t\tpop \tbp\n\t\tret\n_jdos_close\tendp\n\n\n;\n; short far jdos_seek (short handle, long offset)\n;\n; Set file position\n;\n_jdos_seek\tproc\tfar\n\t\tpush\tbp\t\t\t; linkage\n\t\tmov \tbp,sp\n\t\tpush\tsi\t\t\t; save all registers for safety\n\t\tpush\tdi\n\t\tpush\tbx\n\t\tpush\tcx\n\t\tpush\tdx\n\t\tpush\tes\n\t\tpush\tds\n\t\tmov\tbx,word ptr [bp+6]\t; file handle\n\t\tmov\tdx,word ptr [bp+8]\t; LS offset\n\t\tmov\tcx,word ptr [bp+10]\t; MS offset\n\t\tmov\tax,4200h\t\t; absolute seek\n\t\tint\t21h\n\t\tjc\tseek_err\t\t; if failed, return error code\n\t\txor\tax,ax\t\t\t; return zero for OK\nseek_err:\tpop\tds\t\t\t; restore registers and exit\n\t\tpop\tes\n\t\tpop\tdx\n\t\tpop\tcx\n\t\tpop\tbx\n\t\tpop\tdi\n\t\tpop\tsi\n\t\tpop \tbp\n\t\tret\n_jdos_seek\tendp\n\n\n;\n; short far jdos_read (short handle, void far * buffer, unsigned short count)\n;\n; Read from file\n;\n_jdos_read\tproc\tfar\n\t\tpush\tbp\t\t\t; linkage\n\t\tmov \tbp,sp\n\t\tpush\tsi\t\t\t; save all registers for safety\n\t\tpush\tdi\n\t\tpush\tbx\n\t\tpush\tcx\n\t\tpush\tdx\n\t\tpush\tes\n\t\tpush\tds\n\t\tmov\tbx,word ptr [bp+6]\t; file handle\n\t\tlds\tdx,dword ptr [bp+8]\t; buffer address\n\t\tmov\tcx,word ptr [bp+12]\t; number of bytes\n\t\tmov\tah,3fh\t\t\t; read file\n\t\tint\t21h\n\t\tjc\tread_err\t\t; if failed, return error code\n\t\tcmp\tax,word ptr [bp+12]\t; make sure all bytes were read\n\t\tje\tread_ok\n\t\tmov\tax,1\t\t\t; else return 1 for not OK\n\t\tjmp\tshort read_err\nread_ok:\txor\tax,ax\t\t\t; return zero for OK\nread_err:\tpop\tds\t\t\t; restore registers and exit\n\t\tpop\tes\n\t\tpop\tdx\n\t\tpop\tcx\n\t\tpop\tbx\n\t\tpop\tdi\n\t\tpop\tsi\n\t\tpop \tbp\n\t\tret\n_jdos_read\tendp\n\n\n;\n; short far jdos_write (short handle, void far * buffer, unsigned short count)\n;\n; Write to file\n;\n_jdos_write\tproc\tfar\n\t\tpush\tbp\t\t\t; linkage\n\t\tmov \tbp,sp\n\t\tpush\tsi\t\t\t; save all registers for safety\n\t\tpush\tdi\n\t\tpush\tbx\n\t\tpush\tcx\n\t\tpush\tdx\n\t\tpush\tes\n\t\tpush\tds\n\t\tmov\tbx,word ptr [bp+6]\t; file handle\n\t\tlds\tdx,dword ptr [bp+8]\t; buffer address\n\t\tmov\tcx,word ptr [bp+12]\t; number of bytes\n\t\tmov\tah,40h\t\t\t; write file\n\t\tint\t21h\n\t\tjc\twrite_err\t\t; if failed, return error code\n\t\tcmp\tax,word ptr [bp+12]\t; make sure all bytes written\n\t\tje\twrite_ok\n\t\tmov\tax,1\t\t\t; else return 1 for not OK\n\t\tjmp\tshort write_err\nwrite_ok:\txor\tax,ax\t\t\t; return zero for OK\nwrite_err:\tpop\tds\t\t\t; restore registers and exit\n\t\tpop\tes\n\t\tpop\tdx\n\t\tpop\tcx\n\t\tpop\tbx\n\t\tpop\tdi\n\t\tpop\tsi\n\t\tpop \tbp\n\t\tret\n_jdos_write\tendp\n\n\n;\n; void far jxms_getdriver (XMSDRIVER far *)\n;\n; Get the address of the XMS driver, or NULL if not available\n;\n_jxms_getdriver\tproc\tfar\n\t\tpush\tbp\t\t\t; linkage\n\t\tmov \tbp,sp\n\t\tpush\tsi\t\t\t; save all registers for safety\n\t\tpush\tdi\n\t\tpush\tbx\n\t\tpush\tcx\n\t\tpush\tdx\n\t\tpush\tes\n\t\tpush\tds\n\t\tmov \tax,4300h\t\t; call multiplex interrupt with\n\t\tint\t2fh\t\t\t; a magic cookie, hex 4300\n\t\tcmp \tal,80h\t\t\t; AL should contain hex 80\n\t\tje\txmsavail\n\t\txor \tdx,dx\t\t\t; no XMS driver available\n\t\txor \tax,ax\t\t\t; return a nil pointer\n\t\tjmp\tshort xmsavail_done\nxmsavail:\tmov \tax,4310h\t\t; fetch driver address with\n\t\tint\t2fh\t\t\t; another magic cookie\n\t\tmov \tdx,es\t\t\t; copy address to dx:ax\n\t\tmov \tax,bx\nxmsavail_done:\tles \tbx,dword ptr [bp+6]\t; get pointer to return value\n\t\tmov\tword ptr es:[bx],ax\n\t\tmov\tword ptr es:[bx+2],dx\n\t\tpop\tds\t\t\t; restore registers and exit\n\t\tpop\tes\n\t\tpop\tdx\n\t\tpop\tcx\n\t\tpop\tbx\n\t\tpop\tdi\n\t\tpop\tsi\n\t\tpop\tbp\n\t\tret\n_jxms_getdriver\tendp\n\n\n;\n; void far jxms_calldriver (XMSDRIVER, XMScontext far *)\n;\n; The XMScontext structure contains values for the AX,DX,BX,SI,DS registers.\n; These are loaded, the XMS call is performed, and the new values of the\n; AX,DX,BX registers are written back to the context structure.\n;\n_jxms_calldriver \tproc\tfar\n\t\tpush\tbp\t\t\t; linkage\n\t\tmov \tbp,sp\n\t\tpush\tsi\t\t\t; save all registers for safety\n\t\tpush\tdi\n\t\tpush\tbx\n\t\tpush\tcx\n\t\tpush\tdx\n\t\tpush\tes\n\t\tpush\tds\n\t\tles \tbx,dword ptr [bp+10]\t; get XMScontext pointer\n\t\tmov \tax,word ptr es:[bx]\t; load registers\n\t\tmov \tdx,word ptr es:[bx+2]\n\t\tmov \tsi,word ptr es:[bx+6]\n\t\tmov \tds,word ptr es:[bx+8]\n\t\tmov \tbx,word ptr es:[bx+4]\n\t\tcall\tdword ptr [bp+6]\t; call the driver\n\t\tmov\tcx,bx\t\t\t; save returned BX for a sec\n\t\tles \tbx,dword ptr [bp+10]\t; get XMScontext pointer\n\t\tmov \tword ptr es:[bx],ax\t; put back ax,dx,bx\n\t\tmov \tword ptr es:[bx+2],dx\n\t\tmov \tword ptr es:[bx+4],cx\n\t\tpop\tds\t\t\t; restore registers and exit\n\t\tpop\tes\n\t\tpop\tdx\n\t\tpop\tcx\n\t\tpop\tbx\n\t\tpop\tdi\n\t\tpop\tsi\n\t\tpop \tbp\n\t\tret\n_jxms_calldriver \tendp\n\n\n;\n; short far jems_available (void)\n;\n; Have we got an EMS driver? (this comes straight from the EMS 4.0 specs)\n;\n_jems_available\tproc\tfar\n\t\tpush\tsi\t\t\t; save all registers for safety\n\t\tpush\tdi\n\t\tpush\tbx\n\t\tpush\tcx\n\t\tpush\tdx\n\t\tpush\tes\n\t\tpush\tds\n\t\tmov\tax,3567h\t\t; get interrupt vector 67h\n\t\tint\t21h\n\t\tpush\tcs\n\t\tpop\tds\n\t\tmov\tdi,000ah\t\t; check offs 10 in returned seg\n\t\tlea\tsi,ASCII_device_name\t; against literal string\n\t\tmov\tcx,8\n\t\tcld\n\t\trepe cmpsb\n\t\tjne\tno_ems\n\t\tmov\tax,1\t\t\t; match, it's there\n\t\tjmp\tshort avail_done\nno_ems:\t\txor\tax,ax\t\t\t; it's not there\navail_done:\tpop\tds\t\t\t; restore registers and exit\n\t\tpop\tes\n\t\tpop\tdx\n\t\tpop\tcx\n\t\tpop\tbx\n\t\tpop\tdi\n\t\tpop\tsi\n\t\tret\n\nASCII_device_name\tdb\t\"EMMXXXX0\"\n\n_jems_available\tendp\n\n\n;\n; void far jems_calldriver (EMScontext far *)\n;\n; The EMScontext structure contains values for the AX,DX,BX,SI,DS registers.\n; These are loaded, the EMS trap is performed, and the new values of the\n; AX,DX,BX registers are written back to the context structure.\n;\n_jems_calldriver\tproc far\n\t\tpush\tbp\t\t\t; linkage\n\t\tmov \tbp,sp\n\t\tpush\tsi\t\t\t; save all registers for safety\n\t\tpush\tdi\n\t\tpush\tbx\n\t\tpush\tcx\n\t\tpush\tdx\n\t\tpush\tes\n\t\tpush\tds\n\t\tles \tbx,dword ptr [bp+6]\t; get EMScontext pointer\n\t\tmov \tax,word ptr es:[bx]\t; load registers\n\t\tmov \tdx,word ptr es:[bx+2]\n\t\tmov \tsi,word ptr es:[bx+6]\n\t\tmov \tds,word ptr es:[bx+8]\n\t\tmov \tbx,word ptr es:[bx+4]\n\t\tint\t67h\t\t\t; call the EMS driver\n\t\tmov\tcx,bx\t\t\t; save returned BX for a sec\n\t\tles \tbx,dword ptr [bp+6]\t; get EMScontext pointer\n\t\tmov \tword ptr es:[bx],ax\t; put back ax,dx,bx\n\t\tmov \tword ptr es:[bx+2],dx\n\t\tmov \tword ptr es:[bx+4],cx\n\t\tpop\tds\t\t\t; restore registers and exit\n\t\tpop\tes\n\t\tpop\tdx\n\t\tpop\tcx\n\t\tpop\tbx\n\t\tpop\tdi\n\t\tpop\tsi\n\t\tpop \tbp\n\t\tret\n_jems_calldriver\tendp\n\nJMEMDOSA_TXT\tends\n\n\t\tend\n"
  },
  {
    "path": "jmemmac.c",
    "content": "/*\n * jmemmac.c\n *\n * Copyright (C) 1992-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * jmemmac.c provides an Apple Macintosh implementation of the system-\n * dependent portion of the JPEG memory manager.\n *\n * If you use jmemmac.c, then you must define USE_MAC_MEMMGR in the\n * JPEG_INTERNALS part of jconfig.h.\n *\n * jmemmac.c uses the Macintosh toolbox routines NewPtr and DisposePtr\n * instead of malloc and free.  It accurately determines the amount of\n * memory available by using CompactMem.  Notice that if left to its\n * own devices, this code can chew up all available space in the\n * application's zone, with the exception of the rather small \"slop\"\n * factor computed in jpeg_mem_available().  The application can ensure\n * that more space is left over by reducing max_memory_to_use.\n *\n * Large images are swapped to disk using temporary files and System 7.0+'s\n * temporary folder functionality.\n *\n * Note that jmemmac.c depends on two features of MacOS that were first\n * introduced in System 7: FindFolder and the FSSpec-based calls.\n * If your application uses jmemmac.c and is run under System 6 or earlier,\n * and the jpeg library decides it needs a temporary file, it will abort,\n * printing error messages about requiring System 7.  (If no temporary files\n * are created, it will run fine.)\n *\n * If you want to use jmemmac.c in an application that might be used with\n * System 6 or earlier, then you should remove dependencies on FindFolder\n * and the FSSpec calls.  You will need to replace FindFolder with some\n * other mechanism for finding a place to put temporary files, and you\n * should replace the FSSpec calls with their HFS equivalents:\n *\n *     FSpDelete     ->  HDelete\n *     FSpGetFInfo   ->  HGetFInfo\n *     FSpCreate     ->  HCreate\n *     FSpOpenDF     ->  HOpen      *** Note: not HOpenDF ***\n *     FSMakeFSSpec  ->  (fill in spec by hand.)\n *\n * (Use HOpen instead of HOpenDF.  HOpen is just a glue-interface to PBHOpen,\n * which is on all HFS macs.  HOpenDF is a System 7 addition which avoids the\n * ages-old problem of names starting with a period.)\n *\n * Contributed by Sam Bushell (jsam@iagu.on.net) and\n * Dan Gildor (gyld@in-touch.com).\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jmemsys.h\"    /* import the system-dependent declarations */\n\n#ifndef USE_MAC_MEMMGR\t/* make sure user got configuration right */\n  You forgot to define USE_MAC_MEMMGR in jconfig.h. /* deliberate syntax error */\n#endif\n\n#include <Memory.h>     /* we use the MacOS memory manager */\n#include <Files.h>      /* we use the MacOS File stuff */\n#include <Folders.h>    /* we use the MacOS HFS stuff */\n#include <Script.h>     /* for smSystemScript */\n#include <Gestalt.h>    /* we use Gestalt to test for specific functionality */\n\n#ifndef TEMP_FILE_NAME\t\t/* can override from jconfig.h or Makefile */\n#define TEMP_FILE_NAME  \"JPG%03d.TMP\"\n#endif\n\nstatic int next_file_num;\t/* to distinguish among several temp files */\n\n\n/*\n * Memory allocation and freeing are controlled by the MacOS library\n * routines NewPtr() and DisposePtr(), which allocate fixed-address\n * storage.  Unfortunately, the IJG library isn't smart enough to cope\n * with relocatable storage.\n */\n\nGLOBAL(void *)\njpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void *) NewPtr(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)\n{\n  DisposePtr((Ptr) object);\n}\n\n\n/*\n * \"Large\" objects are treated the same as \"small\" ones.\n * NB: we include FAR keywords in the routine declarations simply for\n * consistency with the rest of the IJG code; FAR should expand to empty\n * on rational architectures like the Mac.\n */\n\nGLOBAL(void FAR *)\njpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void FAR *) NewPtr(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)\n{\n  DisposePtr((Ptr) object);\n}\n\n\n/*\n * This routine computes the total memory space available for allocation.\n */\n\nGLOBAL(long)\njpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,\n\t\t    long max_bytes_needed, long already_allocated)\n{\n  long limit = cinfo->mem->max_memory_to_use - already_allocated;\n  long slop, mem;\n\n  /* Don't ask for more than what application has told us we may use */\n  if (max_bytes_needed > limit && limit > 0)\n    max_bytes_needed = limit;\n  /* Find whether there's a big enough free block in the heap.\n   * CompactMem tries to create a contiguous block of the requested size,\n   * and then returns the size of the largest free block (which could be\n   * much more or much less than we asked for).\n   * We add some slop to ensure we don't use up all available memory.\n   */\n  slop = max_bytes_needed / 16 + 32768L;\n  mem = CompactMem(max_bytes_needed + slop) - slop;\n  if (mem < 0)\n    mem = 0;\t\t\t/* sigh, couldn't even get the slop */\n  /* Don't take more than the application says we can have */\n  if (mem > limit && limit > 0)\n    mem = limit;\n  return mem;\n}\n\n\n/*\n * Backing store (temporary file) management.\n * Backing store objects are only used when the value returned by\n * jpeg_mem_available is less than the total space needed.  You can dispense\n * with these routines if you have plenty of virtual memory; see jmemnobs.c.\n */\n\n\nMETHODDEF(void)\nread_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t    void FAR * buffer_address,\n\t\t    long file_offset, long byte_count)\n{\n  long bytes = byte_count;\n  long retVal;\n\n  if ( SetFPos ( info->temp_file, fsFromStart, file_offset ) != noErr )\n    ERREXIT(cinfo, JERR_TFILE_SEEK);\n\n  retVal = FSRead ( info->temp_file, &bytes,\n\t\t    (unsigned char *) buffer_address );\n  if ( retVal != noErr || bytes != byte_count )\n    ERREXIT(cinfo, JERR_TFILE_READ);\n}\n\n\nMETHODDEF(void)\nwrite_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t     void FAR * buffer_address,\n\t\t     long file_offset, long byte_count)\n{\n  long bytes = byte_count;\n  long retVal;\n\n  if ( SetFPos ( info->temp_file, fsFromStart, file_offset ) != noErr )\n    ERREXIT(cinfo, JERR_TFILE_SEEK);\n\n  retVal = FSWrite ( info->temp_file, &bytes,\n\t\t     (unsigned char *) buffer_address );\n  if ( retVal != noErr || bytes != byte_count )\n    ERREXIT(cinfo, JERR_TFILE_WRITE);\n}\n\n\nMETHODDEF(void)\nclose_backing_store (j_common_ptr cinfo, backing_store_ptr info)\n{\n  FSClose ( info->temp_file );\n  FSpDelete ( &(info->tempSpec) );\n}\n\n\n/*\n * Initial opening of a backing-store object.\n *\n * This version uses FindFolder to find the Temporary Items folder,\n * and puts the temporary file in there.\n */\n\nGLOBAL(void)\njpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t\t long total_bytes_needed)\n{\n  short         tmpRef, vRefNum;\n  long          dirID;\n  FInfo         finderInfo;\n  FSSpec        theSpec;\n  Str255        fName;\n  OSErr         osErr;\n  long          gestaltResponse = 0;\n\n  /* Check that FSSpec calls are available. */\n  osErr = Gestalt( gestaltFSAttr, &gestaltResponse );\n  if ( ( osErr != noErr )\n       || !( gestaltResponse & (1<<gestaltHasFSSpecCalls) ) )\n    ERREXITS(cinfo, JERR_TFILE_CREATE, \"- System 7.0 or later required\");\n  /* TO DO: add a proper error message to jerror.h. */\n\n  /* Check that FindFolder is available. */\n  osErr = Gestalt( gestaltFindFolderAttr, &gestaltResponse );\n  if ( ( osErr != noErr )\n       || !( gestaltResponse & (1<<gestaltFindFolderPresent) ) )\n    ERREXITS(cinfo, JERR_TFILE_CREATE, \"- System 7.0 or later required.\");\n  /* TO DO: add a proper error message to jerror.h. */\n\n  osErr = FindFolder ( kOnSystemDisk, kTemporaryFolderType, kCreateFolder,\n                       &vRefNum, &dirID );\n  if ( osErr != noErr )\n    ERREXITS(cinfo, JERR_TFILE_CREATE, \"- temporary items folder unavailable\");\n  /* TO DO: Try putting the temp files somewhere else. */\n\n  /* Keep generating file names till we find one that's not in use */\n  for (;;) {\n    next_file_num++;\t\t/* advance counter */\n\n    sprintf(info->temp_name, TEMP_FILE_NAME, next_file_num);\n    strcpy ( (Ptr)fName+1, info->temp_name );\n    *fName = strlen (info->temp_name);\n    osErr = FSMakeFSSpec ( vRefNum, dirID, fName, &theSpec );\n\n    if ( (osErr = FSpGetFInfo ( &theSpec, &finderInfo ) ) != noErr )\n      break;\n  }\n\n  osErr = FSpCreate ( &theSpec, '????', '????', smSystemScript );\n  if ( osErr != noErr )\n    ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);\n\n  osErr = FSpOpenDF ( &theSpec, fsRdWrPerm, &(info->temp_file) );\n  if ( osErr != noErr )\n    ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);\n\n  info->tempSpec = theSpec;\n\n  info->read_backing_store = read_backing_store;\n  info->write_backing_store = write_backing_store;\n  info->close_backing_store = close_backing_store;\n  TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);\n}\n\n\n/*\n * These routines take care of any system-dependent initialization and\n * cleanup required.\n */\n\nGLOBAL(long)\njpeg_mem_init (j_common_ptr cinfo)\n{\n  next_file_num = 0;\n\n  /* max_memory_to_use will be initialized to FreeMem()'s result;\n   * the calling application might later reduce it, for example\n   * to leave room to invoke multiple JPEG objects.\n   * Note that FreeMem returns the total number of free bytes;\n   * it may not be possible to allocate a single block of this size.\n   */\n  return FreeMem();\n}\n\nGLOBAL(void)\njpeg_mem_term (j_common_ptr cinfo)\n{\n  /* no work */\n}\n"
  },
  {
    "path": "jmemmgr.c",
    "content": "/*\n * jmemmgr.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2011-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the JPEG system-independent memory management\n * routines.  This code is usable across a wide variety of machines; most\n * of the system dependencies have been isolated in a separate file.\n * The major functions provided here are:\n *   * pool-based allocation and freeing of memory;\n *   * policy decisions about how to divide available memory among the\n *     virtual arrays;\n *   * control logic for swapping virtual arrays between main memory and\n *     backing storage.\n * The separate system-dependent file provides the actual backing-storage\n * access code, and it contains the policy decision about how much total\n * main memory to use.\n * This file is system-dependent in the sense that some of its functions\n * are unnecessary in some systems.  For example, if there is enough virtual\n * memory so that backing storage will never be used, much of the virtual\n * array control logic could be removed.  (Of course, if you have that much\n * memory then you shouldn't care about a little bit of unused code...)\n */\n\n#define JPEG_INTERNALS\n#define AM_MEMORY_MANAGER\t/* we define jvirt_Xarray_control structs */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jmemsys.h\"\t\t/* import the system-dependent declarations */\n\n#ifndef NO_GETENV\n#ifndef HAVE_STDLIB_H\t\t/* <stdlib.h> should declare getenv() */\nextern char * getenv JPP((const char * name));\n#endif\n#endif\n\n\n/*\n * Some important notes:\n *   The allocation routines provided here must never return NULL.\n *   They should exit to error_exit if unsuccessful.\n *\n *   It's not a good idea to try to merge the sarray and barray routines,\n *   even though they are textually almost the same, because samples are\n *   usually stored as bytes while coefficients are shorts or ints.  Thus,\n *   in machines where byte pointers have a different representation from\n *   word pointers, the resulting machine code could not be the same.\n */\n\n\n/*\n * Many machines require storage alignment: longs must start on 4-byte\n * boundaries, doubles on 8-byte boundaries, etc.  On such machines, malloc()\n * always returns pointers that are multiples of the worst-case alignment\n * requirement, and we had better do so too.\n * There isn't any really portable way to determine the worst-case alignment\n * requirement.  This module assumes that the alignment requirement is\n * multiples of sizeof(ALIGN_TYPE).\n * By default, we define ALIGN_TYPE as double.  This is necessary on some\n * workstations (where doubles really do need 8-byte alignment) and will work\n * fine on nearly everything.  If your machine has lesser alignment needs,\n * you can save a few bytes by making ALIGN_TYPE smaller.\n * The only place I know of where this will NOT work is certain Macintosh\n * 680x0 compilers that define double as a 10-byte IEEE extended float.\n * Doing 10-byte alignment is counterproductive because longwords won't be\n * aligned well.  Put \"#define ALIGN_TYPE long\" in jconfig.h if you have\n * such a compiler.\n */\n\n#ifndef ALIGN_TYPE\t\t/* so can override from jconfig.h */\n#define ALIGN_TYPE  double\n#endif\n\n\n/*\n * We allocate objects from \"pools\", where each pool is gotten with a single\n * request to jpeg_get_small() or jpeg_get_large().  There is no per-object\n * overhead within a pool, except for alignment padding.  Each pool has a\n * header with a link to the next pool of the same class.\n * Small and large pool headers are identical except that the latter's\n * link pointer must be FAR on 80x86 machines.\n * Notice that the \"real\" header fields are union'ed with a dummy ALIGN_TYPE\n * field.  This forces the compiler to make SIZEOF(small_pool_hdr) a multiple\n * of the alignment requirement of ALIGN_TYPE.\n */\n\ntypedef union small_pool_struct * small_pool_ptr;\n\ntypedef union small_pool_struct {\n  struct {\n    small_pool_ptr next;\t/* next in list of pools */\n    size_t bytes_used;\t\t/* how many bytes already used within pool */\n    size_t bytes_left;\t\t/* bytes still available in this pool */\n  } hdr;\n  ALIGN_TYPE dummy;\t\t/* included in union to ensure alignment */\n} small_pool_hdr;\n\ntypedef union large_pool_struct FAR * large_pool_ptr;\n\ntypedef union large_pool_struct {\n  struct {\n    large_pool_ptr next;\t/* next in list of pools */\n    size_t bytes_used;\t\t/* how many bytes already used within pool */\n    size_t bytes_left;\t\t/* bytes still available in this pool */\n  } hdr;\n  ALIGN_TYPE dummy;\t\t/* included in union to ensure alignment */\n} large_pool_hdr;\n\n\n/*\n * Here is the full definition of a memory manager object.\n */\n\ntypedef struct {\n  struct jpeg_memory_mgr pub;\t/* public fields */\n\n  /* Each pool identifier (lifetime class) names a linked list of pools. */\n  small_pool_ptr small_list[JPOOL_NUMPOOLS];\n  large_pool_ptr large_list[JPOOL_NUMPOOLS];\n\n  /* Since we only have one lifetime class of virtual arrays, only one\n   * linked list is necessary (for each datatype).  Note that the virtual\n   * array control blocks being linked together are actually stored somewhere\n   * in the small-pool list.\n   */\n  jvirt_sarray_ptr virt_sarray_list;\n  jvirt_barray_ptr virt_barray_list;\n\n  /* This counts total space obtained from jpeg_get_small/large */\n  long total_space_allocated;\n\n  /* alloc_sarray and alloc_barray set this value for use by virtual\n   * array routines.\n   */\n  JDIMENSION last_rowsperchunk;\t/* from most recent alloc_sarray/barray */\n} my_memory_mgr;\n\ntypedef my_memory_mgr * my_mem_ptr;\n\n\n/*\n * The control blocks for virtual arrays.\n * Note that these blocks are allocated in the \"small\" pool area.\n * System-dependent info for the associated backing store (if any) is hidden\n * inside the backing_store_info struct.\n */\n\nstruct jvirt_sarray_control {\n  JSAMPARRAY mem_buffer;\t/* => the in-memory buffer */\n  JDIMENSION rows_in_array;\t/* total virtual array height */\n  JDIMENSION samplesperrow;\t/* width of array (and of memory buffer) */\n  JDIMENSION maxaccess;\t\t/* max rows accessed by access_virt_sarray */\n  JDIMENSION rows_in_mem;\t/* height of memory buffer */\n  JDIMENSION rowsperchunk;\t/* allocation chunk size in mem_buffer */\n  JDIMENSION cur_start_row;\t/* first logical row # in the buffer */\n  JDIMENSION first_undef_row;\t/* row # of first uninitialized row */\n  boolean pre_zero;\t\t/* pre-zero mode requested? */\n  boolean dirty;\t\t/* do current buffer contents need written? */\n  boolean b_s_open;\t\t/* is backing-store data valid? */\n  jvirt_sarray_ptr next;\t/* link to next virtual sarray control block */\n  backing_store_info b_s_info;\t/* System-dependent control info */\n};\n\nstruct jvirt_barray_control {\n  JBLOCKARRAY mem_buffer;\t/* => the in-memory buffer */\n  JDIMENSION rows_in_array;\t/* total virtual array height */\n  JDIMENSION blocksperrow;\t/* width of array (and of memory buffer) */\n  JDIMENSION maxaccess;\t\t/* max rows accessed by access_virt_barray */\n  JDIMENSION rows_in_mem;\t/* height of memory buffer */\n  JDIMENSION rowsperchunk;\t/* allocation chunk size in mem_buffer */\n  JDIMENSION cur_start_row;\t/* first logical row # in the buffer */\n  JDIMENSION first_undef_row;\t/* row # of first uninitialized row */\n  boolean pre_zero;\t\t/* pre-zero mode requested? */\n  boolean dirty;\t\t/* do current buffer contents need written? */\n  boolean b_s_open;\t\t/* is backing-store data valid? */\n  jvirt_barray_ptr next;\t/* link to next virtual barray control block */\n  backing_store_info b_s_info;\t/* System-dependent control info */\n};\n\n\n#ifdef MEM_STATS\t\t/* optional extra stuff for statistics */\n\nLOCAL(void)\nprint_mem_stats (j_common_ptr cinfo, int pool_id)\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  small_pool_ptr shdr_ptr;\n  large_pool_ptr lhdr_ptr;\n\n  /* Since this is only a debugging stub, we can cheat a little by using\n   * fprintf directly rather than going through the trace message code.\n   * This is helpful because message parm array can't handle longs.\n   */\n  fprintf(stderr, \"Freeing pool %d, total space = %ld\\n\",\n\t  pool_id, mem->total_space_allocated);\n\n  for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;\n       lhdr_ptr = lhdr_ptr->hdr.next) {\n    fprintf(stderr, \"  Large chunk used %ld\\n\",\n\t    (long) lhdr_ptr->hdr.bytes_used);\n  }\n\n  for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL;\n       shdr_ptr = shdr_ptr->hdr.next) {\n    fprintf(stderr, \"  Small chunk used %ld free %ld\\n\",\n\t    (long) shdr_ptr->hdr.bytes_used,\n\t    (long) shdr_ptr->hdr.bytes_left);\n  }\n}\n\n#endif /* MEM_STATS */\n\n\nLOCAL(noreturn_t)\nout_of_memory (j_common_ptr cinfo, int which)\n/* Report an out-of-memory error and stop execution */\n/* If we compiled MEM_STATS support, report alloc requests before dying */\n{\n#ifdef MEM_STATS\n  cinfo->err->trace_level = 2;\t/* force self_destruct to report stats */\n#endif\n  ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which);\n}\n\n\n/*\n * Allocation of \"small\" objects.\n *\n * For these, we use pooled storage.  When a new pool must be created,\n * we try to get enough space for the current request plus a \"slop\" factor,\n * where the slop will be the amount of leftover space in the new pool.\n * The speed vs. space tradeoff is largely determined by the slop values.\n * A different slop value is provided for each pool class (lifetime),\n * and we also distinguish the first pool of a class from later ones.\n * NOTE: the values given work fairly well on both 16- and 32-bit-int\n * machines, but may be too small if longs are 64 bits or more.\n */\n\nstatic const size_t first_pool_slop[JPOOL_NUMPOOLS] = \n{\n\t1600,\t\t\t/* first PERMANENT pool */\n\t16000\t\t\t/* first IMAGE pool */\n};\n\nstatic const size_t extra_pool_slop[JPOOL_NUMPOOLS] = \n{\n\t0,\t\t\t/* additional PERMANENT pools */\n\t5000\t\t\t/* additional IMAGE pools */\n};\n\n#define MIN_SLOP  50\t\t/* greater than 0 to avoid futile looping */\n\n\nMETHODDEF(void *)\nalloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)\n/* Allocate a \"small\" object */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  small_pool_ptr hdr_ptr, prev_hdr_ptr;\n  char * data_ptr;\n  size_t odd_bytes, min_request, slop;\n\n  /* Check for unsatisfiable request (do now to ensure no overflow below) */\n  if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr)))\n    out_of_memory(cinfo, 1);\t/* request exceeds malloc's ability */\n\n  /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */\n  odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);\n  if (odd_bytes > 0)\n    sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;\n\n  /* See if space is available in any existing pool */\n  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);\t/* safety check */\n  prev_hdr_ptr = NULL;\n  hdr_ptr = mem->small_list[pool_id];\n  while (hdr_ptr != NULL) {\n    if (hdr_ptr->hdr.bytes_left >= sizeofobject)\n      break;\t\t\t/* found pool with enough space */\n    prev_hdr_ptr = hdr_ptr;\n    hdr_ptr = hdr_ptr->hdr.next;\n  }\n\n  /* Time to make a new pool? */\n  if (hdr_ptr == NULL) {\n    /* min_request is what we need now, slop is what will be leftover */\n    min_request = sizeofobject + SIZEOF(small_pool_hdr);\n    if (prev_hdr_ptr == NULL)\t/* first pool in class? */\n      slop = first_pool_slop[pool_id];\n    else\n      slop = extra_pool_slop[pool_id];\n    /* Don't ask for more than MAX_ALLOC_CHUNK */\n    if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request))\n      slop = (size_t) (MAX_ALLOC_CHUNK-min_request);\n    /* Try to get space, if fail reduce slop and try again */\n    for (;;) {\n      hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop);\n      if (hdr_ptr != NULL)\n\tbreak;\n      slop /= 2;\n      if (slop < MIN_SLOP)\t/* give up when it gets real small */\n\tout_of_memory(cinfo, 2); /* jpeg_get_small failed */\n    }\n    mem->total_space_allocated += min_request + slop;\n    /* Success, initialize the new pool header and add to end of list */\n    hdr_ptr->hdr.next = NULL;\n    hdr_ptr->hdr.bytes_used = 0;\n    hdr_ptr->hdr.bytes_left = sizeofobject + slop;\n    if (prev_hdr_ptr == NULL)\t/* first pool in class? */\n      mem->small_list[pool_id] = hdr_ptr;\n    else\n      prev_hdr_ptr->hdr.next = hdr_ptr;\n  }\n\n  /* OK, allocate the object from the current pool */\n  data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */\n  data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */\n  hdr_ptr->hdr.bytes_used += sizeofobject;\n  hdr_ptr->hdr.bytes_left -= sizeofobject;\n\n  return (void *) data_ptr;\n}\n\n\n/*\n * Allocation of \"large\" objects.\n *\n * The external semantics of these are the same as \"small\" objects,\n * except that FAR pointers are used on 80x86.  However the pool\n * management heuristics are quite different.  We assume that each\n * request is large enough that it may as well be passed directly to\n * jpeg_get_large; the pool management just links everything together\n * so that we can free it all on demand.\n * Note: the major use of \"large\" objects is in JSAMPARRAY and JBLOCKARRAY\n * structures.  The routines that create these structures (see below)\n * deliberately bunch rows together to ensure a large request size.\n */\n\nMETHODDEF(void FAR *)\nalloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)\n/* Allocate a \"large\" object */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  large_pool_ptr hdr_ptr;\n  size_t odd_bytes;\n\n  /* Check for unsatisfiable request (do now to ensure no overflow below) */\n  if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)))\n    out_of_memory(cinfo, 3);\t/* request exceeds malloc's ability */\n\n  /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */\n  odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);\n  if (odd_bytes > 0)\n    sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;\n\n  /* Always make a new pool */\n  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);\t/* safety check */\n\n  hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject +\n\t\t\t\t\t    SIZEOF(large_pool_hdr));\n  if (hdr_ptr == NULL)\n    out_of_memory(cinfo, 4);\t/* jpeg_get_large failed */\n  mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr);\n\n  /* Success, initialize the new pool header and add to list */\n  hdr_ptr->hdr.next = mem->large_list[pool_id];\n  /* We maintain space counts in each pool header for statistical purposes,\n   * even though they are not needed for allocation.\n   */\n  hdr_ptr->hdr.bytes_used = sizeofobject;\n  hdr_ptr->hdr.bytes_left = 0;\n  mem->large_list[pool_id] = hdr_ptr;\n\n  return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */\n}\n\n\n/*\n * Creation of 2-D sample arrays.\n * The pointers are in near heap, the samples themselves in FAR heap.\n *\n * To minimize allocation overhead and to allow I/O of large contiguous\n * blocks, we allocate the sample rows in groups of as many rows as possible\n * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request.\n * NB: the virtual array control routines, later in this file, know about\n * this chunking of rows.  The rowsperchunk value is left in the mem manager\n * object so that it can be saved away if this sarray is the workspace for\n * a virtual array.\n */\n\nMETHODDEF(JSAMPARRAY)\nalloc_sarray (j_common_ptr cinfo, int pool_id,\n\t      JDIMENSION samplesperrow, JDIMENSION numrows)\n/* Allocate a 2-D sample array */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  JSAMPARRAY result;\n  JSAMPROW workspace;\n  JDIMENSION rowsperchunk, currow, i;\n  long ltemp;\n\n  /* Calculate max # of rows allowed in one allocation chunk */\n  ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /\n\t  ((long) samplesperrow * SIZEOF(JSAMPLE));\n  if (ltemp <= 0)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n  if (ltemp < (long) numrows)\n    rowsperchunk = (JDIMENSION) ltemp;\n  else\n    rowsperchunk = numrows;\n  mem->last_rowsperchunk = rowsperchunk;\n\n  /* Get space for row pointers (small object) */\n  result = (JSAMPARRAY) alloc_small(cinfo, pool_id,\n\t\t\t\t    (size_t) (numrows * SIZEOF(JSAMPROW)));\n\n  /* Get the rows themselves (large objects) */\n  currow = 0;\n  while (currow < numrows) {\n    rowsperchunk = MIN(rowsperchunk, numrows - currow);\n    workspace = (JSAMPROW) alloc_large(cinfo, pool_id,\n\t(size_t) ((size_t) rowsperchunk * (size_t) samplesperrow\n\t\t  * SIZEOF(JSAMPLE)));\n    for (i = rowsperchunk; i > 0; i--) {\n      result[currow++] = workspace;\n      workspace += samplesperrow;\n    }\n  }\n\n  return result;\n}\n\n\n/*\n * Creation of 2-D coefficient-block arrays.\n * This is essentially the same as the code for sample arrays, above.\n */\n\nMETHODDEF(JBLOCKARRAY)\nalloc_barray (j_common_ptr cinfo, int pool_id,\n\t      JDIMENSION blocksperrow, JDIMENSION numrows)\n/* Allocate a 2-D coefficient-block array */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  JBLOCKARRAY result;\n  JBLOCKROW workspace;\n  JDIMENSION rowsperchunk, currow, i;\n  long ltemp;\n\n  /* Calculate max # of rows allowed in one allocation chunk */\n  ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /\n\t  ((long) blocksperrow * SIZEOF(JBLOCK));\n  if (ltemp <= 0)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n  if (ltemp < (long) numrows)\n    rowsperchunk = (JDIMENSION) ltemp;\n  else\n    rowsperchunk = numrows;\n  mem->last_rowsperchunk = rowsperchunk;\n\n  /* Get space for row pointers (small object) */\n  result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,\n\t\t\t\t     (size_t) (numrows * SIZEOF(JBLOCKROW)));\n\n  /* Get the rows themselves (large objects) */\n  currow = 0;\n  while (currow < numrows) {\n    rowsperchunk = MIN(rowsperchunk, numrows - currow);\n    workspace = (JBLOCKROW) alloc_large(cinfo, pool_id,\n\t(size_t) ((size_t) rowsperchunk * (size_t) blocksperrow\n\t\t  * SIZEOF(JBLOCK)));\n    for (i = rowsperchunk; i > 0; i--) {\n      result[currow++] = workspace;\n      workspace += blocksperrow;\n    }\n  }\n\n  return result;\n}\n\n\n/*\n * About virtual array management:\n *\n * The above \"normal\" array routines are only used to allocate strip buffers\n * (as wide as the image, but just a few rows high).  Full-image-sized buffers\n * are handled as \"virtual\" arrays.  The array is still accessed a strip at a\n * time, but the memory manager must save the whole array for repeated\n * accesses.  The intended implementation is that there is a strip buffer in\n * memory (as high as is possible given the desired memory limit), plus a\n * backing file that holds the rest of the array.\n *\n * The request_virt_array routines are told the total size of the image and\n * the maximum number of rows that will be accessed at once.  The in-memory\n * buffer must be at least as large as the maxaccess value.\n *\n * The request routines create control blocks but not the in-memory buffers.\n * That is postponed until realize_virt_arrays is called.  At that time the\n * total amount of space needed is known (approximately, anyway), so free\n * memory can be divided up fairly.\n *\n * The access_virt_array routines are responsible for making a specific strip\n * area accessible (after reading or writing the backing file, if necessary).\n * Note that the access routines are told whether the caller intends to modify\n * the accessed strip; during a read-only pass this saves having to rewrite\n * data to disk.  The access routines are also responsible for pre-zeroing\n * any newly accessed rows, if pre-zeroing was requested.\n *\n * In current usage, the access requests are usually for nonoverlapping\n * strips; that is, successive access start_row numbers differ by exactly\n * num_rows = maxaccess.  This means we can get good performance with simple\n * buffer dump/reload logic, by making the in-memory buffer be a multiple\n * of the access height; then there will never be accesses across bufferload\n * boundaries.  The code will still work with overlapping access requests,\n * but it doesn't handle bufferload overlaps very efficiently.\n */\n\n\nMETHODDEF(jvirt_sarray_ptr)\nrequest_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero,\n\t\t     JDIMENSION samplesperrow, JDIMENSION numrows,\n\t\t     JDIMENSION maxaccess)\n/* Request a virtual 2-D sample array */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  jvirt_sarray_ptr result;\n\n  /* Only IMAGE-lifetime virtual arrays are currently supported */\n  if (pool_id != JPOOL_IMAGE)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);\t/* safety check */\n\n  /* get control block */\n  result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id,\n\t\t\t\t\t  SIZEOF(struct jvirt_sarray_control));\n\n  result->mem_buffer = NULL;\t/* marks array not yet realized */\n  result->rows_in_array = numrows;\n  result->samplesperrow = samplesperrow;\n  result->maxaccess = maxaccess;\n  result->pre_zero = pre_zero;\n  result->b_s_open = FALSE;\t/* no associated backing-store object */\n  result->next = mem->virt_sarray_list; /* add to list of virtual arrays */\n  mem->virt_sarray_list = result;\n\n  return result;\n}\n\n\nMETHODDEF(jvirt_barray_ptr)\nrequest_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero,\n\t\t     JDIMENSION blocksperrow, JDIMENSION numrows,\n\t\t     JDIMENSION maxaccess)\n/* Request a virtual 2-D coefficient-block array */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  jvirt_barray_ptr result;\n\n  /* Only IMAGE-lifetime virtual arrays are currently supported */\n  if (pool_id != JPOOL_IMAGE)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);\t/* safety check */\n\n  /* get control block */\n  result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id,\n\t\t\t\t\t  SIZEOF(struct jvirt_barray_control));\n\n  result->mem_buffer = NULL;\t/* marks array not yet realized */\n  result->rows_in_array = numrows;\n  result->blocksperrow = blocksperrow;\n  result->maxaccess = maxaccess;\n  result->pre_zero = pre_zero;\n  result->b_s_open = FALSE;\t/* no associated backing-store object */\n  result->next = mem->virt_barray_list; /* add to list of virtual arrays */\n  mem->virt_barray_list = result;\n\n  return result;\n}\n\n\nMETHODDEF(void)\nrealize_virt_arrays (j_common_ptr cinfo)\n/* Allocate the in-memory buffers for any unrealized virtual arrays */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  long space_per_minheight, maximum_space, avail_mem;\n  long minheights, max_minheights;\n  jvirt_sarray_ptr sptr;\n  jvirt_barray_ptr bptr;\n\n  /* Compute the minimum space needed (maxaccess rows in each buffer)\n   * and the maximum space needed (full image height in each buffer).\n   * These may be of use to the system-dependent jpeg_mem_available routine.\n   */\n  space_per_minheight = 0;\n  maximum_space = 0;\n  for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {\n    if (sptr->mem_buffer == NULL) { /* if not realized yet */\n      space_per_minheight += (long) sptr->maxaccess *\n\t\t\t     (long) sptr->samplesperrow * SIZEOF(JSAMPLE);\n      maximum_space += (long) sptr->rows_in_array *\n\t\t       (long) sptr->samplesperrow * SIZEOF(JSAMPLE);\n    }\n  }\n  for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {\n    if (bptr->mem_buffer == NULL) { /* if not realized yet */\n      space_per_minheight += (long) bptr->maxaccess *\n\t\t\t     (long) bptr->blocksperrow * SIZEOF(JBLOCK);\n      maximum_space += (long) bptr->rows_in_array *\n\t\t       (long) bptr->blocksperrow * SIZEOF(JBLOCK);\n    }\n  }\n\n  if (space_per_minheight <= 0)\n    return;\t\t\t/* no unrealized arrays, no work */\n\n  /* Determine amount of memory to actually use; this is system-dependent. */\n  avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,\n\t\t\t\t mem->total_space_allocated);\n\n  /* If the maximum space needed is available, make all the buffers full\n   * height; otherwise parcel it out with the same number of minheights\n   * in each buffer.\n   */\n  if (avail_mem >= maximum_space)\n    max_minheights = 1000000000L;\n  else {\n    max_minheights = avail_mem / space_per_minheight;\n    /* If there doesn't seem to be enough space, try to get the minimum\n     * anyway.  This allows a \"stub\" implementation of jpeg_mem_available().\n     */\n    if (max_minheights <= 0)\n      max_minheights = 1;\n  }\n\n  /* Allocate the in-memory buffers and initialize backing store as needed. */\n\n  for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {\n    if (sptr->mem_buffer == NULL) { /* if not realized yet */\n      minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L;\n      if (minheights <= max_minheights) {\n\t/* This buffer fits in memory */\n\tsptr->rows_in_mem = sptr->rows_in_array;\n      } else {\n\t/* It doesn't fit in memory, create backing store. */\n\tsptr->rows_in_mem = (JDIMENSION) (max_minheights * sptr->maxaccess);\n\tjpeg_open_backing_store(cinfo, & sptr->b_s_info,\n\t\t\t\t(long) sptr->rows_in_array *\n\t\t\t\t(long) sptr->samplesperrow *\n\t\t\t\t(long) SIZEOF(JSAMPLE));\n\tsptr->b_s_open = TRUE;\n      }\n      sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE,\n\t\t\t\t      sptr->samplesperrow, sptr->rows_in_mem);\n      sptr->rowsperchunk = mem->last_rowsperchunk;\n      sptr->cur_start_row = 0;\n      sptr->first_undef_row = 0;\n      sptr->dirty = FALSE;\n    }\n  }\n\n  for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {\n    if (bptr->mem_buffer == NULL) { /* if not realized yet */\n      minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L;\n      if (minheights <= max_minheights) {\n\t/* This buffer fits in memory */\n\tbptr->rows_in_mem = bptr->rows_in_array;\n      } else {\n\t/* It doesn't fit in memory, create backing store. */\n\tbptr->rows_in_mem = (JDIMENSION) (max_minheights * bptr->maxaccess);\n\tjpeg_open_backing_store(cinfo, & bptr->b_s_info,\n\t\t\t\t(long) bptr->rows_in_array *\n\t\t\t\t(long) bptr->blocksperrow *\n\t\t\t\t(long) SIZEOF(JBLOCK));\n\tbptr->b_s_open = TRUE;\n      }\n      bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE,\n\t\t\t\t      bptr->blocksperrow, bptr->rows_in_mem);\n      bptr->rowsperchunk = mem->last_rowsperchunk;\n      bptr->cur_start_row = 0;\n      bptr->first_undef_row = 0;\n      bptr->dirty = FALSE;\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)\n/* Do backing store read or write of a virtual sample array */\n{\n  long bytesperrow, file_offset, byte_count, rows, thisrow, i;\n\n  bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE);\n  file_offset = ptr->cur_start_row * bytesperrow;\n  /* Loop to read or write each allocation chunk in mem_buffer */\n  for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {\n    /* One chunk, but check for short chunk at end of buffer */\n    rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);\n    /* Transfer no more than is currently defined */\n    thisrow = (long) ptr->cur_start_row + i;\n    rows = MIN(rows, (long) ptr->first_undef_row - thisrow);\n    /* Transfer no more than fits in file */\n    rows = MIN(rows, (long) ptr->rows_in_array - thisrow);\n    if (rows <= 0)\t\t/* this chunk might be past end of file! */\n      break;\n    byte_count = rows * bytesperrow;\n    if (writing)\n      (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,\n\t\t\t\t\t    (void FAR *) ptr->mem_buffer[i],\n\t\t\t\t\t    file_offset, byte_count);\n    else\n      (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,\n\t\t\t\t\t   (void FAR *) ptr->mem_buffer[i],\n\t\t\t\t\t   file_offset, byte_count);\n    file_offset += byte_count;\n  }\n}\n\n\nLOCAL(void)\ndo_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)\n/* Do backing store read or write of a virtual coefficient-block array */\n{\n  long bytesperrow, file_offset, byte_count, rows, thisrow, i;\n\n  bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK);\n  file_offset = ptr->cur_start_row * bytesperrow;\n  /* Loop to read or write each allocation chunk in mem_buffer */\n  for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {\n    /* One chunk, but check for short chunk at end of buffer */\n    rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);\n    /* Transfer no more than is currently defined */\n    thisrow = (long) ptr->cur_start_row + i;\n    rows = MIN(rows, (long) ptr->first_undef_row - thisrow);\n    /* Transfer no more than fits in file */\n    rows = MIN(rows, (long) ptr->rows_in_array - thisrow);\n    if (rows <= 0)\t\t/* this chunk might be past end of file! */\n      break;\n    byte_count = rows * bytesperrow;\n    if (writing)\n      (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,\n\t\t\t\t\t    (void FAR *) ptr->mem_buffer[i],\n\t\t\t\t\t    file_offset, byte_count);\n    else\n      (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,\n\t\t\t\t\t   (void FAR *) ptr->mem_buffer[i],\n\t\t\t\t\t   file_offset, byte_count);\n    file_offset += byte_count;\n  }\n}\n\n\nMETHODDEF(JSAMPARRAY)\naccess_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr,\n\t\t    JDIMENSION start_row, JDIMENSION num_rows,\n\t\t    boolean writable)\n/* Access the part of a virtual sample array starting at start_row */\n/* and extending for num_rows rows.  writable is true if  */\n/* caller intends to modify the accessed area. */\n{\n  JDIMENSION end_row = start_row + num_rows;\n  JDIMENSION undef_row;\n\n  /* debugging check */\n  if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||\n      ptr->mem_buffer == NULL)\n    ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n\n  /* Make the desired part of the virtual array accessible */\n  if (start_row < ptr->cur_start_row ||\n      end_row > ptr->cur_start_row+ptr->rows_in_mem) {\n    if (! ptr->b_s_open)\n      ERREXIT(cinfo, JERR_VIRTUAL_BUG);\n    /* Flush old buffer contents if necessary */\n    if (ptr->dirty) {\n      do_sarray_io(cinfo, ptr, TRUE);\n      ptr->dirty = FALSE;\n    }\n    /* Decide what part of virtual array to access.\n     * Algorithm: if target address > current window, assume forward scan,\n     * load starting at target address.  If target address < current window,\n     * assume backward scan, load so that target area is top of window.\n     * Note that when switching from forward write to forward read, will have\n     * start_row = 0, so the limiting case applies and we load from 0 anyway.\n     */\n    if (start_row > ptr->cur_start_row) {\n      ptr->cur_start_row = start_row;\n    } else {\n      /* use long arithmetic here to avoid overflow & unsigned problems */\n      long ltemp;\n\n      ltemp = (long) end_row - (long) ptr->rows_in_mem;\n      if (ltemp < 0)\n\tltemp = 0;\t\t/* don't fall off front end of file */\n      ptr->cur_start_row = (JDIMENSION) ltemp;\n    }\n    /* Read in the selected part of the array.\n     * During the initial write pass, we will do no actual read\n     * because the selected part is all undefined.\n     */\n    do_sarray_io(cinfo, ptr, FALSE);\n  }\n  /* Ensure the accessed part of the array is defined; prezero if needed.\n   * To improve locality of access, we only prezero the part of the array\n   * that the caller is about to access, not the entire in-memory array.\n   */\n  if (ptr->first_undef_row < end_row) {\n    if (ptr->first_undef_row < start_row) {\n      if (writable)\t\t/* writer skipped over a section of array */\n\tERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n      undef_row = start_row;\t/* but reader is allowed to read ahead */\n    } else {\n      undef_row = ptr->first_undef_row;\n    }\n    if (writable)\n      ptr->first_undef_row = end_row;\n    if (ptr->pre_zero) {\n      size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE);\n      undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */\n      end_row -= ptr->cur_start_row;\n      while (undef_row < end_row) {\n\tFMEMZERO((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);\n\tundef_row++;\n      }\n    } else {\n      if (! writable)\t\t/* reader looking at undefined data */\n\tERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n    }\n  }\n  /* Flag the buffer dirty if caller will write in it */\n  if (writable)\n    ptr->dirty = TRUE;\n  /* Return address of proper part of the buffer */\n  return ptr->mem_buffer + (start_row - ptr->cur_start_row);\n}\n\n\nMETHODDEF(JBLOCKARRAY)\naccess_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr,\n\t\t    JDIMENSION start_row, JDIMENSION num_rows,\n\t\t    boolean writable)\n/* Access the part of a virtual block array starting at start_row */\n/* and extending for num_rows rows.  writable is true if  */\n/* caller intends to modify the accessed area. */\n{\n  JDIMENSION end_row = start_row + num_rows;\n  JDIMENSION undef_row;\n\n  /* debugging check */\n  if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||\n      ptr->mem_buffer == NULL)\n    ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n\n  /* Make the desired part of the virtual array accessible */\n  if (start_row < ptr->cur_start_row ||\n      end_row > ptr->cur_start_row+ptr->rows_in_mem) {\n    if (! ptr->b_s_open)\n      ERREXIT(cinfo, JERR_VIRTUAL_BUG);\n    /* Flush old buffer contents if necessary */\n    if (ptr->dirty) {\n      do_barray_io(cinfo, ptr, TRUE);\n      ptr->dirty = FALSE;\n    }\n    /* Decide what part of virtual array to access.\n     * Algorithm: if target address > current window, assume forward scan,\n     * load starting at target address.  If target address < current window,\n     * assume backward scan, load so that target area is top of window.\n     * Note that when switching from forward write to forward read, will have\n     * start_row = 0, so the limiting case applies and we load from 0 anyway.\n     */\n    if (start_row > ptr->cur_start_row) {\n      ptr->cur_start_row = start_row;\n    } else {\n      /* use long arithmetic here to avoid overflow & unsigned problems */\n      long ltemp;\n\n      ltemp = (long) end_row - (long) ptr->rows_in_mem;\n      if (ltemp < 0)\n\tltemp = 0;\t\t/* don't fall off front end of file */\n      ptr->cur_start_row = (JDIMENSION) ltemp;\n    }\n    /* Read in the selected part of the array.\n     * During the initial write pass, we will do no actual read\n     * because the selected part is all undefined.\n     */\n    do_barray_io(cinfo, ptr, FALSE);\n  }\n  /* Ensure the accessed part of the array is defined; prezero if needed.\n   * To improve locality of access, we only prezero the part of the array\n   * that the caller is about to access, not the entire in-memory array.\n   */\n  if (ptr->first_undef_row < end_row) {\n    if (ptr->first_undef_row < start_row) {\n      if (writable)\t\t/* writer skipped over a section of array */\n\tERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n      undef_row = start_row;\t/* but reader is allowed to read ahead */\n    } else {\n      undef_row = ptr->first_undef_row;\n    }\n    if (writable)\n      ptr->first_undef_row = end_row;\n    if (ptr->pre_zero) {\n      size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK);\n      undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */\n      end_row -= ptr->cur_start_row;\n      while (undef_row < end_row) {\n\tFMEMZERO((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);\n\tundef_row++;\n      }\n    } else {\n      if (! writable)\t\t/* reader looking at undefined data */\n\tERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n    }\n  }\n  /* Flag the buffer dirty if caller will write in it */\n  if (writable)\n    ptr->dirty = TRUE;\n  /* Return address of proper part of the buffer */\n  return ptr->mem_buffer + (start_row - ptr->cur_start_row);\n}\n\n\n/*\n * Release all objects belonging to a specified pool.\n */\n\nMETHODDEF(void)\nfree_pool (j_common_ptr cinfo, int pool_id)\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  small_pool_ptr shdr_ptr;\n  large_pool_ptr lhdr_ptr;\n  size_t space_freed;\n\n  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);\t/* safety check */\n\n#ifdef MEM_STATS\n  if (cinfo->err->trace_level > 1)\n    print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */\n#endif\n\n  /* If freeing IMAGE pool, close any virtual arrays first */\n  if (pool_id == JPOOL_IMAGE) {\n    jvirt_sarray_ptr sptr;\n    jvirt_barray_ptr bptr;\n\n    for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {\n      if (sptr->b_s_open) {\t/* there may be no backing store */\n\tsptr->b_s_open = FALSE;\t/* prevent recursive close if error */\n\t(*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info);\n      }\n    }\n    mem->virt_sarray_list = NULL;\n    for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {\n      if (bptr->b_s_open) {\t/* there may be no backing store */\n\tbptr->b_s_open = FALSE;\t/* prevent recursive close if error */\n\t(*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info);\n      }\n    }\n    mem->virt_barray_list = NULL;\n  }\n\n  /* Release large objects */\n  lhdr_ptr = mem->large_list[pool_id];\n  mem->large_list[pool_id] = NULL;\n\n  while (lhdr_ptr != NULL) {\n    large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next;\n    space_freed = lhdr_ptr->hdr.bytes_used +\n\t\t  lhdr_ptr->hdr.bytes_left +\n\t\t  SIZEOF(large_pool_hdr);\n    jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed);\n    mem->total_space_allocated -= space_freed;\n    lhdr_ptr = next_lhdr_ptr;\n  }\n\n  /* Release small objects */\n  shdr_ptr = mem->small_list[pool_id];\n  mem->small_list[pool_id] = NULL;\n\n  while (shdr_ptr != NULL) {\n    small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next;\n    space_freed = shdr_ptr->hdr.bytes_used +\n\t\t  shdr_ptr->hdr.bytes_left +\n\t\t  SIZEOF(small_pool_hdr);\n    jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed);\n    mem->total_space_allocated -= space_freed;\n    shdr_ptr = next_shdr_ptr;\n  }\n}\n\n\n/*\n * Close up shop entirely.\n * Note that this cannot be called unless cinfo->mem is non-NULL.\n */\n\nMETHODDEF(void)\nself_destruct (j_common_ptr cinfo)\n{\n  int pool;\n\n  /* Close all backing store, release all memory.\n   * Releasing pools in reverse order might help avoid fragmentation\n   * with some (brain-damaged) malloc libraries.\n   */\n  for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {\n    free_pool(cinfo, pool);\n  }\n\n  /* Release the memory manager control block too. */\n  jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr));\n  cinfo->mem = NULL;\t\t/* ensures I will be called only once */\n\n  jpeg_mem_term(cinfo);\t\t/* system-dependent cleanup */\n}\n\n\n/*\n * Memory manager initialization.\n * When this is called, only the error manager pointer is valid in cinfo!\n */\n\nGLOBAL(void)\njinit_memory_mgr (j_common_ptr cinfo)\n{\n  my_mem_ptr mem;\n  long max_to_use;\n  int pool;\n  size_t test_mac;\n\n  cinfo->mem = NULL;\t\t/* for safety if init fails */\n\n  /* Check for configuration errors.\n   * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably\n   * doesn't reflect any real hardware alignment requirement.\n   * The test is a little tricky: for X>0, X and X-1 have no one-bits\n   * in common if and only if X is a power of 2, ie has only one one-bit.\n   * Some compilers may give an \"unreachable code\" warning here; ignore it.\n   */\n  if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0)\n    ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE);\n  /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be\n   * a multiple of SIZEOF(ALIGN_TYPE).\n   * Again, an \"unreachable code\" warning may be ignored here.\n   * But a \"constant too large\" warning means you need to fix MAX_ALLOC_CHUNK.\n   */\n  test_mac = (size_t) MAX_ALLOC_CHUNK;\n  if ((long) test_mac != MAX_ALLOC_CHUNK ||\n      (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0)\n    ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);\n\n  max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */\n\n  /* Attempt to allocate memory manager's control block */\n  mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr));\n\n  if (mem == NULL) {\n    jpeg_mem_term(cinfo);\t/* system-dependent cleanup */\n    ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0);\n  }\n\n  /* OK, fill in the method pointers */\n  mem->pub.alloc_small = alloc_small;\n  mem->pub.alloc_large = alloc_large;\n  mem->pub.alloc_sarray = alloc_sarray;\n  mem->pub.alloc_barray = alloc_barray;\n  mem->pub.request_virt_sarray = request_virt_sarray;\n  mem->pub.request_virt_barray = request_virt_barray;\n  mem->pub.realize_virt_arrays = realize_virt_arrays;\n  mem->pub.access_virt_sarray = access_virt_sarray;\n  mem->pub.access_virt_barray = access_virt_barray;\n  mem->pub.free_pool = free_pool;\n  mem->pub.self_destruct = self_destruct;\n\n  /* Make MAX_ALLOC_CHUNK accessible to other modules */\n  mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK;\n\n  /* Initialize working state */\n  mem->pub.max_memory_to_use = max_to_use;\n\n  for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {\n    mem->small_list[pool] = NULL;\n    mem->large_list[pool] = NULL;\n  }\n  mem->virt_sarray_list = NULL;\n  mem->virt_barray_list = NULL;\n\n  mem->total_space_allocated = SIZEOF(my_memory_mgr);\n\n  /* Declare ourselves open for business */\n  cinfo->mem = & mem->pub;\n\n  /* Check for an environment variable JPEGMEM; if found, override the\n   * default max_memory setting from jpeg_mem_init.  Note that the\n   * surrounding application may again override this value.\n   * If your system doesn't support getenv(), define NO_GETENV to disable\n   * this feature.\n   */\n#ifndef NO_GETENV\n  { char * memenv;\n\n    if ((memenv = getenv(\"JPEGMEM\")) != NULL) {\n      char ch = 'x';\n\n      if (sscanf(memenv, \"%ld%c\", &max_to_use, &ch) > 0) {\n\tif (ch == 'm' || ch == 'M')\n\t  max_to_use *= 1000L;\n\tmem->pub.max_memory_to_use = max_to_use * 1000L;\n      }\n    }\n  }\n#endif\n\n}\n"
  },
  {
    "path": "jmemname.c",
    "content": "/*\n * jmemname.c\n *\n * Copyright (C) 1992-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file provides a generic implementation of the system-dependent\n * portion of the JPEG memory manager.  This implementation assumes that\n * you must explicitly construct a name for each temp file.\n * Also, the problem of determining the amount of memory available\n * is shoved onto the user.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jmemsys.h\"\t\t/* import the system-dependent declarations */\n\n#ifndef HAVE_STDLIB_H\t\t/* <stdlib.h> should declare malloc(),free() */\nextern void * malloc JPP((size_t size));\nextern void free JPP((void *ptr));\n#endif\n\n#ifndef SEEK_SET\t\t/* pre-ANSI systems may not define this; */\n#define SEEK_SET  0\t\t/* if not, assume 0 is correct */\n#endif\n\n#ifdef DONT_USE_B_MODE\t\t/* define mode parameters for fopen() */\n#define READ_BINARY\t\"r\"\n#define RW_BINARY\t\"w+\"\n#else\n#ifdef VMS\t\t\t/* VMS is very nonstandard */\n#define READ_BINARY\t\"rb\", \"ctx=stm\"\n#define RW_BINARY\t\"w+b\", \"ctx=stm\"\n#else\t\t\t\t/* standard ANSI-compliant case */\n#define READ_BINARY\t\"rb\"\n#define RW_BINARY\t\"w+b\"\n#endif\n#endif\n\n\n/*\n * Selection of a file name for a temporary file.\n * This is system-dependent!\n *\n * The code as given is suitable for most Unix systems, and it is easily\n * modified for most non-Unix systems.  Some notes:\n *  1.  The temp file is created in the directory named by TEMP_DIRECTORY.\n *      The default value is /usr/tmp, which is the conventional place for\n *      creating large temp files on Unix.  On other systems you'll probably\n *      want to change the file location.  You can do this by editing the\n *      #define, or (preferred) by defining TEMP_DIRECTORY in jconfig.h.\n *\n *  2.  If you need to change the file name as well as its location,\n *      you can override the TEMP_FILE_NAME macro.  (Note that this is\n *      actually a printf format string; it must contain %s and %d.)\n *      Few people should need to do this.\n *\n *  3.  mktemp() is used to ensure that multiple processes running\n *      simultaneously won't select the same file names.  If your system\n *      doesn't have mktemp(), define NO_MKTEMP to do it the hard way.\n *      (If you don't have <errno.h>, also define NO_ERRNO_H.)\n *\n *  4.  You probably want to define NEED_SIGNAL_CATCHER so that cjpeg.c/djpeg.c\n *      will cause the temp files to be removed if you stop the program early.\n */\n\n#ifndef TEMP_DIRECTORY\t\t/* can override from jconfig.h or Makefile */\n#define TEMP_DIRECTORY  \"/usr/tmp/\" /* recommended setting for Unix */\n#endif\n\nstatic int next_file_num;\t/* to distinguish among several temp files */\n\n#ifdef NO_MKTEMP\n\n#ifndef TEMP_FILE_NAME\t\t/* can override from jconfig.h or Makefile */\n#define TEMP_FILE_NAME  \"%sJPG%03d.TMP\"\n#endif\n\n#ifndef NO_ERRNO_H\n#include <errno.h>\t\t/* to define ENOENT */\n#endif\n\n/* ANSI C specifies that errno is a macro, but on older systems it's more\n * likely to be a plain int variable.  And not all versions of errno.h\n * bother to declare it, so we have to in order to be most portable.  Thus:\n */\n#ifndef errno\nextern int errno;\n#endif\n\n\nLOCAL(void)\nselect_file_name (char * fname)\n{\n  FILE * tfile;\n\n  /* Keep generating file names till we find one that's not in use */\n  for (;;) {\n    next_file_num++;\t\t/* advance counter */\n    sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);\n    if ((tfile = fopen(fname, READ_BINARY)) == NULL) {\n      /* fopen could have failed for a reason other than the file not\n       * being there; for example, file there but unreadable.\n       * If <errno.h> isn't available, then we cannot test the cause.\n       */\n#ifdef ENOENT\n      if (errno != ENOENT)\n\tcontinue;\n#endif\n      break;\n    }\n    fclose(tfile);\t\t/* oops, it's there; close tfile & try again */\n  }\n}\n\n#else /* ! NO_MKTEMP */\n\n/* Note that mktemp() requires the initial filename to end in six X's */\n#ifndef TEMP_FILE_NAME\t\t/* can override from jconfig.h or Makefile */\n#define TEMP_FILE_NAME  \"%sJPG%dXXXXXX\"\n#endif\n\nLOCAL(void)\nselect_file_name (char * fname)\n{\n  next_file_num++;\t\t/* advance counter */\n  sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);\n  mktemp(fname);\t\t/* make sure file name is unique */\n  /* mktemp replaces the trailing XXXXXX with a unique string of characters */\n}\n\n#endif /* NO_MKTEMP */\n\n\n/*\n * Memory allocation and freeing are controlled by the regular library\n * routines malloc() and free().\n */\n\nGLOBAL(void *)\njpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void *) malloc(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)\n{\n  free(object);\n}\n\n\n/*\n * \"Large\" objects are treated the same as \"small\" ones.\n * NB: although we include FAR keywords in the routine declarations,\n * this file won't actually work in 80x86 small/medium model; at least,\n * you probably won't be able to process useful-size images in only 64KB.\n */\n\nGLOBAL(void FAR *)\njpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void FAR *) malloc(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)\n{\n  free(object);\n}\n\n\n/*\n * This routine computes the total memory space available for allocation.\n * It's impossible to do this in a portable way; our current solution is\n * to make the user tell us (with a default value set at compile time).\n * If you can actually get the available space, it's a good idea to subtract\n * a slop factor of 5% or so.\n */\n\n#ifndef DEFAULT_MAX_MEM\t\t/* so can override from makefile */\n#define DEFAULT_MAX_MEM\t\t1000000L /* default: one megabyte */\n#endif\n\nGLOBAL(long)\njpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,\n\t\t    long max_bytes_needed, long already_allocated)\n{\n  return cinfo->mem->max_memory_to_use - already_allocated;\n}\n\n\n/*\n * Backing store (temporary file) management.\n * Backing store objects are only used when the value returned by\n * jpeg_mem_available is less than the total space needed.  You can dispense\n * with these routines if you have plenty of virtual memory; see jmemnobs.c.\n */\n\n\nMETHODDEF(void)\nread_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t    void FAR * buffer_address,\n\t\t    long file_offset, long byte_count)\n{\n  if (fseek(info->temp_file, file_offset, SEEK_SET))\n    ERREXIT(cinfo, JERR_TFILE_SEEK);\n  if (JFREAD(info->temp_file, buffer_address, byte_count)\n      != (size_t) byte_count)\n    ERREXIT(cinfo, JERR_TFILE_READ);\n}\n\n\nMETHODDEF(void)\nwrite_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t     void FAR * buffer_address,\n\t\t     long file_offset, long byte_count)\n{\n  if (fseek(info->temp_file, file_offset, SEEK_SET))\n    ERREXIT(cinfo, JERR_TFILE_SEEK);\n  if (JFWRITE(info->temp_file, buffer_address, byte_count)\n      != (size_t) byte_count)\n    ERREXIT(cinfo, JERR_TFILE_WRITE);\n}\n\n\nMETHODDEF(void)\nclose_backing_store (j_common_ptr cinfo, backing_store_ptr info)\n{\n  fclose(info->temp_file);\t/* close the file */\n  unlink(info->temp_name);\t/* delete the file */\n/* If your system doesn't have unlink(), use remove() instead.\n * remove() is the ANSI-standard name for this function, but if\n * your system was ANSI you'd be using jmemansi.c, right?\n */\n  TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name);\n}\n\n\n/*\n * Initial opening of a backing-store object.\n */\n\nGLOBAL(void)\njpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t\t long total_bytes_needed)\n{\n  select_file_name(info->temp_name);\n  if ((info->temp_file = fopen(info->temp_name, RW_BINARY)) == NULL)\n    ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);\n  info->read_backing_store = read_backing_store;\n  info->write_backing_store = write_backing_store;\n  info->close_backing_store = close_backing_store;\n  TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);\n}\n\n\n/*\n * These routines take care of any system-dependent initialization and\n * cleanup required.\n */\n\nGLOBAL(long)\njpeg_mem_init (j_common_ptr cinfo)\n{\n  next_file_num = 0;\t\t/* initialize temp file name generator */\n  return DEFAULT_MAX_MEM;\t/* default for max_memory_to_use */\n}\n\nGLOBAL(void)\njpeg_mem_term (j_common_ptr cinfo)\n{\n  /* no work */\n}\n"
  },
  {
    "path": "jmemnobs.c",
    "content": "/*\n * jmemnobs.c\n *\n * Copyright (C) 1992-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file provides a really simple implementation of the system-\n * dependent portion of the JPEG memory manager.  This implementation\n * assumes that no backing-store files are needed: all required space\n * can be obtained from malloc().\n * This is very portable in the sense that it'll compile on almost anything,\n * but you'd better have lots of main memory (or virtual memory) if you want\n * to process big images.\n * Note that the max_memory_to_use option is ignored by this implementation.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jmemsys.h\"\t\t/* import the system-dependent declarations */\n\n#ifndef HAVE_STDLIB_H\t\t/* <stdlib.h> should declare malloc(),free() */\nextern void * malloc JPP((size_t size));\nextern void free JPP((void *ptr));\n#endif\n\n\n/*\n * Memory allocation and freeing are controlled by the regular library\n * routines malloc() and free().\n */\n\nGLOBAL(void *)\njpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void *) malloc(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)\n{\n  free(object);\n}\n\n\n/*\n * \"Large\" objects are treated the same as \"small\" ones.\n * NB: although we include FAR keywords in the routine declarations,\n * this file won't actually work in 80x86 small/medium model; at least,\n * you probably won't be able to process useful-size images in only 64KB.\n */\n\nGLOBAL(void FAR *)\njpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void FAR *) malloc(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)\n{\n  free(object);\n}\n\n\n/*\n * This routine computes the total memory space available for allocation.\n * Here we always say, \"we got all you want bud!\"\n */\n\nGLOBAL(long)\njpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,\n\t\t    long max_bytes_needed, long already_allocated)\n{\n  return max_bytes_needed;\n}\n\n\n/*\n * Backing store (temporary file) management.\n * Since jpeg_mem_available always promised the moon,\n * this should never be called and we can just error out.\n */\n\nGLOBAL(void)\njpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t\t long total_bytes_needed)\n{\n  ERREXIT(cinfo, JERR_NO_BACKING_STORE);\n}\n\n\n/*\n * These routines take care of any system-dependent initialization and\n * cleanup required.  Here, there isn't any.\n */\n\nGLOBAL(long)\njpeg_mem_init (j_common_ptr cinfo)\n{\n  return 0;\t\t\t/* just set max_memory_to_use to 0 */\n}\n\nGLOBAL(void)\njpeg_mem_term (j_common_ptr cinfo)\n{\n  /* no work */\n}\n"
  },
  {
    "path": "jmemsys.h",
    "content": "/*\n * jmemsys.h\n *\n * Copyright (C) 1992-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This include file defines the interface between the system-independent\n * and system-dependent portions of the JPEG memory manager.  No other\n * modules need include it.  (The system-independent portion is jmemmgr.c;\n * there are several different versions of the system-dependent portion.)\n *\n * This file works as-is for the system-dependent memory managers supplied\n * in the IJG distribution.  You may need to modify it if you write a\n * custom memory manager.  If system-dependent changes are needed in\n * this file, the best method is to #ifdef them based on a configuration\n * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR\n * and USE_MAC_MEMMGR.\n */\n\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_get_small\t\tjGetSmall\n#define jpeg_free_small\t\tjFreeSmall\n#define jpeg_get_large\t\tjGetLarge\n#define jpeg_free_large\t\tjFreeLarge\n#define jpeg_mem_available\tjMemAvail\n#define jpeg_open_backing_store\tjOpenBackStore\n#define jpeg_mem_init\t\tjMemInit\n#define jpeg_mem_term\t\tjMemTerm\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/*\n * These two functions are used to allocate and release small chunks of\n * memory.  (Typically the total amount requested through jpeg_get_small is\n * no more than 20K or so; this will be requested in chunks of a few K each.)\n * Behavior should be the same as for the standard library functions malloc\n * and free; in particular, jpeg_get_small must return NULL on failure.\n * On most systems, these ARE malloc and free.  jpeg_free_small is passed the\n * size of the object being freed, just in case it's needed.\n * On an 80x86 machine using small-data memory model, these manage near heap.\n */\n\nEXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject));\nEXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object,\n\t\t\t\t  size_t sizeofobject));\n\n/*\n * These two functions are used to allocate and release large chunks of\n * memory (up to the total free space designated by jpeg_mem_available).\n * The interface is the same as above, except that on an 80x86 machine,\n * far pointers are used.  On most other machines these are identical to\n * the jpeg_get/free_small routines; but we keep them separate anyway,\n * in case a different allocation strategy is desirable for large chunks.\n */\n\nEXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo,\n\t\t\t\t       size_t sizeofobject));\nEXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object,\n\t\t\t\t  size_t sizeofobject));\n\n/*\n * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may\n * be requested in a single call to jpeg_get_large (and jpeg_get_small for that\n * matter, but that case should never come into play).  This macro is needed\n * to model the 64Kb-segment-size limit of far addressing on 80x86 machines.\n * On those machines, we expect that jconfig.h will provide a proper value.\n * On machines with 32-bit flat address spaces, any large constant may be used.\n *\n * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type\n * size_t and will be a multiple of sizeof(align_type).\n */\n\n#ifndef MAX_ALLOC_CHUNK\t\t/* may be overridden in jconfig.h */\n#define MAX_ALLOC_CHUNK  1000000000L\n#endif\n\n/*\n * This routine computes the total space still available for allocation by\n * jpeg_get_large.  If more space than this is needed, backing store will be\n * used.  NOTE: any memory already allocated must not be counted.\n *\n * There is a minimum space requirement, corresponding to the minimum\n * feasible buffer sizes; jmemmgr.c will request that much space even if\n * jpeg_mem_available returns zero.  The maximum space needed, enough to hold\n * all working storage in memory, is also passed in case it is useful.\n * Finally, the total space already allocated is passed.  If no better\n * method is available, cinfo->mem->max_memory_to_use - already_allocated\n * is often a suitable calculation.\n *\n * It is OK for jpeg_mem_available to underestimate the space available\n * (that'll just lead to more backing-store access than is really necessary).\n * However, an overestimate will lead to failure.  Hence it's wise to subtract\n * a slop factor from the true available space.  5% should be enough.\n *\n * On machines with lots of virtual memory, any large constant may be returned.\n * Conversely, zero may be returned to always use the minimum amount of memory.\n */\n\nEXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo,\n\t\t\t\t     long min_bytes_needed,\n\t\t\t\t     long max_bytes_needed,\n\t\t\t\t     long already_allocated));\n\n\n/*\n * This structure holds whatever state is needed to access a single\n * backing-store object.  The read/write/close method pointers are called\n * by jmemmgr.c to manipulate the backing-store object; all other fields\n * are private to the system-dependent backing store routines.\n */\n\n#define TEMP_NAME_LENGTH   64\t/* max length of a temporary file's name */\n\n\n#ifdef USE_MSDOS_MEMMGR\t\t/* DOS-specific junk */\n\ntypedef unsigned short XMSH;\t/* type of extended-memory handles */\ntypedef unsigned short EMSH;\t/* type of expanded-memory handles */\n\ntypedef union {\n  short file_handle;\t\t/* DOS file handle if it's a temp file */\n  XMSH xms_handle;\t\t/* handle if it's a chunk of XMS */\n  EMSH ems_handle;\t\t/* handle if it's a chunk of EMS */\n} handle_union;\n\n#endif /* USE_MSDOS_MEMMGR */\n\n#ifdef USE_MAC_MEMMGR\t\t/* Mac-specific junk */\n#include <Files.h>\n#endif /* USE_MAC_MEMMGR */\n\n\ntypedef struct backing_store_struct * backing_store_ptr;\n\ntypedef struct backing_store_struct {\n  /* Methods for reading/writing/closing this backing-store object */\n  JMETHOD(void, read_backing_store, (j_common_ptr cinfo,\n\t\t\t\t     backing_store_ptr info,\n\t\t\t\t     void FAR * buffer_address,\n\t\t\t\t     long file_offset, long byte_count));\n  JMETHOD(void, write_backing_store, (j_common_ptr cinfo,\n\t\t\t\t      backing_store_ptr info,\n\t\t\t\t      void FAR * buffer_address,\n\t\t\t\t      long file_offset, long byte_count));\n  JMETHOD(void, close_backing_store, (j_common_ptr cinfo,\n\t\t\t\t      backing_store_ptr info));\n\n  /* Private fields for system-dependent backing-store management */\n#ifdef USE_MSDOS_MEMMGR\n  /* For the MS-DOS manager (jmemdos.c), we need: */\n  handle_union handle;\t\t/* reference to backing-store storage object */\n  char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */\n#else\n#ifdef USE_MAC_MEMMGR\n  /* For the Mac manager (jmemmac.c), we need: */\n  short temp_file;\t\t/* file reference number to temp file */\n  FSSpec tempSpec;\t\t/* the FSSpec for the temp file */\n  char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */\n#else\n  /* For a typical implementation with temp files, we need: */\n  FILE * temp_file;\t\t/* stdio reference to temp file */\n  char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */\n#endif\n#endif\n} backing_store_info;\n\n\n/*\n * Initial opening of a backing-store object.  This must fill in the\n * read/write/close pointers in the object.  The read/write routines\n * may take an error exit if the specified maximum file size is exceeded.\n * (If jpeg_mem_available always returns a large value, this routine can\n * just take an error exit.)\n */\n\nEXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo,\n\t\t\t\t\t  backing_store_ptr info,\n\t\t\t\t\t  long total_bytes_needed));\n\n\n/*\n * These routines take care of any system-dependent initialization and\n * cleanup required.  jpeg_mem_init will be called before anything is\n * allocated (and, therefore, nothing in cinfo is of use except the error\n * manager pointer).  It should return a suitable default value for\n * max_memory_to_use; this may subsequently be overridden by the surrounding\n * application.  (Note that max_memory_to_use is only important if\n * jpeg_mem_available chooses to consult it ... no one else will.)\n * jpeg_mem_term may assume that all requested memory has been freed and that\n * all opened backing-store objects have been closed.\n */\n\nEXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo));\nEXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo));\n"
  },
  {
    "path": "jmorecfg.h",
    "content": "/*\n * jmorecfg.h\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 1997-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains additional configuration options that customize the\n * JPEG software for special applications or support machine-dependent\n * optimizations.  Most users will not need to touch this file.\n */\n\n\n/*\n * Define BITS_IN_JSAMPLE as either\n *   8   for 8-bit sample values (the usual setting)\n *   9   for 9-bit sample values\n *   10  for 10-bit sample values\n *   11  for 11-bit sample values\n *   12  for 12-bit sample values\n * Only 8, 9, 10, 11, and 12 bits sample data precision are supported for\n * full-feature DCT processing.  Further depths up to 16-bit may be added\n * later for the lossless modes of operation.\n * Run-time selection and conversion of data precision will be added later\n * and are currently not supported, sorry.\n * Exception:  The transcoding part (jpegtran) supports all settings in a\n * single instance, since it operates on the level of DCT coefficients and\n * not sample values.  The DCT coefficients are of the same type (16 bits)\n * in all cases (see below).\n */\n\n#define BITS_IN_JSAMPLE  8\t/* use 8, 9, 10, 11, or 12 */\n\n\n/*\n * Maximum number of components (color channels) allowed in JPEG image.\n * To meet the letter of the JPEG spec, set this to 255.  However, darn\n * few applications need more than 4 channels (maybe 5 for CMYK + alpha\n * mask).  We recommend 10 as a reasonable compromise; use 4 if you are\n * really short on memory.  (Each allowed component costs a hundred or so\n * bytes of storage, whether actually used in an image or not.)\n */\n\n#define MAX_COMPONENTS  10\t/* maximum number of image components */\n\n\n/*\n * Basic data types.\n * You may need to change these if you have a machine with unusual data\n * type sizes; for example, \"char\" not 8 bits, \"short\" not 16 bits,\n * or \"long\" not 32 bits.  We don't care whether \"int\" is 16 or 32 bits,\n * but it had better be at least 16.\n */\n\n/* Representation of a single sample (pixel element value).\n * We frequently allocate large arrays of these, so it's important to keep\n * them small.  But if you have memory to burn and access to char or short\n * arrays is very slow on your hardware, you might want to change these.\n */\n\n#if BITS_IN_JSAMPLE == 8\n/* JSAMPLE should be the smallest type that will hold the values 0..255.\n * You can use a signed char by having GETJSAMPLE mask it with 0xFF.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JSAMPLE;\n#ifdef CHAR_IS_UNSIGNED\n#define GETJSAMPLE(value)  ((int) (value))\n#else\n#define GETJSAMPLE(value)  ((int) (value) & 0xFF)\n#endif /* CHAR_IS_UNSIGNED */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n#define MAXJSAMPLE\t255\n#define CENTERJSAMPLE\t128\n\n#endif /* BITS_IN_JSAMPLE == 8 */\n\n\n#if BITS_IN_JSAMPLE == 9\n/* JSAMPLE should be the smallest type that will hold the values 0..511.\n * On nearly all machines \"short\" will do nicely.\n */\n\ntypedef short JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#define MAXJSAMPLE\t511\n#define CENTERJSAMPLE\t256\n\n#endif /* BITS_IN_JSAMPLE == 9 */\n\n\n#if BITS_IN_JSAMPLE == 10\n/* JSAMPLE should be the smallest type that will hold the values 0..1023.\n * On nearly all machines \"short\" will do nicely.\n */\n\ntypedef short JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#define MAXJSAMPLE\t1023\n#define CENTERJSAMPLE\t512\n\n#endif /* BITS_IN_JSAMPLE == 10 */\n\n\n#if BITS_IN_JSAMPLE == 11\n/* JSAMPLE should be the smallest type that will hold the values 0..2047.\n * On nearly all machines \"short\" will do nicely.\n */\n\ntypedef short JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#define MAXJSAMPLE\t2047\n#define CENTERJSAMPLE\t1024\n\n#endif /* BITS_IN_JSAMPLE == 11 */\n\n\n#if BITS_IN_JSAMPLE == 12\n/* JSAMPLE should be the smallest type that will hold the values 0..4095.\n * On nearly all machines \"short\" will do nicely.\n */\n\ntypedef short JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#define MAXJSAMPLE\t4095\n#define CENTERJSAMPLE\t2048\n\n#endif /* BITS_IN_JSAMPLE == 12 */\n\n\n/* Representation of a DCT frequency coefficient.\n * This should be a signed value of at least 16 bits; \"short\" is usually OK.\n * Again, we allocate large arrays of these, but you can change to int\n * if you have memory to burn and \"short\" is really slow.\n */\n\ntypedef short JCOEF;\n\n\n/* Compressed datastreams are represented as arrays of JOCTET.\n * These must be EXACTLY 8 bits wide, at least once they are written to\n * external storage.  Note that when using the stdio data source/destination\n * managers, this is also the data type passed to fread/fwrite.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JOCTET;\n#define GETJOCTET(value)  (value)\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JOCTET;\n#ifdef CHAR_IS_UNSIGNED\n#define GETJOCTET(value)  (value)\n#else\n#define GETJOCTET(value)  ((value) & 0xFF)\n#endif /* CHAR_IS_UNSIGNED */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n/* These typedefs are used for various table entries and so forth.\n * They must be at least as wide as specified; but making them too big\n * won't cost a huge amount of memory, so we don't provide special\n * extraction code like we did for JSAMPLE.  (In other words, these\n * typedefs live at a different point on the speed/space tradeoff curve.)\n */\n\n/* UINT8 must hold at least the values 0..255. */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char UINT8;\n#else /* not HAVE_UNSIGNED_CHAR */\n#ifdef CHAR_IS_UNSIGNED\ntypedef char UINT8;\n#else /* not CHAR_IS_UNSIGNED */\ntypedef short UINT8;\n#endif /* CHAR_IS_UNSIGNED */\n#endif /* HAVE_UNSIGNED_CHAR */\n\n/* UINT16 must hold at least the values 0..65535. */\n\n#ifdef HAVE_UNSIGNED_SHORT\ntypedef unsigned short UINT16;\n#else /* not HAVE_UNSIGNED_SHORT */\ntypedef unsigned int UINT16;\n#endif /* HAVE_UNSIGNED_SHORT */\n\n/* INT16 must hold at least the values -32768..32767. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT16 */\ntypedef short INT16;\n#endif\n\n/* INT32 must hold at least signed 32-bit values. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT32 */\n#ifndef _BASETSD_H_\t\t/* Microsoft defines it in basetsd.h */\n#ifndef _BASETSD_H\t\t/* MinGW is slightly different */\n#ifndef QGLOBAL_H\t\t/* Qt defines it in qglobal.h */\ntypedef long INT32;\n#endif\n#endif\n#endif\n#endif\n\n/* Datatype used for image dimensions.  The JPEG standard only supports\n * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore\n * \"unsigned int\" is sufficient on all machines.  However, if you need to\n * handle larger images and you don't mind deviating from the spec, you\n * can change this datatype.\n */\n\ntypedef unsigned int JDIMENSION;\n\n#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */\n\n\n/* These macros are used in all function definitions and extern declarations.\n * You could modify them if you need to change function linkage conventions;\n * in particular, you'll need to do that to make the library a Windows DLL.\n * Another application is to make all functions global for use with debuggers\n * or code profilers that require it.\n */\n\n/* a function called through method pointers: */\n#define METHODDEF(type)\t\tstatic type\n/* a function used only in its module: */\n#define LOCAL(type)\t\tstatic type\n/* a function referenced thru EXTERNs: */\n#define GLOBAL(type)\t\ttype\n/* a reference to a GLOBAL function: */\n#define EXTERN(type)\t\textern type\n\n\n/* This macro is used to declare a \"method\", that is, a function pointer.\n * We want to supply prototype parameters if the compiler can cope.\n * Note that the arglist parameter must be parenthesized!\n * Again, you can customize this if you need special linkage keywords.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist\n#else\n#define JMETHOD(type,methodname,arglist)  type (*methodname) ()\n#endif\n\n\n/* The noreturn type identifier is used to declare functions\n * which cannot return.\n * Compilers can thus create more optimized code and perform\n * better checks for warnings and errors.\n * Static analyzer tools can make improved inferences about\n * execution paths and are prevented from giving false alerts.\n *\n * Unfortunately, the proposed specifications of corresponding\n * extensions in the Dec 2011 ISO C standard revision (C11),\n * GCC, MSVC, etc. are not viable.\n * Thus we introduce a user defined type to declare noreturn\n * functions at least for clarity.  A proper compiler would\n * have a suitable noreturn type to match in place of void.\n */\n\n#ifndef HAVE_NORETURN_T\ntypedef void noreturn_t;\n#endif\n\n\n/* Here is the pseudo-keyword for declaring pointers that must be \"far\"\n * on 80x86 machines.  Most of the specialized coding for 80x86 is handled\n * by just saying \"FAR *\" where such a pointer is needed.  In a few places\n * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.\n */\n\n#ifndef FAR\n#ifdef NEED_FAR_POINTERS\n#define FAR  far\n#else\n#define FAR\n#endif\n#endif\n\n\n/*\n * On a few systems, type boolean and/or its values FALSE, TRUE may appear\n * in standard header files.  Or you may have conflicts with application-\n * specific header files that you want to include together with these files.\n * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.\n */\n\n#ifndef HAVE_BOOLEAN\n#if defined FALSE || defined TRUE || defined QGLOBAL_H\n/* Qt3 defines FALSE and TRUE as \"const\" variables in qglobal.h */\ntypedef int boolean;\n#ifndef FALSE\t\t\t/* in case these macros already exist */\n#define FALSE\t0\t\t/* values of boolean */\n#endif\n#ifndef TRUE\n#define TRUE\t1\n#endif\n#else\ntypedef enum { FALSE = 0, TRUE = 1 } boolean;\n#endif\n#endif\n\n\n/*\n * The remaining options affect code selection within the JPEG library,\n * but they don't need to be visible to most applications using the library.\n * To minimize application namespace pollution, the symbols won't be\n * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.\n */\n\n#ifdef JPEG_INTERNALS\n#define JPEG_INTERNAL_OPTIONS\n#endif\n\n#ifdef JPEG_INTERNAL_OPTIONS\n\n\n/*\n * These defines indicate whether to include various optional functions.\n * Undefining some of these symbols will produce a smaller but less capable\n * library.  Note that you can leave certain source files out of the\n * compilation/linking process if you've #undef'd the corresponding symbols.\n * (You may HAVE to do that if your compiler doesn't like null source files.)\n */\n\n/* Capability options common to encoder and decoder: */\n\n#define DCT_ISLOW_SUPPORTED\t/* slow but accurate integer algorithm */\n#define DCT_IFAST_SUPPORTED\t/* faster, less accurate integer method */\n#define DCT_FLOAT_SUPPORTED\t/* floating-point: accurate, fast on fast HW */\n\n/* Encoder capability options: */\n\n#define C_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */\n#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define C_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define DCT_SCALING_SUPPORTED\t    /* Input rescaling via DCT? (Requires DCT_ISLOW)*/\n#define ENTROPY_OPT_SUPPORTED\t    /* Optimization of entropy coding parms? */\n/* Note: if you selected more than 8-bit data precision, it is dangerous to\n * turn off ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only\n * good for 8-bit precision, so arithmetic coding is recommended for higher\n * precision.  The Huffman encoder normally uses entropy optimization to\n * compute usable tables for higher precision.  Otherwise, you'll have to\n * supply different default Huffman tables.\n * The exact same statements apply for progressive JPEG: the default tables\n * don't work for progressive mode.  (This may get fixed, however.)\n */\n#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */\n\n/* Decoder capability options: */\n\n#define D_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */\n#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define D_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define IDCT_SCALING_SUPPORTED\t    /* Output rescaling via IDCT? (Requires DCT_ISLOW)*/\n#define SAVE_MARKERS_SUPPORTED\t    /* jpeg_save_markers() needed? */\n#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */\n#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */\n#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */\n#define QUANT_1PASS_SUPPORTED\t    /* 1-pass color quantization? */\n#define QUANT_2PASS_SUPPORTED\t    /* 2-pass color quantization? */\n\n/* more capability options later, no doubt */\n\n\n/*\n * Ordering of RGB data in scanlines passed to or from the application.\n * If your application wants to deal with data in the order B,G,R, just\n * change these macros.  You can also deal with formats such as R,G,B,X\n * (one extra byte per pixel) by changing RGB_PIXELSIZE.  Note that changing\n * the offsets will also change the order in which colormap data is organized.\n * RESTRICTIONS:\n * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.\n * 2. The color quantizer modules will not behave desirably if RGB_PIXELSIZE\n *    is not 3 (they don't understand about dummy color components!).  So you\n *    can't use color quantization if you change that value.\n */\n\n#define RGB_RED\t\t0\t/* Offset of Red in an RGB scanline element */\n#define RGB_GREEN\t1\t/* Offset of Green */\n#define RGB_BLUE\t2\t/* Offset of Blue */\n#define RGB_PIXELSIZE\t3\t/* JSAMPLEs per RGB scanline element */\n\n\n/* Definitions for speed-related optimizations. */\n\n\n/* If your compiler supports inline functions, define INLINE\n * as the inline keyword; otherwise define it as empty.\n */\n\n#ifndef INLINE\n#ifdef __GNUC__\t\t\t/* for instance, GNU C knows about inline */\n#define INLINE __inline__\n#endif\n#ifndef INLINE\n#define INLINE\t\t\t/* default is to define it as empty */\n#endif\n#endif\n\n\n/* On some machines (notably 68000 series) \"int\" is 32 bits, but multiplying\n * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER\n * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.\n */\n\n#ifndef MULTIPLIER\n#define MULTIPLIER  int\t\t/* type for fastest integer multiply */\n#endif\n\n\n/* FAST_FLOAT should be either float or double, whichever is done faster\n * by your compiler.  (Note that this type is only used in the floating point\n * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)\n * Typically, float is faster in ANSI C compilers, while double is faster in\n * pre-ANSI compilers (because they insist on converting to double anyway).\n * The code below therefore chooses float if we have ANSI-style prototypes.\n */\n\n#ifndef FAST_FLOAT\n#ifdef HAVE_PROTOTYPES\n#define FAST_FLOAT  float\n#else\n#define FAST_FLOAT  double\n#endif\n#endif\n\n#endif /* JPEG_INTERNAL_OPTIONS */\n"
  },
  {
    "path": "jpegint.h",
    "content": "/*\n * jpegint.h\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 1997-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file provides common declarations for the various JPEG modules.\n * These declarations are considered internal to the JPEG library; most\n * applications using the library shouldn't need to include this file.\n */\n\n\n/* Declarations for both compression & decompression */\n\ntypedef enum {\t\t\t/* Operating modes for buffer controllers */\n\tJBUF_PASS_THRU,\t\t/* Plain stripwise operation */\n\t/* Remaining modes require a full-image buffer to have been created */\n\tJBUF_SAVE_SOURCE,\t/* Run source subobject only, save output */\n\tJBUF_CRANK_DEST,\t/* Run dest subobject only, using saved data */\n\tJBUF_SAVE_AND_PASS\t/* Run both subobjects, save output */\n} J_BUF_MODE;\n\n/* Values of global_state field (jdapi.c has some dependencies on ordering!) */\n#define CSTATE_START\t100\t/* after create_compress */\n#define CSTATE_SCANNING\t101\t/* start_compress done, write_scanlines OK */\n#define CSTATE_RAW_OK\t102\t/* start_compress done, write_raw_data OK */\n#define CSTATE_WRCOEFS\t103\t/* jpeg_write_coefficients done */\n#define DSTATE_START\t200\t/* after create_decompress */\n#define DSTATE_INHEADER\t201\t/* reading header markers, no SOS yet */\n#define DSTATE_READY\t202\t/* found SOS, ready for start_decompress */\n#define DSTATE_PRELOAD\t203\t/* reading multiscan file in start_decompress*/\n#define DSTATE_PRESCAN\t204\t/* performing dummy pass for 2-pass quant */\n#define DSTATE_SCANNING\t205\t/* start_decompress done, read_scanlines OK */\n#define DSTATE_RAW_OK\t206\t/* start_decompress done, read_raw_data OK */\n#define DSTATE_BUFIMAGE\t207\t/* expecting jpeg_start_output */\n#define DSTATE_BUFPOST\t208\t/* looking for SOS/EOI in jpeg_finish_output */\n#define DSTATE_RDCOEFS\t209\t/* reading file in jpeg_read_coefficients */\n#define DSTATE_STOPPING\t210\t/* looking for EOI in jpeg_finish_decompress */\n\n\n/* Declarations for compression modules */\n\n/* Master control module */\nstruct jpeg_comp_master {\n  JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo));\n  JMETHOD(void, pass_startup, (j_compress_ptr cinfo));\n  JMETHOD(void, finish_pass, (j_compress_ptr cinfo));\n\n  /* State variables made visible to other modules */\n  boolean call_pass_startup;\t/* True if pass_startup must be called */\n  boolean is_last_pass;\t\t/* True during last pass */\n};\n\n/* Main buffer control (downsampled-data buffer) */\nstruct jpeg_c_main_controller {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));\n  JMETHOD(void, process_data, (j_compress_ptr cinfo,\n\t\t\t       JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n\t\t\t       JDIMENSION in_rows_avail));\n};\n\n/* Compression preprocessing (downsampling input buffer control) */\nstruct jpeg_c_prep_controller {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));\n  JMETHOD(void, pre_process_data, (j_compress_ptr cinfo,\n\t\t\t\t   JSAMPARRAY input_buf,\n\t\t\t\t   JDIMENSION *in_row_ctr,\n\t\t\t\t   JDIMENSION in_rows_avail,\n\t\t\t\t   JSAMPIMAGE output_buf,\n\t\t\t\t   JDIMENSION *out_row_group_ctr,\n\t\t\t\t   JDIMENSION out_row_groups_avail));\n};\n\n/* Coefficient buffer control */\nstruct jpeg_c_coef_controller {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));\n  JMETHOD(boolean, compress_data, (j_compress_ptr cinfo,\n\t\t\t\t   JSAMPIMAGE input_buf));\n};\n\n/* Colorspace conversion */\nstruct jpeg_color_converter {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo));\n  JMETHOD(void, color_convert, (j_compress_ptr cinfo,\n\t\t\t\tJSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t\t\t\tJDIMENSION output_row, int num_rows));\n};\n\n/* Downsampling */\nstruct jpeg_downsampler {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo));\n  JMETHOD(void, downsample, (j_compress_ptr cinfo,\n\t\t\t     JSAMPIMAGE input_buf, JDIMENSION in_row_index,\n\t\t\t     JSAMPIMAGE output_buf,\n\t\t\t     JDIMENSION out_row_group_index));\n\n  boolean need_context_rows;\t/* TRUE if need rows above & below */\n};\n\n/* Forward DCT (also controls coefficient quantization) */\ntypedef JMETHOD(void, forward_DCT_ptr,\n\t\t(j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JSAMPARRAY sample_data, JBLOCKROW coef_blocks,\n\t\t JDIMENSION start_row, JDIMENSION start_col,\n\t\t JDIMENSION num_blocks));\n\nstruct jpeg_forward_dct {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo));\n  /* It is useful to allow each component to have a separate FDCT method. */\n  forward_DCT_ptr forward_DCT[MAX_COMPONENTS];\n};\n\n/* Entropy encoding */\nstruct jpeg_entropy_encoder {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));\n  JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));\n  JMETHOD(void, finish_pass, (j_compress_ptr cinfo));\n};\n\n/* Marker writing */\nstruct jpeg_marker_writer {\n  JMETHOD(void, write_file_header, (j_compress_ptr cinfo));\n  JMETHOD(void, write_frame_header, (j_compress_ptr cinfo));\n  JMETHOD(void, write_scan_header, (j_compress_ptr cinfo));\n  JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo));\n  JMETHOD(void, write_tables_only, (j_compress_ptr cinfo));\n  /* These routines are exported to allow insertion of extra markers */\n  /* Probably only COM and APPn markers should be written this way */\n  JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker,\n\t\t\t\t      unsigned int datalen));\n  JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val));\n};\n\n\n/* Declarations for decompression modules */\n\n/* Master control module */\nstruct jpeg_decomp_master {\n  JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo));\n  JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));\n\n  /* State variables made visible to other modules */\n  boolean is_dummy_pass;\t/* True during 1st pass for 2-pass quant */\n};\n\n/* Input control module */\nstruct jpeg_input_controller {\n  JMETHOD(int, consume_input, (j_decompress_ptr cinfo));\n  JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo));\n  JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));\n  JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo));\n\n  /* State variables made visible to other modules */\n  boolean has_multiple_scans;\t/* True if file has multiple scans */\n  boolean eoi_reached;\t\t/* True when EOI has been consumed */\n};\n\n/* Main buffer control (downsampled-data buffer) */\nstruct jpeg_d_main_controller {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));\n  JMETHOD(void, process_data, (j_decompress_ptr cinfo,\n\t\t\t       JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t\t       JDIMENSION out_rows_avail));\n};\n\n/* Coefficient buffer control */\nstruct jpeg_d_coef_controller {\n  JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));\n  JMETHOD(int, consume_data, (j_decompress_ptr cinfo));\n  JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo));\n  JMETHOD(int, decompress_data, (j_decompress_ptr cinfo,\n\t\t\t\t JSAMPIMAGE output_buf));\n  /* Pointer to array of coefficient virtual arrays, or NULL if none */\n  jvirt_barray_ptr *coef_arrays;\n};\n\n/* Decompression postprocessing (color quantization buffer control) */\nstruct jpeg_d_post_controller {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));\n  JMETHOD(void, post_process_data, (j_decompress_ptr cinfo,\n\t\t\t\t    JSAMPIMAGE input_buf,\n\t\t\t\t    JDIMENSION *in_row_group_ctr,\n\t\t\t\t    JDIMENSION in_row_groups_avail,\n\t\t\t\t    JSAMPARRAY output_buf,\n\t\t\t\t    JDIMENSION *out_row_ctr,\n\t\t\t\t    JDIMENSION out_rows_avail));\n};\n\n/* Marker reading & parsing */\nstruct jpeg_marker_reader {\n  JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo));\n  /* Read markers until SOS or EOI.\n   * Returns same codes as are defined for jpeg_consume_input:\n   * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.\n   */\n  JMETHOD(int, read_markers, (j_decompress_ptr cinfo));\n  /* Read a restart marker --- exported for use by entropy decoder only */\n  jpeg_marker_parser_method read_restart_marker;\n\n  /* State of marker reader --- nominally internal, but applications\n   * supplying COM or APPn handlers might like to know the state.\n   */\n  boolean saw_SOI;\t\t/* found SOI? */\n  boolean saw_SOF;\t\t/* found SOF? */\n  int next_restart_num;\t\t/* next restart number expected (0-7) */\n  unsigned int discarded_bytes;\t/* # of bytes skipped looking for a marker */\n};\n\n/* Entropy decoding */\nstruct jpeg_entropy_decoder {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));\n  JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, JBLOCKROW *MCU_data));\n  JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));\n};\n\n/* Inverse DCT (also performs dequantization) */\ntypedef JMETHOD(void, inverse_DCT_method_ptr,\n\t\t(j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col));\n\nstruct jpeg_inverse_dct {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));\n  /* It is useful to allow each component to have a separate IDCT method. */\n  inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];\n};\n\n/* Upsampling (note that upsampler must also call color converter) */\nstruct jpeg_upsampler {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));\n  JMETHOD(void, upsample, (j_decompress_ptr cinfo,\n\t\t\t   JSAMPIMAGE input_buf,\n\t\t\t   JDIMENSION *in_row_group_ctr,\n\t\t\t   JDIMENSION in_row_groups_avail,\n\t\t\t   JSAMPARRAY output_buf,\n\t\t\t   JDIMENSION *out_row_ctr,\n\t\t\t   JDIMENSION out_rows_avail));\n\n  boolean need_context_rows;\t/* TRUE if need rows above & below */\n};\n\n/* Colorspace conversion */\nstruct jpeg_color_deconverter {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));\n  JMETHOD(void, color_convert, (j_decompress_ptr cinfo,\n\t\t\t\tJSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t\t\tJSAMPARRAY output_buf, int num_rows));\n};\n\n/* Color quantization or color precision reduction */\nstruct jpeg_color_quantizer {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan));\n  JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,\n\t\t\t\t JSAMPARRAY input_buf, JSAMPARRAY output_buf,\n\t\t\t\t int num_rows));\n  JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));\n  JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));\n};\n\n\n/* Miscellaneous useful macros */\n\n#undef MAX\n#define MAX(a,b)\t((a) > (b) ? (a) : (b))\n#undef MIN\n#define MIN(a,b)\t((a) < (b) ? (a) : (b))\n\n\n/* We assume that right shift corresponds to signed division by 2 with\n * rounding towards minus infinity.  This is correct for typical \"arithmetic\n * shift\" instructions that shift in copies of the sign bit.  But some\n * C compilers implement >> with an unsigned shift.  For these machines you\n * must define RIGHT_SHIFT_IS_UNSIGNED.\n * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.\n * It is only applied with constant shift counts.  SHIFT_TEMPS must be\n * included in the variables of any routine using RIGHT_SHIFT.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define SHIFT_TEMPS\tINT32 shift_temp;\n#define RIGHT_SHIFT(x,shft)  \\\n\t((shift_temp = (x)) < 0 ? \\\n\t (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \\\n\t (shift_temp >> (shft)))\n#else\n#define SHIFT_TEMPS\n#define RIGHT_SHIFT(x,shft)\t((x) >> (shft))\n#endif\n\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jinit_compress_master\tjICompress\n#define jinit_c_master_control\tjICMaster\n#define jinit_c_main_controller\tjICMainC\n#define jinit_c_prep_controller\tjICPrepC\n#define jinit_c_coef_controller\tjICCoefC\n#define jinit_color_converter\tjICColor\n#define jinit_downsampler\tjIDownsampler\n#define jinit_forward_dct\tjIFDCT\n#define jinit_huff_encoder\tjIHEncoder\n#define jinit_arith_encoder\tjIAEncoder\n#define jinit_marker_writer\tjIMWriter\n#define jinit_master_decompress\tjIDMaster\n#define jinit_d_main_controller\tjIDMainC\n#define jinit_d_coef_controller\tjIDCoefC\n#define jinit_d_post_controller\tjIDPostC\n#define jinit_input_controller\tjIInCtlr\n#define jinit_marker_reader\tjIMReader\n#define jinit_huff_decoder\tjIHDecoder\n#define jinit_arith_decoder\tjIADecoder\n#define jinit_inverse_dct\tjIIDCT\n#define jinit_upsampler\t\tjIUpsampler\n#define jinit_color_deconverter\tjIDColor\n#define jinit_1pass_quantizer\tjI1Quant\n#define jinit_2pass_quantizer\tjI2Quant\n#define jinit_merged_upsampler\tjIMUpsampler\n#define jinit_memory_mgr\tjIMemMgr\n#define jdiv_round_up\t\tjDivRound\n#define jround_up\t\tjRound\n#define jzero_far\t\tjZeroFar\n#define jcopy_sample_rows\tjCopySamples\n#define jcopy_block_row\t\tjCopyBlocks\n#define jpeg_zigzag_order\tjZIGTable\n#define jpeg_natural_order\tjZAGTable\n#define jpeg_natural_order7\tjZAG7Table\n#define jpeg_natural_order6\tjZAG6Table\n#define jpeg_natural_order5\tjZAG5Table\n#define jpeg_natural_order4\tjZAG4Table\n#define jpeg_natural_order3\tjZAG3Table\n#define jpeg_natural_order2\tjZAG2Table\n#define jpeg_aritab\t\tjAriTab\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays\n * and coefficient-block arrays.  This won't work on 80x86 because the arrays\n * are FAR and we're assuming a small-pointer memory model.  However, some\n * DOS compilers provide far-pointer versions of memcpy() and memset() even\n * in the small-model libraries.  These will be used if USE_FMEM is defined.\n * Otherwise, the routines in jutils.c do it the hard way.\n */\n\n#ifndef NEED_FAR_POINTERS\t/* normal case, same as regular macro */\n#define FMEMZERO(target,size)\tMEMZERO(target,size)\n#else\t\t\t\t/* 80x86 case */\n#ifdef USE_FMEM\n#define FMEMZERO(target,size)\t_fmemset((void FAR *)(target), 0, (size_t)(size))\n#else\nEXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));\n#define FMEMZERO(target,size)\tjzero_far(target, size)\n#endif\n#endif\n\n\n/* Compression module initialization routines */\nEXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,\n\t\t\t\t\t boolean transcode_only));\nEXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  boolean need_full_buffer));\nEXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  boolean need_full_buffer));\nEXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  boolean need_full_buffer));\nEXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));\n/* Decompression module initialization routines */\nEXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t  boolean need_full_buffer));\nEXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t  boolean need_full_buffer));\nEXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t  boolean need_full_buffer));\nEXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo));\n/* Memory manager initialization */\nEXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));\n\n/* Utility routines in jutils.c */\nEXTERN(long) jdiv_round_up JPP((long a, long b));\nEXTERN(long) jround_up JPP((long a, long b));\nEXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,\n\t\t\t\t    JSAMPARRAY output_array, int dest_row,\n\t\t\t\t    int num_rows, JDIMENSION num_cols));\nEXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,\n\t\t\t\t  JDIMENSION num_blocks));\n/* Constant tables in jutils.c */\n#if 0\t\t\t\t/* This table is not actually needed in v6a */\nextern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */\n#endif\nextern const int jpeg_natural_order[]; /* zigzag coef order to natural order */\nextern const int jpeg_natural_order7[]; /* zz to natural order for 7x7 block */\nextern const int jpeg_natural_order6[]; /* zz to natural order for 6x6 block */\nextern const int jpeg_natural_order5[]; /* zz to natural order for 5x5 block */\nextern const int jpeg_natural_order4[]; /* zz to natural order for 4x4 block */\nextern const int jpeg_natural_order3[]; /* zz to natural order for 3x3 block */\nextern const int jpeg_natural_order2[]; /* zz to natural order for 2x2 block */\n\n/* Arithmetic coding probability estimation tables in jaricom.c */\nextern const INT32 jpeg_aritab[];\n\n/* Suppress undefined-structure complaints if necessary. */\n\n#ifdef INCOMPLETE_TYPES_BROKEN\n#ifndef AM_MEMORY_MANAGER\t/* only jmemmgr.c defines these */\nstruct jvirt_sarray_control { long dummy; };\nstruct jvirt_barray_control { long dummy; };\n#endif\n#endif /* INCOMPLETE_TYPES_BROKEN */\n"
  },
  {
    "path": "jpeglib.h",
    "content": "/*\n * jpeglib.h\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2002-2013 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file defines the application interface for the JPEG library.\n * Most applications using the library need only include this file,\n * and perhaps jerror.h if they want to know the exact error codes.\n */\n\n#ifndef JPEGLIB_H\n#define JPEGLIB_H\n\n/*\n * First we include the configuration files that record how this\n * installation of the JPEG library is set up.  jconfig.h can be\n * generated automatically for many systems.  jmorecfg.h contains\n * manual configuration options that most people need not worry about.\n */\n\n#ifndef JCONFIG_INCLUDED\t/* in case jinclude.h already did */\n#include \"jconfig.h\"\t\t/* widely used configuration options */\n#endif\n#include \"jmorecfg.h\"\t\t/* seldom changed options */\n\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\nextern \"C\" {\n#endif\n#endif\n\n/* Version IDs for the JPEG library.\n * Might be useful for tests like \"#if JPEG_LIB_VERSION >= 90\".\n */\n\n#define JPEG_LIB_VERSION        90\t/* Compatibility version 9.0 */\n#define JPEG_LIB_VERSION_MAJOR  9\n#define JPEG_LIB_VERSION_MINOR  1\n\n\n/* Various constants determining the sizes of things.\n * All of these are specified by the JPEG standard,\n * so don't change them if you want to be compatible.\n */\n\n#define DCTSIZE\t\t    8\t/* The basic DCT block is 8x8 coefficients */\n#define DCTSIZE2\t    64\t/* DCTSIZE squared; # of elements in a block */\n#define NUM_QUANT_TBLS      4\t/* Quantization tables are numbered 0..3 */\n#define NUM_HUFF_TBLS       4\t/* Huffman tables are numbered 0..3 */\n#define NUM_ARITH_TBLS      16\t/* Arith-coding tables are numbered 0..15 */\n#define MAX_COMPS_IN_SCAN   4\t/* JPEG limit on # of components in one scan */\n#define MAX_SAMP_FACTOR     4\t/* JPEG limit on sampling factors */\n/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;\n * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.\n * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU\n * to handle it.  We even let you do this from the jconfig.h file.  However,\n * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe\n * sometimes emits noncompliant files doesn't mean you should too.\n */\n#define C_MAX_BLOCKS_IN_MCU   10 /* compressor's limit on blocks per MCU */\n#ifndef D_MAX_BLOCKS_IN_MCU\n#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */\n#endif\n\n\n/* Data structures for images (arrays of samples and of DCT coefficients).\n * On 80x86 machines, the image arrays are too big for near pointers,\n * but the pointer arrays can fit in near memory.\n */\n\ntypedef JSAMPLE FAR *JSAMPROW;\t/* ptr to one image row of pixel samples. */\ntypedef JSAMPROW *JSAMPARRAY;\t/* ptr to some rows (a 2-D sample array) */\ntypedef JSAMPARRAY *JSAMPIMAGE;\t/* a 3-D sample array: top index is color */\n\ntypedef JCOEF JBLOCK[DCTSIZE2];\t/* one block of coefficients */\ntypedef JBLOCK FAR *JBLOCKROW;\t/* pointer to one row of coefficient blocks */\ntypedef JBLOCKROW *JBLOCKARRAY;\t\t/* a 2-D array of coefficient blocks */\ntypedef JBLOCKARRAY *JBLOCKIMAGE;\t/* a 3-D array of coefficient blocks */\n\ntypedef JCOEF FAR *JCOEFPTR;\t/* useful in a couple of places */\n\n\n/* Types for JPEG compression parameters and working tables. */\n\n\n/* DCT coefficient quantization tables. */\n\ntypedef struct {\n  /* This array gives the coefficient quantizers in natural array order\n   * (not the zigzag order in which they are stored in a JPEG DQT marker).\n   * CAUTION: IJG versions prior to v6a kept this array in zigzag order.\n   */\n  UINT16 quantval[DCTSIZE2];\t/* quantization step for each coefficient */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JQUANT_TBL;\n\n\n/* Huffman coding tables. */\n\ntypedef struct {\n  /* These two fields directly represent the contents of a JPEG DHT marker */\n  UINT8 bits[17];\t\t/* bits[k] = # of symbols with codes of */\n\t\t\t\t/* length k bits; bits[0] is unused */\n  UINT8 huffval[256];\t\t/* The symbols, in order of incr code length */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JHUFF_TBL;\n\n\n/* Basic info about one component (color channel). */\n\ntypedef struct {\n  /* These values are fixed over the whole image. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOF marker. */\n  int component_id;\t\t/* identifier for this component (0..255) */\n  int component_index;\t\t/* its index in SOF or cinfo->comp_info[] */\n  int h_samp_factor;\t\t/* horizontal sampling factor (1..4) */\n  int v_samp_factor;\t\t/* vertical sampling factor (1..4) */\n  int quant_tbl_no;\t\t/* quantization table selector (0..3) */\n  /* These values may vary between scans. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOS marker. */\n  /* The decompressor output side may not use these variables. */\n  int dc_tbl_no;\t\t/* DC entropy table selector (0..3) */\n  int ac_tbl_no;\t\t/* AC entropy table selector (0..3) */\n  \n  /* Remaining fields should be treated as private by applications. */\n  \n  /* These values are computed during compression or decompression startup: */\n  /* Component's size in DCT blocks.\n   * Any dummy blocks added to complete an MCU are not counted; therefore\n   * these values do not depend on whether a scan is interleaved or not.\n   */\n  JDIMENSION width_in_blocks;\n  JDIMENSION height_in_blocks;\n  /* Size of a DCT block in samples,\n   * reflecting any scaling we choose to apply during the DCT step.\n   * Values from 1 to 16 are supported.\n   * Note that different components may receive different DCT scalings.\n   */\n  int DCT_h_scaled_size;\n  int DCT_v_scaled_size;\n  /* The downsampled dimensions are the component's actual, unpadded number\n   * of samples at the main buffer (preprocessing/compression interface);\n   * DCT scaling is included, so\n   * downsampled_width =\n   *   ceil(image_width * Hi/Hmax * DCT_h_scaled_size/block_size)\n   * and similarly for height.\n   */\n  JDIMENSION downsampled_width;\t /* actual width in samples */\n  JDIMENSION downsampled_height; /* actual height in samples */\n  /* For decompression, in cases where some of the components will be\n   * ignored (eg grayscale output from YCbCr image), we can skip most\n   * computations for the unused components.\n   * For compression, some of the components will need further quantization\n   * scale by factor of 2 after DCT (eg BG_YCC output from normal RGB input).\n   * The field is first set TRUE for decompression, FALSE for compression\n   * in initial_setup, and then adapted in color conversion setup.\n   */\n  boolean component_needed;\n\n  /* These values are computed before starting a scan of the component. */\n  /* The decompressor output side may not use these variables. */\n  int MCU_width;\t\t/* number of blocks per MCU, horizontally */\n  int MCU_height;\t\t/* number of blocks per MCU, vertically */\n  int MCU_blocks;\t\t/* MCU_width * MCU_height */\n  int MCU_sample_width;\t/* MCU width in samples: MCU_width * DCT_h_scaled_size */\n  int last_col_width;\t\t/* # of non-dummy blocks across in last MCU */\n  int last_row_height;\t\t/* # of non-dummy blocks down in last MCU */\n\n  /* Saved quantization table for component; NULL if none yet saved.\n   * See jdinput.c comments about the need for this information.\n   * This field is currently used only for decompression.\n   */\n  JQUANT_TBL * quant_table;\n\n  /* Private per-component storage for DCT or IDCT subsystem. */\n  void * dct_table;\n} jpeg_component_info;\n\n\n/* The script for encoding a multiple-scan file is an array of these: */\n\ntypedef struct {\n  int comps_in_scan;\t\t/* number of components encoded in this scan */\n  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */\n  int Ss, Se;\t\t\t/* progressive JPEG spectral selection parms */\n  int Ah, Al;\t\t\t/* progressive JPEG successive approx. parms */\n} jpeg_scan_info;\n\n/* The decompressor can save APPn and COM markers in a list of these: */\n\ntypedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;\n\nstruct jpeg_marker_struct {\n  jpeg_saved_marker_ptr next;\t/* next in list, or NULL */\n  UINT8 marker;\t\t\t/* marker code: JPEG_COM, or JPEG_APP0+n */\n  unsigned int original_length;\t/* # bytes of data in the file */\n  unsigned int data_length;\t/* # bytes of data saved at data[] */\n  JOCTET FAR * data;\t\t/* the data contained in the marker */\n  /* the marker length word is not counted in data_length or original_length */\n};\n\n/* Known color spaces. */\n\ntypedef enum {\n\tJCS_UNKNOWN,\t\t/* error/unspecified */\n\tJCS_GRAYSCALE,\t\t/* monochrome */\n\tJCS_RGB,\t\t/* red/green/blue, standard RGB (sRGB) */\n\tJCS_YCbCr,\t\t/* Y/Cb/Cr (also known as YUV), standard YCC */\n\tJCS_CMYK,\t\t/* C/M/Y/K */\n\tJCS_YCCK,\t\t/* Y/Cb/Cr/K */\n\tJCS_BG_RGB,\t\t/* big gamut red/green/blue, bg-sRGB */\n\tJCS_BG_YCC\t\t/* big gamut Y/Cb/Cr, bg-sYCC */\n} J_COLOR_SPACE;\n\n/* Supported color transforms. */\n\ntypedef enum {\n\tJCT_NONE           = 0,\n\tJCT_SUBTRACT_GREEN = 1\n} J_COLOR_TRANSFORM;\n\n/* DCT/IDCT algorithm options. */\n\ntypedef enum {\n\tJDCT_ISLOW,\t\t/* slow but accurate integer algorithm */\n\tJDCT_IFAST,\t\t/* faster, less accurate integer method */\n\tJDCT_FLOAT\t\t/* floating-point: accurate, fast on fast HW */\n} J_DCT_METHOD;\n\n#ifndef JDCT_DEFAULT\t\t/* may be overridden in jconfig.h */\n#define JDCT_DEFAULT  JDCT_ISLOW\n#endif\n#ifndef JDCT_FASTEST\t\t/* may be overridden in jconfig.h */\n#define JDCT_FASTEST  JDCT_IFAST\n#endif\n\n/* Dithering options for decompression. */\n\ntypedef enum {\n\tJDITHER_NONE,\t\t/* no dithering */\n\tJDITHER_ORDERED,\t/* simple ordered dither */\n\tJDITHER_FS\t\t/* Floyd-Steinberg error diffusion dither */\n} J_DITHER_MODE;\n\n\n/* Common fields between JPEG compression and decompression master structs. */\n\n#define jpeg_common_fields \\\n  struct jpeg_error_mgr * err;\t/* Error handler module */\\\n  struct jpeg_memory_mgr * mem;\t/* Memory manager module */\\\n  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\\\n  void * client_data;\t\t/* Available for use by application */\\\n  boolean is_decompressor;\t/* So common code can tell which is which */\\\n  int global_state\t\t/* For checking call sequence validity */\n\n/* Routines that are to be used by both halves of the library are declared\n * to receive a pointer to this structure.  There are no actual instances of\n * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.\n */\nstruct jpeg_common_struct {\n  jpeg_common_fields;\t\t/* Fields common to both master struct types */\n  /* Additional fields follow in an actual jpeg_compress_struct or\n   * jpeg_decompress_struct.  All three structs must agree on these\n   * initial fields!  (This would be a lot cleaner in C++.)\n   */\n};\n\ntypedef struct jpeg_common_struct * j_common_ptr;\ntypedef struct jpeg_compress_struct * j_compress_ptr;\ntypedef struct jpeg_decompress_struct * j_decompress_ptr;\n\n\n/* Master record for a compression instance */\n\nstruct jpeg_compress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_decompress_struct */\n\n  /* Destination for compressed data */\n  struct jpeg_destination_mgr * dest;\n\n  /* Description of source image --- these fields must be filled in by\n   * outer application before starting compression.  in_color_space must\n   * be correct before you can even call jpeg_set_defaults().\n   */\n\n  JDIMENSION image_width;\t/* input image width */\n  JDIMENSION image_height;\t/* input image height */\n  int input_components;\t\t/* # of color components in input image */\n  J_COLOR_SPACE in_color_space;\t/* colorspace of input image */\n\n  double input_gamma;\t\t/* image gamma of input image */\n\n  /* Compression parameters --- these fields must be set before calling\n   * jpeg_start_compress().  We recommend calling jpeg_set_defaults() to\n   * initialize everything to reasonable defaults, then changing anything\n   * the application specifically wants to change.  That way you won't get\n   * burnt when new parameters are added.  Also note that there are several\n   * helper routines to simplify changing parameters.\n   */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  JDIMENSION jpeg_width;\t/* scaled JPEG image width */\n  JDIMENSION jpeg_height;\t/* scaled JPEG image height */\n  /* Dimensions of actual JPEG image that will be written to file,\n   * derived from input dimensions by scaling factors above.\n   * These fields are computed by jpeg_start_compress().\n   * You can also use jpeg_calc_jpeg_dimensions() to determine these values\n   * in advance of calling jpeg_start_compress().\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  int q_scale_factor[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined,\n   * and corresponding scale factors (percentage, initialized 100).\n   */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  int num_scans;\t\t/* # of entries in scan_info array */\n  const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */\n  /* The default value of scan_info is NULL, which causes a single-scan\n   * sequential JPEG file to be emitted.  To create a multi-scan file,\n   * set num_scans and scan_info to point to an array of scan definitions.\n   */\n\n  boolean raw_data_in;\t\t/* TRUE=caller supplies downsampled data */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n  boolean optimize_coding;\t/* TRUE=optimize entropy encoding parms */\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n  boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */\n  int smoothing_factor;\t\t/* 1..100, or 0 for no input smoothing */\n  J_DCT_METHOD dct_method;\t/* DCT algorithm selector */\n\n  /* The restart interval can be specified in absolute MCUs by setting\n   * restart_interval, or in MCU rows by setting restart_in_rows\n   * (in which case the correct restart_interval will be figured\n   * for each scan).\n   */\n  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */\n  int restart_in_rows;\t\t/* if > 0, MCU rows per restart interval */\n\n  /* Parameters controlling emission of special markers. */\n\n  boolean write_JFIF_header;\t/* should a JFIF marker be written? */\n  UINT8 JFIF_major_version;\t/* What to write for the JFIF version number */\n  UINT8 JFIF_minor_version;\n  /* These three values are not used by the JPEG code, merely copied */\n  /* into the JFIF APP0 marker.  density_unit can be 0 for unknown, */\n  /* 1 for dots/inch, or 2 for dots/cm.  Note that the pixel aspect */\n  /* ratio is defined by X_density/Y_density even when density_unit=0. */\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean write_Adobe_marker;\t/* should an Adobe marker be written? */\n\n  J_COLOR_TRANSFORM color_transform;\n  /* Color transform identifier, writes LSE marker if nonzero */\n\n  /* State variable: index of next scanline to be written to\n   * jpeg_write_scanlines().  Application may use this to control its\n   * processing loop, e.g., \"while (next_scanline < image_height)\".\n   */\n\n  JDIMENSION next_scanline;\t/* 0 .. image_height-1  */\n\n  /* Remaining fields are known throughout compressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during compression startup\n   */\n  boolean progressive_mode;\t/* TRUE if scan script uses progressive mode */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows to be input to coef ctlr */\n  /* The coefficient controller receives data in units of MCU rows as defined\n   * for fully interleaved scans (whether the JPEG file is interleaved or not).\n   * There are v_samp_factor * DCTSIZE sample rows of each component in an\n   * \"iMCU\" (interleaved MCU) row.\n   */\n  \n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n  \n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n  \n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[C_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order;\t/* natural-order position array */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) */\n\n  /*\n   * Links to compression subobjects (methods and private variables of modules)\n   */\n  struct jpeg_comp_master * master;\n  struct jpeg_c_main_controller * main;\n  struct jpeg_c_prep_controller * prep;\n  struct jpeg_c_coef_controller * coef;\n  struct jpeg_marker_writer * marker;\n  struct jpeg_color_converter * cconvert;\n  struct jpeg_downsampler * downsample;\n  struct jpeg_forward_dct * fdct;\n  struct jpeg_entropy_encoder * entropy;\n  jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */\n  int script_space_size;\n};\n\n\n/* Master record for a decompression instance */\n\nstruct jpeg_decompress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_compress_struct */\n\n  /* Source of compressed data */\n  struct jpeg_source_mgr * src;\n\n  /* Basic description of image --- filled in by jpeg_read_header(). */\n  /* Application may inspect these values to decide how to process image. */\n\n  JDIMENSION image_width;\t/* nominal image width (from SOF marker) */\n  JDIMENSION image_height;\t/* nominal image height */\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  /* Decompression processing parameters --- these fields must be set before\n   * calling jpeg_start_decompress().  Note that jpeg_read_header() initializes\n   * them to default values.\n   */\n\n  J_COLOR_SPACE out_color_space; /* colorspace for output */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  double output_gamma;\t\t/* image gamma wanted in output */\n\n  boolean buffered_image;\t/* TRUE=multiple output passes */\n  boolean raw_data_out;\t\t/* TRUE=downsampled data wanted */\n\n  J_DCT_METHOD dct_method;\t/* IDCT algorithm selector */\n  boolean do_fancy_upsampling;\t/* TRUE=apply fancy upsampling */\n  boolean do_block_smoothing;\t/* TRUE=apply interblock smoothing */\n\n  boolean quantize_colors;\t/* TRUE=colormapped output wanted */\n  /* the following are ignored if not quantize_colors: */\n  J_DITHER_MODE dither_mode;\t/* type of color dithering to use */\n  boolean two_pass_quantize;\t/* TRUE=use two-pass color quantization */\n  int desired_number_of_colors;\t/* max # colors to use in created colormap */\n  /* these are significant only in buffered-image mode: */\n  boolean enable_1pass_quant;\t/* enable future use of 1-pass quantizer */\n  boolean enable_external_quant;/* enable future use of external colormap */\n  boolean enable_2pass_quant;\t/* enable future use of 2-pass quantizer */\n\n  /* Description of actual output image that will be returned to application.\n   * These fields are computed by jpeg_start_decompress().\n   * You can also use jpeg_calc_output_dimensions() to determine these values\n   * in advance of calling jpeg_start_decompress().\n   */\n\n  JDIMENSION output_width;\t/* scaled image width */\n  JDIMENSION output_height;\t/* scaled image height */\n  int out_color_components;\t/* # of color components in out_color_space */\n  int output_components;\t/* # of color components returned */\n  /* output_components is 1 (a colormap index) when quantizing colors;\n   * otherwise it equals out_color_components.\n   */\n  int rec_outbuf_height;\t/* min recommended height of scanline buffer */\n  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows\n   * high, space and time will be wasted due to unnecessary data copying.\n   * Usually rec_outbuf_height will be 1 or 2, at most 4.\n   */\n\n  /* When quantizing colors, the output colormap is described by these fields.\n   * The application can supply a colormap by setting colormap non-NULL before\n   * calling jpeg_start_decompress; otherwise a colormap is created during\n   * jpeg_start_decompress or jpeg_start_output.\n   * The map has out_color_components rows and actual_number_of_colors columns.\n   */\n  int actual_number_of_colors;\t/* number of entries in use */\n  JSAMPARRAY colormap;\t\t/* The color map as a 2-D pixel array */\n\n  /* State variables: these variables indicate the progress of decompression.\n   * The application may examine these but must not modify them.\n   */\n\n  /* Row index of next scanline to be read from jpeg_read_scanlines().\n   * Application may use this to control its processing loop, e.g.,\n   * \"while (output_scanline < output_height)\".\n   */\n  JDIMENSION output_scanline;\t/* 0 .. output_height-1  */\n\n  /* Current input scan number and number of iMCU rows completed in scan.\n   * These indicate the progress of the decompressor input side.\n   */\n  int input_scan_number;\t/* Number of SOS markers seen so far */\n  JDIMENSION input_iMCU_row;\t/* Number of iMCU rows completed */\n\n  /* The \"output scan number\" is the notional scan being displayed by the\n   * output side.  The decompressor will not allow output scan/row number\n   * to get ahead of input scan/row, but it can fall arbitrarily far behind.\n   */\n  int output_scan_number;\t/* Nominal scan number being displayed */\n  JDIMENSION output_iMCU_row;\t/* Number of iMCU rows read */\n\n  /* Current progression status.  coef_bits[c][i] indicates the precision\n   * with which component c's DCT coefficient i (in zigzag order) is known.\n   * It is -1 when no data has yet been received, otherwise it is the point\n   * transform (shift) value for the most recent scan of the coefficient\n   * (thus, 0 at completion of the progression).\n   * This pointer is NULL when reading a non-progressive file.\n   */\n  int (*coef_bits)[DCTSIZE2];\t/* -1 or current Al value for each coef */\n\n  /* Internal JPEG parameters --- the application usually need not look at\n   * these fields.  Note that the decompressor output side may not use\n   * any parameters that can change between scans.\n   */\n\n  /* Quantization and Huffman tables are carried forward across input\n   * datastreams when processing abbreviated JPEG datastreams.\n   */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  /* These parameters are never carried across datastreams, since they\n   * are given in SOF/SOS markers or defined to be reset by SOI.\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  boolean is_baseline;\t\t/* TRUE if Baseline SOF0 encountered */\n  boolean progressive_mode;\t/* TRUE if SOFn specifies progressive mode */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */\n\n  /* These fields record data obtained from optional markers recognized by\n   * the JPEG library.\n   */\n  boolean saw_JFIF_marker;\t/* TRUE iff a JFIF APP0 marker was found */\n  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */\n  UINT8 JFIF_major_version;\t/* JFIF version number */\n  UINT8 JFIF_minor_version;\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean saw_Adobe_marker;\t/* TRUE iff an Adobe APP14 marker was found */\n  UINT8 Adobe_transform;\t/* Color transform code from Adobe marker */\n\n  J_COLOR_TRANSFORM color_transform;\n  /* Color transform identifier derived from LSE marker, otherwise zero */\n\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n\n  /* Aside from the specific data retained from APPn markers known to the\n   * library, the uninterpreted contents of any or all APPn and COM markers\n   * can be saved in a list for examination by the application.\n   */\n  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */\n\n  /* Remaining fields are known throughout decompressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during decompression startup\n   */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows in image */\n  /* The coefficient controller's input and output progress is measured in\n   * units of \"iMCU\" (interleaved MCU) rows.  These are the same as MCU rows\n   * in fully interleaved JPEG scans, but are used whether the scan is\n   * interleaved or not.  We define an iMCU row as v_samp_factor DCT block\n   * rows of each component.  Therefore, the IDCT output contains\n   * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.\n   */\n\n  JSAMPLE * sample_range_limit; /* table for fast range-limiting */\n\n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   * Note that the decompressor output side must not use these fields.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n\n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n\n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[D_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n  /* These fields are derived from Se of first SOS marker.\n   */\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order; /* natural-order position array for entropy decode */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) for entropy decode */\n\n  /* This field is shared between entropy decoder and marker parser.\n   * It is either zero or the code of a JPEG marker that has been\n   * read from the data source, but has not yet been processed.\n   */\n  int unread_marker;\n\n  /*\n   * Links to decompression subobjects (methods, private variables of modules)\n   */\n  struct jpeg_decomp_master * master;\n  struct jpeg_d_main_controller * main;\n  struct jpeg_d_coef_controller * coef;\n  struct jpeg_d_post_controller * post;\n  struct jpeg_input_controller * inputctl;\n  struct jpeg_marker_reader * marker;\n  struct jpeg_entropy_decoder * entropy;\n  struct jpeg_inverse_dct * idct;\n  struct jpeg_upsampler * upsample;\n  struct jpeg_color_deconverter * cconvert;\n  struct jpeg_color_quantizer * cquantize;\n};\n\n\n/* \"Object\" declarations for JPEG modules that may be supplied or called\n * directly by the surrounding application.\n * As with all objects in the JPEG library, these structs only define the\n * publicly visible methods and state variables of a module.  Additional\n * private fields may exist after the public ones.\n */\n\n\n/* Error handler object */\n\nstruct jpeg_error_mgr {\n  /* Error exit handler: does not return to caller */\n  JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo));\n  /* Conditionally emit a trace or warning message */\n  JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));\n  /* Routine that actually outputs a trace or error message */\n  JMETHOD(void, output_message, (j_common_ptr cinfo));\n  /* Format a message string for the most recent JPEG error or message */\n  JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));\n#define JMSG_LENGTH_MAX  200\t/* recommended size of format_message buffer */\n  /* Reset error state variables at start of a new image */\n  JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));\n  \n  /* The message ID code and any parameters are saved here.\n   * A message can have one string parameter or up to 8 int parameters.\n   */\n  int msg_code;\n#define JMSG_STR_PARM_MAX  80\n  union {\n    int i[8];\n    char s[JMSG_STR_PARM_MAX];\n  } msg_parm;\n  \n  /* Standard state variables for error facility */\n  \n  int trace_level;\t\t/* max msg_level that will be displayed */\n  \n  /* For recoverable corrupt-data errors, we emit a warning message,\n   * but keep going unless emit_message chooses to abort.  emit_message\n   * should count warnings in num_warnings.  The surrounding application\n   * can check for bad data by seeing if num_warnings is nonzero at the\n   * end of processing.\n   */\n  long num_warnings;\t\t/* number of corrupt-data warnings */\n\n  /* These fields point to the table(s) of error message strings.\n   * An application can change the table pointer to switch to a different\n   * message list (typically, to change the language in which errors are\n   * reported).  Some applications may wish to add additional error codes\n   * that will be handled by the JPEG library error mechanism; the second\n   * table pointer is used for this purpose.\n   *\n   * First table includes all errors generated by JPEG library itself.\n   * Error code 0 is reserved for a \"no such error string\" message.\n   */\n  const char * const * jpeg_message_table; /* Library errors */\n  int last_jpeg_message;    /* Table contains strings 0..last_jpeg_message */\n  /* Second table can be added by application (see cjpeg/djpeg for example).\n   * It contains strings numbered first_addon_message..last_addon_message.\n   */\n  const char * const * addon_message_table; /* Non-library errors */\n  int first_addon_message;\t/* code for first string in addon table */\n  int last_addon_message;\t/* code for last string in addon table */\n};\n\n\n/* Progress monitor object */\n\nstruct jpeg_progress_mgr {\n  JMETHOD(void, progress_monitor, (j_common_ptr cinfo));\n\n  long pass_counter;\t\t/* work units completed in this pass */\n  long pass_limit;\t\t/* total number of work units in this pass */\n  int completed_passes;\t\t/* passes completed so far */\n  int total_passes;\t\t/* total number of passes expected */\n};\n\n\n/* Data destination object for compression */\n\nstruct jpeg_destination_mgr {\n  JOCTET * next_output_byte;\t/* => next byte to write in buffer */\n  size_t free_in_buffer;\t/* # of byte spaces remaining in buffer */\n\n  JMETHOD(void, init_destination, (j_compress_ptr cinfo));\n  JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));\n  JMETHOD(void, term_destination, (j_compress_ptr cinfo));\n};\n\n\n/* Data source object for decompression */\n\nstruct jpeg_source_mgr {\n  const JOCTET * next_input_byte; /* => next byte to read from buffer */\n  size_t bytes_in_buffer;\t/* # of bytes remaining in buffer */\n\n  JMETHOD(void, init_source, (j_decompress_ptr cinfo));\n  JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));\n  JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));\n  JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));\n  JMETHOD(void, term_source, (j_decompress_ptr cinfo));\n};\n\n\n/* Memory manager object.\n * Allocates \"small\" objects (a few K total), \"large\" objects (tens of K),\n * and \"really big\" objects (virtual arrays with backing store if needed).\n * The memory manager does not allow individual objects to be freed; rather,\n * each created object is assigned to a pool, and whole pools can be freed\n * at once.  This is faster and more convenient than remembering exactly what\n * to free, especially where malloc()/free() are not too speedy.\n * NB: alloc routines never return NULL.  They exit to error_exit if not\n * successful.\n */\n\n#define JPOOL_PERMANENT\t0\t/* lasts until master record is destroyed */\n#define JPOOL_IMAGE\t1\t/* lasts until done with image/datastream */\n#define JPOOL_NUMPOOLS\t2\n\ntypedef struct jvirt_sarray_control * jvirt_sarray_ptr;\ntypedef struct jvirt_barray_control * jvirt_barray_ptr;\n\n\nstruct jpeg_memory_mgr {\n  /* Method pointers */\n  JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,\n\t\t\t\tsize_t sizeofobject));\n  JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     size_t sizeofobject));\n  JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     JDIMENSION samplesperrow,\n\t\t\t\t     JDIMENSION numrows));\n  JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t      JDIMENSION blocksperrow,\n\t\t\t\t      JDIMENSION numrows));\n  JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION samplesperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION blocksperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));\n  JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t   jvirt_sarray_ptr ptr,\n\t\t\t\t\t   JDIMENSION start_row,\n\t\t\t\t\t   JDIMENSION num_rows,\n\t\t\t\t\t   boolean writable));\n  JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t    jvirt_barray_ptr ptr,\n\t\t\t\t\t    JDIMENSION start_row,\n\t\t\t\t\t    JDIMENSION num_rows,\n\t\t\t\t\t    boolean writable));\n  JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));\n  JMETHOD(void, self_destruct, (j_common_ptr cinfo));\n\n  /* Limit on memory allocation for this JPEG object.  (Note that this is\n   * merely advisory, not a guaranteed maximum; it only affects the space\n   * used for virtual-array buffers.)  May be changed by outer application\n   * after creating the JPEG object.\n   */\n  long max_memory_to_use;\n\n  /* Maximum allocation request accepted by alloc_large. */\n  long max_alloc_chunk;\n};\n\n\n/* Routine signature for application-supplied marker processing methods.\n * Need not pass marker code since it is stored in cinfo->unread_marker.\n */\ntypedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));\n\n\n/* Declarations for routines called by application.\n * The JPP macro hides prototype parameters from compilers that can't cope.\n * Note JPP requires double parentheses.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JPP(arglist)\targlist\n#else\n#define JPP(arglist)\t()\n#endif\n\n\n/* Short forms of external names for systems with brain-damaged linkers.\n * We shorten external names to be unique in the first six letters, which\n * is good enough for all known systems.\n * (If your compiler itself needs names to be unique in less than 15 \n * characters, you are out of luck.  Get a better compiler.)\n */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_std_error\t\tjStdError\n#define jpeg_CreateCompress\tjCreaCompress\n#define jpeg_CreateDecompress\tjCreaDecompress\n#define jpeg_destroy_compress\tjDestCompress\n#define jpeg_destroy_decompress\tjDestDecompress\n#define jpeg_stdio_dest\t\tjStdDest\n#define jpeg_stdio_src\t\tjStdSrc\n#define jpeg_mem_dest\t\tjMemDest\n#define jpeg_mem_src\t\tjMemSrc\n#define jpeg_set_defaults\tjSetDefaults\n#define jpeg_set_colorspace\tjSetColorspace\n#define jpeg_default_colorspace\tjDefColorspace\n#define jpeg_set_quality\tjSetQuality\n#define jpeg_set_linear_quality\tjSetLQuality\n#define jpeg_default_qtables\tjDefQTables\n#define jpeg_add_quant_table\tjAddQuantTable\n#define jpeg_quality_scaling\tjQualityScaling\n#define jpeg_simple_progression\tjSimProgress\n#define jpeg_suppress_tables\tjSuppressTables\n#define jpeg_alloc_quant_table\tjAlcQTable\n#define jpeg_alloc_huff_table\tjAlcHTable\n#define jpeg_start_compress\tjStrtCompress\n#define jpeg_write_scanlines\tjWrtScanlines\n#define jpeg_finish_compress\tjFinCompress\n#define jpeg_calc_jpeg_dimensions\tjCjpegDimensions\n#define jpeg_write_raw_data\tjWrtRawData\n#define jpeg_write_marker\tjWrtMarker\n#define jpeg_write_m_header\tjWrtMHeader\n#define jpeg_write_m_byte\tjWrtMByte\n#define jpeg_write_tables\tjWrtTables\n#define jpeg_read_header\tjReadHeader\n#define jpeg_start_decompress\tjStrtDecompress\n#define jpeg_read_scanlines\tjReadScanlines\n#define jpeg_finish_decompress\tjFinDecompress\n#define jpeg_read_raw_data\tjReadRawData\n#define jpeg_has_multiple_scans\tjHasMultScn\n#define jpeg_start_output\tjStrtOutput\n#define jpeg_finish_output\tjFinOutput\n#define jpeg_input_complete\tjInComplete\n#define jpeg_new_colormap\tjNewCMap\n#define jpeg_consume_input\tjConsumeInput\n#define jpeg_core_output_dimensions\tjCoreDimensions\n#define jpeg_calc_output_dimensions\tjCalcDimensions\n#define jpeg_save_markers\tjSaveMarkers\n#define jpeg_set_marker_processor\tjSetMarker\n#define jpeg_read_coefficients\tjReadCoefs\n#define jpeg_write_coefficients\tjWrtCoefs\n#define jpeg_copy_critical_parameters\tjCopyCrit\n#define jpeg_abort_compress\tjAbrtCompress\n#define jpeg_abort_decompress\tjAbrtDecompress\n#define jpeg_abort\t\tjAbort\n#define jpeg_destroy\t\tjDestroy\n#define jpeg_resync_to_restart\tjResyncRestart\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/* Default error-management setup */\nEXTERN(struct jpeg_error_mgr *) jpeg_std_error\n\tJPP((struct jpeg_error_mgr * err));\n\n/* Initialization of JPEG compression objects.\n * jpeg_create_compress() and jpeg_create_decompress() are the exported\n * names that applications should call.  These expand to calls on\n * jpeg_CreateCompress and jpeg_CreateDecompress with additional information\n * passed for version mismatch checking.\n * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.\n */\n#define jpeg_create_compress(cinfo) \\\n    jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t(size_t) sizeof(struct jpeg_compress_struct))\n#define jpeg_create_decompress(cinfo) \\\n    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t  (size_t) sizeof(struct jpeg_decompress_struct))\nEXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,\n\t\t\t\t      int version, size_t structsize));\nEXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,\n\t\t\t\t\tint version, size_t structsize));\n/* Destruction of JPEG compression objects */\nEXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));\n\n/* Standard data source and destination managers: stdio streams. */\n/* Caller is responsible for opening the file before and closing after. */\nEXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));\nEXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));\n\n/* Data source and destination managers: memory buffers. */\nEXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,\n\t\t\t       unsigned char ** outbuffer,\n\t\t\t       unsigned long * outsize));\nEXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,\n\t\t\t      unsigned char * inbuffer,\n\t\t\t      unsigned long insize));\n\n/* Default parameter setup for compression */\nEXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));\n/* Compression parameter setup aids */\nEXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,\n\t\t\t\t      J_COLOR_SPACE colorspace));\nEXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,\n\t\t\t\t   boolean force_baseline));\nEXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  int scale_factor,\n\t\t\t\t\t  boolean force_baseline));\nEXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean force_baseline));\nEXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,\n\t\t\t\t       const unsigned int *basic_table,\n\t\t\t\t       int scale_factor,\n\t\t\t\t       boolean force_baseline));\nEXTERN(int) jpeg_quality_scaling JPP((int quality));\nEXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean suppress));\nEXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));\nEXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));\n\n/* Main entry points for compression */\nEXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,\n\t\t\t\t      boolean write_all_tables));\nEXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,\n\t\t\t\t\t     JSAMPARRAY scanlines,\n\t\t\t\t\t     JDIMENSION num_lines));\nEXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));\n\n/* Precalculate JPEG dimensions for current compression parameters. */\nEXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo));\n\n/* Replaces jpeg_write_scanlines when writing raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,\n\t\t\t\t\t    JSAMPIMAGE data,\n\t\t\t\t\t    JDIMENSION num_lines));\n\n/* Write a special marker.  See libjpeg.txt concerning safe usage. */\nEXTERN(void) jpeg_write_marker\n\tJPP((j_compress_ptr cinfo, int marker,\n\t     const JOCTET * dataptr, unsigned int datalen));\n/* Same, but piecemeal. */\nEXTERN(void) jpeg_write_m_header\n\tJPP((j_compress_ptr cinfo, int marker, unsigned int datalen));\nEXTERN(void) jpeg_write_m_byte\n\tJPP((j_compress_ptr cinfo, int val));\n\n/* Alternate compression function: just write an abbreviated table file */\nEXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));\n\n/* Decompression startup: read start of JPEG datastream to see what's there */\nEXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,\n\t\t\t\t  boolean require_image));\n/* Return value is one of: */\n#define JPEG_SUSPENDED\t\t0 /* Suspended due to lack of input data */\n#define JPEG_HEADER_OK\t\t1 /* Found valid image datastream */\n#define JPEG_HEADER_TABLES_ONLY\t2 /* Found valid table-specs-only datastream */\n/* If you pass require_image = TRUE (normal case), you need not check for\n * a TABLES_ONLY return code; an abbreviated file will cause an error exit.\n * JPEG_SUSPENDED is only possible if you use a data source module that can\n * give a suspension return (the stdio source module doesn't).\n */\n\n/* Main entry points for decompression */\nEXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));\nEXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    JSAMPARRAY scanlines,\n\t\t\t\t\t    JDIMENSION max_lines));\nEXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));\n\n/* Replaces jpeg_read_scanlines when reading raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t   JSAMPIMAGE data,\n\t\t\t\t\t   JDIMENSION max_lines));\n\n/* Additional entry points for buffered-image mode. */\nEXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,\n\t\t\t\t       int scan_number));\nEXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));\nEXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));\n/* Return value is one of: */\n/* #define JPEG_SUSPENDED\t0    Suspended due to lack of input data */\n#define JPEG_REACHED_SOS\t1 /* Reached start of new scan */\n#define JPEG_REACHED_EOI\t2 /* Reached end of image */\n#define JPEG_ROW_COMPLETED\t3 /* Completed one iMCU row */\n#define JPEG_SCAN_COMPLETED\t4 /* Completed last iMCU row of a scan */\n\n/* Precalculate output dimensions for current decompression parameters. */\nEXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));\n\n/* Control saving of COM and APPn markers into marker_list. */\nEXTERN(void) jpeg_save_markers\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     unsigned int length_limit));\n\n/* Install a special processing method for COM or APPn markers. */\nEXTERN(void) jpeg_set_marker_processor\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     jpeg_marker_parser_method routine));\n\n/* Read or write raw DCT coefficients --- useful for lossless transcoding. */\nEXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  jvirt_barray_ptr * coef_arrays));\nEXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,\n\t\t\t\t\t\tj_compress_ptr dstinfo));\n\n/* If you choose to abort compression or decompression before completing\n * jpeg_finish_(de)compress, then you need to clean up to release memory,\n * temporary files, etc.  You can just call jpeg_destroy_(de)compress\n * if you're done with the JPEG object, but if you want to clean it up and\n * reuse it, call this:\n */\nEXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));\n\n/* Generic versions of jpeg_abort and jpeg_destroy that work on either\n * flavor of JPEG object.  These may be more convenient in some places.\n */\nEXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));\nEXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));\n\n/* Default restart-marker-resync procedure for use by data source modules */\nEXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    int desired));\n\n\n/* These marker codes are exported since applications and data source modules\n * are likely to want to use them.\n */\n\n#define JPEG_RST0\t0xD0\t/* RST0 marker code */\n#define JPEG_EOI\t0xD9\t/* EOI marker code */\n#define JPEG_APP0\t0xE0\t/* APP0 marker code */\n#define JPEG_COM\t0xFE\t/* COM marker code */\n\n\n/* If we have a brain-damaged compiler that emits warnings (or worse, errors)\n * for structure definitions that are never filled in, keep it quiet by\n * supplying dummy definitions for the various substructures.\n */\n\n#ifdef INCOMPLETE_TYPES_BROKEN\n#ifndef JPEG_INTERNALS\t\t/* will be defined in jpegint.h */\nstruct jvirt_sarray_control { long dummy; };\nstruct jvirt_barray_control { long dummy; };\nstruct jpeg_comp_master { long dummy; };\nstruct jpeg_c_main_controller { long dummy; };\nstruct jpeg_c_prep_controller { long dummy; };\nstruct jpeg_c_coef_controller { long dummy; };\nstruct jpeg_marker_writer { long dummy; };\nstruct jpeg_color_converter { long dummy; };\nstruct jpeg_downsampler { long dummy; };\nstruct jpeg_forward_dct { long dummy; };\nstruct jpeg_entropy_encoder { long dummy; };\nstruct jpeg_decomp_master { long dummy; };\nstruct jpeg_d_main_controller { long dummy; };\nstruct jpeg_d_coef_controller { long dummy; };\nstruct jpeg_d_post_controller { long dummy; };\nstruct jpeg_input_controller { long dummy; };\nstruct jpeg_marker_reader { long dummy; };\nstruct jpeg_entropy_decoder { long dummy; };\nstruct jpeg_inverse_dct { long dummy; };\nstruct jpeg_upsampler { long dummy; };\nstruct jpeg_color_deconverter { long dummy; };\nstruct jpeg_color_quantizer { long dummy; };\n#endif /* JPEG_INTERNALS */\n#endif /* INCOMPLETE_TYPES_BROKEN */\n\n\n/*\n * The JPEG library modules define JPEG_INTERNALS before including this file.\n * The internal structure declarations are read only when that is true.\n * Applications using the library should not include jpegint.h, but may wish\n * to include jerror.h.\n */\n\n#ifdef JPEG_INTERNALS\n#include \"jpegint.h\"\t\t/* fetch private declarations */\n#include \"jerror.h\"\t\t/* fetch error codes too */\n#endif\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\n}\n#endif\n#endif\n\n#endif /* JPEGLIB_H */\n"
  },
  {
    "path": "jpegtran.1",
    "content": ".TH JPEGTRAN 1 \"13 September 2013\"\n.SH NAME\njpegtran \\- lossless transformation of JPEG files\n.SH SYNOPSIS\n.B jpegtran\n[\n.I options\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B jpegtran\nperforms various useful transformations of JPEG files.\nIt can translate the coded representation from one variant of JPEG to another,\nfor example from baseline JPEG to progressive JPEG or vice versa.  It can also\nperform some rearrangements of the image data, for example turning an image\nfrom landscape to portrait format by rotation.\n.PP\n.B jpegtran\nworks by rearranging the compressed data (DCT coefficients), without\never fully decoding the image.  Therefore, its transformations are lossless:\nthere is no image degradation at all, which would not be true if you used\n.B djpeg\nfollowed by\n.B cjpeg\nto accomplish the same conversion.  But by the same token,\n.B jpegtran\ncannot perform lossy operations such as changing the image quality.\n.PP\n.B jpegtran\nreads the named JPEG/JFIF file, or the standard input if no file is\nnamed, and produces a JPEG/JFIF file on the standard output.\n.SH OPTIONS\nAll switch names may be abbreviated; for example,\n.B \\-optimize\nmay be written\n.B \\-opt\nor\n.BR \\-o .\nUpper and lower case are equivalent.\nBritish spellings are also accepted (e.g.,\n.BR \\-optimise ),\nthough for brevity these are not mentioned below.\n.PP\nTo specify the coded JPEG representation used in the output file,\n.B jpegtran\naccepts a subset of the switches recognized by\n.BR cjpeg :\n.TP\n.B \\-optimize\nPerform optimization of entropy encoding parameters.\n.TP\n.B \\-progressive\nCreate progressive JPEG file.\n.TP\n.BI \\-restart \" N\"\nEmit a JPEG restart marker every N MCU rows, or every N MCU blocks if \"B\" is\nattached to the number.\n.TP\n.B \\-arithmetic\nUse arithmetic coding.\n.TP\n.BI \\-scans \" file\"\nUse the scan script given in the specified text file.\n.PP\nSee\n.BR cjpeg (1)\nfor more details about these switches.\nIf you specify none of these switches, you get a plain baseline-JPEG output\nfile.  The quality setting and so forth are determined by the input file.\n.PP\nThe image can be losslessly transformed by giving one of these switches:\n.TP\n.B \\-flip horizontal\nMirror image horizontally (left-right).\n.TP\n.B \\-flip vertical\nMirror image vertically (top-bottom).\n.TP\n.B \\-rotate 90\nRotate image 90 degrees clockwise.\n.TP\n.B \\-rotate 180\nRotate image 180 degrees.\n.TP\n.B \\-rotate 270\nRotate image 270 degrees clockwise (or 90 ccw).\n.TP\n.B \\-transpose\nTranspose image (across UL-to-LR axis).\n.TP\n.B \\-transverse\nTransverse transpose (across UR-to-LL axis).\n.IP\nThe transpose transformation has no restrictions regarding image dimensions.\nThe other transformations operate rather oddly if the image dimensions are not\na multiple of the iMCU size (usually 8 or 16 pixels), because they can only\ntransform complete blocks of DCT coefficient data in the desired way.\n.IP\n.BR jpegtran 's\ndefault behavior when transforming an odd-size image is designed\nto preserve exact reversibility and mathematical consistency of the\ntransformation set.  As stated, transpose is able to flip the entire image\narea.  Horizontal mirroring leaves any partial iMCU column at the right edge\nuntouched, but is able to flip all rows of the image.  Similarly, vertical\nmirroring leaves any partial iMCU row at the bottom edge untouched, but is\nable to flip all columns.  The other transforms can be built up as sequences\nof transpose and flip operations; for consistency, their actions on edge\npixels are defined to be the same as the end result of the corresponding\ntranspose-and-flip sequence.\n.IP\nFor practical use, you may prefer to discard any untransformable edge pixels\nrather than having a strange-looking strip along the right and/or bottom edges\nof a transformed image.  To do this, add the\n.B \\-trim\nswitch:\n.TP\n.B \\-trim\nDrop non-transformable edge blocks.\n.IP\nObviously, a transformation with\n.B \\-trim\nis not reversible, so strictly speaking\n.B jpegtran\nwith this switch is not lossless.  Also, the expected mathematical\nequivalences between the transformations no longer hold.  For example,\n.B \\-rot 270 -trim\ntrims only the bottom edge, but\n.B \\-rot 90 -trim\nfollowed by\n.B \\-rot 180 -trim\ntrims both edges.\n.IP\nIf you are only interested in perfect transformation, add the\n.B \\-perfect\nswitch:\n.TP\n.B \\-perfect\nFails with an error if the transformation is not perfect.\n.IP\nFor example you may want to do\n.IP\n.B (jpegtran \\-rot 90 -perfect\n.I foo.jpg\n.B || djpeg\n.I foo.jpg\n.B | pnmflip \\-r90 | cjpeg)\n.IP\nto do a perfect rotation if available or an approximated one if not.\n.PP\nWe also offer a lossless-crop option, which discards data outside a given\nimage region but losslessly preserves what is inside.  Like the rotate and\nflip transforms, lossless crop is restricted by the current JPEG format: the\nupper left corner of the selected region must fall on an iMCU boundary.  If\nthis does not hold for the given crop parameters, we silently move the upper\nleft corner up and/or left to make it so, simultaneously increasing the\nregion dimensions to keep the lower right crop corner unchanged.  (Thus, the\noutput image covers at least the requested region, but may cover more.)\nThe adjustment of the region dimensions may be optionally disabled.\n\nThe image can be losslessly cropped by giving the switch:\n.TP\n.B \\-crop WxH+X+Y\nCrop to a rectangular subarea of width W, height H starting at point X,Y.\n.PP\nA complementary lossless-wipe option is provided to discard (gray out) data\ninside a given image region while losslessly preserving what is outside:\n.TP\n.B \\-wipe WxH+X+Y\nWipe (gray out) a rectangular subarea of width W, height H starting at point\nX,Y.\n.PP\nOther not-strictly-lossless transformation switches are:\n.TP\n.B \\-grayscale\nForce grayscale output.\n.IP\nThis option discards the chrominance channels if the input image is YCbCr\n(ie, a standard color JPEG), resulting in a grayscale JPEG file.  The\nluminance channel is preserved exactly, so this is a better method of reducing\nto grayscale than decompression, conversion, and recompression.  This switch\nis particularly handy for fixing a monochrome picture that was mistakenly\nencoded as a color JPEG.  (In such a case, the space savings from getting rid\nof the near-empty chroma channels won't be large; but the decoding time for\na grayscale JPEG is substantially less than that for a color JPEG.)\n.TP\n.BI \\-scale \" M/N\"\nScale the output image by a factor M/N.\n.IP\nCurrently supported scale factors are M/N with all M from 1 to 16, where N is\nthe source DCT size, which is 8 for baseline JPEG.  If the /N part is omitted,\nthen M specifies the DCT scaled size to be applied on the given input.  For\nbaseline JPEG this is equivalent to M/8 scaling, since the source DCT size\nfor baseline JPEG is 8.\n.B Caution:\nAn implementation of the JPEG SmartScale extension is required for this\nfeature.  SmartScale enabled JPEG is not yet widely implemented, so many\ndecoders will be unable to view a SmartScale extended JPEG file at all.\n.PP\n.B jpegtran\nalso recognizes these switches that control what to do with \"extra\" markers,\nsuch as comment blocks:\n.TP\n.B \\-copy none\nCopy no extra markers from source file.  This setting suppresses all\ncomments and other excess baggage present in the source file.\n.TP\n.B \\-copy comments\nCopy only comment markers.  This setting copies comments from the source file,\nbut discards any other inessential (for image display) data.\n.TP\n.B \\-copy all\nCopy all extra markers.  This setting preserves miscellaneous markers\nfound in the source file, such as JFIF thumbnails, Exif data, and Photoshop\nsettings.  In some files these extra markers can be sizable.\n.IP\nThe default behavior is\n.BR \"\\-copy comments\" .\n(Note: in IJG releases v6 and v6a,\n.B jpegtran\nalways did the equivalent of\n.BR \"\\-copy none\" .)\n.PP\nAdditional switches recognized by jpegtran are:\n.TP\n.BI \\-maxmemory \" N\"\nSet limit for amount of memory to use in processing large images.  Value is\nin thousands of bytes, or millions of bytes if \"M\" is attached to the\nnumber.  For example,\n.B \\-max 4m\nselects 4000000 bytes.  If more space is needed, temporary files will be used.\n.TP\n.BI \\-outfile \" name\"\nSend output image to the named file, not to standard output.\n.TP\n.B \\-verbose\nEnable debug printout.  More\n.BR \\-v 's\ngive more output.  Also, version information is printed at startup.\n.TP\n.B \\-debug\nSame as\n.BR \\-verbose .\n.SH EXAMPLES\n.LP\nThis example converts a baseline JPEG file to progressive form:\n.IP\n.B jpegtran \\-progressive\n.I foo.jpg\n.B >\n.I fooprog.jpg\n.PP\nThis example rotates an image 90 degrees clockwise, discarding any\nunrotatable edge pixels:\n.IP\n.B jpegtran \\-rot 90 -trim\n.I foo.jpg\n.B >\n.I foo90.jpg\n.SH ENVIRONMENT\n.TP\n.B JPEGMEM\nIf this environment variable is set, its value is the default memory limit.\nThe value is specified as described for the\n.B \\-maxmemory\nswitch.\n.B JPEGMEM\noverrides the default value specified when the program was compiled, and\nitself is overridden by an explicit\n.BR \\-maxmemory .\n.SH SEE ALSO\n.BR cjpeg (1),\n.BR djpeg (1),\n.BR rdjpgcom (1),\n.BR wrjpgcom (1)\n.br\nWallace, Gregory K.  \"The JPEG Still Picture Compression Standard\",\nCommunications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.\n.SH AUTHOR\nIndependent JPEG Group\n.SH BUGS\nThe transform options can't transform odd-size images perfectly.  Use\n.B \\-trim\nor\n.B \\-perfect\nif you don't like the results.\n.PP\nThe entire image is read into memory and then written out again, even in\ncases where this isn't really necessary.  Expect swapping on large images,\nespecially when using the more complex transform options.\n"
  },
  {
    "path": "jpegtran.c",
    "content": "/*\n * jpegtran.c\n *\n * Copyright (C) 1995-2013, Thomas G. Lane, Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a command-line user interface for JPEG transcoding.\n * It is very similar to cjpeg.c, and partly to djpeg.c, but provides\n * lossless transcoding between different JPEG file formats.  It also\n * provides some lossless and sort-of-lossless transformations of JPEG data.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n#include \"transupp.h\"\t\t/* Support routines for jpegtran */\n#include \"jversion.h\"\t\t/* for version message */\n\n#ifdef USE_CCOMMAND\t\t/* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>\t\t/* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>\t\t/* Think declares it here */\n#endif\n#endif\n\n\n/*\n * Argument-parsing code.\n * The switch parser is designed to be useful with DOS-style command line\n * syntax, ie, intermixed switches and file names, where only the switches\n * to the left of a given file name affect processing of that file.\n * The main program in this file doesn't actually use this capability...\n */\n\n\nstatic const char * progname;\t/* program name for error messages */\nstatic char * outfilename;\t/* for -outfile switch */\nstatic char * scaleoption;\t/* -scale switch */\nstatic JCOPY_OPTION copyoption;\t/* -copy switch */\nstatic jpeg_transform_info transformoption; /* image transformation options */\n\n\nLOCAL(void)\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"usage: %s [switches] \", progname);\n#ifdef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"inputfile outputfile\\n\");\n#else\n  fprintf(stderr, \"[inputfile]\\n\");\n#endif\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -copy none     Copy no extra markers from source file\\n\");\n  fprintf(stderr, \"  -copy comments Copy only comment markers (default)\\n\");\n  fprintf(stderr, \"  -copy all      Copy all extra markers\\n\");\n#ifdef ENTROPY_OPT_SUPPORTED\n  fprintf(stderr, \"  -optimize      Optimize Huffman table (smaller file, but slow compression)\\n\");\n#endif\n#ifdef C_PROGRESSIVE_SUPPORTED\n  fprintf(stderr, \"  -progressive   Create progressive JPEG file\\n\");\n#endif\n  fprintf(stderr, \"Switches for modifying the image:\\n\");\n#if TRANSFORMS_SUPPORTED\n  fprintf(stderr, \"  -crop WxH+X+Y  Crop to a rectangular subarea\\n\");\n  fprintf(stderr, \"  -flip [horizontal|vertical]  Mirror image (left-right or top-bottom)\\n\");\n  fprintf(stderr, \"  -grayscale     Reduce to grayscale (omit color data)\\n\");\n  fprintf(stderr, \"  -perfect       Fail if there is non-transformable edge blocks\\n\");\n  fprintf(stderr, \"  -rotate [90|180|270]         Rotate image (degrees clockwise)\\n\");\n#endif\n  fprintf(stderr, \"  -scale M/N     Scale output image by fraction M/N, eg, 1/8\\n\");\n#if TRANSFORMS_SUPPORTED\n  fprintf(stderr, \"  -transpose     Transpose image\\n\");\n  fprintf(stderr, \"  -transverse    Transverse transpose image\\n\");\n  fprintf(stderr, \"  -trim          Drop non-transformable edge blocks\\n\");\n  fprintf(stderr, \"  -wipe WxH+X+Y  Wipe (gray out) a rectangular subarea\\n\");\n#endif\n  fprintf(stderr, \"Switches for advanced users:\\n\");\n#ifdef C_ARITH_CODING_SUPPORTED\n  fprintf(stderr, \"  -arithmetic    Use arithmetic coding\\n\");\n#endif\n  fprintf(stderr, \"  -restart N     Set restart interval in rows, or in blocks with B\\n\");\n  fprintf(stderr, \"  -maxmemory N   Maximum memory to use (in kbytes)\\n\");\n  fprintf(stderr, \"  -outfile name  Specify name for output file\\n\");\n  fprintf(stderr, \"  -verbose  or  -debug   Emit debug output\\n\");\n  fprintf(stderr, \"Switches for wizards:\\n\");\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n  fprintf(stderr, \"  -scans file    Create multi-scan JPEG per script file\\n\");\n#endif\n  exit(EXIT_FAILURE);\n}\n\n\nLOCAL(void)\nselect_transform (JXFORM_CODE transform)\n/* Silly little routine to detect multiple transform options,\n * which we can't handle.\n */\n{\n#if TRANSFORMS_SUPPORTED\n  if (transformoption.transform == JXFORM_NONE ||\n      transformoption.transform == transform) {\n    transformoption.transform = transform;\n  } else {\n    fprintf(stderr, \"%s: can only do one image transformation at a time\\n\",\n\t    progname);\n    usage();\n  }\n#else\n  fprintf(stderr, \"%s: sorry, image transformation was not compiled\\n\",\n\t  progname);\n  exit(EXIT_FAILURE);\n#endif\n}\n\n\nLOCAL(int)\nparse_switches (j_compress_ptr cinfo, int argc, char **argv,\n\t\tint last_file_arg_seen, boolean for_real)\n/* Parse optional switches.\n * Returns argv[] index of first file-name argument (== argc if none).\n * Any file names with indexes <= last_file_arg_seen are ignored;\n * they have presumably been processed in a previous iteration.\n * (Pass 0 for last_file_arg_seen on the first or only iteration.)\n * for_real is FALSE on the first (dummy) pass; we may skip any expensive\n * processing.\n */\n{\n  int argn;\n  char * arg;\n  boolean simple_progressive;\n  char * scansarg = NULL;\t/* saves -scans parm if any */\n\n  /* Set up default JPEG parameters. */\n  simple_progressive = FALSE;\n  outfilename = NULL;\n  scaleoption = NULL;\n  copyoption = JCOPYOPT_DEFAULT;\n  transformoption.transform = JXFORM_NONE;\n  transformoption.perfect = FALSE;\n  transformoption.trim = FALSE;\n  transformoption.force_grayscale = FALSE;\n  transformoption.crop = FALSE;\n  cinfo->err->trace_level = 0;\n\n  /* Scan command line options, adjust parameters */\n\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (*arg != '-') {\n      /* Not a switch, must be a file name argument */\n      if (argn <= last_file_arg_seen) {\n\toutfilename = NULL;\t/* -outfile applies to just one input file */\n\tcontinue;\t\t/* ignore this name if previously processed */\n      }\n      break;\t\t\t/* else done parsing switches */\n    }\n    arg++;\t\t\t/* advance past switch marker character */\n\n    if (keymatch(arg, \"arithmetic\", 1)) {\n      /* Use arithmetic coding. */\n#ifdef C_ARITH_CODING_SUPPORTED\n      cinfo->arith_code = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, arithmetic coding not supported\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"copy\", 2)) {\n      /* Select which extra markers to copy. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (keymatch(argv[argn], \"none\", 1)) {\n\tcopyoption = JCOPYOPT_NONE;\n      } else if (keymatch(argv[argn], \"comments\", 1)) {\n\tcopyoption = JCOPYOPT_COMMENTS;\n      } else if (keymatch(argv[argn], \"all\", 1)) {\n\tcopyoption = JCOPYOPT_ALL;\n      } else\n\tusage();\n\n    } else if (keymatch(arg, \"crop\", 2)) {\n      /* Perform lossless cropping. */\n#if TRANSFORMS_SUPPORTED\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (transformoption.crop /* reject multiple crop/wipe requests */ ||\n\t  ! jtransform_parse_crop_spec(&transformoption, argv[argn])) {\n\tfprintf(stderr, \"%s: bogus -crop argument '%s'\\n\",\n\t\tprogname, argv[argn]);\n\texit(EXIT_FAILURE);\n      }\n#else\n      select_transform(JXFORM_NONE);\t/* force an error */\n#endif\n\n    } else if (keymatch(arg, \"debug\", 1) || keymatch(arg, \"verbose\", 1)) {\n      /* Enable debug printouts. */\n      /* On first -d, print version identification */\n      static boolean printed_version = FALSE;\n\n      if (! printed_version) {\n\tfprintf(stderr, \"Independent JPEG Group's JPEGTRAN, version %s\\n%s\\n\",\n\t\tJVERSION, JCOPYRIGHT);\n\tprinted_version = TRUE;\n      }\n      cinfo->err->trace_level++;\n\n    } else if (keymatch(arg, \"flip\", 1)) {\n      /* Mirror left-right or top-bottom. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (keymatch(argv[argn], \"horizontal\", 1))\n\tselect_transform(JXFORM_FLIP_H);\n      else if (keymatch(argv[argn], \"vertical\", 1))\n\tselect_transform(JXFORM_FLIP_V);\n      else\n\tusage();\n\n    } else if (keymatch(arg, \"grayscale\", 1) || keymatch(arg, \"greyscale\",1)) {\n      /* Force to grayscale. */\n#if TRANSFORMS_SUPPORTED\n      transformoption.force_grayscale = TRUE;\n#else\n      select_transform(JXFORM_NONE);\t/* force an error */\n#endif\n\n    } else if (keymatch(arg, \"maxmemory\", 3)) {\n      /* Maximum memory in Kb (or Mb with 'm'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n\tusage();\n      if (ch == 'm' || ch == 'M')\n\tlval *= 1000L;\n      cinfo->mem->max_memory_to_use = lval * 1000L;\n\n    } else if (keymatch(arg, \"optimize\", 1) || keymatch(arg, \"optimise\", 1)) {\n      /* Enable entropy parm optimization. */\n#ifdef ENTROPY_OPT_SUPPORTED\n      cinfo->optimize_coding = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, entropy optimization was not compiled\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"outfile\", 4)) {\n      /* Set output file name. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      outfilename = argv[argn];\t/* save it away for later use */\n\n    } else if (keymatch(arg, \"perfect\", 2)) {\n      /* Fail if there is any partial edge MCUs that the transform can't\n       * handle. */\n      transformoption.perfect = TRUE;\n\n    } else if (keymatch(arg, \"progressive\", 2)) {\n      /* Select simple progressive mode. */\n#ifdef C_PROGRESSIVE_SUPPORTED\n      simple_progressive = TRUE;\n      /* We must postpone execution until num_components is known. */\n#else\n      fprintf(stderr, \"%s: sorry, progressive output was not compiled\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"restart\", 1)) {\n      /* Restart interval in MCU rows (or in MCUs with 'b'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n\tusage();\n      if (lval < 0 || lval > 65535L)\n\tusage();\n      if (ch == 'b' || ch == 'B') {\n\tcinfo->restart_interval = (unsigned int) lval;\n\tcinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */\n      } else {\n\tcinfo->restart_in_rows = (int) lval;\n\t/* restart_interval will be computed during startup */\n      }\n\n    } else if (keymatch(arg, \"rotate\", 2)) {\n      /* Rotate 90, 180, or 270 degrees (measured clockwise). */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (keymatch(argv[argn], \"90\", 2))\n\tselect_transform(JXFORM_ROT_90);\n      else if (keymatch(argv[argn], \"180\", 3))\n\tselect_transform(JXFORM_ROT_180);\n      else if (keymatch(argv[argn], \"270\", 3))\n\tselect_transform(JXFORM_ROT_270);\n      else\n\tusage();\n\n    } else if (keymatch(arg, \"scale\", 4)) {\n      /* Scale the output image by a fraction M/N. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      scaleoption = argv[argn];\n      /* We must postpone processing until decompression startup. */\n\n    } else if (keymatch(arg, \"scans\", 1)) {\n      /* Set scan script. */\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      scansarg = argv[argn];\n      /* We must postpone reading the file in case -progressive appears. */\n#else\n      fprintf(stderr, \"%s: sorry, multi-scan output was not compiled\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"transpose\", 1)) {\n      /* Transpose (across UL-to-LR axis). */\n      select_transform(JXFORM_TRANSPOSE);\n\n    } else if (keymatch(arg, \"transverse\", 6)) {\n      /* Transverse transpose (across UR-to-LL axis). */\n      select_transform(JXFORM_TRANSVERSE);\n\n    } else if (keymatch(arg, \"trim\", 3)) {\n      /* Trim off any partial edge MCUs that the transform can't handle. */\n      transformoption.trim = TRUE;\n\n    } else if (keymatch(arg, \"wipe\", 1)) {\n#if TRANSFORMS_SUPPORTED\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (transformoption.crop /* reject multiple crop/wipe requests */ ||\n\t  ! jtransform_parse_crop_spec(&transformoption, argv[argn])) {\n\tfprintf(stderr, \"%s: bogus -wipe argument '%s'\\n\",\n\t\tprogname, argv[argn]);\n\texit(EXIT_FAILURE);\n      }\n      select_transform(JXFORM_WIPE);\n#else\n      select_transform(JXFORM_NONE);\t/* force an error */\n#endif\n\n    } else {\n      usage();\t\t\t/* bogus switch */\n    }\n  }\n\n  /* Post-switch-scanning cleanup */\n\n  if (for_real) {\n\n#ifdef C_PROGRESSIVE_SUPPORTED\n    if (simple_progressive)\t/* process -progressive; -scans can override */\n      jpeg_simple_progression(cinfo);\n#endif\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n    if (scansarg != NULL)\t/* process -scans if it was present */\n      if (! read_scan_script(cinfo, scansarg))\n\tusage();\n#endif\n  }\n\n  return argn;\t\t\t/* return index of next arg (file name) */\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  struct jpeg_decompress_struct srcinfo;\n  struct jpeg_compress_struct dstinfo;\n  struct jpeg_error_mgr jsrcerr, jdsterr;\n#ifdef PROGRESS_REPORT\n  struct cdjpeg_progress_mgr progress;\n#endif\n  jvirt_barray_ptr * src_coef_arrays;\n  jvirt_barray_ptr * dst_coef_arrays;\n  int file_index;\n  /* We assume all-in-memory processing and can therefore use only a\n   * single file pointer for sequential input and output operation. \n   */\n  FILE * fp;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"jpegtran\";\t/* in case C library doesn't provide it */\n\n  /* Initialize the JPEG decompression object with default error handling. */\n  srcinfo.err = jpeg_std_error(&jsrcerr);\n  jpeg_create_decompress(&srcinfo);\n  /* Initialize the JPEG compression object with default error handling. */\n  dstinfo.err = jpeg_std_error(&jdsterr);\n  jpeg_create_compress(&dstinfo);\n\n  /* Now safe to enable signal catcher.\n   * Note: we assume only the decompression object will have virtual arrays.\n   */\n#ifdef NEED_SIGNAL_CATCHER\n  enable_signal_catcher((j_common_ptr) &srcinfo);\n#endif\n\n  /* Scan command line to find file names.\n   * It is convenient to use just one switch-parsing routine, but the switch\n   * values read here are mostly ignored; we will rescan the switches after\n   * opening the input file.  Also note that most of the switches affect the\n   * destination JPEG object, so we parse into that and then copy over what\n   * needs to affects the source too.\n   */\n\n  file_index = parse_switches(&dstinfo, argc, argv, 0, FALSE);\n  jsrcerr.trace_level = jdsterr.trace_level;\n  srcinfo.mem->max_memory_to_use = dstinfo.mem->max_memory_to_use;\n\n#ifdef TWO_FILE_COMMANDLINE\n  /* Must have either -outfile switch or explicit output file name */\n  if (outfilename == NULL) {\n    if (file_index != argc-2) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n\t      progname);\n      usage();\n    }\n    outfilename = argv[file_index+1];\n  } else {\n    if (file_index != argc-1) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n\t      progname);\n      usage();\n    }\n  }\n#else\n  /* Unix style: expect zero or one file name */\n  if (file_index < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n#endif /* TWO_FILE_COMMANDLINE */\n\n  /* Open the input file. */\n  if (file_index < argc) {\n    if ((fp = fopen(argv[file_index], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s for reading\\n\", progname, argv[file_index]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n    fp = read_stdin();\n  }\n\n#ifdef PROGRESS_REPORT\n  start_progress_monitor((j_common_ptr) &dstinfo, &progress);\n#endif\n\n  /* Specify data source for decompression */\n  jpeg_stdio_src(&srcinfo, fp);\n\n  /* Enable saving of extra markers that we want to copy */\n  jcopy_markers_setup(&srcinfo, copyoption);\n\n  /* Read file header */\n  (void) jpeg_read_header(&srcinfo, TRUE);\n\n  /* Adjust default decompression parameters */\n  if (scaleoption != NULL)\n    if (sscanf(scaleoption, \"%u/%u\",\n\t&srcinfo.scale_num, &srcinfo.scale_denom) < 1)\n      usage();\n\n  /* Any space needed by a transform option must be requested before\n   * jpeg_read_coefficients so that memory allocation will be done right.\n   */\n#if TRANSFORMS_SUPPORTED\n  /* Fail right away if -perfect is given and transformation is not perfect.\n   */\n  if (!jtransform_request_workspace(&srcinfo, &transformoption)) {\n    fprintf(stderr, \"%s: transformation is not perfect\\n\", progname);\n    exit(EXIT_FAILURE);\n  }\n#endif\n\n  /* Read source file as DCT coefficients */\n  src_coef_arrays = jpeg_read_coefficients(&srcinfo);\n\n  /* Initialize destination compression parameters from source values */\n  jpeg_copy_critical_parameters(&srcinfo, &dstinfo);\n\n  /* Adjust destination parameters if required by transform options;\n   * also find out which set of coefficient arrays will hold the output.\n   */\n#if TRANSFORMS_SUPPORTED\n  dst_coef_arrays = jtransform_adjust_parameters(&srcinfo, &dstinfo,\n\t\t\t\t\t\t src_coef_arrays,\n\t\t\t\t\t\t &transformoption);\n#else\n  dst_coef_arrays = src_coef_arrays;\n#endif\n\n  /* Close input file, if we opened it.\n   * Note: we assume that jpeg_read_coefficients consumed all input\n   * until JPEG_REACHED_EOI, and that jpeg_finish_decompress will\n   * only consume more while (! cinfo->inputctl->eoi_reached).\n   * We cannot call jpeg_finish_decompress here since we still need the\n   * virtual arrays allocated from the source object for processing.\n   */\n  if (fp != stdin)\n    fclose(fp);\n\n  /* Open the output file. */\n  if (outfilename != NULL) {\n    if ((fp = fopen(outfilename, WRITE_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s for writing\\n\", progname, outfilename);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default output file is stdout */\n    fp = write_stdout();\n  }\n\n  /* Adjust default compression parameters by re-parsing the options */\n  file_index = parse_switches(&dstinfo, argc, argv, 0, TRUE);\n\n  /* Specify data destination for compression */\n  jpeg_stdio_dest(&dstinfo, fp);\n\n  /* Start compressor (note no image data is actually written here) */\n  jpeg_write_coefficients(&dstinfo, dst_coef_arrays);\n\n  /* Copy to the output file any extra markers that we want to preserve */\n  jcopy_markers_execute(&srcinfo, &dstinfo, copyoption);\n\n  /* Execute image transformation, if any */\n#if TRANSFORMS_SUPPORTED\n  jtransform_execute_transformation(&srcinfo, &dstinfo,\n\t\t\t\t    src_coef_arrays,\n\t\t\t\t    &transformoption);\n#endif\n\n  /* Finish compression and release memory */\n  jpeg_finish_compress(&dstinfo);\n  jpeg_destroy_compress(&dstinfo);\n  (void) jpeg_finish_decompress(&srcinfo);\n  jpeg_destroy_decompress(&srcinfo);\n\n  /* Close output file, if we opened it */\n  if (fp != stdout)\n    fclose(fp);\n\n#ifdef PROGRESS_REPORT\n  end_progress_monitor((j_common_ptr) &dstinfo);\n#endif\n\n  /* All done. */\n  exit(jsrcerr.num_warnings + jdsterr.num_warnings ?EXIT_WARNING:EXIT_SUCCESS);\n  return 0;\t\t\t/* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "jquant1.c",
    "content": "/*\n * jquant1.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * Modified 2011 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains 1-pass color quantization (color mapping) routines.\n * These routines provide mapping to a fixed color map using equally spaced\n * color values.  Optional Floyd-Steinberg or ordered dithering is available.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n#ifdef QUANT_1PASS_SUPPORTED\n\n\n/*\n * The main purpose of 1-pass quantization is to provide a fast, if not very\n * high quality, colormapped output capability.  A 2-pass quantizer usually\n * gives better visual quality; however, for quantized grayscale output this\n * quantizer is perfectly adequate.  Dithering is highly recommended with this\n * quantizer, though you can turn it off if you really want to.\n *\n * In 1-pass quantization the colormap must be chosen in advance of seeing the\n * image.  We use a map consisting of all combinations of Ncolors[i] color\n * values for the i'th component.  The Ncolors[] values are chosen so that\n * their product, the total number of colors, is no more than that requested.\n * (In most cases, the product will be somewhat less.)\n *\n * Since the colormap is orthogonal, the representative value for each color\n * component can be determined without considering the other components;\n * then these indexes can be combined into a colormap index by a standard\n * N-dimensional-array-subscript calculation.  Most of the arithmetic involved\n * can be precalculated and stored in the lookup table colorindex[].\n * colorindex[i][j] maps pixel value j in component i to the nearest\n * representative value (grid plane) for that component; this index is\n * multiplied by the array stride for component i, so that the\n * index of the colormap entry closest to a given pixel value is just\n *    sum( colorindex[component-number][pixel-component-value] )\n * Aside from being fast, this scheme allows for variable spacing between\n * representative values with no additional lookup cost.\n *\n * If gamma correction has been applied in color conversion, it might be wise\n * to adjust the color grid spacing so that the representative colors are\n * equidistant in linear space.  At this writing, gamma correction is not\n * implemented by jdcolor, so nothing is done here.\n */\n\n\n/* Declarations for ordered dithering.\n *\n * We use a standard 16x16 ordered dither array.  The basic concept of ordered\n * dithering is described in many references, for instance Dale Schumacher's\n * chapter II.2 of Graphics Gems II (James Arvo, ed. Academic Press, 1991).\n * In place of Schumacher's comparisons against a \"threshold\" value, we add a\n * \"dither\" value to the input pixel and then round the result to the nearest\n * output value.  The dither value is equivalent to (0.5 - threshold) times\n * the distance between output values.  For ordered dithering, we assume that\n * the output colors are equally spaced; if not, results will probably be\n * worse, since the dither may be too much or too little at a given point.\n *\n * The normal calculation would be to form pixel value + dither, range-limit\n * this to 0..MAXJSAMPLE, and then index into the colorindex table as usual.\n * We can skip the separate range-limiting step by extending the colorindex\n * table in both directions.\n */\n\n#define ODITHER_SIZE  16\t/* dimension of dither matrix */\n/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */\n#define ODITHER_CELLS (ODITHER_SIZE*ODITHER_SIZE)\t/* # cells in matrix */\n#define ODITHER_MASK  (ODITHER_SIZE-1) /* mask for wrapping around counters */\n\ntypedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE];\ntypedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE];\n\nstatic const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = {\n  /* Bayer's order-4 dither array.  Generated by the code given in\n   * Stephen Hawley's article \"Ordered Dithering\" in Graphics Gems I.\n   * The values in this array must range from 0 to ODITHER_CELLS-1.\n   */\n  {   0,192, 48,240, 12,204, 60,252,  3,195, 51,243, 15,207, 63,255 },\n  { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 },\n  {  32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 },\n  { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 },\n  {   8,200, 56,248,  4,196, 52,244, 11,203, 59,251,  7,199, 55,247 },\n  { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 },\n  {  40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 },\n  { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 },\n  {   2,194, 50,242, 14,206, 62,254,  1,193, 49,241, 13,205, 61,253 },\n  { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 },\n  {  34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 },\n  { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 },\n  {  10,202, 58,250,  6,198, 54,246,  9,201, 57,249,  5,197, 53,245 },\n  { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 },\n  {  42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 },\n  { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 }\n};\n\n\n/* Declarations for Floyd-Steinberg dithering.\n *\n * Errors are accumulated into the array fserrors[], at a resolution of\n * 1/16th of a pixel count.  The error at a given pixel is propagated\n * to its not-yet-processed neighbors using the standard F-S fractions,\n *\t\t...\t(here)\t7/16\n *\t\t3/16\t5/16\t1/16\n * We work left-to-right on even rows, right-to-left on odd rows.\n *\n * We can get away with a single array (holding one row's worth of errors)\n * by using it to store the current row's errors at pixel columns not yet\n * processed, but the next row's errors at columns already processed.  We\n * need only a few extra variables to hold the errors immediately around the\n * current column.  (If we are lucky, those variables are in registers, but\n * even if not, they're probably cheaper to access than array elements are.)\n *\n * The fserrors[] array is indexed [component#][position].\n * We provide (#columns + 2) entries per component; the extra entry at each\n * end saves us from special-casing the first and last pixels.\n *\n * Note: on a wide image, we might not have enough room in a PC's near data\n * segment to hold the error array; so it is allocated with alloc_large.\n */\n\n#if BITS_IN_JSAMPLE == 8\ntypedef INT16 FSERROR;\t\t/* 16 bits should be enough */\ntypedef int LOCFSERROR;\t\t/* use 'int' for calculation temps */\n#else\ntypedef INT32 FSERROR;\t\t/* may need more than 16 bits */\ntypedef INT32 LOCFSERROR;\t/* be sure calculation temps are big enough */\n#endif\n\ntypedef FSERROR FAR *FSERRPTR;\t/* pointer to error array (in FAR storage!) */\n\n\n/* Private subobject */\n\n#define MAX_Q_COMPS 4\t\t/* max components I can handle */\n\ntypedef struct {\n  struct jpeg_color_quantizer pub; /* public fields */\n\n  /* Initially allocated colormap is saved here */\n  JSAMPARRAY sv_colormap;\t/* The color map as a 2-D pixel array */\n  int sv_actual;\t\t/* number of entries in use */\n\n  JSAMPARRAY colorindex;\t/* Precomputed mapping for speed */\n  /* colorindex[i][j] = index of color closest to pixel value j in component i,\n   * premultiplied as described above.  Since colormap indexes must fit into\n   * JSAMPLEs, the entries of this array will too.\n   */\n  boolean is_padded;\t\t/* is the colorindex padded for odither? */\n\n  int Ncolors[MAX_Q_COMPS];\t/* # of values alloced to each component */\n\n  /* Variables for ordered dithering */\n  int row_index;\t\t/* cur row's vertical index in dither matrix */\n  ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */\n\n  /* Variables for Floyd-Steinberg dithering */\n  FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */\n  boolean on_odd_row;\t\t/* flag to remember which row we are on */\n} my_cquantizer;\n\ntypedef my_cquantizer * my_cquantize_ptr;\n\n\n/*\n * Policy-making subroutines for create_colormap and create_colorindex.\n * These routines determine the colormap to be used.  The rest of the module\n * only assumes that the colormap is orthogonal.\n *\n *  * select_ncolors decides how to divvy up the available colors\n *    among the components.\n *  * output_value defines the set of representative values for a component.\n *  * largest_input_value defines the mapping from input values to\n *    representative values for a component.\n * Note that the latter two routines may impose different policies for\n * different components, though this is not currently done.\n */\n\n\nLOCAL(int)\nselect_ncolors (j_decompress_ptr cinfo, int Ncolors[])\n/* Determine allocation of desired colors to components, */\n/* and fill in Ncolors[] array to indicate choice. */\n/* Return value is total number of colors (product of Ncolors[] values). */\n{\n  int nc = cinfo->out_color_components; /* number of color components */\n  int max_colors = cinfo->desired_number_of_colors;\n  int total_colors, iroot, i, j;\n  boolean changed;\n  long temp;\n  static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE };\n\n  /* We can allocate at least the nc'th root of max_colors per component. */\n  /* Compute floor(nc'th root of max_colors). */\n  iroot = 1;\n  do {\n    iroot++;\n    temp = iroot;\t\t/* set temp = iroot ** nc */\n    for (i = 1; i < nc; i++)\n      temp *= iroot;\n  } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */\n  iroot--;\t\t\t/* now iroot = floor(root) */\n\n  /* Must have at least 2 color values per component */\n  if (iroot < 2)\n    ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp);\n\n  /* Initialize to iroot color values for each component */\n  total_colors = 1;\n  for (i = 0; i < nc; i++) {\n    Ncolors[i] = iroot;\n    total_colors *= iroot;\n  }\n  /* We may be able to increment the count for one or more components without\n   * exceeding max_colors, though we know not all can be incremented.\n   * Sometimes, the first component can be incremented more than once!\n   * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.)\n   * In RGB colorspace, try to increment G first, then R, then B.\n   */\n  do {\n    changed = FALSE;\n    for (i = 0; i < nc; i++) {\n      j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i);\n      /* calculate new total_colors if Ncolors[j] is incremented */\n      temp = total_colors / Ncolors[j];\n      temp *= Ncolors[j]+1;\t/* done in long arith to avoid oflo */\n      if (temp > (long) max_colors)\n\tbreak;\t\t\t/* won't fit, done with this pass */\n      Ncolors[j]++;\t\t/* OK, apply the increment */\n      total_colors = (int) temp;\n      changed = TRUE;\n    }\n  } while (changed);\n\n  return total_colors;\n}\n\n\nLOCAL(int)\noutput_value (j_decompress_ptr cinfo, int ci, int j, int maxj)\n/* Return j'th output value, where j will range from 0 to maxj */\n/* The output values must fall in 0..MAXJSAMPLE in increasing order */\n{\n  /* We always provide values 0 and MAXJSAMPLE for each component;\n   * any additional values are equally spaced between these limits.\n   * (Forcing the upper and lower values to the limits ensures that\n   * dithering can't produce a color outside the selected gamut.)\n   */\n  return (int) (((INT32) j * MAXJSAMPLE + maxj/2) / maxj);\n}\n\n\nLOCAL(int)\nlargest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj)\n/* Return largest input value that should map to j'th output value */\n/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */\n{\n  /* Breakpoints are halfway between values returned by output_value */\n  return (int) (((INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj));\n}\n\n\n/*\n * Create the colormap.\n */\n\nLOCAL(void)\ncreate_colormap (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  JSAMPARRAY colormap;\t\t/* Created colormap */\n  int total_colors;\t\t/* Number of distinct output colors */\n  int i,j,k, nci, blksize, blkdist, ptr, val;\n\n  /* Select number of colors for each component */\n  total_colors = select_ncolors(cinfo, cquantize->Ncolors);\n\n  /* Report selected color counts */\n  if (cinfo->out_color_components == 3)\n    TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS,\n\t     total_colors, cquantize->Ncolors[0],\n\t     cquantize->Ncolors[1], cquantize->Ncolors[2]);\n  else\n    TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors);\n\n  /* Allocate and fill in the colormap. */\n  /* The colors are ordered in the map in standard row-major order, */\n  /* i.e. rightmost (highest-indexed) color changes most rapidly. */\n\n  colormap = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components);\n\n  /* blksize is number of adjacent repeated entries for a component */\n  /* blkdist is distance between groups of identical entries for a component */\n  blkdist = total_colors;\n\n  for (i = 0; i < cinfo->out_color_components; i++) {\n    /* fill in colormap entries for i'th color component */\n    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */\n    blksize = blkdist / nci;\n    for (j = 0; j < nci; j++) {\n      /* Compute j'th output value (out of nci) for component */\n      val = output_value(cinfo, i, j, nci-1);\n      /* Fill in all colormap entries that have this value of this component */\n      for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) {\n\t/* fill in blksize entries beginning at ptr */\n\tfor (k = 0; k < blksize; k++)\n\t  colormap[i][ptr+k] = (JSAMPLE) val;\n      }\n    }\n    blkdist = blksize;\t\t/* blksize of this color is blkdist of next */\n  }\n\n  /* Save the colormap in private storage,\n   * where it will survive color quantization mode changes.\n   */\n  cquantize->sv_colormap = colormap;\n  cquantize->sv_actual = total_colors;\n}\n\n\n/*\n * Create the color index table.\n */\n\nLOCAL(void)\ncreate_colorindex (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  JSAMPROW indexptr;\n  int i,j,k, nci, blksize, val, pad;\n\n  /* For ordered dither, we pad the color index tables by MAXJSAMPLE in\n   * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE).\n   * This is not necessary in the other dithering modes.  However, we\n   * flag whether it was done in case user changes dithering mode.\n   */\n  if (cinfo->dither_mode == JDITHER_ORDERED) {\n    pad = MAXJSAMPLE*2;\n    cquantize->is_padded = TRUE;\n  } else {\n    pad = 0;\n    cquantize->is_padded = FALSE;\n  }\n\n  cquantize->colorindex = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     (JDIMENSION) (MAXJSAMPLE+1 + pad),\n     (JDIMENSION) cinfo->out_color_components);\n\n  /* blksize is number of adjacent repeated entries for a component */\n  blksize = cquantize->sv_actual;\n\n  for (i = 0; i < cinfo->out_color_components; i++) {\n    /* fill in colorindex entries for i'th color component */\n    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */\n    blksize = blksize / nci;\n\n    /* adjust colorindex pointers to provide padding at negative indexes. */\n    if (pad)\n      cquantize->colorindex[i] += MAXJSAMPLE;\n\n    /* in loop, val = index of current output value, */\n    /* and k = largest j that maps to current val */\n    indexptr = cquantize->colorindex[i];\n    val = 0;\n    k = largest_input_value(cinfo, i, 0, nci-1);\n    for (j = 0; j <= MAXJSAMPLE; j++) {\n      while (j > k)\t\t/* advance val if past boundary */\n\tk = largest_input_value(cinfo, i, ++val, nci-1);\n      /* premultiply so that no multiplication needed in main processing */\n      indexptr[j] = (JSAMPLE) (val * blksize);\n    }\n    /* Pad at both ends if necessary */\n    if (pad)\n      for (j = 1; j <= MAXJSAMPLE; j++) {\n\tindexptr[-j] = indexptr[0];\n\tindexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE];\n      }\n  }\n}\n\n\n/*\n * Create an ordered-dither array for a component having ncolors\n * distinct output values.\n */\n\nLOCAL(ODITHER_MATRIX_PTR)\nmake_odither_array (j_decompress_ptr cinfo, int ncolors)\n{\n  ODITHER_MATRIX_PTR odither;\n  int j,k;\n  INT32 num,den;\n\n  odither = (ODITHER_MATRIX_PTR)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(ODITHER_MATRIX));\n  /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1).\n   * Hence the dither value for the matrix cell with fill order f\n   * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1).\n   * On 16-bit-int machine, be careful to avoid overflow.\n   */\n  den = 2 * ODITHER_CELLS * ((INT32) (ncolors - 1));\n  for (j = 0; j < ODITHER_SIZE; j++) {\n    for (k = 0; k < ODITHER_SIZE; k++) {\n      num = ((INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k])))\n\t    * MAXJSAMPLE;\n      /* Ensure round towards zero despite C's lack of consistency\n       * about rounding negative values in integer division...\n       */\n      odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den);\n    }\n  }\n  return odither;\n}\n\n\n/*\n * Create the ordered-dither tables.\n * Components having the same number of representative colors may \n * share a dither table.\n */\n\nLOCAL(void)\ncreate_odither_tables (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  ODITHER_MATRIX_PTR odither;\n  int i, j, nci;\n\n  for (i = 0; i < cinfo->out_color_components; i++) {\n    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */\n    odither = NULL;\t\t/* search for matching prior component */\n    for (j = 0; j < i; j++) {\n      if (nci == cquantize->Ncolors[j]) {\n\todither = cquantize->odither[j];\n\tbreak;\n      }\n    }\n    if (odither == NULL)\t/* need a new table? */\n      odither = make_odither_array(cinfo, nci);\n    cquantize->odither[i] = odither;\n  }\n}\n\n\n/*\n * Map some rows of pixels to the output colormapped representation.\n */\n\nMETHODDEF(void)\ncolor_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n\t\tJSAMPARRAY output_buf, int num_rows)\n/* General case, no dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  JSAMPARRAY colorindex = cquantize->colorindex;\n  register int pixcode, ci;\n  register JSAMPROW ptrin, ptrout;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n  register int nc = cinfo->out_color_components;\n\n  for (row = 0; row < num_rows; row++) {\n    ptrin = input_buf[row];\n    ptrout = output_buf[row];\n    for (col = width; col > 0; col--) {\n      pixcode = 0;\n      for (ci = 0; ci < nc; ci++) {\n\tpixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]);\n      }\n      *ptrout++ = (JSAMPLE) pixcode;\n    }\n  }\n}\n\n\nMETHODDEF(void)\ncolor_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n\t\t JSAMPARRAY output_buf, int num_rows)\n/* Fast path for out_color_components==3, no dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register int pixcode;\n  register JSAMPROW ptrin, ptrout;\n  JSAMPROW colorindex0 = cquantize->colorindex[0];\n  JSAMPROW colorindex1 = cquantize->colorindex[1];\n  JSAMPROW colorindex2 = cquantize->colorindex[2];\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    ptrin = input_buf[row];\n    ptrout = output_buf[row];\n    for (col = width; col > 0; col--) {\n      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]);\n      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]);\n      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]);\n      *ptrout++ = (JSAMPLE) pixcode;\n    }\n  }\n}\n\n\nMETHODDEF(void)\nquantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n\t\t     JSAMPARRAY output_buf, int num_rows)\n/* General case, with ordered dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register JSAMPROW input_ptr;\n  register JSAMPROW output_ptr;\n  JSAMPROW colorindex_ci;\n  int * dither;\t\t\t/* points to active row of dither matrix */\n  int row_index, col_index;\t/* current indexes into dither matrix */\n  int nc = cinfo->out_color_components;\n  int ci;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    /* Initialize output values to 0 so can process components separately */\n    FMEMZERO((void FAR *) output_buf[row],\n\t     (size_t) (width * SIZEOF(JSAMPLE)));\n    row_index = cquantize->row_index;\n    for (ci = 0; ci < nc; ci++) {\n      input_ptr = input_buf[row] + ci;\n      output_ptr = output_buf[row];\n      colorindex_ci = cquantize->colorindex[ci];\n      dither = cquantize->odither[ci][row_index];\n      col_index = 0;\n\n      for (col = width; col > 0; col--) {\n\t/* Form pixel value + dither, range-limit to 0..MAXJSAMPLE,\n\t * select output value, accumulate into output code for this pixel.\n\t * Range-limiting need not be done explicitly, as we have extended\n\t * the colorindex table to produce the right answers for out-of-range\n\t * inputs.  The maximum dither is +- MAXJSAMPLE; this sets the\n\t * required amount of padding.\n\t */\n\t*output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]];\n\tinput_ptr += nc;\n\toutput_ptr++;\n\tcol_index = (col_index + 1) & ODITHER_MASK;\n      }\n    }\n    /* Advance row index for next row */\n    row_index = (row_index + 1) & ODITHER_MASK;\n    cquantize->row_index = row_index;\n  }\n}\n\n\nMETHODDEF(void)\nquantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n\t\t      JSAMPARRAY output_buf, int num_rows)\n/* Fast path for out_color_components==3, with ordered dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register int pixcode;\n  register JSAMPROW input_ptr;\n  register JSAMPROW output_ptr;\n  JSAMPROW colorindex0 = cquantize->colorindex[0];\n  JSAMPROW colorindex1 = cquantize->colorindex[1];\n  JSAMPROW colorindex2 = cquantize->colorindex[2];\n  int * dither0;\t\t/* points to active row of dither matrix */\n  int * dither1;\n  int * dither2;\n  int row_index, col_index;\t/* current indexes into dither matrix */\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    row_index = cquantize->row_index;\n    input_ptr = input_buf[row];\n    output_ptr = output_buf[row];\n    dither0 = cquantize->odither[0][row_index];\n    dither1 = cquantize->odither[1][row_index];\n    dither2 = cquantize->odither[2][row_index];\n    col_index = 0;\n\n    for (col = width; col > 0; col--) {\n      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) +\n\t\t\t\t\tdither0[col_index]]);\n      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) +\n\t\t\t\t\tdither1[col_index]]);\n      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) +\n\t\t\t\t\tdither2[col_index]]);\n      *output_ptr++ = (JSAMPLE) pixcode;\n      col_index = (col_index + 1) & ODITHER_MASK;\n    }\n    row_index = (row_index + 1) & ODITHER_MASK;\n    cquantize->row_index = row_index;\n  }\n}\n\n\nMETHODDEF(void)\nquantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n\t\t    JSAMPARRAY output_buf, int num_rows)\n/* General case, with Floyd-Steinberg dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register LOCFSERROR cur;\t/* current error or pixel value */\n  LOCFSERROR belowerr;\t\t/* error for pixel below cur */\n  LOCFSERROR bpreverr;\t\t/* error for below/prev col */\n  LOCFSERROR bnexterr;\t\t/* error for below/next col */\n  LOCFSERROR delta;\n  register FSERRPTR errorptr;\t/* => fserrors[] at column before current */\n  register JSAMPROW input_ptr;\n  register JSAMPROW output_ptr;\n  JSAMPROW colorindex_ci;\n  JSAMPROW colormap_ci;\n  int pixcode;\n  int nc = cinfo->out_color_components;\n  int dir;\t\t\t/* 1 for left-to-right, -1 for right-to-left */\n  int dirnc;\t\t\t/* dir * nc */\n  int ci;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n  JSAMPLE *range_limit = cinfo->sample_range_limit;\n  SHIFT_TEMPS\n\n  for (row = 0; row < num_rows; row++) {\n    /* Initialize output values to 0 so can process components separately */\n    FMEMZERO((void FAR *) output_buf[row],\n\t     (size_t) (width * SIZEOF(JSAMPLE)));\n    for (ci = 0; ci < nc; ci++) {\n      input_ptr = input_buf[row] + ci;\n      output_ptr = output_buf[row];\n      if (cquantize->on_odd_row) {\n\t/* work right to left in this row */\n\tinput_ptr += (width-1) * nc; /* so point to rightmost pixel */\n\toutput_ptr += width-1;\n\tdir = -1;\n\tdirnc = -nc;\n\terrorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */\n      } else {\n\t/* work left to right in this row */\n\tdir = 1;\n\tdirnc = nc;\n\terrorptr = cquantize->fserrors[ci]; /* => entry before first column */\n      }\n      colorindex_ci = cquantize->colorindex[ci];\n      colormap_ci = cquantize->sv_colormap[ci];\n      /* Preset error values: no error propagated to first pixel from left */\n      cur = 0;\n      /* and no error propagated to row below yet */\n      belowerr = bpreverr = 0;\n\n      for (col = width; col > 0; col--) {\n\t/* cur holds the error propagated from the previous pixel on the\n\t * current line.  Add the error propagated from the previous line\n\t * to form the complete error correction term for this pixel, and\n\t * round the error term (which is expressed * 16) to an integer.\n\t * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct\n\t * for either sign of the error value.\n\t * Note: errorptr points to *previous* column's array entry.\n\t */\n\tcur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4);\n\t/* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.\n\t * The maximum error is +- MAXJSAMPLE; this sets the required size\n\t * of the range_limit array.\n\t */\n\tcur += GETJSAMPLE(*input_ptr);\n\tcur = GETJSAMPLE(range_limit[cur]);\n\t/* Select output value, accumulate into output code for this pixel */\n\tpixcode = GETJSAMPLE(colorindex_ci[cur]);\n\t*output_ptr += (JSAMPLE) pixcode;\n\t/* Compute actual representation error at this pixel */\n\t/* Note: we can do this even though we don't have the final */\n\t/* pixel code, because the colormap is orthogonal. */\n\tcur -= GETJSAMPLE(colormap_ci[pixcode]);\n\t/* Compute error fractions to be propagated to adjacent pixels.\n\t * Add these into the running sums, and simultaneously shift the\n\t * next-line error sums left by 1 column.\n\t */\n\tbnexterr = cur;\n\tdelta = cur * 2;\n\tcur += delta;\t\t/* form error * 3 */\n\terrorptr[0] = (FSERROR) (bpreverr + cur);\n\tcur += delta;\t\t/* form error * 5 */\n\tbpreverr = belowerr + cur;\n\tbelowerr = bnexterr;\n\tcur += delta;\t\t/* form error * 7 */\n\t/* At this point cur contains the 7/16 error value to be propagated\n\t * to the next pixel on the current line, and all the errors for the\n\t * next line have been shifted over. We are therefore ready to move on.\n\t */\n\tinput_ptr += dirnc;\t/* advance input ptr to next column */\n\toutput_ptr += dir;\t/* advance output ptr to next column */\n\terrorptr += dir;\t/* advance errorptr to current column */\n      }\n      /* Post-loop cleanup: we must unload the final error value into the\n       * final fserrors[] entry.  Note we need not unload belowerr because\n       * it is for the dummy column before or after the actual array.\n       */\n      errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */\n    }\n    cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE);\n  }\n}\n\n\n/*\n * Allocate workspace for Floyd-Steinberg errors.\n */\n\nLOCAL(void)\nalloc_fs_workspace (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  size_t arraysize;\n  int i;\n\n  arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));\n  for (i = 0; i < cinfo->out_color_components; i++) {\n    cquantize->fserrors[i] = (FSERRPTR)\n      (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);\n  }\n}\n\n\n/*\n * Initialize for one-pass color quantization.\n */\n\nMETHODDEF(void)\nstart_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  size_t arraysize;\n  int i;\n\n  /* Install my colormap. */\n  cinfo->colormap = cquantize->sv_colormap;\n  cinfo->actual_number_of_colors = cquantize->sv_actual;\n\n  /* Initialize for desired dithering mode. */\n  switch (cinfo->dither_mode) {\n  case JDITHER_NONE:\n    if (cinfo->out_color_components == 3)\n      cquantize->pub.color_quantize = color_quantize3;\n    else\n      cquantize->pub.color_quantize = color_quantize;\n    break;\n  case JDITHER_ORDERED:\n    if (cinfo->out_color_components == 3)\n      cquantize->pub.color_quantize = quantize3_ord_dither;\n    else\n      cquantize->pub.color_quantize = quantize_ord_dither;\n    cquantize->row_index = 0;\t/* initialize state for ordered dither */\n    /* If user changed to ordered dither from another mode,\n     * we must recreate the color index table with padding.\n     * This will cost extra space, but probably isn't very likely.\n     */\n    if (! cquantize->is_padded)\n      create_colorindex(cinfo);\n    /* Create ordered-dither tables if we didn't already. */\n    if (cquantize->odither[0] == NULL)\n      create_odither_tables(cinfo);\n    break;\n  case JDITHER_FS:\n    cquantize->pub.color_quantize = quantize_fs_dither;\n    cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */\n    /* Allocate Floyd-Steinberg workspace if didn't already. */\n    if (cquantize->fserrors[0] == NULL)\n      alloc_fs_workspace(cinfo);\n    /* Initialize the propagated errors to zero. */\n    arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));\n    for (i = 0; i < cinfo->out_color_components; i++)\n      FMEMZERO((void FAR *) cquantize->fserrors[i], arraysize);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n    break;\n  }\n}\n\n\n/*\n * Finish up at the end of the pass.\n */\n\nMETHODDEF(void)\nfinish_pass_1_quant (j_decompress_ptr cinfo)\n{\n  /* no work in 1-pass case */\n}\n\n\n/*\n * Switch to a new external colormap between output passes.\n * Shouldn't get to this module!\n */\n\nMETHODDEF(void)\nnew_color_map_1_quant (j_decompress_ptr cinfo)\n{\n  ERREXIT(cinfo, JERR_MODE_CHANGE);\n}\n\n\n/*\n * Module initialization routine for 1-pass color quantization.\n */\n\nGLOBAL(void)\njinit_1pass_quantizer (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize;\n\n  cquantize = (my_cquantize_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_cquantizer));\n  cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;\n  cquantize->pub.start_pass = start_pass_1_quant;\n  cquantize->pub.finish_pass = finish_pass_1_quant;\n  cquantize->pub.new_color_map = new_color_map_1_quant;\n  cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */\n  cquantize->odither[0] = NULL;\t/* Also flag odither arrays not allocated */\n\n  /* Make sure my internal arrays won't overflow */\n  if (cinfo->out_color_components > MAX_Q_COMPS)\n    ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS);\n  /* Make sure colormap indexes can be represented by JSAMPLEs */\n  if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1))\n    ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1);\n\n  /* Create the colormap and color index table. */\n  create_colormap(cinfo);\n  create_colorindex(cinfo);\n\n  /* Allocate Floyd-Steinberg workspace now if requested.\n   * We do this now since it is FAR storage and may affect the memory\n   * manager's space calculations.  If the user changes to FS dither\n   * mode in a later pass, we will allocate the space then, and will\n   * possibly overrun the max_memory_to_use setting.\n   */\n  if (cinfo->dither_mode == JDITHER_FS)\n    alloc_fs_workspace(cinfo);\n}\n\n#endif /* QUANT_1PASS_SUPPORTED */\n"
  },
  {
    "path": "jquant2.c",
    "content": "/*\n * jquant2.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * Modified 2011 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains 2-pass color quantization (color mapping) routines.\n * These routines provide selection of a custom color map for an image,\n * followed by mapping of the image to that color map, with optional\n * Floyd-Steinberg dithering.\n * It is also possible to use just the second pass to map to an arbitrary\n * externally-given color map.\n *\n * Note: ordered dithering is not supported, since there isn't any fast\n * way to compute intercolor distances; it's unclear that ordered dither's\n * fundamental assumptions even hold with an irregularly spaced color map.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n#ifdef QUANT_2PASS_SUPPORTED\n\n\n/*\n * This module implements the well-known Heckbert paradigm for color\n * quantization.  Most of the ideas used here can be traced back to\n * Heckbert's seminal paper\n *   Heckbert, Paul.  \"Color Image Quantization for Frame Buffer Display\",\n *   Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304.\n *\n * In the first pass over the image, we accumulate a histogram showing the\n * usage count of each possible color.  To keep the histogram to a reasonable\n * size, we reduce the precision of the input; typical practice is to retain\n * 5 or 6 bits per color, so that 8 or 4 different input values are counted\n * in the same histogram cell.\n *\n * Next, the color-selection step begins with a box representing the whole\n * color space, and repeatedly splits the \"largest\" remaining box until we\n * have as many boxes as desired colors.  Then the mean color in each\n * remaining box becomes one of the possible output colors.\n * \n * The second pass over the image maps each input pixel to the closest output\n * color (optionally after applying a Floyd-Steinberg dithering correction).\n * This mapping is logically trivial, but making it go fast enough requires\n * considerable care.\n *\n * Heckbert-style quantizers vary a good deal in their policies for choosing\n * the \"largest\" box and deciding where to cut it.  The particular policies\n * used here have proved out well in experimental comparisons, but better ones\n * may yet be found.\n *\n * In earlier versions of the IJG code, this module quantized in YCbCr color\n * space, processing the raw upsampled data without a color conversion step.\n * This allowed the color conversion math to be done only once per colormap\n * entry, not once per pixel.  However, that optimization precluded other\n * useful optimizations (such as merging color conversion with upsampling)\n * and it also interfered with desired capabilities such as quantizing to an\n * externally-supplied colormap.  We have therefore abandoned that approach.\n * The present code works in the post-conversion color space, typically RGB.\n *\n * To improve the visual quality of the results, we actually work in scaled\n * RGB space, giving G distances more weight than R, and R in turn more than\n * B.  To do everything in integer math, we must use integer scale factors.\n * The 2/3/1 scale factors used here correspond loosely to the relative\n * weights of the colors in the NTSC grayscale equation.\n * If you want to use this code to quantize a non-RGB color space, you'll\n * probably need to change these scale factors.\n */\n\n#define R_SCALE 2\t\t/* scale R distances by this much */\n#define G_SCALE 3\t\t/* scale G distances by this much */\n#define B_SCALE 1\t\t/* and B by this much */\n\n/* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined\n * in jmorecfg.h.  As the code stands, it will do the right thing for R,G,B\n * and B,G,R orders.  If you define some other weird order in jmorecfg.h,\n * you'll get compile errors until you extend this logic.  In that case\n * you'll probably want to tweak the histogram sizes too.\n */\n\n#if RGB_RED == 0\n#define C0_SCALE R_SCALE\n#endif\n#if RGB_BLUE == 0\n#define C0_SCALE B_SCALE\n#endif\n#if RGB_GREEN == 1\n#define C1_SCALE G_SCALE\n#endif\n#if RGB_RED == 2\n#define C2_SCALE R_SCALE\n#endif\n#if RGB_BLUE == 2\n#define C2_SCALE B_SCALE\n#endif\n\n\n/*\n * First we have the histogram data structure and routines for creating it.\n *\n * The number of bits of precision can be adjusted by changing these symbols.\n * We recommend keeping 6 bits for G and 5 each for R and B.\n * If you have plenty of memory and cycles, 6 bits all around gives marginally\n * better results; if you are short of memory, 5 bits all around will save\n * some space but degrade the results.\n * To maintain a fully accurate histogram, we'd need to allocate a \"long\"\n * (preferably unsigned long) for each cell.  In practice this is overkill;\n * we can get by with 16 bits per cell.  Few of the cell counts will overflow,\n * and clamping those that do overflow to the maximum value will give close-\n * enough results.  This reduces the recommended histogram size from 256Kb\n * to 128Kb, which is a useful savings on PC-class machines.\n * (In the second pass the histogram space is re-used for pixel mapping data;\n * in that capacity, each cell must be able to store zero to the number of\n * desired colors.  16 bits/cell is plenty for that too.)\n * Since the JPEG code is intended to run in small memory model on 80x86\n * machines, we can't just allocate the histogram in one chunk.  Instead\n * of a true 3-D array, we use a row of pointers to 2-D arrays.  Each\n * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and\n * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries.  Note that\n * on 80x86 machines, the pointer row is in near memory but the actual\n * arrays are in far memory (same arrangement as we use for image arrays).\n */\n\n#define MAXNUMCOLORS  (MAXJSAMPLE+1) /* maximum size of colormap */\n\n/* These will do the right thing for either R,G,B or B,G,R color order,\n * but you may not like the results for other color orders.\n */\n#define HIST_C0_BITS  5\t\t/* bits of precision in R/B histogram */\n#define HIST_C1_BITS  6\t\t/* bits of precision in G histogram */\n#define HIST_C2_BITS  5\t\t/* bits of precision in B/R histogram */\n\n/* Number of elements along histogram axes. */\n#define HIST_C0_ELEMS  (1<<HIST_C0_BITS)\n#define HIST_C1_ELEMS  (1<<HIST_C1_BITS)\n#define HIST_C2_ELEMS  (1<<HIST_C2_BITS)\n\n/* These are the amounts to shift an input value to get a histogram index. */\n#define C0_SHIFT  (BITS_IN_JSAMPLE-HIST_C0_BITS)\n#define C1_SHIFT  (BITS_IN_JSAMPLE-HIST_C1_BITS)\n#define C2_SHIFT  (BITS_IN_JSAMPLE-HIST_C2_BITS)\n\n\ntypedef UINT16 histcell;\t/* histogram cell; prefer an unsigned type */\n\ntypedef histcell FAR * histptr;\t/* for pointers to histogram cells */\n\ntypedef histcell hist1d[HIST_C2_ELEMS]; /* typedefs for the array */\ntypedef hist1d FAR * hist2d;\t/* type for the 2nd-level pointers */\ntypedef hist2d * hist3d;\t/* type for top-level pointer */\n\n\n/* Declarations for Floyd-Steinberg dithering.\n *\n * Errors are accumulated into the array fserrors[], at a resolution of\n * 1/16th of a pixel count.  The error at a given pixel is propagated\n * to its not-yet-processed neighbors using the standard F-S fractions,\n *\t\t...\t(here)\t7/16\n *\t\t3/16\t5/16\t1/16\n * We work left-to-right on even rows, right-to-left on odd rows.\n *\n * We can get away with a single array (holding one row's worth of errors)\n * by using it to store the current row's errors at pixel columns not yet\n * processed, but the next row's errors at columns already processed.  We\n * need only a few extra variables to hold the errors immediately around the\n * current column.  (If we are lucky, those variables are in registers, but\n * even if not, they're probably cheaper to access than array elements are.)\n *\n * The fserrors[] array has (#columns + 2) entries; the extra entry at\n * each end saves us from special-casing the first and last pixels.\n * Each entry is three values long, one value for each color component.\n *\n * Note: on a wide image, we might not have enough room in a PC's near data\n * segment to hold the error array; so it is allocated with alloc_large.\n */\n\n#if BITS_IN_JSAMPLE == 8\ntypedef INT16 FSERROR;\t\t/* 16 bits should be enough */\ntypedef int LOCFSERROR;\t\t/* use 'int' for calculation temps */\n#else\ntypedef INT32 FSERROR;\t\t/* may need more than 16 bits */\ntypedef INT32 LOCFSERROR;\t/* be sure calculation temps are big enough */\n#endif\n\ntypedef FSERROR FAR *FSERRPTR;\t/* pointer to error array (in FAR storage!) */\n\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_color_quantizer pub; /* public fields */\n\n  /* Space for the eventually created colormap is stashed here */\n  JSAMPARRAY sv_colormap;\t/* colormap allocated at init time */\n  int desired;\t\t\t/* desired # of colors = size of colormap */\n\n  /* Variables for accumulating image statistics */\n  hist3d histogram;\t\t/* pointer to the histogram */\n\n  boolean needs_zeroed;\t\t/* TRUE if next pass must zero histogram */\n\n  /* Variables for Floyd-Steinberg dithering */\n  FSERRPTR fserrors;\t\t/* accumulated errors */\n  boolean on_odd_row;\t\t/* flag to remember which row we are on */\n  int * error_limiter;\t\t/* table for clamping the applied error */\n} my_cquantizer;\n\ntypedef my_cquantizer * my_cquantize_ptr;\n\n\n/*\n * Prescan some rows of pixels.\n * In this module the prescan simply updates the histogram, which has been\n * initialized to zeroes by start_pass.\n * An output_buf parameter is required by the method signature, but no data\n * is actually output (in fact the buffer controller is probably passing a\n * NULL pointer).\n */\n\nMETHODDEF(void)\nprescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n\t\t  JSAMPARRAY output_buf, int num_rows)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register JSAMPROW ptr;\n  register histptr histp;\n  register hist3d histogram = cquantize->histogram;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    ptr = input_buf[row];\n    for (col = width; col > 0; col--) {\n      /* get pixel value and index into the histogram */\n      histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT]\n\t\t\t [GETJSAMPLE(ptr[1]) >> C1_SHIFT]\n\t\t\t [GETJSAMPLE(ptr[2]) >> C2_SHIFT];\n      /* increment, check for overflow and undo increment if so. */\n      if (++(*histp) <= 0)\n\t(*histp)--;\n      ptr += 3;\n    }\n  }\n}\n\n\n/*\n * Next we have the really interesting routines: selection of a colormap\n * given the completed histogram.\n * These routines work with a list of \"boxes\", each representing a rectangular\n * subset of the input color space (to histogram precision).\n */\n\ntypedef struct {\n  /* The bounds of the box (inclusive); expressed as histogram indexes */\n  int c0min, c0max;\n  int c1min, c1max;\n  int c2min, c2max;\n  /* The volume (actually 2-norm) of the box */\n  INT32 volume;\n  /* The number of nonzero histogram cells within this box */\n  long colorcount;\n} box;\n\ntypedef box * boxptr;\n\n\nLOCAL(boxptr)\nfind_biggest_color_pop (boxptr boxlist, int numboxes)\n/* Find the splittable box with the largest color population */\n/* Returns NULL if no splittable boxes remain */\n{\n  register boxptr boxp;\n  register int i;\n  register long maxc = 0;\n  boxptr which = NULL;\n  \n  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {\n    if (boxp->colorcount > maxc && boxp->volume > 0) {\n      which = boxp;\n      maxc = boxp->colorcount;\n    }\n  }\n  return which;\n}\n\n\nLOCAL(boxptr)\nfind_biggest_volume (boxptr boxlist, int numboxes)\n/* Find the splittable box with the largest (scaled) volume */\n/* Returns NULL if no splittable boxes remain */\n{\n  register boxptr boxp;\n  register int i;\n  register INT32 maxv = 0;\n  boxptr which = NULL;\n  \n  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {\n    if (boxp->volume > maxv) {\n      which = boxp;\n      maxv = boxp->volume;\n    }\n  }\n  return which;\n}\n\n\nLOCAL(void)\nupdate_box (j_decompress_ptr cinfo, boxptr boxp)\n/* Shrink the min/max bounds of a box to enclose only nonzero elements, */\n/* and recompute its volume and population */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  histptr histp;\n  int c0,c1,c2;\n  int c0min,c0max,c1min,c1max,c2min,c2max;\n  INT32 dist0,dist1,dist2;\n  long ccount;\n  \n  c0min = boxp->c0min;  c0max = boxp->c0max;\n  c1min = boxp->c1min;  c1max = boxp->c1max;\n  c2min = boxp->c2min;  c2max = boxp->c2max;\n  \n  if (c0max > c0min)\n    for (c0 = c0min; c0 <= c0max; c0++)\n      for (c1 = c1min; c1 <= c1max; c1++) {\n\thistp = & histogram[c0][c1][c2min];\n\tfor (c2 = c2min; c2 <= c2max; c2++)\n\t  if (*histp++ != 0) {\n\t    boxp->c0min = c0min = c0;\n\t    goto have_c0min;\n\t  }\n      }\n have_c0min:\n  if (c0max > c0min)\n    for (c0 = c0max; c0 >= c0min; c0--)\n      for (c1 = c1min; c1 <= c1max; c1++) {\n\thistp = & histogram[c0][c1][c2min];\n\tfor (c2 = c2min; c2 <= c2max; c2++)\n\t  if (*histp++ != 0) {\n\t    boxp->c0max = c0max = c0;\n\t    goto have_c0max;\n\t  }\n      }\n have_c0max:\n  if (c1max > c1min)\n    for (c1 = c1min; c1 <= c1max; c1++)\n      for (c0 = c0min; c0 <= c0max; c0++) {\n\thistp = & histogram[c0][c1][c2min];\n\tfor (c2 = c2min; c2 <= c2max; c2++)\n\t  if (*histp++ != 0) {\n\t    boxp->c1min = c1min = c1;\n\t    goto have_c1min;\n\t  }\n      }\n have_c1min:\n  if (c1max > c1min)\n    for (c1 = c1max; c1 >= c1min; c1--)\n      for (c0 = c0min; c0 <= c0max; c0++) {\n\thistp = & histogram[c0][c1][c2min];\n\tfor (c2 = c2min; c2 <= c2max; c2++)\n\t  if (*histp++ != 0) {\n\t    boxp->c1max = c1max = c1;\n\t    goto have_c1max;\n\t  }\n      }\n have_c1max:\n  if (c2max > c2min)\n    for (c2 = c2min; c2 <= c2max; c2++)\n      for (c0 = c0min; c0 <= c0max; c0++) {\n\thistp = & histogram[c0][c1min][c2];\n\tfor (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)\n\t  if (*histp != 0) {\n\t    boxp->c2min = c2min = c2;\n\t    goto have_c2min;\n\t  }\n      }\n have_c2min:\n  if (c2max > c2min)\n    for (c2 = c2max; c2 >= c2min; c2--)\n      for (c0 = c0min; c0 <= c0max; c0++) {\n\thistp = & histogram[c0][c1min][c2];\n\tfor (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)\n\t  if (*histp != 0) {\n\t    boxp->c2max = c2max = c2;\n\t    goto have_c2max;\n\t  }\n      }\n have_c2max:\n\n  /* Update box volume.\n   * We use 2-norm rather than real volume here; this biases the method\n   * against making long narrow boxes, and it has the side benefit that\n   * a box is splittable iff norm > 0.\n   * Since the differences are expressed in histogram-cell units,\n   * we have to shift back to JSAMPLE units to get consistent distances;\n   * after which, we scale according to the selected distance scale factors.\n   */\n  dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE;\n  dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE;\n  dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE;\n  boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2;\n  \n  /* Now scan remaining volume of box and compute population */\n  ccount = 0;\n  for (c0 = c0min; c0 <= c0max; c0++)\n    for (c1 = c1min; c1 <= c1max; c1++) {\n      histp = & histogram[c0][c1][c2min];\n      for (c2 = c2min; c2 <= c2max; c2++, histp++)\n\tif (*histp != 0) {\n\t  ccount++;\n\t}\n    }\n  boxp->colorcount = ccount;\n}\n\n\nLOCAL(int)\nmedian_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes,\n\t    int desired_colors)\n/* Repeatedly select and split the largest box until we have enough boxes */\n{\n  int n,lb;\n  int c0,c1,c2,cmax;\n  register boxptr b1,b2;\n\n  while (numboxes < desired_colors) {\n    /* Select box to split.\n     * Current algorithm: by population for first half, then by volume.\n     */\n    if (numboxes*2 <= desired_colors) {\n      b1 = find_biggest_color_pop(boxlist, numboxes);\n    } else {\n      b1 = find_biggest_volume(boxlist, numboxes);\n    }\n    if (b1 == NULL)\t\t/* no splittable boxes left! */\n      break;\n    b2 = &boxlist[numboxes];\t/* where new box will go */\n    /* Copy the color bounds to the new box. */\n    b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max;\n    b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min;\n    /* Choose which axis to split the box on.\n     * Current algorithm: longest scaled axis.\n     * See notes in update_box about scaling distances.\n     */\n    c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE;\n    c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE;\n    c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE;\n    /* We want to break any ties in favor of green, then red, blue last.\n     * This code does the right thing for R,G,B or B,G,R color orders only.\n     */\n#if RGB_RED == 0\n    cmax = c1; n = 1;\n    if (c0 > cmax) { cmax = c0; n = 0; }\n    if (c2 > cmax) { n = 2; }\n#else\n    cmax = c1; n = 1;\n    if (c2 > cmax) { cmax = c2; n = 2; }\n    if (c0 > cmax) { n = 0; }\n#endif\n    /* Choose split point along selected axis, and update box bounds.\n     * Current algorithm: split at halfway point.\n     * (Since the box has been shrunk to minimum volume,\n     * any split will produce two nonempty subboxes.)\n     * Note that lb value is max for lower box, so must be < old max.\n     */\n    switch (n) {\n    case 0:\n      lb = (b1->c0max + b1->c0min) / 2;\n      b1->c0max = lb;\n      b2->c0min = lb+1;\n      break;\n    case 1:\n      lb = (b1->c1max + b1->c1min) / 2;\n      b1->c1max = lb;\n      b2->c1min = lb+1;\n      break;\n    case 2:\n      lb = (b1->c2max + b1->c2min) / 2;\n      b1->c2max = lb;\n      b2->c2min = lb+1;\n      break;\n    }\n    /* Update stats for boxes */\n    update_box(cinfo, b1);\n    update_box(cinfo, b2);\n    numboxes++;\n  }\n  return numboxes;\n}\n\n\nLOCAL(void)\ncompute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)\n/* Compute representative color for a box, put it in colormap[icolor] */\n{\n  /* Current algorithm: mean weighted by pixels (not colors) */\n  /* Note it is important to get the rounding correct! */\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  histptr histp;\n  int c0,c1,c2;\n  int c0min,c0max,c1min,c1max,c2min,c2max;\n  long count;\n  long total = 0;\n  long c0total = 0;\n  long c1total = 0;\n  long c2total = 0;\n  \n  c0min = boxp->c0min;  c0max = boxp->c0max;\n  c1min = boxp->c1min;  c1max = boxp->c1max;\n  c2min = boxp->c2min;  c2max = boxp->c2max;\n  \n  for (c0 = c0min; c0 <= c0max; c0++)\n    for (c1 = c1min; c1 <= c1max; c1++) {\n      histp = & histogram[c0][c1][c2min];\n      for (c2 = c2min; c2 <= c2max; c2++) {\n\tif ((count = *histp++) != 0) {\n\t  total += count;\n\t  c0total += ((c0 << C0_SHIFT) + ((1<<C0_SHIFT)>>1)) * count;\n\t  c1total += ((c1 << C1_SHIFT) + ((1<<C1_SHIFT)>>1)) * count;\n\t  c2total += ((c2 << C2_SHIFT) + ((1<<C2_SHIFT)>>1)) * count;\n\t}\n      }\n    }\n  \n  cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total);\n  cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total);\n  cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);\n}\n\n\nLOCAL(void)\nselect_colors (j_decompress_ptr cinfo, int desired_colors)\n/* Master routine for color selection */\n{\n  boxptr boxlist;\n  int numboxes;\n  int i;\n\n  /* Allocate workspace for box list */\n  boxlist = (boxptr) (*cinfo->mem->alloc_small)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF(box));\n  /* Initialize one box containing whole space */\n  numboxes = 1;\n  boxlist[0].c0min = 0;\n  boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT;\n  boxlist[0].c1min = 0;\n  boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT;\n  boxlist[0].c2min = 0;\n  boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT;\n  /* Shrink it to actually-used volume and set its statistics */\n  update_box(cinfo, & boxlist[0]);\n  /* Perform median-cut to produce final box list */\n  numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors);\n  /* Compute the representative color for each box, fill colormap */\n  for (i = 0; i < numboxes; i++)\n    compute_color(cinfo, & boxlist[i], i);\n  cinfo->actual_number_of_colors = numboxes;\n  TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes);\n}\n\n\n/*\n * These routines are concerned with the time-critical task of mapping input\n * colors to the nearest color in the selected colormap.\n *\n * We re-use the histogram space as an \"inverse color map\", essentially a\n * cache for the results of nearest-color searches.  All colors within a\n * histogram cell will be mapped to the same colormap entry, namely the one\n * closest to the cell's center.  This may not be quite the closest entry to\n * the actual input color, but it's almost as good.  A zero in the cache\n * indicates we haven't found the nearest color for that cell yet; the array\n * is cleared to zeroes before starting the mapping pass.  When we find the\n * nearest color for a cell, its colormap index plus one is recorded in the\n * cache for future use.  The pass2 scanning routines call fill_inverse_cmap\n * when they need to use an unfilled entry in the cache.\n *\n * Our method of efficiently finding nearest colors is based on the \"locally\n * sorted search\" idea described by Heckbert and on the incremental distance\n * calculation described by Spencer W. Thomas in chapter III.1 of Graphics\n * Gems II (James Arvo, ed.  Academic Press, 1991).  Thomas points out that\n * the distances from a given colormap entry to each cell of the histogram can\n * be computed quickly using an incremental method: the differences between\n * distances to adjacent cells themselves differ by a constant.  This allows a\n * fairly fast implementation of the \"brute force\" approach of computing the\n * distance from every colormap entry to every histogram cell.  Unfortunately,\n * it needs a work array to hold the best-distance-so-far for each histogram\n * cell (because the inner loop has to be over cells, not colormap entries).\n * The work array elements have to be INT32s, so the work array would need\n * 256Kb at our recommended precision.  This is not feasible in DOS machines.\n *\n * To get around these problems, we apply Thomas' method to compute the\n * nearest colors for only the cells within a small subbox of the histogram.\n * The work array need be only as big as the subbox, so the memory usage\n * problem is solved.  Furthermore, we need not fill subboxes that are never\n * referenced in pass2; many images use only part of the color gamut, so a\n * fair amount of work is saved.  An additional advantage of this\n * approach is that we can apply Heckbert's locality criterion to quickly\n * eliminate colormap entries that are far away from the subbox; typically\n * three-fourths of the colormap entries are rejected by Heckbert's criterion,\n * and we need not compute their distances to individual cells in the subbox.\n * The speed of this approach is heavily influenced by the subbox size: too\n * small means too much overhead, too big loses because Heckbert's criterion\n * can't eliminate as many colormap entries.  Empirically the best subbox\n * size seems to be about 1/512th of the histogram (1/8th in each direction).\n *\n * Thomas' article also describes a refined method which is asymptotically\n * faster than the brute-force method, but it is also far more complex and\n * cannot efficiently be applied to small subboxes.  It is therefore not\n * useful for programs intended to be portable to DOS machines.  On machines\n * with plenty of memory, filling the whole histogram in one shot with Thomas'\n * refined method might be faster than the present code --- but then again,\n * it might not be any faster, and it's certainly more complicated.\n */\n\n\n/* log2(histogram cells in update box) for each axis; this can be adjusted */\n#define BOX_C0_LOG  (HIST_C0_BITS-3)\n#define BOX_C1_LOG  (HIST_C1_BITS-3)\n#define BOX_C2_LOG  (HIST_C2_BITS-3)\n\n#define BOX_C0_ELEMS  (1<<BOX_C0_LOG) /* # of hist cells in update box */\n#define BOX_C1_ELEMS  (1<<BOX_C1_LOG)\n#define BOX_C2_ELEMS  (1<<BOX_C2_LOG)\n\n#define BOX_C0_SHIFT  (C0_SHIFT + BOX_C0_LOG)\n#define BOX_C1_SHIFT  (C1_SHIFT + BOX_C1_LOG)\n#define BOX_C2_SHIFT  (C2_SHIFT + BOX_C2_LOG)\n\n\n/*\n * The next three routines implement inverse colormap filling.  They could\n * all be folded into one big routine, but splitting them up this way saves\n * some stack space (the mindist[] and bestdist[] arrays need not coexist)\n * and may allow some compilers to produce better code by registerizing more\n * inner-loop variables.\n */\n\nLOCAL(int)\nfind_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,\n\t\t    JSAMPLE colorlist[])\n/* Locate the colormap entries close enough to an update box to be candidates\n * for the nearest entry to some cell(s) in the update box.  The update box\n * is specified by the center coordinates of its first cell.  The number of\n * candidate colormap entries is returned, and their colormap indexes are\n * placed in colorlist[].\n * This routine uses Heckbert's \"locally sorted search\" criterion to select\n * the colors that need further consideration.\n */\n{\n  int numcolors = cinfo->actual_number_of_colors;\n  int maxc0, maxc1, maxc2;\n  int centerc0, centerc1, centerc2;\n  int i, x, ncolors;\n  INT32 minmaxdist, min_dist, max_dist, tdist;\n  INT32 mindist[MAXNUMCOLORS];\t/* min distance to colormap entry i */\n\n  /* Compute true coordinates of update box's upper corner and center.\n   * Actually we compute the coordinates of the center of the upper-corner\n   * histogram cell, which are the upper bounds of the volume we care about.\n   * Note that since \">>\" rounds down, the \"center\" values may be closer to\n   * min than to max; hence comparisons to them must be \"<=\", not \"<\".\n   */\n  maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT));\n  centerc0 = (minc0 + maxc0) >> 1;\n  maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT));\n  centerc1 = (minc1 + maxc1) >> 1;\n  maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT));\n  centerc2 = (minc2 + maxc2) >> 1;\n\n  /* For each color in colormap, find:\n   *  1. its minimum squared-distance to any point in the update box\n   *     (zero if color is within update box);\n   *  2. its maximum squared-distance to any point in the update box.\n   * Both of these can be found by considering only the corners of the box.\n   * We save the minimum distance for each color in mindist[];\n   * only the smallest maximum distance is of interest.\n   */\n  minmaxdist = 0x7FFFFFFFL;\n\n  for (i = 0; i < numcolors; i++) {\n    /* We compute the squared-c0-distance term, then add in the other two. */\n    x = GETJSAMPLE(cinfo->colormap[0][i]);\n    if (x < minc0) {\n      tdist = (x - minc0) * C0_SCALE;\n      min_dist = tdist*tdist;\n      tdist = (x - maxc0) * C0_SCALE;\n      max_dist = tdist*tdist;\n    } else if (x > maxc0) {\n      tdist = (x - maxc0) * C0_SCALE;\n      min_dist = tdist*tdist;\n      tdist = (x - minc0) * C0_SCALE;\n      max_dist = tdist*tdist;\n    } else {\n      /* within cell range so no contribution to min_dist */\n      min_dist = 0;\n      if (x <= centerc0) {\n\ttdist = (x - maxc0) * C0_SCALE;\n\tmax_dist = tdist*tdist;\n      } else {\n\ttdist = (x - minc0) * C0_SCALE;\n\tmax_dist = tdist*tdist;\n      }\n    }\n\n    x = GETJSAMPLE(cinfo->colormap[1][i]);\n    if (x < minc1) {\n      tdist = (x - minc1) * C1_SCALE;\n      min_dist += tdist*tdist;\n      tdist = (x - maxc1) * C1_SCALE;\n      max_dist += tdist*tdist;\n    } else if (x > maxc1) {\n      tdist = (x - maxc1) * C1_SCALE;\n      min_dist += tdist*tdist;\n      tdist = (x - minc1) * C1_SCALE;\n      max_dist += tdist*tdist;\n    } else {\n      /* within cell range so no contribution to min_dist */\n      if (x <= centerc1) {\n\ttdist = (x - maxc1) * C1_SCALE;\n\tmax_dist += tdist*tdist;\n      } else {\n\ttdist = (x - minc1) * C1_SCALE;\n\tmax_dist += tdist*tdist;\n      }\n    }\n\n    x = GETJSAMPLE(cinfo->colormap[2][i]);\n    if (x < minc2) {\n      tdist = (x - minc2) * C2_SCALE;\n      min_dist += tdist*tdist;\n      tdist = (x - maxc2) * C2_SCALE;\n      max_dist += tdist*tdist;\n    } else if (x > maxc2) {\n      tdist = (x - maxc2) * C2_SCALE;\n      min_dist += tdist*tdist;\n      tdist = (x - minc2) * C2_SCALE;\n      max_dist += tdist*tdist;\n    } else {\n      /* within cell range so no contribution to min_dist */\n      if (x <= centerc2) {\n\ttdist = (x - maxc2) * C2_SCALE;\n\tmax_dist += tdist*tdist;\n      } else {\n\ttdist = (x - minc2) * C2_SCALE;\n\tmax_dist += tdist*tdist;\n      }\n    }\n\n    mindist[i] = min_dist;\t/* save away the results */\n    if (max_dist < minmaxdist)\n      minmaxdist = max_dist;\n  }\n\n  /* Now we know that no cell in the update box is more than minmaxdist\n   * away from some colormap entry.  Therefore, only colors that are\n   * within minmaxdist of some part of the box need be considered.\n   */\n  ncolors = 0;\n  for (i = 0; i < numcolors; i++) {\n    if (mindist[i] <= minmaxdist)\n      colorlist[ncolors++] = (JSAMPLE) i;\n  }\n  return ncolors;\n}\n\n\nLOCAL(void)\nfind_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,\n\t\t  int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[])\n/* Find the closest colormap entry for each cell in the update box,\n * given the list of candidate colors prepared by find_nearby_colors.\n * Return the indexes of the closest entries in the bestcolor[] array.\n * This routine uses Thomas' incremental distance calculation method to\n * find the distance from a colormap entry to successive cells in the box.\n */\n{\n  int ic0, ic1, ic2;\n  int i, icolor;\n  register INT32 * bptr;\t/* pointer into bestdist[] array */\n  JSAMPLE * cptr;\t\t/* pointer into bestcolor[] array */\n  INT32 dist0, dist1;\t\t/* initial distance values */\n  register INT32 dist2;\t\t/* current distance in inner loop */\n  INT32 xx0, xx1;\t\t/* distance increments */\n  register INT32 xx2;\n  INT32 inc0, inc1, inc2;\t/* initial values for increments */\n  /* This array holds the distance to the nearest-so-far color for each cell */\n  INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];\n\n  /* Initialize best-distance for each cell of the update box */\n  bptr = bestdist;\n  for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--)\n    *bptr++ = 0x7FFFFFFFL;\n  \n  /* For each color selected by find_nearby_colors,\n   * compute its distance to the center of each cell in the box.\n   * If that's less than best-so-far, update best distance and color number.\n   */\n  \n  /* Nominal steps between cell centers (\"x\" in Thomas article) */\n#define STEP_C0  ((1 << C0_SHIFT) * C0_SCALE)\n#define STEP_C1  ((1 << C1_SHIFT) * C1_SCALE)\n#define STEP_C2  ((1 << C2_SHIFT) * C2_SCALE)\n  \n  for (i = 0; i < numcolors; i++) {\n    icolor = GETJSAMPLE(colorlist[i]);\n    /* Compute (square of) distance from minc0/c1/c2 to this color */\n    inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE;\n    dist0 = inc0*inc0;\n    inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE;\n    dist0 += inc1*inc1;\n    inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE;\n    dist0 += inc2*inc2;\n    /* Form the initial difference increments */\n    inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0;\n    inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1;\n    inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2;\n    /* Now loop over all cells in box, updating distance per Thomas method */\n    bptr = bestdist;\n    cptr = bestcolor;\n    xx0 = inc0;\n    for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) {\n      dist1 = dist0;\n      xx1 = inc1;\n      for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) {\n\tdist2 = dist1;\n\txx2 = inc2;\n\tfor (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) {\n\t  if (dist2 < *bptr) {\n\t    *bptr = dist2;\n\t    *cptr = (JSAMPLE) icolor;\n\t  }\n\t  dist2 += xx2;\n\t  xx2 += 2 * STEP_C2 * STEP_C2;\n\t  bptr++;\n\t  cptr++;\n\t}\n\tdist1 += xx1;\n\txx1 += 2 * STEP_C1 * STEP_C1;\n      }\n      dist0 += xx0;\n      xx0 += 2 * STEP_C0 * STEP_C0;\n    }\n  }\n}\n\n\nLOCAL(void)\nfill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)\n/* Fill the inverse-colormap entries in the update box that contains */\n/* histogram cell c0/c1/c2.  (Only that one cell MUST be filled, but */\n/* we can fill as many others as we wish.) */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  int minc0, minc1, minc2;\t/* lower left corner of update box */\n  int ic0, ic1, ic2;\n  register JSAMPLE * cptr;\t/* pointer into bestcolor[] array */\n  register histptr cachep;\t/* pointer into main cache array */\n  /* This array lists the candidate colormap indexes. */\n  JSAMPLE colorlist[MAXNUMCOLORS];\n  int numcolors;\t\t/* number of candidate colors */\n  /* This array holds the actually closest colormap index for each cell. */\n  JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];\n\n  /* Convert cell coordinates to update box ID */\n  c0 >>= BOX_C0_LOG;\n  c1 >>= BOX_C1_LOG;\n  c2 >>= BOX_C2_LOG;\n\n  /* Compute true coordinates of update box's origin corner.\n   * Actually we compute the coordinates of the center of the corner\n   * histogram cell, which are the lower bounds of the volume we care about.\n   */\n  minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1);\n  minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1);\n  minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1);\n  \n  /* Determine which colormap entries are close enough to be candidates\n   * for the nearest entry to some cell in the update box.\n   */\n  numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist);\n\n  /* Determine the actually nearest colors. */\n  find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist,\n\t\t   bestcolor);\n\n  /* Save the best color numbers (plus 1) in the main cache array */\n  c0 <<= BOX_C0_LOG;\t\t/* convert ID back to base cell indexes */\n  c1 <<= BOX_C1_LOG;\n  c2 <<= BOX_C2_LOG;\n  cptr = bestcolor;\n  for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) {\n    for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) {\n      cachep = & histogram[c0+ic0][c1+ic1][c2];\n      for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) {\n\t*cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1);\n      }\n    }\n  }\n}\n\n\n/*\n * Map some rows of pixels to the output colormapped representation.\n */\n\nMETHODDEF(void)\npass2_no_dither (j_decompress_ptr cinfo,\n\t\t JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)\n/* This version performs no dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  register JSAMPROW inptr, outptr;\n  register histptr cachep;\n  register int c0, c1, c2;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    inptr = input_buf[row];\n    outptr = output_buf[row];\n    for (col = width; col > 0; col--) {\n      /* get pixel value and index into the cache */\n      c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT;\n      c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT;\n      c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT;\n      cachep = & histogram[c0][c1][c2];\n      /* If we have not seen this color before, find nearest colormap entry */\n      /* and update the cache */\n      if (*cachep == 0)\n\tfill_inverse_cmap(cinfo, c0,c1,c2);\n      /* Now emit the colormap index for this cell */\n      *outptr++ = (JSAMPLE) (*cachep - 1);\n    }\n  }\n}\n\n\nMETHODDEF(void)\npass2_fs_dither (j_decompress_ptr cinfo,\n\t\t JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)\n/* This version performs Floyd-Steinberg dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  register LOCFSERROR cur0, cur1, cur2;\t/* current error or pixel value */\n  LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */\n  LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */\n  register FSERRPTR errorptr;\t/* => fserrors[] at column before current */\n  JSAMPROW inptr;\t\t/* => current input pixel */\n  JSAMPROW outptr;\t\t/* => current output pixel */\n  histptr cachep;\n  int dir;\t\t\t/* +1 or -1 depending on direction */\n  int dir3;\t\t\t/* 3*dir, for advancing inptr & errorptr */\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n  JSAMPLE *range_limit = cinfo->sample_range_limit;\n  int *error_limit = cquantize->error_limiter;\n  JSAMPROW colormap0 = cinfo->colormap[0];\n  JSAMPROW colormap1 = cinfo->colormap[1];\n  JSAMPROW colormap2 = cinfo->colormap[2];\n  SHIFT_TEMPS\n\n  for (row = 0; row < num_rows; row++) {\n    inptr = input_buf[row];\n    outptr = output_buf[row];\n    if (cquantize->on_odd_row) {\n      /* work right to left in this row */\n      inptr += (width-1) * 3;\t/* so point to rightmost pixel */\n      outptr += width-1;\n      dir = -1;\n      dir3 = -3;\n      errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */\n      cquantize->on_odd_row = FALSE; /* flip for next time */\n    } else {\n      /* work left to right in this row */\n      dir = 1;\n      dir3 = 3;\n      errorptr = cquantize->fserrors; /* => entry before first real column */\n      cquantize->on_odd_row = TRUE; /* flip for next time */\n    }\n    /* Preset error values: no error propagated to first pixel from left */\n    cur0 = cur1 = cur2 = 0;\n    /* and no error propagated to row below yet */\n    belowerr0 = belowerr1 = belowerr2 = 0;\n    bpreverr0 = bpreverr1 = bpreverr2 = 0;\n\n    for (col = width; col > 0; col--) {\n      /* curN holds the error propagated from the previous pixel on the\n       * current line.  Add the error propagated from the previous line\n       * to form the complete error correction term for this pixel, and\n       * round the error term (which is expressed * 16) to an integer.\n       * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct\n       * for either sign of the error value.\n       * Note: errorptr points to *previous* column's array entry.\n       */\n      cur0 = RIGHT_SHIFT(cur0 + errorptr[dir3+0] + 8, 4);\n      cur1 = RIGHT_SHIFT(cur1 + errorptr[dir3+1] + 8, 4);\n      cur2 = RIGHT_SHIFT(cur2 + errorptr[dir3+2] + 8, 4);\n      /* Limit the error using transfer function set by init_error_limit.\n       * See comments with init_error_limit for rationale.\n       */\n      cur0 = error_limit[cur0];\n      cur1 = error_limit[cur1];\n      cur2 = error_limit[cur2];\n      /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.\n       * The maximum error is +- MAXJSAMPLE (or less with error limiting);\n       * this sets the required size of the range_limit array.\n       */\n      cur0 += GETJSAMPLE(inptr[0]);\n      cur1 += GETJSAMPLE(inptr[1]);\n      cur2 += GETJSAMPLE(inptr[2]);\n      cur0 = GETJSAMPLE(range_limit[cur0]);\n      cur1 = GETJSAMPLE(range_limit[cur1]);\n      cur2 = GETJSAMPLE(range_limit[cur2]);\n      /* Index into the cache with adjusted pixel value */\n      cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT];\n      /* If we have not seen this color before, find nearest colormap */\n      /* entry and update the cache */\n      if (*cachep == 0)\n\tfill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT);\n      /* Now emit the colormap index for this cell */\n      { register int pixcode = *cachep - 1;\n\t*outptr = (JSAMPLE) pixcode;\n\t/* Compute representation error for this pixel */\n\tcur0 -= GETJSAMPLE(colormap0[pixcode]);\n\tcur1 -= GETJSAMPLE(colormap1[pixcode]);\n\tcur2 -= GETJSAMPLE(colormap2[pixcode]);\n      }\n      /* Compute error fractions to be propagated to adjacent pixels.\n       * Add these into the running sums, and simultaneously shift the\n       * next-line error sums left by 1 column.\n       */\n      { register LOCFSERROR bnexterr, delta;\n\n\tbnexterr = cur0;\t/* Process component 0 */\n\tdelta = cur0 * 2;\n\tcur0 += delta;\t\t/* form error * 3 */\n\terrorptr[0] = (FSERROR) (bpreverr0 + cur0);\n\tcur0 += delta;\t\t/* form error * 5 */\n\tbpreverr0 = belowerr0 + cur0;\n\tbelowerr0 = bnexterr;\n\tcur0 += delta;\t\t/* form error * 7 */\n\tbnexterr = cur1;\t/* Process component 1 */\n\tdelta = cur1 * 2;\n\tcur1 += delta;\t\t/* form error * 3 */\n\terrorptr[1] = (FSERROR) (bpreverr1 + cur1);\n\tcur1 += delta;\t\t/* form error * 5 */\n\tbpreverr1 = belowerr1 + cur1;\n\tbelowerr1 = bnexterr;\n\tcur1 += delta;\t\t/* form error * 7 */\n\tbnexterr = cur2;\t/* Process component 2 */\n\tdelta = cur2 * 2;\n\tcur2 += delta;\t\t/* form error * 3 */\n\terrorptr[2] = (FSERROR) (bpreverr2 + cur2);\n\tcur2 += delta;\t\t/* form error * 5 */\n\tbpreverr2 = belowerr2 + cur2;\n\tbelowerr2 = bnexterr;\n\tcur2 += delta;\t\t/* form error * 7 */\n      }\n      /* At this point curN contains the 7/16 error value to be propagated\n       * to the next pixel on the current line, and all the errors for the\n       * next line have been shifted over.  We are therefore ready to move on.\n       */\n      inptr += dir3;\t\t/* Advance pixel pointers to next column */\n      outptr += dir;\n      errorptr += dir3;\t\t/* advance errorptr to current column */\n    }\n    /* Post-loop cleanup: we must unload the final error values into the\n     * final fserrors[] entry.  Note we need not unload belowerrN because\n     * it is for the dummy column before or after the actual array.\n     */\n    errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */\n    errorptr[1] = (FSERROR) bpreverr1;\n    errorptr[2] = (FSERROR) bpreverr2;\n  }\n}\n\n\n/*\n * Initialize the error-limiting transfer function (lookup table).\n * The raw F-S error computation can potentially compute error values of up to\n * +- MAXJSAMPLE.  But we want the maximum correction applied to a pixel to be\n * much less, otherwise obviously wrong pixels will be created.  (Typical\n * effects include weird fringes at color-area boundaries, isolated bright\n * pixels in a dark area, etc.)  The standard advice for avoiding this problem\n * is to ensure that the \"corners\" of the color cube are allocated as output\n * colors; then repeated errors in the same direction cannot cause cascading\n * error buildup.  However, that only prevents the error from getting\n * completely out of hand; Aaron Giles reports that error limiting improves\n * the results even with corner colors allocated.\n * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty\n * well, but the smoother transfer function used below is even better.  Thanks\n * to Aaron Giles for this idea.\n */\n\nLOCAL(void)\ninit_error_limit (j_decompress_ptr cinfo)\n/* Allocate and fill in the error_limiter table */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  int * table;\n  int in, out;\n\n  table = (int *) (*cinfo->mem->alloc_small)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int));\n  table += MAXJSAMPLE;\t\t/* so can index -MAXJSAMPLE .. +MAXJSAMPLE */\n  cquantize->error_limiter = table;\n\n#define STEPSIZE ((MAXJSAMPLE+1)/16)\n  /* Map errors 1:1 up to +- MAXJSAMPLE/16 */\n  out = 0;\n  for (in = 0; in < STEPSIZE; in++, out++) {\n    table[in] = out; table[-in] = -out;\n  }\n  /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */\n  for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) {\n    table[in] = out; table[-in] = -out;\n  }\n  /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */\n  for (; in <= MAXJSAMPLE; in++) {\n    table[in] = out; table[-in] = -out;\n  }\n#undef STEPSIZE\n}\n\n\n/*\n * Finish up at the end of each pass.\n */\n\nMETHODDEF(void)\nfinish_pass1 (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n\n  /* Select the representative colors and fill in cinfo->colormap */\n  cinfo->colormap = cquantize->sv_colormap;\n  select_colors(cinfo, cquantize->desired);\n  /* Force next pass to zero the color index table */\n  cquantize->needs_zeroed = TRUE;\n}\n\n\nMETHODDEF(void)\nfinish_pass2 (j_decompress_ptr cinfo)\n{\n  /* no work */\n}\n\n\n/*\n * Initialize for each processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  int i;\n\n  /* Only F-S dithering or no dithering is supported. */\n  /* If user asks for ordered dither, give him F-S. */\n  if (cinfo->dither_mode != JDITHER_NONE)\n    cinfo->dither_mode = JDITHER_FS;\n\n  if (is_pre_scan) {\n    /* Set up method pointers */\n    cquantize->pub.color_quantize = prescan_quantize;\n    cquantize->pub.finish_pass = finish_pass1;\n    cquantize->needs_zeroed = TRUE; /* Always zero histogram */\n  } else {\n    /* Set up method pointers */\n    if (cinfo->dither_mode == JDITHER_FS)\n      cquantize->pub.color_quantize = pass2_fs_dither;\n    else\n      cquantize->pub.color_quantize = pass2_no_dither;\n    cquantize->pub.finish_pass = finish_pass2;\n\n    /* Make sure color count is acceptable */\n    i = cinfo->actual_number_of_colors;\n    if (i < 1)\n      ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 1);\n    if (i > MAXNUMCOLORS)\n      ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);\n\n    if (cinfo->dither_mode == JDITHER_FS) {\n      size_t arraysize = (size_t) ((cinfo->output_width + 2) *\n\t\t\t\t   (3 * SIZEOF(FSERROR)));\n      /* Allocate Floyd-Steinberg workspace if we didn't already. */\n      if (cquantize->fserrors == NULL)\n\tcquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)\n\t  ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);\n      /* Initialize the propagated errors to zero. */\n      FMEMZERO((void FAR *) cquantize->fserrors, arraysize);\n      /* Make the error-limit table if we didn't already. */\n      if (cquantize->error_limiter == NULL)\n\tinit_error_limit(cinfo);\n      cquantize->on_odd_row = FALSE;\n    }\n\n  }\n  /* Zero the histogram or inverse color map, if necessary */\n  if (cquantize->needs_zeroed) {\n    for (i = 0; i < HIST_C0_ELEMS; i++) {\n      FMEMZERO((void FAR *) histogram[i],\n\t       HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell));\n    }\n    cquantize->needs_zeroed = FALSE;\n  }\n}\n\n\n/*\n * Switch to a new external colormap between output passes.\n */\n\nMETHODDEF(void)\nnew_color_map_2_quant (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n\n  /* Reset the inverse color map */\n  cquantize->needs_zeroed = TRUE;\n}\n\n\n/*\n * Module initialization routine for 2-pass color quantization.\n */\n\nGLOBAL(void)\njinit_2pass_quantizer (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize;\n  int i;\n\n  cquantize = (my_cquantize_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_cquantizer));\n  cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;\n  cquantize->pub.start_pass = start_pass_2_quant;\n  cquantize->pub.new_color_map = new_color_map_2_quant;\n  cquantize->fserrors = NULL;\t/* flag optional arrays not allocated */\n  cquantize->error_limiter = NULL;\n\n  /* Make sure jdmaster didn't give me a case I can't handle */\n  if (cinfo->out_color_components != 3)\n    ERREXIT(cinfo, JERR_NOTIMPL);\n\n  /* Allocate the histogram/inverse colormap storage */\n  cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF(hist2d));\n  for (i = 0; i < HIST_C0_ELEMS; i++) {\n    cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell));\n  }\n  cquantize->needs_zeroed = TRUE; /* histogram is garbage now */\n\n  /* Allocate storage for the completed colormap, if required.\n   * We do this now since it is FAR storage and may affect\n   * the memory manager's space calculations.\n   */\n  if (cinfo->enable_2pass_quant) {\n    /* Make sure color count is acceptable */\n    int desired = cinfo->desired_number_of_colors;\n    /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */\n    if (desired < 8)\n      ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 8);\n    /* Make sure colormap indexes can be represented by JSAMPLEs */\n    if (desired > MAXNUMCOLORS)\n      ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);\n    cquantize->sv_colormap = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3);\n    cquantize->desired = desired;\n  } else\n    cquantize->sv_colormap = NULL;\n\n  /* Only F-S dithering or no dithering is supported. */\n  /* If user asks for ordered dither, give him F-S. */\n  if (cinfo->dither_mode != JDITHER_NONE)\n    cinfo->dither_mode = JDITHER_FS;\n\n  /* Allocate Floyd-Steinberg workspace if necessary.\n   * This isn't really needed until pass 2, but again it is FAR storage.\n   * Although we will cope with a later change in dither_mode,\n   * we do not promise to honor max_memory_to_use if dither_mode changes.\n   */\n  if (cinfo->dither_mode == JDITHER_FS) {\n    cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF(FSERROR))));\n    /* Might as well create the error-limiting table too. */\n    init_error_limit(cinfo);\n  }\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n"
  },
  {
    "path": "jutils.c",
    "content": "/*\n * jutils.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * Modified 2009-2011 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains tables and miscellaneous utility routines needed\n * for both compression and decompression.\n * Note we prefix all global names with \"j\" to minimize conflicts with\n * a surrounding application.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element\n * of a DCT block read in natural order (left to right, top to bottom).\n */\n\n#if 0\t\t\t\t/* This table is not actually needed in v6a */\n\nconst int jpeg_zigzag_order[DCTSIZE2] = {\n   0,  1,  5,  6, 14, 15, 27, 28,\n   2,  4,  7, 13, 16, 26, 29, 42,\n   3,  8, 12, 17, 25, 30, 41, 43,\n   9, 11, 18, 24, 31, 40, 44, 53,\n  10, 19, 23, 32, 39, 45, 52, 54,\n  20, 22, 33, 38, 46, 51, 55, 60,\n  21, 34, 37, 47, 50, 56, 59, 61,\n  35, 36, 48, 49, 57, 58, 62, 63\n};\n\n#endif\n\n/*\n * jpeg_natural_order[i] is the natural-order position of the i'th element\n * of zigzag order.\n *\n * When reading corrupted data, the Huffman decoders could attempt\n * to reference an entry beyond the end of this array (if the decoded\n * zero run length reaches past the end of the block).  To prevent\n * wild stores without adding an inner-loop test, we put some extra\n * \"63\"s after the real entries.  This will cause the extra coefficient\n * to be stored in location 63 of the block, not somewhere random.\n * The worst case would be a run-length of 15, which means we need 16\n * fake entries.\n */\n\nconst int jpeg_natural_order[DCTSIZE2+16] = {\n  0,  1,  8, 16,  9,  2,  3, 10,\n 17, 24, 32, 25, 18, 11,  4,  5,\n 12, 19, 26, 33, 40, 48, 41, 34,\n 27, 20, 13,  6,  7, 14, 21, 28,\n 35, 42, 49, 56, 57, 50, 43, 36,\n 29, 22, 15, 23, 30, 37, 44, 51,\n 58, 59, 52, 45, 38, 31, 39, 46,\n 53, 60, 61, 54, 47, 55, 62, 63,\n 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */\n 63, 63, 63, 63, 63, 63, 63, 63\n};\n\nconst int jpeg_natural_order7[7*7+16] = {\n  0,  1,  8, 16,  9,  2,  3, 10,\n 17, 24, 32, 25, 18, 11,  4,  5,\n 12, 19, 26, 33, 40, 48, 41, 34,\n 27, 20, 13,  6, 14, 21, 28, 35,\n 42, 49, 50, 43, 36, 29, 22, 30,\n 37, 44, 51, 52, 45, 38, 46, 53,\n 54,\n 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */\n 63, 63, 63, 63, 63, 63, 63, 63\n};\n\nconst int jpeg_natural_order6[6*6+16] = {\n  0,  1,  8, 16,  9,  2,  3, 10,\n 17, 24, 32, 25, 18, 11,  4,  5,\n 12, 19, 26, 33, 40, 41, 34, 27,\n 20, 13, 21, 28, 35, 42, 43, 36,\n 29, 37, 44, 45,\n 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */\n 63, 63, 63, 63, 63, 63, 63, 63\n};\n\nconst int jpeg_natural_order5[5*5+16] = {\n  0,  1,  8, 16,  9,  2,  3, 10,\n 17, 24, 32, 25, 18, 11,  4, 12,\n 19, 26, 33, 34, 27, 20, 28, 35,\n 36,\n 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */\n 63, 63, 63, 63, 63, 63, 63, 63\n};\n\nconst int jpeg_natural_order4[4*4+16] = {\n  0,  1,  8, 16,  9,  2,  3, 10,\n 17, 24, 25, 18, 11, 19, 26, 27,\n 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */\n 63, 63, 63, 63, 63, 63, 63, 63\n};\n\nconst int jpeg_natural_order3[3*3+16] = {\n  0,  1,  8, 16,  9,  2, 10, 17,\n 18,\n 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */\n 63, 63, 63, 63, 63, 63, 63, 63\n};\n\nconst int jpeg_natural_order2[2*2+16] = {\n  0,  1,  8,  9,\n 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */\n 63, 63, 63, 63, 63, 63, 63, 63\n};\n\n\n/*\n * Arithmetic utilities\n */\n\nGLOBAL(long)\njdiv_round_up (long a, long b)\n/* Compute a/b rounded up to next integer, ie, ceil(a/b) */\n/* Assumes a >= 0, b > 0 */\n{\n  return (a + b - 1L) / b;\n}\n\n\nGLOBAL(long)\njround_up (long a, long b)\n/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */\n/* Assumes a >= 0, b > 0 */\n{\n  a += b - 1L;\n  return a - (a % b);\n}\n\n\n/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays\n * and coefficient-block arrays.  This won't work on 80x86 because the arrays\n * are FAR and we're assuming a small-pointer memory model.  However, some\n * DOS compilers provide far-pointer versions of memcpy() and memset() even\n * in the small-model libraries.  These will be used if USE_FMEM is defined.\n * Otherwise, the routines below do it the hard way.  (The performance cost\n * is not all that great, because these routines aren't very heavily used.)\n */\n\n#ifndef NEED_FAR_POINTERS\t/* normal case, same as regular macro */\n#define FMEMCOPY(dest,src,size)\tMEMCOPY(dest,src,size)\n#else\t\t\t\t/* 80x86 case, define if we can */\n#ifdef USE_FMEM\n#define FMEMCOPY(dest,src,size)\t_fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size))\n#else\n/* This function is for use by the FMEMZERO macro defined in jpegint.h.\n * Do not call this function directly, use the FMEMZERO macro instead.\n */\nGLOBAL(void)\njzero_far (void FAR * target, size_t bytestozero)\n/* Zero out a chunk of FAR memory. */\n/* This might be sample-array data, block-array data, or alloc_large data. */\n{\n  register char FAR * ptr = (char FAR *) target;\n  register size_t count;\n\n  for (count = bytestozero; count > 0; count--) {\n    *ptr++ = 0;\n  }\n}\n#endif\n#endif\n\n\nGLOBAL(void)\njcopy_sample_rows (JSAMPARRAY input_array, int source_row,\n\t\t   JSAMPARRAY output_array, int dest_row,\n\t\t   int num_rows, JDIMENSION num_cols)\n/* Copy some rows of samples from one place to another.\n * num_rows rows are copied from input_array[source_row++]\n * to output_array[dest_row++]; these areas may overlap for duplication.\n * The source and destination arrays must be at least as wide as num_cols.\n */\n{\n  register JSAMPROW inptr, outptr;\n#ifdef FMEMCOPY\n  register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE));\n#else\n  register JDIMENSION count;\n#endif\n  register int row;\n\n  input_array += source_row;\n  output_array += dest_row;\n\n  for (row = num_rows; row > 0; row--) {\n    inptr = *input_array++;\n    outptr = *output_array++;\n#ifdef FMEMCOPY\n    FMEMCOPY(outptr, inptr, count);\n#else\n    for (count = num_cols; count > 0; count--)\n      *outptr++ = *inptr++;\t/* needn't bother with GETJSAMPLE() here */\n#endif\n  }\n}\n\n\nGLOBAL(void)\njcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,\n\t\t JDIMENSION num_blocks)\n/* Copy a row of coefficient blocks from one place to another. */\n{\n#ifdef FMEMCOPY\n  FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));\n#else\n  register JCOEFPTR inptr, outptr;\n  register long count;\n\n  inptr = (JCOEFPTR) input_row;\n  outptr = (JCOEFPTR) output_row;\n  for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) {\n    *outptr++ = *inptr++;\n  }\n#endif\n}\n"
  },
  {
    "path": "jversion.h",
    "content": "/*\n * jversion.h\n *\n * Copyright (C) 1991-2014, Thomas G. Lane, Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains software version identification.\n */\n\n\n#define JVERSION\t\"9a  19-Jan-2014\"\n\n#define JCOPYRIGHT\t\"Copyright (C) 2014, Thomas G. Lane, Guido Vollbeding\"\n"
  },
  {
    "path": "libjpeg.txt",
    "content": "USING THE IJG JPEG LIBRARY\n\nCopyright (C) 1994-2013, Thomas G. Lane, Guido Vollbeding.\nThis file is part of the Independent JPEG Group's software.\nFor conditions of distribution and use, see the accompanying README file.\n\n\nThis file describes how to use the IJG JPEG library within an application\nprogram.  Read it if you want to write a program that uses the library.\n\nThe file example.c provides heavily commented skeleton code for calling the\nJPEG library.  Also see jpeglib.h (the include file to be used by application\nprograms) for full details about data structures and function parameter lists.\nThe library source code, of course, is the ultimate reference.\n\nNote that there have been *major* changes from the application interface\npresented by IJG version 4 and earlier versions.  The old design had several\ninherent limitations, and it had accumulated a lot of cruft as we added\nfeatures while trying to minimize application-interface changes.  We have\nsacrificed backward compatibility in the version 5 rewrite, but we think the\nimprovements justify this.\n\n\nTABLE OF CONTENTS\n-----------------\n\nOverview:\n\tFunctions provided by the library\n\tOutline of typical usage\nBasic library usage:\n\tData formats\n\tCompression details\n\tDecompression details\n\tMechanics of usage: include files, linking, etc\nAdvanced features:\n\tCompression parameter selection\n\tDecompression parameter selection\n\tSpecial color spaces\n\tError handling\n\tCompressed data handling (source and destination managers)\n\tI/O suspension\n\tProgressive JPEG support\n\tBuffered-image mode\n\tAbbreviated datastreams and multiple images\n\tSpecial markers\n\tRaw (downsampled) image data\n\tReally raw data: DCT coefficients\n\tProgress monitoring\n\tMemory management\n\tMemory usage\n\tLibrary compile-time options\n\tPortability considerations\n\tNotes for MS-DOS implementors\n\nYou should read at least the overview and basic usage sections before trying\nto program with the library.  The sections on advanced features can be read\nif and when you need them.\n\n\nOVERVIEW\n========\n\nFunctions provided by the library\n---------------------------------\n\nThe IJG JPEG library provides C code to read and write JPEG-compressed image\nfiles.  The surrounding application program receives or supplies image data a\nscanline at a time, using a straightforward uncompressed image format.  All\ndetails of color conversion and other preprocessing/postprocessing can be\nhandled by the library.\n\nThe library includes a substantial amount of code that is not covered by the\nJPEG standard but is necessary for typical applications of JPEG.  These\nfunctions preprocess the image before JPEG compression or postprocess it after\ndecompression.  They include colorspace conversion, downsampling/upsampling,\nand color quantization.  The application indirectly selects use of this code\nby specifying the format in which it wishes to supply or receive image data.\nFor example, if colormapped output is requested, then the decompression\nlibrary automatically invokes color quantization.\n\nA wide range of quality vs. speed tradeoffs are possible in JPEG processing,\nand even more so in decompression postprocessing.  The decompression library\nprovides multiple implementations that cover most of the useful tradeoffs,\nranging from very-high-quality down to fast-preview operation.  On the\ncompression side we have generally not provided low-quality choices, since\ncompression is normally less time-critical.  It should be understood that the\nlow-quality modes may not meet the JPEG standard's accuracy requirements;\nnonetheless, they are useful for viewers.\n\nA word about functions *not* provided by the library.  We handle a subset of\nthe ISO JPEG standard; most baseline, extended-sequential, and progressive\nJPEG processes are supported.  (Our subset includes all features now in common\nuse.)  Unsupported ISO options include:\n\t* Hierarchical storage\n\t* Lossless JPEG\n\t* DNL marker\n\t* Nonintegral subsampling ratios\nWe support 8-bit to 12-bit data precision, but this is a compile-time choice\nrather than a run-time choice; hence it is difficult to use different\nprecisions in a single application.\n\nBy itself, the library handles only interchange JPEG datastreams --- in\nparticular the widely used JFIF file format.  The library can be used by\nsurrounding code to process interchange or abbreviated JPEG datastreams that\nare embedded in more complex file formats.  (For example, this library is\nused by the free LIBTIFF library to support JPEG compression in TIFF.)\n\n\nOutline of typical usage\n------------------------\n\nThe rough outline of a JPEG compression operation is:\n\n\tAllocate and initialize a JPEG compression object\n\tSpecify the destination for the compressed data (eg, a file)\n\tSet parameters for compression, including image size & colorspace\n\tjpeg_start_compress(...);\n\twhile (scan lines remain to be written)\n\t\tjpeg_write_scanlines(...);\n\tjpeg_finish_compress(...);\n\tRelease the JPEG compression object\n\nA JPEG compression object holds parameters and working state for the JPEG\nlibrary.  We make creation/destruction of the object separate from starting\nor finishing compression of an image; the same object can be re-used for a\nseries of image compression operations.  This makes it easy to re-use the\nsame parameter settings for a sequence of images.  Re-use of a JPEG object\nalso has important implications for processing abbreviated JPEG datastreams,\nas discussed later.\n\nThe image data to be compressed is supplied to jpeg_write_scanlines() from\nin-memory buffers.  If the application is doing file-to-file compression,\nreading image data from the source file is the application's responsibility.\nThe library emits compressed data by calling a \"data destination manager\",\nwhich typically will write the data into a file; but the application can\nprovide its own destination manager to do something else.\n\nSimilarly, the rough outline of a JPEG decompression operation is:\n\n\tAllocate and initialize a JPEG decompression object\n\tSpecify the source of the compressed data (eg, a file)\n\tCall jpeg_read_header() to obtain image info\n\tSet parameters for decompression\n\tjpeg_start_decompress(...);\n\twhile (scan lines remain to be read)\n\t\tjpeg_read_scanlines(...);\n\tjpeg_finish_decompress(...);\n\tRelease the JPEG decompression object\n\nThis is comparable to the compression outline except that reading the\ndatastream header is a separate step.  This is helpful because information\nabout the image's size, colorspace, etc is available when the application\nselects decompression parameters.  For example, the application can choose an\noutput scaling ratio that will fit the image into the available screen size.\n\nThe decompression library obtains compressed data by calling a data source\nmanager, which typically will read the data from a file; but other behaviors\ncan be obtained with a custom source manager.  Decompressed data is delivered\ninto in-memory buffers passed to jpeg_read_scanlines().\n\nIt is possible to abort an incomplete compression or decompression operation\nby calling jpeg_abort(); or, if you do not need to retain the JPEG object,\nsimply release it by calling jpeg_destroy().\n\nJPEG compression and decompression objects are two separate struct types.\nHowever, they share some common fields, and certain routines such as\njpeg_destroy() can work on either type of object.\n\nThe JPEG library has no static variables: all state is in the compression\nor decompression object.  Therefore it is possible to process multiple\ncompression and decompression operations concurrently, using multiple JPEG\nobjects.\n\nBoth compression and decompression can be done in an incremental memory-to-\nmemory fashion, if suitable source/destination managers are used.  See the\nsection on \"I/O suspension\" for more details.\n\n\nBASIC LIBRARY USAGE\n===================\n\nData formats\n------------\n\nBefore diving into procedural details, it is helpful to understand the\nimage data format that the JPEG library expects or returns.\n\nThe standard input image format is a rectangular array of pixels, with each\npixel having the same number of \"component\" or \"sample\" values (color\nchannels).  You must specify how many components there are and the colorspace\ninterpretation of the components.  Most applications will use RGB data\n(three components per pixel) or grayscale data (one component per pixel).\nPLEASE NOTE THAT RGB DATA IS THREE SAMPLES PER PIXEL, GRAYSCALE ONLY ONE.\nA remarkable number of people manage to miss this, only to find that their\nprograms don't work with grayscale JPEG files.\n\nThere is no provision for colormapped input.  JPEG files are always full-color\nor full grayscale (or sometimes another colorspace such as CMYK).  You can\nfeed in a colormapped image by expanding it to full-color format.  However\nJPEG often doesn't work very well with source data that has been colormapped,\nbecause of dithering noise.  This is discussed in more detail in the JPEG FAQ\nand the other references mentioned in the README file.\n\nPixels are stored by scanlines, with each scanline running from left to\nright.  The component values for each pixel are adjacent in the row; for\nexample, R,G,B,R,G,B,R,G,B,... for 24-bit RGB color.  Each scanline is an\narray of data type JSAMPLE --- which is typically \"unsigned char\", unless\nyou've changed jmorecfg.h.  (You can also change the RGB pixel layout, say\nto B,G,R order, by modifying jmorecfg.h.  But see the restrictions listed in\nthat file before doing so.)\n\nA 2-D array of pixels is formed by making a list of pointers to the starts of\nscanlines; so the scanlines need not be physically adjacent in memory.  Even\nif you process just one scanline at a time, you must make a one-element\npointer array to conform to this structure.  Pointers to JSAMPLE rows are of\ntype JSAMPROW, and the pointer to the pointer array is of type JSAMPARRAY.\n\nThe library accepts or supplies one or more complete scanlines per call.\nIt is not possible to process part of a row at a time.  Scanlines are always\nprocessed top-to-bottom.  You can process an entire image in one call if you\nhave it all in memory, but usually it's simplest to process one scanline at\na time.\n\nFor best results, source data values should have the precision specified by\nBITS_IN_JSAMPLE (normally 8 bits).  For instance, if you choose to compress\ndata that's only 6 bits/channel, you should left-justify each value in a\nbyte before passing it to the compressor.  If you need to compress data\nthat has more than 8 bits/channel, compile with BITS_IN_JSAMPLE = 9 to 12.\n(See \"Library compile-time options\", later.)\n\n\nThe data format returned by the decompressor is the same in all details,\nexcept that colormapped output is supported.  (Again, a JPEG file is never\ncolormapped.  But you can ask the decompressor to perform on-the-fly color\nquantization to deliver colormapped output.)  If you request colormapped\noutput then the returned data array contains a single JSAMPLE per pixel;\nits value is an index into a color map.  The color map is represented as\na 2-D JSAMPARRAY in which each row holds the values of one color component,\nthat is, colormap[i][j] is the value of the i'th color component for pixel\nvalue (map index) j.  Note that since the colormap indexes are stored in\nJSAMPLEs, the maximum number of colors is limited by the size of JSAMPLE\n(ie, at most 256 colors for an 8-bit JPEG library).\n\n\nCompression details\n-------------------\n\nHere we revisit the JPEG compression outline given in the overview.\n\n1. Allocate and initialize a JPEG compression object.\n\nA JPEG compression object is a \"struct jpeg_compress_struct\".  (It also has\na bunch of subsidiary structures which are allocated via malloc(), but the\napplication doesn't control those directly.)  This struct can be just a local\nvariable in the calling routine, if a single routine is going to execute the\nwhole JPEG compression sequence.  Otherwise it can be static or allocated\nfrom malloc().\n\nYou will also need a structure representing a JPEG error handler.  The part\nof this that the library cares about is a \"struct jpeg_error_mgr\".  If you\nare providing your own error handler, you'll typically want to embed the\njpeg_error_mgr struct in a larger structure; this is discussed later under\n\"Error handling\".  For now we'll assume you are just using the default error\nhandler.  The default error handler will print JPEG error/warning messages\non stderr, and it will call exit() if a fatal error occurs.\n\nYou must initialize the error handler structure, store a pointer to it into\nthe JPEG object's \"err\" field, and then call jpeg_create_compress() to\ninitialize the rest of the JPEG object.\n\nTypical code for this step, if you are using the default error handler, is\n\n\tstruct jpeg_compress_struct cinfo;\n\tstruct jpeg_error_mgr jerr;\n\t...\n\tcinfo.err = jpeg_std_error(&jerr);\n\tjpeg_create_compress(&cinfo);\n\njpeg_create_compress allocates a small amount of memory, so it could fail\nif you are out of memory.  In that case it will exit via the error handler;\nthat's why the error handler must be initialized first.\n\n\n2. Specify the destination for the compressed data (eg, a file).\n\nAs previously mentioned, the JPEG library delivers compressed data to a\n\"data destination\" module.  The library includes one data destination\nmodule which knows how to write to a stdio stream.  You can use your own\ndestination module if you want to do something else, as discussed later.\n\nIf you use the standard destination module, you must open the target stdio\nstream beforehand.  Typical code for this step looks like:\n\n\tFILE * outfile;\n\t...\n\tif ((outfile = fopen(filename, \"wb\")) == NULL) {\n\t    fprintf(stderr, \"can't open %s\\n\", filename);\n\t    exit(1);\n\t}\n\tjpeg_stdio_dest(&cinfo, outfile);\n\nwhere the last line invokes the standard destination module.\n\nWARNING: it is critical that the binary compressed data be delivered to the\noutput file unchanged.  On non-Unix systems the stdio library may perform\nnewline translation or otherwise corrupt binary data.  To suppress this\nbehavior, you may need to use a \"b\" option to fopen (as shown above), or use\nsetmode() or another routine to put the stdio stream in binary mode.  See\ncjpeg.c and djpeg.c for code that has been found to work on many systems.\n\nYou can select the data destination after setting other parameters (step 3),\nif that's more convenient.  You may not change the destination between\ncalling jpeg_start_compress() and jpeg_finish_compress().\n\n\n3. Set parameters for compression, including image size & colorspace.\n\nYou must supply information about the source image by setting the following\nfields in the JPEG object (cinfo structure):\n\n\timage_width\t\tWidth of image, in pixels\n\timage_height\t\tHeight of image, in pixels\n\tinput_components\tNumber of color channels (samples per pixel)\n\tin_color_space\t\tColor space of source image\n\nThe image dimensions are, hopefully, obvious.  JPEG supports image dimensions\nof 1 to 64K pixels in either direction.  The input color space is typically\nRGB or grayscale, and input_components is 3 or 1 accordingly.  (See \"Special\ncolor spaces\", later, for more info.)  The in_color_space field must be\nassigned one of the J_COLOR_SPACE enum constants, typically JCS_RGB or\nJCS_GRAYSCALE.\n\nJPEG has a large number of compression parameters that determine how the\nimage is encoded.  Most applications don't need or want to know about all\nthese parameters.  You can set all the parameters to reasonable defaults by\ncalling jpeg_set_defaults(); then, if there are particular values you want\nto change, you can do so after that.  The \"Compression parameter selection\"\nsection tells about all the parameters.\n\nYou must set in_color_space correctly before calling jpeg_set_defaults(),\nbecause the defaults depend on the source image colorspace.  However the\nother three source image parameters need not be valid until you call\njpeg_start_compress().  There's no harm in calling jpeg_set_defaults() more\nthan once, if that happens to be convenient.\n\nTypical code for a 24-bit RGB source image is\n\n\tcinfo.image_width = Width; \t/* image width and height, in pixels */\n\tcinfo.image_height = Height;\n\tcinfo.input_components = 3;\t/* # of color components per pixel */\n\tcinfo.in_color_space = JCS_RGB; /* colorspace of input image */\n\n\tjpeg_set_defaults(&cinfo);\n\t/* Make optional parameter settings here */\n\n\n4. jpeg_start_compress(...);\n\nAfter you have established the data destination and set all the necessary\nsource image info and other parameters, call jpeg_start_compress() to begin\na compression cycle.  This will initialize internal state, allocate working\nstorage, and emit the first few bytes of the JPEG datastream header.\n\nTypical code:\n\n\tjpeg_start_compress(&cinfo, TRUE);\n\nThe \"TRUE\" parameter ensures that a complete JPEG interchange datastream\nwill be written.  This is appropriate in most cases.  If you think you might\nwant to use an abbreviated datastream, read the section on abbreviated\ndatastreams, below.\n\nOnce you have called jpeg_start_compress(), you may not alter any JPEG\nparameters or other fields of the JPEG object until you have completed\nthe compression cycle.\n\n\n5. while (scan lines remain to be written)\n\tjpeg_write_scanlines(...);\n\nNow write all the required image data by calling jpeg_write_scanlines()\none or more times.  You can pass one or more scanlines in each call, up\nto the total image height.  In most applications it is convenient to pass\njust one or a few scanlines at a time.  The expected format for the passed\ndata is discussed under \"Data formats\", above.\n\nImage data should be written in top-to-bottom scanline order.  The JPEG spec\ncontains some weasel wording about how top and bottom are application-defined\nterms (a curious interpretation of the English language...) but if you want\nyour files to be compatible with everyone else's, you WILL use top-to-bottom\norder.  If the source data must be read in bottom-to-top order, you can use\nthe JPEG library's virtual array mechanism to invert the data efficiently.\nExamples of this can be found in the sample application cjpeg.\n\nThe library maintains a count of the number of scanlines written so far\nin the next_scanline field of the JPEG object.  Usually you can just use\nthis variable as the loop counter, so that the loop test looks like\n\"while (cinfo.next_scanline < cinfo.image_height)\".\n\nCode for this step depends heavily on the way that you store the source data.\nexample.c shows the following code for the case of a full-size 2-D source\narray containing 3-byte RGB pixels:\n\n\tJSAMPROW row_pointer[1];\t/* pointer to a single row */\n\tint row_stride;\t\t\t/* physical row width in buffer */\n\n\trow_stride = image_width * 3;\t/* JSAMPLEs per row in image_buffer */\n\n\twhile (cinfo.next_scanline < cinfo.image_height) {\n\t    row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];\n\t    jpeg_write_scanlines(&cinfo, row_pointer, 1);\n\t}\n\njpeg_write_scanlines() returns the number of scanlines actually written.\nThis will normally be equal to the number passed in, so you can usually\nignore the return value.  It is different in just two cases:\n  * If you try to write more scanlines than the declared image height,\n    the additional scanlines are ignored.\n  * If you use a suspending data destination manager, output buffer overrun\n    will cause the compressor to return before accepting all the passed lines.\n    This feature is discussed under \"I/O suspension\", below.  The normal\n    stdio destination manager will NOT cause this to happen.\nIn any case, the return value is the same as the change in the value of\nnext_scanline.\n\n\n6. jpeg_finish_compress(...);\n\nAfter all the image data has been written, call jpeg_finish_compress() to\ncomplete the compression cycle.  This step is ESSENTIAL to ensure that the\nlast bufferload of data is written to the data destination.\njpeg_finish_compress() also releases working memory associated with the JPEG\nobject.\n\nTypical code:\n\n\tjpeg_finish_compress(&cinfo);\n\nIf using the stdio destination manager, don't forget to close the output\nstdio stream (if necessary) afterwards.\n\nIf you have requested a multi-pass operating mode, such as Huffman code\noptimization, jpeg_finish_compress() will perform the additional passes using\ndata buffered by the first pass.  In this case jpeg_finish_compress() may take\nquite a while to complete.  With the default compression parameters, this will\nnot happen.\n\nIt is an error to call jpeg_finish_compress() before writing the necessary\ntotal number of scanlines.  If you wish to abort compression, call\njpeg_abort() as discussed below.\n\nAfter completing a compression cycle, you may dispose of the JPEG object\nas discussed next, or you may use it to compress another image.  In that case\nreturn to step 2, 3, or 4 as appropriate.  If you do not change the\ndestination manager, the new datastream will be written to the same target.\nIf you do not change any JPEG parameters, the new datastream will be written\nwith the same parameters as before.  Note that you can change the input image\ndimensions freely between cycles, but if you change the input colorspace, you\nshould call jpeg_set_defaults() to adjust for the new colorspace; and then\nyou'll need to repeat all of step 3.\n\n\n7. Release the JPEG compression object.\n\nWhen you are done with a JPEG compression object, destroy it by calling\njpeg_destroy_compress().  This will free all subsidiary memory (regardless of\nthe previous state of the object).  Or you can call jpeg_destroy(), which\nworks for either compression or decompression objects --- this may be more\nconvenient if you are sharing code between compression and decompression\ncases.  (Actually, these routines are equivalent except for the declared type\nof the passed pointer.  To avoid gripes from ANSI C compilers, jpeg_destroy()\nshould be passed a j_common_ptr.)\n\nIf you allocated the jpeg_compress_struct structure from malloc(), freeing\nit is your responsibility --- jpeg_destroy() won't.  Ditto for the error\nhandler structure.\n\nTypical code:\n\n\tjpeg_destroy_compress(&cinfo);\n\n\n8. Aborting.\n\nIf you decide to abort a compression cycle before finishing, you can clean up\nin either of two ways:\n\n* If you don't need the JPEG object any more, just call\n  jpeg_destroy_compress() or jpeg_destroy() to release memory.  This is\n  legitimate at any point after calling jpeg_create_compress() --- in fact,\n  it's safe even if jpeg_create_compress() fails.\n\n* If you want to re-use the JPEG object, call jpeg_abort_compress(), or call\n  jpeg_abort() which works on both compression and decompression objects.\n  This will return the object to an idle state, releasing any working memory.\n  jpeg_abort() is allowed at any time after successful object creation.\n\nNote that cleaning up the data destination, if required, is your\nresponsibility; neither of these routines will call term_destination().\n(See \"Compressed data handling\", below, for more about that.)\n\njpeg_destroy() and jpeg_abort() are the only safe calls to make on a JPEG\nobject that has reported an error by calling error_exit (see \"Error handling\"\nfor more info).  The internal state of such an object is likely to be out of\nwhack.  Either of these two routines will return the object to a known state.\n\n\nDecompression details\n---------------------\n\nHere we revisit the JPEG decompression outline given in the overview.\n\n1. Allocate and initialize a JPEG decompression object.\n\nThis is just like initialization for compression, as discussed above,\nexcept that the object is a \"struct jpeg_decompress_struct\" and you\ncall jpeg_create_decompress().  Error handling is exactly the same.\n\nTypical code:\n\n\tstruct jpeg_decompress_struct cinfo;\n\tstruct jpeg_error_mgr jerr;\n\t...\n\tcinfo.err = jpeg_std_error(&jerr);\n\tjpeg_create_decompress(&cinfo);\n\n(Both here and in the IJG code, we usually use variable name \"cinfo\" for\nboth compression and decompression objects.)\n\n\n2. Specify the source of the compressed data (eg, a file).\n\nAs previously mentioned, the JPEG library reads compressed data from a \"data\nsource\" module.  The library includes one data source module which knows how\nto read from a stdio stream.  You can use your own source module if you want\nto do something else, as discussed later.\n\nIf you use the standard source module, you must open the source stdio stream\nbeforehand.  Typical code for this step looks like:\n\n\tFILE * infile;\n\t...\n\tif ((infile = fopen(filename, \"rb\")) == NULL) {\n\t    fprintf(stderr, \"can't open %s\\n\", filename);\n\t    exit(1);\n\t}\n\tjpeg_stdio_src(&cinfo, infile);\n\nwhere the last line invokes the standard source module.\n\nWARNING: it is critical that the binary compressed data be read unchanged.\nOn non-Unix systems the stdio library may perform newline translation or\notherwise corrupt binary data.  To suppress this behavior, you may need to use\na \"b\" option to fopen (as shown above), or use setmode() or another routine to\nput the stdio stream in binary mode.  See cjpeg.c and djpeg.c for code that\nhas been found to work on many systems.\n\nYou may not change the data source between calling jpeg_read_header() and\njpeg_finish_decompress().  If you wish to read a series of JPEG images from\na single source file, you should repeat the jpeg_read_header() to\njpeg_finish_decompress() sequence without reinitializing either the JPEG\nobject or the data source module; this prevents buffered input data from\nbeing discarded.\n\n\n3. Call jpeg_read_header() to obtain image info.\n\nTypical code for this step is just\n\n\tjpeg_read_header(&cinfo, TRUE);\n\nThis will read the source datastream header markers, up to the beginning\nof the compressed data proper.  On return, the image dimensions and other\ninfo have been stored in the JPEG object.  The application may wish to\nconsult this information before selecting decompression parameters.\n\nMore complex code is necessary if\n  * A suspending data source is used --- in that case jpeg_read_header()\n    may return before it has read all the header data.  See \"I/O suspension\",\n    below.  The normal stdio source manager will NOT cause this to happen.\n  * Abbreviated JPEG files are to be processed --- see the section on\n    abbreviated datastreams.  Standard applications that deal only in\n    interchange JPEG files need not be concerned with this case either.\n\nIt is permissible to stop at this point if you just wanted to find out the\nimage dimensions and other header info for a JPEG file.  In that case,\ncall jpeg_destroy() when you are done with the JPEG object, or call\njpeg_abort() to return it to an idle state before selecting a new data\nsource and reading another header.\n\n\n4. Set parameters for decompression.\n\njpeg_read_header() sets appropriate default decompression parameters based on\nthe properties of the image (in particular, its colorspace).  However, you\nmay well want to alter these defaults before beginning the decompression.\nFor example, the default is to produce full color output from a color file.\nIf you want colormapped output you must ask for it.  Other options allow the\nreturned image to be scaled and allow various speed/quality tradeoffs to be\nselected.  \"Decompression parameter selection\", below, gives details.\n\nIf the defaults are appropriate, nothing need be done at this step.\n\nNote that all default values are set by each call to jpeg_read_header().\nIf you reuse a decompression object, you cannot expect your parameter\nsettings to be preserved across cycles, as you can for compression.\nYou must set desired parameter values each time.\n\n\n5. jpeg_start_decompress(...);\n\nOnce the parameter values are satisfactory, call jpeg_start_decompress() to\nbegin decompression.  This will initialize internal state, allocate working\nmemory, and prepare for returning data.\n\nTypical code is just\n\n\tjpeg_start_decompress(&cinfo);\n\nIf you have requested a multi-pass operating mode, such as 2-pass color\nquantization, jpeg_start_decompress() will do everything needed before data\noutput can begin.  In this case jpeg_start_decompress() may take quite a while\nto complete.  With a single-scan (non progressive) JPEG file and default\ndecompression parameters, this will not happen; jpeg_start_decompress() will\nreturn quickly.\n\nAfter this call, the final output image dimensions, including any requested\nscaling, are available in the JPEG object; so is the selected colormap, if\ncolormapped output has been requested.  Useful fields include\n\n\toutput_width\t\timage width and height, as scaled\n\toutput_height\n\tout_color_components\t# of color components in out_color_space\n\toutput_components\t# of color components returned per pixel\n\tcolormap\t\tthe selected colormap, if any\n\tactual_number_of_colors\t\tnumber of entries in colormap\n\noutput_components is 1 (a colormap index) when quantizing colors; otherwise it\nequals out_color_components.  It is the number of JSAMPLE values that will be\nemitted per pixel in the output arrays.\n\nTypically you will need to allocate data buffers to hold the incoming image.\nYou will need output_width * output_components JSAMPLEs per scanline in your\noutput buffer, and a total of output_height scanlines will be returned.\n\nNote: if you are using the JPEG library's internal memory manager to allocate\ndata buffers (as djpeg does), then the manager's protocol requires that you\nrequest large buffers *before* calling jpeg_start_decompress().  This is a\nlittle tricky since the output_XXX fields are not normally valid then.  You\ncan make them valid by calling jpeg_calc_output_dimensions() after setting the\nrelevant parameters (scaling, output color space, and quantization flag).\n\n\n6. while (scan lines remain to be read)\n\tjpeg_read_scanlines(...);\n\nNow you can read the decompressed image data by calling jpeg_read_scanlines()\none or more times.  At each call, you pass in the maximum number of scanlines\nto be read (ie, the height of your working buffer); jpeg_read_scanlines()\nwill return up to that many lines.  The return value is the number of lines\nactually read.  The format of the returned data is discussed under \"Data\nformats\", above.  Don't forget that grayscale and color JPEGs will return\ndifferent data formats!\n\nImage data is returned in top-to-bottom scanline order.  If you must write\nout the image in bottom-to-top order, you can use the JPEG library's virtual\narray mechanism to invert the data efficiently.  Examples of this can be\nfound in the sample application djpeg.\n\nThe library maintains a count of the number of scanlines returned so far\nin the output_scanline field of the JPEG object.  Usually you can just use\nthis variable as the loop counter, so that the loop test looks like\n\"while (cinfo.output_scanline < cinfo.output_height)\".  (Note that the test\nshould NOT be against image_height, unless you never use scaling.  The\nimage_height field is the height of the original unscaled image.)\nThe return value always equals the change in the value of output_scanline.\n\nIf you don't use a suspending data source, it is safe to assume that\njpeg_read_scanlines() reads at least one scanline per call, until the\nbottom of the image has been reached.\n\nIf you use a buffer larger than one scanline, it is NOT safe to assume that\njpeg_read_scanlines() fills it.  (The current implementation returns only a\nfew scanlines per call, no matter how large a buffer you pass.)  So you must\nalways provide a loop that calls jpeg_read_scanlines() repeatedly until the\nwhole image has been read.\n\n\n7. jpeg_finish_decompress(...);\n\nAfter all the image data has been read, call jpeg_finish_decompress() to\ncomplete the decompression cycle.  This causes working memory associated\nwith the JPEG object to be released.\n\nTypical code:\n\n\tjpeg_finish_decompress(&cinfo);\n\nIf using the stdio source manager, don't forget to close the source stdio\nstream if necessary.\n\nIt is an error to call jpeg_finish_decompress() before reading the correct\ntotal number of scanlines.  If you wish to abort decompression, call\njpeg_abort() as discussed below.\n\nAfter completing a decompression cycle, you may dispose of the JPEG object as\ndiscussed next, or you may use it to decompress another image.  In that case\nreturn to step 2 or 3 as appropriate.  If you do not change the source\nmanager, the next image will be read from the same source.\n\n\n8. Release the JPEG decompression object.\n\nWhen you are done with a JPEG decompression object, destroy it by calling\njpeg_destroy_decompress() or jpeg_destroy().  The previous discussion of\ndestroying compression objects applies here too.\n\nTypical code:\n\n\tjpeg_destroy_decompress(&cinfo);\n\n\n9. Aborting.\n\nYou can abort a decompression cycle by calling jpeg_destroy_decompress() or\njpeg_destroy() if you don't need the JPEG object any more, or\njpeg_abort_decompress() or jpeg_abort() if you want to reuse the object.\nThe previous discussion of aborting compression cycles applies here too.\n\n\nMechanics of usage: include files, linking, etc\n-----------------------------------------------\n\nApplications using the JPEG library should include the header file jpeglib.h\nto obtain declarations of data types and routines.  Before including\njpeglib.h, include system headers that define at least the typedefs FILE and\nsize_t.  On ANSI-conforming systems, including <stdio.h> is sufficient; on\nolder Unix systems, you may need <sys/types.h> to define size_t.\n\nIf the application needs to refer to individual JPEG library error codes, also\ninclude jerror.h to define those symbols.\n\njpeglib.h indirectly includes the files jconfig.h and jmorecfg.h.  If you are\ninstalling the JPEG header files in a system directory, you will want to\ninstall all four files: jpeglib.h, jerror.h, jconfig.h, jmorecfg.h.\n\nThe most convenient way to include the JPEG code into your executable program\nis to prepare a library file (\"libjpeg.a\", or a corresponding name on non-Unix\nmachines) and reference it at your link step.  If you use only half of the\nlibrary (only compression or only decompression), only that much code will be\nincluded from the library, unless your linker is hopelessly brain-damaged.\nThe supplied makefiles build libjpeg.a automatically (see install.txt).\n\nWhile you can build the JPEG library as a shared library if the whim strikes\nyou, we don't really recommend it.  The trouble with shared libraries is that\nat some point you'll probably try to substitute a new version of the library\nwithout recompiling the calling applications.  That generally doesn't work\nbecause the parameter struct declarations usually change with each new\nversion.  In other words, the library's API is *not* guaranteed binary\ncompatible across versions; we only try to ensure source-code compatibility.\n(In hindsight, it might have been smarter to hide the parameter structs from\napplications and introduce a ton of access functions instead.  Too late now,\nhowever.)\n\nOn some systems your application may need to set up a signal handler to ensure\nthat temporary files are deleted if the program is interrupted.  This is most\ncritical if you are on MS-DOS and use the jmemdos.c memory manager back end;\nit will try to grab extended memory for temp files, and that space will NOT be\nfreed automatically.  See cjpeg.c or djpeg.c for an example signal handler.\n\nIt may be worth pointing out that the core JPEG library does not actually\nrequire the stdio library: only the default source/destination managers and\nerror handler need it.  You can use the library in a stdio-less environment\nif you replace those modules and use jmemnobs.c (or another memory manager of\nyour own devising).  More info about the minimum system library requirements\nmay be found in jinclude.h.\n\n\nADVANCED FEATURES\n=================\n\nCompression parameter selection\n-------------------------------\n\nThis section describes all the optional parameters you can set for JPEG\ncompression, as well as the \"helper\" routines provided to assist in this\ntask.  Proper setting of some parameters requires detailed understanding\nof the JPEG standard; if you don't know what a parameter is for, it's best\nnot to mess with it!  See REFERENCES in the README file for pointers to\nmore info about JPEG.\n\nIt's a good idea to call jpeg_set_defaults() first, even if you plan to set\nall the parameters; that way your code is more likely to work with future JPEG\nlibraries that have additional parameters.  For the same reason, we recommend\nyou use a helper routine where one is provided, in preference to twiddling\ncinfo fields directly.\n\nThe helper routines are:\n\njpeg_set_defaults (j_compress_ptr cinfo)\n\tThis routine sets all JPEG parameters to reasonable defaults, using\n\tonly the input image's color space (field in_color_space, which must\n\talready be set in cinfo).  Many applications will only need to use\n\tthis routine and perhaps jpeg_set_quality().\n\njpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)\n\tSets the JPEG file's colorspace (field jpeg_color_space) as specified,\n\tand sets other color-space-dependent parameters appropriately.  See\n\t\"Special color spaces\", below, before using this.  A large number of\n\tparameters, including all per-component parameters, are set by this\n\troutine; if you want to twiddle individual parameters you should call\n\tjpeg_set_colorspace() before rather than after.\n\njpeg_default_colorspace (j_compress_ptr cinfo)\n\tSelects an appropriate JPEG colorspace based on cinfo->in_color_space,\n\tand calls jpeg_set_colorspace().  This is actually a subroutine of\n\tjpeg_set_defaults().  It's broken out in case you want to change\n\tjust the colorspace-dependent JPEG parameters.\n\njpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)\n\tConstructs JPEG quantization tables appropriate for the indicated\n\tquality setting.  The quality value is expressed on the 0..100 scale\n\trecommended by IJG (cjpeg's \"-quality\" switch uses this routine).\n\tNote that the exact mapping from quality values to tables may change\n\tin future IJG releases as more is learned about DCT quantization.\n\tIf the force_baseline parameter is TRUE, then the quantization table\n\tentries are constrained to the range 1..255 for full JPEG baseline\n\tcompatibility.  In the current implementation, this only makes a\n\tdifference for quality settings below 25, and it effectively prevents\n\tvery small/low quality files from being generated.  The IJG decoder\n\tis capable of reading the non-baseline files generated at low quality\n\tsettings when force_baseline is FALSE, but other decoders may not be.\n\njpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,\n\t\t\t boolean force_baseline)\n\tSame as jpeg_set_quality() except that the generated tables are the\n\tsample tables given in the JPEC spec section K.1, multiplied by the\n\tspecified scale factor (which is expressed as a percentage; thus\n\tscale_factor = 100 reproduces the spec's tables).  Note that larger\n\tscale factors give lower quality.  This entry point is useful for\n\tconforming to the Adobe PostScript DCT conventions, but we do not\n\trecommend linear scaling as a user-visible quality scale otherwise.\n\tforce_baseline again constrains the computed table entries to 1..255.\n\nint jpeg_quality_scaling (int quality)\n\tConverts a value on the IJG-recommended quality scale to a linear\n\tscaling percentage.  Note that this routine may change or go away\n\tin future releases --- IJG may choose to adopt a scaling method that\n\tcan't be expressed as a simple scalar multiplier, in which case the\n\tpremise of this routine collapses.  Caveat user.\n\njpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)\n\tSet default quantization tables with linear q_scale_factor[] values\n\t(see below).\n\njpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,\n\t\t      const unsigned int *basic_table,\n\t\t      int scale_factor, boolean force_baseline)\n\tAllows an arbitrary quantization table to be created.  which_tbl\n\tindicates which table slot to fill.  basic_table points to an array\n\tof 64 unsigned ints given in normal array order.  These values are\n\tmultiplied by scale_factor/100 and then clamped to the range 1..65535\n\t(or to 1..255 if force_baseline is TRUE).\n\tCAUTION: prior to library version 6a, jpeg_add_quant_table expected\n\tthe basic table to be given in JPEG zigzag order.  If you need to\n\twrite code that works with either older or newer versions of this\n\troutine, you must check the library version number.  Something like\n\t\"#if JPEG_LIB_VERSION >= 61\" is the right test.\n\njpeg_simple_progression (j_compress_ptr cinfo)\n\tGenerates a default scan script for writing a progressive-JPEG file.\n\tThis is the recommended method of creating a progressive file,\n\tunless you want to make a custom scan sequence.  You must ensure that\n\tthe JPEG color space is set correctly before calling this routine.\n\n\nCompression parameters (cinfo fields) include:\n\nboolean arith_code\n\tIf TRUE, use arithmetic coding.\n\tIf FALSE, use Huffman coding.\n\nint block_size\n\tSet DCT block size.  All N from 1 to 16 are possible.\n\tDefault is 8 (baseline format).\n\tLarger values produce higher compression,\n\tsmaller values produce higher quality.\n\tAn exact DCT stage is possible with 1 or 2.\n\tWith the default quality of 75 and default Luminance qtable\n\tthe DCT+Quantization stage is lossless for value 1.\n\tNote that values other than 8 require a SmartScale capable decoder,\n\tintroduced with IJG JPEG 8.  Setting the block_size parameter for\n\tcompression works with version 8c and later.\n\nJ_DCT_METHOD dct_method\n\tSelects the algorithm used for the DCT step.  Choices are:\n\t\tJDCT_ISLOW: slow but accurate integer algorithm\n\t\tJDCT_IFAST: faster, less accurate integer method\n\t\tJDCT_FLOAT: floating-point method\n\t\tJDCT_DEFAULT: default method (normally JDCT_ISLOW)\n\t\tJDCT_FASTEST: fastest method (normally JDCT_IFAST)\n\tThe FLOAT method is very slightly more accurate than the ISLOW method,\n\tbut may give different results on different machines due to varying\n\troundoff behavior.  The integer methods should give the same results\n\ton all machines.  On machines with sufficiently fast FP hardware, the\n\tfloating-point method may also be the fastest.  The IFAST method is\n\tconsiderably less accurate than the other two; its use is not\n\trecommended if high quality is a concern.  JDCT_DEFAULT and\n\tJDCT_FASTEST are macros configurable by each installation.\n\nunsigned int scale_num, scale_denom\n\tScale the image by the fraction scale_num/scale_denom.  Default is\n\t1/1, or no scaling.  Currently, the supported scaling ratios are\n\tM/N with all N from 1 to 16, where M is the destination DCT size,\n\twhich is 8 by default (see block_size parameter above).\n\t(The library design allows for arbitrary scaling ratios but this\n\tis not likely to be implemented any time soon.)\n\nJ_COLOR_SPACE jpeg_color_space\nint num_components\n\tThe JPEG color space and corresponding number of components; see\n\t\"Special color spaces\", below, for more info.  We recommend using\n\tjpeg_set_colorspace() if you want to change these.\n\nJ_COLOR_TRANSFORM color_transform\n\tInternal color transform identifier, writes LSE marker if nonzero\n\t(requires decoder with inverse color transform support, introduced\n\twith IJG JPEG 9).\n\tTwo values are currently possible: JCT_NONE and JCT_SUBTRACT_GREEN.\n\tSet this value for lossless RGB application *before* calling\n\tjpeg_set_colorspace(), because entropy table assignment in\n\tjpeg_set_colorspace() depends on color_transform.\n\nboolean optimize_coding\n\tTRUE causes the compressor to compute optimal Huffman coding tables\n\tfor the image.  This requires an extra pass over the data and\n\ttherefore costs a good deal of space and time.  The default is\n\tFALSE, which tells the compressor to use the supplied or default\n\tHuffman tables.  In most cases optimal tables save only a few percent\n\tof file size compared to the default tables.  Note that when this is\n\tTRUE, you need not supply Huffman tables at all, and any you do\n\tsupply will be overwritten.\n\nunsigned int restart_interval\nint restart_in_rows\n\tTo emit restart markers in the JPEG file, set one of these nonzero.\n\tSet restart_interval to specify the exact interval in MCU blocks.\n\tSet restart_in_rows to specify the interval in MCU rows.  (If\n\trestart_in_rows is not 0, then restart_interval is set after the\n\timage width in MCUs is computed.)  Defaults are zero (no restarts).\n\tOne restart marker per MCU row is often a good choice.\n\tNOTE: the overhead of restart markers is higher in grayscale JPEG\n\tfiles than in color files, and MUCH higher in progressive JPEGs.\n\tIf you use restarts, you may want to use larger intervals in those\n\tcases.\n\nconst jpeg_scan_info * scan_info\nint num_scans\n\tBy default, scan_info is NULL; this causes the compressor to write a\n\tsingle-scan sequential JPEG file.  If not NULL, scan_info points to\n\tan array of scan definition records of length num_scans.  The\n\tcompressor will then write a JPEG file having one scan for each scan\n\tdefinition record.  This is used to generate noninterleaved or\n\tprogressive JPEG files.  The library checks that the scan array\n\tdefines a valid JPEG scan sequence.  (jpeg_simple_progression creates\n\ta suitable scan definition array for progressive JPEG.)  This is\n\tdiscussed further under \"Progressive JPEG support\".\n\nboolean do_fancy_downsampling\n\tIf TRUE, use direct DCT scaling with DCT size > 8 for downsampling\n\tof chroma components.\n\tIf FALSE, use only DCT size <= 8 and simple separate downsampling.\n\tDefault is TRUE.\n\tFor better image stability in multiple generation compression cycles\n\tit is preferable that this value matches the corresponding\n\tdo_fancy_upsampling value in decompression.\n\nint smoothing_factor\n\tIf non-zero, the input image is smoothed; the value should be 1 for\n\tminimal smoothing to 100 for maximum smoothing.  Consult jcsample.c\n\tfor details of the smoothing algorithm.  The default is zero.\n\nboolean write_JFIF_header\n\tIf TRUE, a JFIF APP0 marker is emitted.  jpeg_set_defaults() and\n\tjpeg_set_colorspace() set this TRUE if a JFIF-legal JPEG color space\n\t(ie, YCbCr or grayscale) is selected, otherwise FALSE.\n\nUINT8 JFIF_major_version\nUINT8 JFIF_minor_version\n\tThe version number to be written into the JFIF marker.\n\tjpeg_set_defaults() initializes the version to 1.01 (major=minor=1).\n\tYou should set it to 1.02 (major=1, minor=2) if you plan to write\n\tany JFIF 1.02 extension markers.\n\nUINT8 density_unit\nUINT16 X_density\nUINT16 Y_density\n\tThe resolution information to be written into the JFIF marker;\n\tnot used otherwise.  density_unit may be 0 for unknown,\n\t1 for dots/inch, or 2 for dots/cm.  The default values are 0,1,1\n\tindicating square pixels of unknown size.\n\nboolean write_Adobe_marker\n\tIf TRUE, an Adobe APP14 marker is emitted.  jpeg_set_defaults() and\n\tjpeg_set_colorspace() set this TRUE if JPEG color space RGB, CMYK,\n\tor YCCK is selected, otherwise FALSE.  It is generally a bad idea\n\tto set both write_JFIF_header and write_Adobe_marker.  In fact,\n\tyou probably shouldn't change the default settings at all --- the\n\tdefault behavior ensures that the JPEG file's color space can be\n\trecognized by the decoder.\n\nJQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]\n\tPointers to coefficient quantization tables, one per table slot,\n\tor NULL if no table is defined for a slot.  Usually these should\n\tbe set via one of the above helper routines; jpeg_add_quant_table()\n\tis general enough to define any quantization table.  The other\n\troutines will set up table slot 0 for luminance quality and table\n\tslot 1 for chrominance.\n\nint q_scale_factor[NUM_QUANT_TBLS]\n\tLinear quantization scaling factors (percentage, initialized 100)\n\tfor use with jpeg_default_qtables().\n\tSee rdswitch.c and cjpeg.c for an example of usage.\n\tNote that the q_scale_factor[] fields are the \"linear\" scales, so you\n\thave to convert from user-defined ratings via jpeg_quality_scaling().\n\tHere is an example code which corresponds to cjpeg -quality 90,70:\n\n\t\tjpeg_set_defaults(cinfo);\n\n\t\t/* Set luminance quality 90. */\n\t\tcinfo->q_scale_factor[0] = jpeg_quality_scaling(90);\n\t\t/* Set chrominance quality 70. */\n\t\tcinfo->q_scale_factor[1] = jpeg_quality_scaling(70);\n\n\t\tjpeg_default_qtables(cinfo, force_baseline);\n\n\tCAUTION: You must also set 1x1 subsampling for efficient separate\n\tcolor quality selection, since the default value used by library\n\tis 2x2:\n\n\t\tcinfo->comp_info[0].v_samp_factor = 1;\n\t\tcinfo->comp_info[0].h_samp_factor = 1;\n\nJHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]\nJHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]\n\tPointers to Huffman coding tables, one per table slot, or NULL if\n\tno table is defined for a slot.  Slots 0 and 1 are filled with the\n\tJPEG sample tables by jpeg_set_defaults().  If you need to allocate\n\tmore table structures, jpeg_alloc_huff_table() may be used.\n\tNote that optimal Huffman tables can be computed for an image\n\tby setting optimize_coding, as discussed above; there's seldom\n\tany need to mess with providing your own Huffman tables.\n\n\nThe actual dimensions of the JPEG image that will be written to the file are\ngiven by the following fields.  These are computed from the input image\ndimensions and the compression parameters by jpeg_start_compress().  You can\nalso call jpeg_calc_jpeg_dimensions() to obtain the values that will result\nfrom the current parameter settings.  This can be useful if you are trying\nto pick a scaling ratio that will get close to a desired target size.\n\nJDIMENSION jpeg_width\t\tActual dimensions of output image.\nJDIMENSION jpeg_height\n\n\nPer-component parameters are stored in the struct cinfo.comp_info[i] for\ncomponent number i.  Note that components here refer to components of the\nJPEG color space, *not* the source image color space.  A suitably large\ncomp_info[] array is allocated by jpeg_set_defaults(); if you choose not\nto use that routine, it's up to you to allocate the array.\n\nint component_id\n\tThe one-byte identifier code to be recorded in the JPEG file for\n\tthis component.  For the standard color spaces, we recommend you\n\tleave the default values alone.\n\nint h_samp_factor\nint v_samp_factor\n\tHorizontal and vertical sampling factors for the component; must\n\tbe 1..4 according to the JPEG standard.  Note that larger sampling\n\tfactors indicate a higher-resolution component; many people find\n\tthis behavior quite unintuitive.  The default values are 2,2 for\n\tluminance components and 1,1 for chrominance components, except\n\tfor grayscale where 1,1 is used.\n\nint quant_tbl_no\n\tQuantization table number for component.  The default value is\n\t0 for luminance components and 1 for chrominance components.\n\nint dc_tbl_no\nint ac_tbl_no\n\tDC and AC entropy coding table numbers.  The default values are\n\t0 for luminance components and 1 for chrominance components.\n\nint component_index\n\tMust equal the component's index in comp_info[].  (Beginning in\n\trelease v6, the compressor library will fill this in automatically;\n\tyou don't have to.)\n\n\nDecompression parameter selection\n---------------------------------\n\nDecompression parameter selection is somewhat simpler than compression\nparameter selection, since all of the JPEG internal parameters are\nrecorded in the source file and need not be supplied by the application.\n(Unless you are working with abbreviated files, in which case see\n\"Abbreviated datastreams\", below.)  Decompression parameters control\nthe postprocessing done on the image to deliver it in a format suitable\nfor the application's use.  Many of the parameters control speed/quality\ntradeoffs, in which faster decompression may be obtained at the price of\na poorer-quality image.  The defaults select the highest quality (slowest)\nprocessing.\n\nThe following fields in the JPEG object are set by jpeg_read_header() and\nmay be useful to the application in choosing decompression parameters:\n\nJDIMENSION image_width\t\t\tWidth and height of image\nJDIMENSION image_height\nint num_components\t\t\tNumber of color components\nJ_COLOR_SPACE jpeg_color_space\t\tColorspace of image\nboolean saw_JFIF_marker\t\t\tTRUE if a JFIF APP0 marker was seen\n  UINT8 JFIF_major_version\t\tVersion information from JFIF marker\n  UINT8 JFIF_minor_version\n  UINT8 density_unit\t\t\tResolution data from JFIF marker\n  UINT16 X_density\n  UINT16 Y_density\nboolean saw_Adobe_marker\t\tTRUE if an Adobe APP14 marker was seen\n  UINT8 Adobe_transform\t\t\tColor transform code from Adobe marker\n\nThe JPEG color space, unfortunately, is something of a guess since the JPEG\nstandard proper does not provide a way to record it.  In practice most files\nadhere to the JFIF or Adobe conventions, and the decoder will recognize these\ncorrectly.  See \"Special color spaces\", below, for more info.\n\n\nThe decompression parameters that determine the basic properties of the\nreturned image are:\n\nJ_COLOR_SPACE out_color_space\n\tOutput color space.  jpeg_read_header() sets an appropriate default\n\tbased on jpeg_color_space; typically it will be RGB or grayscale.\n\tThe application can change this field to request output in a different\n\tcolorspace.  For example, set it to JCS_GRAYSCALE to get grayscale\n\toutput from a color file.  (This is useful for previewing: grayscale\n\toutput is faster than full color since the color components need not\n\tbe processed.)  Note that not all possible color space transforms are\n\tcurrently implemented; you may need to extend jdcolor.c if you want an\n\tunusual conversion.\n\nunsigned int scale_num, scale_denom\n\tScale the image by the fraction scale_num/scale_denom.  Currently,\n\tthe supported scaling ratios are M/N with all M from 1 to 16, where\n\tN is the source DCT size, which is 8 for baseline JPEG.  (The library\n\tdesign allows for arbitrary scaling ratios but this is not likely\n\tto be implemented any time soon.)  The values are initialized by\n\tjpeg_read_header() with the source DCT size.  For baseline JPEG\n\tthis is 8/8.  If you change only the scale_num value while leaving\n\tthe other unchanged, then this specifies the DCT scaled size to be\n\tapplied on the given input.  For baseline JPEG this is equivalent\n\tto M/8 scaling, since the source DCT size for baseline JPEG is 8.\n\tSmaller scaling ratios permit significantly faster decoding since\n\tfewer pixels need be processed and a simpler IDCT method can be used.\n\nboolean quantize_colors\n\tIf set TRUE, colormapped output will be delivered.  Default is FALSE,\n\tmeaning that full-color output will be delivered.\n\nThe next three parameters are relevant only if quantize_colors is TRUE.\n\nint desired_number_of_colors\n\tMaximum number of colors to use in generating a library-supplied color\n\tmap (the actual number of colors is returned in a different field).\n\tDefault 256.  Ignored when the application supplies its own color map.\n\nboolean two_pass_quantize\n\tIf TRUE, an extra pass over the image is made to select a custom color\n\tmap for the image.  This usually looks a lot better than the one-size-\n\tfits-all colormap that is used otherwise.  Default is TRUE.  Ignored\n\twhen the application supplies its own color map.\n\nJ_DITHER_MODE dither_mode\n\tSelects color dithering method.  Supported values are:\n\t\tJDITHER_NONE\tno dithering: fast, very low quality\n\t\tJDITHER_ORDERED\tordered dither: moderate speed and quality\n\t\tJDITHER_FS\tFloyd-Steinberg dither: slow, high quality\n\tDefault is JDITHER_FS.  (At present, ordered dither is implemented\n\tonly in the single-pass, standard-colormap case.  If you ask for\n\tordered dither when two_pass_quantize is TRUE or when you supply\n\tan external color map, you'll get F-S dithering.)\n\nWhen quantize_colors is TRUE, the target color map is described by the next\ntwo fields.  colormap is set to NULL by jpeg_read_header().  The application\ncan supply a color map by setting colormap non-NULL and setting\nactual_number_of_colors to the map size.  Otherwise, jpeg_start_decompress()\nselects a suitable color map and sets these two fields itself.\n[Implementation restriction: at present, an externally supplied colormap is\nonly accepted for 3-component output color spaces.]\n\nJSAMPARRAY colormap\n\tThe color map, represented as a 2-D pixel array of out_color_components\n\trows and actual_number_of_colors columns.  Ignored if not quantizing.\n\tCAUTION: if the JPEG library creates its own colormap, the storage\n\tpointed to by this field is released by jpeg_finish_decompress().\n\tCopy the colormap somewhere else first, if you want to save it.\n\nint actual_number_of_colors\n\tThe number of colors in the color map.\n\nAdditional decompression parameters that the application may set include:\n\nJ_DCT_METHOD dct_method\n\tSelects the algorithm used for the DCT step.  Choices are the same\n\tas described above for compression.\n\nboolean do_fancy_upsampling\n\tIf TRUE, use direct DCT scaling with DCT size > 8 for upsampling\n\tof chroma components.\n\tIf FALSE, use only DCT size <= 8 and simple separate upsampling.\n\tDefault is TRUE.\n\tFor better image stability in multiple generation compression cycles\n\tit is preferable that this value matches the corresponding\n\tdo_fancy_downsampling value in compression.\n\nboolean do_block_smoothing\n\tIf TRUE, interblock smoothing is applied in early stages of decoding\n\tprogressive JPEG files; if FALSE, not.  Default is TRUE.  Early\n\tprogression stages look \"fuzzy\" with smoothing, \"blocky\" without.\n\tIn any case, block smoothing ceases to be applied after the first few\n\tAC coefficients are known to full accuracy, so it is relevant only\n\twhen using buffered-image mode for progressive images.\n\nboolean enable_1pass_quant\nboolean enable_external_quant\nboolean enable_2pass_quant\n\tThese are significant only in buffered-image mode, which is\n\tdescribed in its own section below.\n\n\nThe output image dimensions are given by the following fields.  These are\ncomputed from the source image dimensions and the decompression parameters\nby jpeg_start_decompress().  You can also call jpeg_calc_output_dimensions()\nto obtain the values that will result from the current parameter settings.\nThis can be useful if you are trying to pick a scaling ratio that will get\nclose to a desired target size.  It's also important if you are using the\nJPEG library's memory manager to allocate output buffer space, because you\nare supposed to request such buffers *before* jpeg_start_decompress().\n\nJDIMENSION output_width\t\tActual dimensions of output image.\nJDIMENSION output_height\nint out_color_components\tNumber of color components in out_color_space.\nint output_components\t\tNumber of color components returned.\nint rec_outbuf_height\t\tRecommended height of scanline buffer.\n\nWhen quantizing colors, output_components is 1, indicating a single color map\nindex per pixel.  Otherwise it equals out_color_components.  The output arrays\nare required to be output_width * output_components JSAMPLEs wide.\n\nrec_outbuf_height is the recommended minimum height (in scanlines) of the\nbuffer passed to jpeg_read_scanlines().  If the buffer is smaller, the\nlibrary will still work, but time will be wasted due to unnecessary data\ncopying.  In high-quality modes, rec_outbuf_height is always 1, but some\nfaster, lower-quality modes set it to larger values (typically 2 to 4).\nIf you are going to ask for a high-speed processing mode, you may as well\ngo to the trouble of honoring rec_outbuf_height so as to avoid data copying.\n(An output buffer larger than rec_outbuf_height lines is OK, but won't\nprovide any material speed improvement over that height.)\n\n\nSpecial color spaces\n--------------------\n\nThe JPEG standard itself is \"color blind\" and doesn't specify any particular\ncolor space.  It is customary to convert color data to a luminance/chrominance\ncolor space before compressing, since this permits greater compression.  The\nexisting JPEG file interchange format standards specify YCbCr or GRAYSCALE\ndata (JFIF version 1), GRAYSCALE, RGB, YCbCr, CMYK, or YCCK (Adobe), or BG_RGB\nor BG_YCC (big gamut color spaces, JFIF version 2).  For special applications\nsuch as multispectral images, other color spaces can be used,\nbut it must be understood that such files will be unportable.\n\nThe JPEG library can handle the most common colorspace conversions (namely\nRGB <=> YCbCr and CMYK <=> YCCK).  It can also deal with data of an unknown\ncolor space, passing it through without conversion.  If you deal extensively\nwith an unusual color space, you can easily extend the library to understand\nadditional color spaces and perform appropriate conversions.\n\nFor compression, the source data's color space is specified by field\nin_color_space.  This is transformed to the JPEG file's color space given\nby jpeg_color_space.  jpeg_set_defaults() chooses a reasonable JPEG color\nspace depending on in_color_space, but you can override this by calling\njpeg_set_colorspace().  Of course you must select a supported transformation.\njccolor.c currently supports the following transformations:\n\tRGB => YCbCr\n\tRGB => GRAYSCALE\n\tRGB => BG_YCC\n\tYCbCr => GRAYSCALE\n\tYCbCr => BG_YCC\n\tCMYK => YCCK\nplus the null transforms: GRAYSCALE => GRAYSCALE, RGB => RGB,\nBG_RGB => BG_RGB, YCbCr => YCbCr, BG_YCC => BG_YCC, CMYK => CMYK,\nYCCK => YCCK, and UNKNOWN => UNKNOWN.\n\nThe file interchange format standards (JFIF and Adobe) specify APPn markers\nthat indicate the color space of the JPEG file.  It is important to ensure\nthat these are written correctly, or omitted if the JPEG file's color space\nis not one of the ones supported by the interchange standards.\njpeg_set_colorspace() will set the compression parameters to include or omit\nthe APPn markers properly, so long as it is told the truth about the JPEG\ncolor space.  For example, if you are writing some random 3-component color\nspace without conversion, don't try to fake out the library by setting\nin_color_space and jpeg_color_space to JCS_YCbCr; use JCS_UNKNOWN.\nYou may want to write an APPn marker of your own devising to identify\nthe colorspace --- see \"Special markers\", below.\n\nWhen told that the color space is UNKNOWN, the library will default to using\nluminance-quality compression parameters for all color components.  You may\nwell want to change these parameters.  See the source code for\njpeg_set_colorspace(), in jcparam.c, for details.\n\nFor decompression, the JPEG file's color space is given in jpeg_color_space,\nand this is transformed to the output color space out_color_space.\njpeg_read_header's setting of jpeg_color_space can be relied on if the file\nconforms to JFIF or Adobe conventions, but otherwise it is no better than a\nguess.  If you know the JPEG file's color space for certain, you can override\njpeg_read_header's guess by setting jpeg_color_space.  jpeg_read_header also\nselects a default output color space based on (its guess of) jpeg_color_space;\nset out_color_space to override this.  Again, you must select a supported\ntransformation.  jdcolor.c currently supports\n\tYCbCr => RGB\n\tYCbCr => GRAYSCALE\n\tBG_YCC => RGB\n\tBG_YCC => GRAYSCALE\n\tRGB => GRAYSCALE\n\tGRAYSCALE => RGB\n\tYCCK => CMYK\nas well as the null transforms.  (Since GRAYSCALE=>RGB is provided, an\napplication can force grayscale JPEGs to look like color JPEGs if it only\nwants to handle one case.)\n\nThe two-pass color quantizer, jquant2.c, is specialized to handle RGB data\n(it weights distances appropriately for RGB colors).  You'll need to modify\nthe code if you want to use it for non-RGB output color spaces.  Note that\njquant2.c is used to map to an application-supplied colormap as well as for\nthe normal two-pass colormap selection process.\n\nCAUTION: it appears that Adobe Photoshop writes inverted data in CMYK JPEG\nfiles: 0 represents 100% ink coverage, rather than 0% ink as you'd expect.\nThis is arguably a bug in Photoshop, but if you need to work with Photoshop\nCMYK files, you will have to deal with it in your application.  We cannot\n\"fix\" this in the library by inverting the data during the CMYK<=>YCCK\ntransform, because that would break other applications, notably Ghostscript.\nPhotoshop versions prior to 3.0 write EPS files containing JPEG-encoded CMYK\ndata in the same inverted-YCCK representation used in bare JPEG files, but\nthe surrounding PostScript code performs an inversion using the PS image\noperator.  I am told that Photoshop 3.0 will write uninverted YCCK in\nEPS/JPEG files, and will omit the PS-level inversion.  (But the data\npolarity used in bare JPEG files will not change in 3.0.)  In either case,\nthe JPEG library must not invert the data itself, or else Ghostscript would\nread these EPS files incorrectly.\n\n\nError handling\n--------------\n\nWhen the default error handler is used, any error detected inside the JPEG\nroutines will cause a message to be printed on stderr, followed by exit().\nYou can supply your own error handling routines to override this behavior\nand to control the treatment of nonfatal warnings and trace/debug messages.\nThe file example.c illustrates the most common case, which is to have the\napplication regain control after an error rather than exiting.\n\nThe JPEG library never writes any message directly; it always goes through\nthe error handling routines.  Three classes of messages are recognized:\n  * Fatal errors: the library cannot continue.\n  * Warnings: the library can continue, but the data is corrupt, and a\n    damaged output image is likely to result.\n  * Trace/informational messages.  These come with a trace level indicating\n    the importance of the message; you can control the verbosity of the\n    program by adjusting the maximum trace level that will be displayed.\n\nYou may, if you wish, simply replace the entire JPEG error handling module\n(jerror.c) with your own code.  However, you can avoid code duplication by\nonly replacing some of the routines depending on the behavior you need.\nThis is accomplished by calling jpeg_std_error() as usual, but then overriding\nsome of the method pointers in the jpeg_error_mgr struct, as illustrated by\nexample.c.\n\nAll of the error handling routines will receive a pointer to the JPEG object\n(a j_common_ptr which points to either a jpeg_compress_struct or a\njpeg_decompress_struct; if you need to tell which, test the is_decompressor\nfield).  This struct includes a pointer to the error manager struct in its\n\"err\" field.  Frequently, custom error handler routines will need to access\nadditional data which is not known to the JPEG library or the standard error\nhandler.  The most convenient way to do this is to embed either the JPEG\nobject or the jpeg_error_mgr struct in a larger structure that contains\nadditional fields; then casting the passed pointer provides access to the\nadditional fields.  Again, see example.c for one way to do it.  (Beginning\nwith IJG version 6b, there is also a void pointer \"client_data\" in each\nJPEG object, which the application can also use to find related data.\nThe library does not touch client_data at all.)\n\nThe individual methods that you might wish to override are:\n\nerror_exit (j_common_ptr cinfo)\n\tReceives control for a fatal error.  Information sufficient to\n\tgenerate the error message has been stored in cinfo->err; call\n\toutput_message to display it.  Control must NOT return to the caller;\n\tgenerally this routine will exit() or longjmp() somewhere.\n\tTypically you would override this routine to get rid of the exit()\n\tdefault behavior.  Note that if you continue processing, you should\n\tclean up the JPEG object with jpeg_abort() or jpeg_destroy().\n\noutput_message (j_common_ptr cinfo)\n\tActual output of any JPEG message.  Override this to send messages\n\tsomewhere other than stderr.  Note that this method does not know\n\thow to generate a message, only where to send it.\n\nformat_message (j_common_ptr cinfo, char * buffer)\n\tConstructs a readable error message string based on the error info\n\tstored in cinfo->err.  This method is called by output_message.  Few\n\tapplications should need to override this method.  One possible\n\treason for doing so is to implement dynamic switching of error message\n\tlanguage.\n\nemit_message (j_common_ptr cinfo, int msg_level)\n\tDecide whether or not to emit a warning or trace message; if so,\n\tcalls output_message.  The main reason for overriding this method\n\twould be to abort on warnings.  msg_level is -1 for warnings,\n\t0 and up for trace messages.\n\nOnly error_exit() and emit_message() are called from the rest of the JPEG\nlibrary; the other two are internal to the error handler.\n\nThe actual message texts are stored in an array of strings which is pointed to\nby the field err->jpeg_message_table.  The messages are numbered from 0 to\nerr->last_jpeg_message, and it is these code numbers that are used in the\nJPEG library code.  You could replace the message texts (for instance, with\nmessages in French or German) by changing the message table pointer.  See\njerror.h for the default texts.  CAUTION: this table will almost certainly\nchange or grow from one library version to the next.\n\nIt may be useful for an application to add its own message texts that are\nhandled by the same mechanism.  The error handler supports a second \"add-on\"\nmessage table for this purpose.  To define an addon table, set the pointer\nerr->addon_message_table and the message numbers err->first_addon_message and\nerr->last_addon_message.  If you number the addon messages beginning at 1000\nor so, you won't have to worry about conflicts with the library's built-in\nmessages.  See the sample applications cjpeg/djpeg for an example of using\naddon messages (the addon messages are defined in cderror.h).\n\nActual invocation of the error handler is done via macros defined in jerror.h:\n\tERREXITn(...)\tfor fatal errors\n\tWARNMSn(...)\tfor corrupt-data warnings\n\tTRACEMSn(...)\tfor trace and informational messages.\nThese macros store the message code and any additional parameters into the\nerror handler struct, then invoke the error_exit() or emit_message() method.\nThe variants of each macro are for varying numbers of additional parameters.\nThe additional parameters are inserted into the generated message using\nstandard printf() format codes.\n\nSee jerror.h and jerror.c for further details.\n\n\nCompressed data handling (source and destination managers)\n----------------------------------------------------------\n\nThe JPEG compression library sends its compressed data to a \"destination\nmanager\" module.  The default destination manager just writes the data to a\nmemory buffer or to a stdio stream, but you can provide your own manager to\ndo something else.  Similarly, the decompression library calls a \"source\nmanager\" to obtain the compressed data; you can provide your own source\nmanager if you want the data to come from somewhere other than a memory\nbuffer or a stdio stream.\n\nIn both cases, compressed data is processed a bufferload at a time: the\ndestination or source manager provides a work buffer, and the library invokes\nthe manager only when the buffer is filled or emptied.  (You could define a\none-character buffer to force the manager to be invoked for each byte, but\nthat would be rather inefficient.)  The buffer's size and location are\ncontrolled by the manager, not by the library.  For example, the memory\nsource manager just makes the buffer pointer and length point to the original\ndata in memory.  In this case the buffer-reload procedure will be invoked\nonly if the decompressor ran off the end of the datastream, which would\nindicate an erroneous datastream.\n\nThe work buffer is defined as an array of datatype JOCTET, which is generally\n\"char\" or \"unsigned char\".  On a machine where char is not exactly 8 bits\nwide, you must define JOCTET as a wider data type and then modify the data\nsource and destination modules to transcribe the work arrays into 8-bit units\non external storage.\n\nA data destination manager struct contains a pointer and count defining the\nnext byte to write in the work buffer and the remaining free space:\n\n\tJOCTET * next_output_byte;  /* => next byte to write in buffer */\n\tsize_t free_in_buffer;      /* # of byte spaces remaining in buffer */\n\nThe library increments the pointer and decrements the count until the buffer\nis filled.  The manager's empty_output_buffer method must reset the pointer\nand count.  The manager is expected to remember the buffer's starting address\nand total size in private fields not visible to the library.\n\nA data destination manager provides three methods:\n\ninit_destination (j_compress_ptr cinfo)\n\tInitialize destination.  This is called by jpeg_start_compress()\n\tbefore any data is actually written.  It must initialize\n\tnext_output_byte and free_in_buffer.  free_in_buffer must be\n\tinitialized to a positive value.\n\nempty_output_buffer (j_compress_ptr cinfo)\n\tThis is called whenever the buffer has filled (free_in_buffer\n\treaches zero).  In typical applications, it should write out the\n\t*entire* buffer (use the saved start address and buffer length;\n\tignore the current state of next_output_byte and free_in_buffer).\n\tThen reset the pointer & count to the start of the buffer, and\n\treturn TRUE indicating that the buffer has been dumped.\n\tfree_in_buffer must be set to a positive value when TRUE is\n\treturned.  A FALSE return should only be used when I/O suspension is\n\tdesired (this operating mode is discussed in the next section).\n\nterm_destination (j_compress_ptr cinfo)\n\tTerminate destination --- called by jpeg_finish_compress() after all\n\tdata has been written.  In most applications, this must flush any\n\tdata remaining in the buffer.  Use either next_output_byte or\n\tfree_in_buffer to determine how much data is in the buffer.\n\nterm_destination() is NOT called by jpeg_abort() or jpeg_destroy().  If you\nwant the destination manager to be cleaned up during an abort, you must do it\nyourself.\n\nYou will also need code to create a jpeg_destination_mgr struct, fill in its\nmethod pointers, and insert a pointer to the struct into the \"dest\" field of\nthe JPEG compression object.  This can be done in-line in your setup code if\nyou like, but it's probably cleaner to provide a separate routine similar to\nthe jpeg_stdio_dest() or jpeg_mem_dest() routines of the supplied destination\nmanagers.\n\nDecompression source managers follow a parallel design, but with some\nadditional frammishes.  The source manager struct contains a pointer and count\ndefining the next byte to read from the work buffer and the number of bytes\nremaining:\n\n\tconst JOCTET * next_input_byte; /* => next byte to read from buffer */\n\tsize_t bytes_in_buffer;         /* # of bytes remaining in buffer */\n\nThe library increments the pointer and decrements the count until the buffer\nis emptied.  The manager's fill_input_buffer method must reset the pointer and\ncount.  In most applications, the manager must remember the buffer's starting\naddress and total size in private fields not visible to the library.\n\nA data source manager provides five methods:\n\ninit_source (j_decompress_ptr cinfo)\n\tInitialize source.  This is called by jpeg_read_header() before any\n\tdata is actually read.  Unlike init_destination(), it may leave\n\tbytes_in_buffer set to 0 (in which case a fill_input_buffer() call\n\twill occur immediately).\n\nfill_input_buffer (j_decompress_ptr cinfo)\n\tThis is called whenever bytes_in_buffer has reached zero and more\n\tdata is wanted.  In typical applications, it should read fresh data\n\tinto the buffer (ignoring the current state of next_input_byte and\n\tbytes_in_buffer), reset the pointer & count to the start of the\n\tbuffer, and return TRUE indicating that the buffer has been reloaded.\n\tIt is not necessary to fill the buffer entirely, only to obtain at\n\tleast one more byte.  bytes_in_buffer MUST be set to a positive value\n\tif TRUE is returned.  A FALSE return should only be used when I/O\n\tsuspension is desired (this mode is discussed in the next section).\n\nskip_input_data (j_decompress_ptr cinfo, long num_bytes)\n\tSkip num_bytes worth of data.  The buffer pointer and count should\n\tbe advanced over num_bytes input bytes, refilling the buffer as\n\tneeded.  This is used to skip over a potentially large amount of\n\tuninteresting data (such as an APPn marker).  In some applications\n\tit may be possible to optimize away the reading of the skipped data,\n\tbut it's not clear that being smart is worth much trouble; large\n\tskips are uncommon.  bytes_in_buffer may be zero on return.\n\tA zero or negative skip count should be treated as a no-op.\n\nresync_to_restart (j_decompress_ptr cinfo, int desired)\n\tThis routine is called only when the decompressor has failed to find\n\ta restart (RSTn) marker where one is expected.  Its mission is to\n\tfind a suitable point for resuming decompression.  For most\n\tapplications, we recommend that you just use the default resync\n\tprocedure, jpeg_resync_to_restart().  However, if you are able to back\n\tup in the input data stream, or if you have a-priori knowledge about\n\tthe likely location of restart markers, you may be able to do better.\n\tRead the read_restart_marker() and jpeg_resync_to_restart() routines\n\tin jdmarker.c if you think you'd like to implement your own resync\n\tprocedure.\n\nterm_source (j_decompress_ptr cinfo)\n\tTerminate source --- called by jpeg_finish_decompress() after all\n\tdata has been read.  Often a no-op.\n\nFor both fill_input_buffer() and skip_input_data(), there is no such thing\nas an EOF return.  If the end of the file has been reached, the routine has\na choice of exiting via ERREXIT() or inserting fake data into the buffer.\nIn most cases, generating a warning message and inserting a fake EOI marker\nis the best course of action --- this will allow the decompressor to output\nhowever much of the image is there.  In pathological cases, the decompressor\nmay swallow the EOI and again demand data ... just keep feeding it fake EOIs.\njdatasrc.c illustrates the recommended error recovery behavior.\n\nterm_source() is NOT called by jpeg_abort() or jpeg_destroy().  If you want\nthe source manager to be cleaned up during an abort, you must do it yourself.\n\nYou will also need code to create a jpeg_source_mgr struct, fill in its method\npointers, and insert a pointer to the struct into the \"src\" field of the JPEG\ndecompression object.  This can be done in-line in your setup code if you\nlike, but it's probably cleaner to provide a separate routine similar to the\njpeg_stdio_src() or jpeg_mem_src() routines of the supplied source managers.\n\nFor more information, consult the memory and stdio source and destination\nmanagers in jdatasrc.c and jdatadst.c.\n\n\nI/O suspension\n--------------\n\nSome applications need to use the JPEG library as an incremental memory-to-\nmemory filter: when the compressed data buffer is filled or emptied, they want\ncontrol to return to the outer loop, rather than expecting that the buffer can\nbe emptied or reloaded within the data source/destination manager subroutine.\nThe library supports this need by providing an \"I/O suspension\" mode, which we\ndescribe in this section.\n\nThe I/O suspension mode is not a panacea: nothing is guaranteed about the\nmaximum amount of time spent in any one call to the library, so it will not\neliminate response-time problems in single-threaded applications.  If you\nneed guaranteed response time, we suggest you \"bite the bullet\" and implement\na real multi-tasking capability.\n\nTo use I/O suspension, cooperation is needed between the calling application\nand the data source or destination manager; you will always need a custom\nsource/destination manager.  (Please read the previous section if you haven't\nalready.)  The basic idea is that the empty_output_buffer() or\nfill_input_buffer() routine is a no-op, merely returning FALSE to indicate\nthat it has done nothing.  Upon seeing this, the JPEG library suspends\noperation and returns to its caller.  The surrounding application is\nresponsible for emptying or refilling the work buffer before calling the\nJPEG library again.\n\nCompression suspension:\n\nFor compression suspension, use an empty_output_buffer() routine that returns\nFALSE; typically it will not do anything else.  This will cause the\ncompressor to return to the caller of jpeg_write_scanlines(), with the return\nvalue indicating that not all the supplied scanlines have been accepted.\nThe application must make more room in the output buffer, adjust the output\nbuffer pointer/count appropriately, and then call jpeg_write_scanlines()\nagain, pointing to the first unconsumed scanline.\n\nWhen forced to suspend, the compressor will backtrack to a convenient stopping\npoint (usually the start of the current MCU); it will regenerate some output\ndata when restarted.  Therefore, although empty_output_buffer() is only\ncalled when the buffer is filled, you should NOT write out the entire buffer\nafter a suspension.  Write only the data up to the current position of\nnext_output_byte/free_in_buffer.  The data beyond that point will be\nregenerated after resumption.\n\nBecause of the backtracking behavior, a good-size output buffer is essential\nfor efficiency; you don't want the compressor to suspend often.  (In fact, an\noverly small buffer could lead to infinite looping, if a single MCU required\nmore data than would fit in the buffer.)  We recommend a buffer of at least\nseveral Kbytes.  You may want to insert explicit code to ensure that you don't\ncall jpeg_write_scanlines() unless there is a reasonable amount of space in\nthe output buffer; in other words, flush the buffer before trying to compress\nmore data.\n\nThe compressor does not allow suspension while it is trying to write JPEG\nmarkers at the beginning and end of the file.  This means that:\n  * At the beginning of a compression operation, there must be enough free\n    space in the output buffer to hold the header markers (typically 600 or\n    so bytes).  The recommended buffer size is bigger than this anyway, so\n    this is not a problem as long as you start with an empty buffer.  However,\n    this restriction might catch you if you insert large special markers, such\n    as a JFIF thumbnail image, without flushing the buffer afterwards.\n  * When you call jpeg_finish_compress(), there must be enough space in the\n    output buffer to emit any buffered data and the final EOI marker.  In the\n    current implementation, half a dozen bytes should suffice for this, but\n    for safety's sake we recommend ensuring that at least 100 bytes are free\n    before calling jpeg_finish_compress().\n\nA more significant restriction is that jpeg_finish_compress() cannot suspend.\nThis means you cannot use suspension with multi-pass operating modes, namely\nHuffman code optimization and multiple-scan output.  Those modes write the\nwhole file during jpeg_finish_compress(), which will certainly result in\nbuffer overrun.  (Note that this restriction applies only to compression,\nnot decompression.  The decompressor supports input suspension in all of its\noperating modes.)\n\nDecompression suspension:\n\nFor decompression suspension, use a fill_input_buffer() routine that simply\nreturns FALSE (except perhaps during error recovery, as discussed below).\nThis will cause the decompressor to return to its caller with an indication\nthat suspension has occurred.  This can happen at four places:\n  * jpeg_read_header(): will return JPEG_SUSPENDED.\n  * jpeg_start_decompress(): will return FALSE, rather than its usual TRUE.\n  * jpeg_read_scanlines(): will return the number of scanlines already\n\tcompleted (possibly 0).\n  * jpeg_finish_decompress(): will return FALSE, rather than its usual TRUE.\nThe surrounding application must recognize these cases, load more data into\nthe input buffer, and repeat the call.  In the case of jpeg_read_scanlines(),\nincrement the passed pointers past any scanlines successfully read.\n\nJust as with compression, the decompressor will typically backtrack to a\nconvenient restart point before suspending.  When fill_input_buffer() is\ncalled, next_input_byte/bytes_in_buffer point to the current restart point,\nwhich is where the decompressor will backtrack to if FALSE is returned.\nThe data beyond that position must NOT be discarded if you suspend; it needs\nto be re-read upon resumption.  In most implementations, you'll need to shift\nthis data down to the start of your work buffer and then load more data after\nit.  Again, this behavior means that a several-Kbyte work buffer is essential\nfor decent performance; furthermore, you should load a reasonable amount of\nnew data before resuming decompression.  (If you loaded, say, only one new\nbyte each time around, you could waste a LOT of cycles.)\n\nThe skip_input_data() source manager routine requires special care in a\nsuspension scenario.  This routine is NOT granted the ability to suspend the\ndecompressor; it can decrement bytes_in_buffer to zero, but no more.  If the\nrequested skip distance exceeds the amount of data currently in the input\nbuffer, then skip_input_data() must set bytes_in_buffer to zero and record the\nadditional skip distance somewhere else.  The decompressor will immediately\ncall fill_input_buffer(), which should return FALSE, which will cause a\nsuspension return.  The surrounding application must then arrange to discard\nthe recorded number of bytes before it resumes loading the input buffer.\n(Yes, this design is rather baroque, but it avoids complexity in the far more\ncommon case where a non-suspending source manager is used.)\n\nIf the input data has been exhausted, we recommend that you emit a warning\nand insert dummy EOI markers just as a non-suspending data source manager\nwould do.  This can be handled either in the surrounding application logic or\nwithin fill_input_buffer(); the latter is probably more efficient.  If\nfill_input_buffer() knows that no more data is available, it can set the\npointer/count to point to a dummy EOI marker and then return TRUE just as\nthough it had read more data in a non-suspending situation.\n\nThe decompressor does not attempt to suspend within standard JPEG markers;\ninstead it will backtrack to the start of the marker and reprocess the whole\nmarker next time.  Hence the input buffer must be large enough to hold the\nlongest standard marker in the file.  Standard JPEG markers should normally\nnot exceed a few hundred bytes each (DHT tables are typically the longest).\nWe recommend at least a 2K buffer for performance reasons, which is much\nlarger than any correct marker is likely to be.  For robustness against\ndamaged marker length counts, you may wish to insert a test in your\napplication for the case that the input buffer is completely full and yet\nthe decoder has suspended without consuming any data --- otherwise, if this\nsituation did occur, it would lead to an endless loop.  (The library can't\nprovide this test since it has no idea whether \"the buffer is full\", or\neven whether there is a fixed-size input buffer.)\n\nThe input buffer would need to be 64K to allow for arbitrary COM or APPn\nmarkers, but these are handled specially: they are either saved into allocated\nmemory, or skipped over by calling skip_input_data().  In the former case,\nsuspension is handled correctly, and in the latter case, the problem of\nbuffer overrun is placed on skip_input_data's shoulders, as explained above.\nNote that if you provide your own marker handling routine for large markers,\nyou should consider how to deal with buffer overflow.\n\nMultiple-buffer management:\n\nIn some applications it is desirable to store the compressed data in a linked\nlist of buffer areas, so as to avoid data copying.  This can be handled by\nhaving empty_output_buffer() or fill_input_buffer() set the pointer and count\nto reference the next available buffer; FALSE is returned only if no more\nbuffers are available.  Although seemingly straightforward, there is a\npitfall in this approach: the backtrack that occurs when FALSE is returned\ncould back up into an earlier buffer.  For example, when fill_input_buffer()\nis called, the current pointer & count indicate the backtrack restart point.\nSince fill_input_buffer() will set the pointer and count to refer to a new\nbuffer, the restart position must be saved somewhere else.  Suppose a second\ncall to fill_input_buffer() occurs in the same library call, and no\nadditional input data is available, so fill_input_buffer must return FALSE.\nIf the JPEG library has not moved the pointer/count forward in the current\nbuffer, then *the correct restart point is the saved position in the prior\nbuffer*.  Prior buffers may be discarded only after the library establishes\na restart point within a later buffer.  Similar remarks apply for output into\na chain of buffers.\n\nThe library will never attempt to backtrack over a skip_input_data() call,\nso any skipped data can be permanently discarded.  You still have to deal\nwith the case of skipping not-yet-received data, however.\n\nIt's much simpler to use only a single buffer; when fill_input_buffer() is\ncalled, move any unconsumed data (beyond the current pointer/count) down to\nthe beginning of this buffer and then load new data into the remaining buffer\nspace.  This approach requires a little more data copying but is far easier\nto get right.\n\n\nProgressive JPEG support\n------------------------\n\nProgressive JPEG rearranges the stored data into a series of scans of\nincreasing quality.  In situations where a JPEG file is transmitted across a\nslow communications link, a decoder can generate a low-quality image very\nquickly from the first scan, then gradually improve the displayed quality as\nmore scans are received.  The final image after all scans are complete is\nidentical to that of a regular (sequential) JPEG file of the same quality\nsetting.  Progressive JPEG files are often slightly smaller than equivalent\nsequential JPEG files, but the possibility of incremental display is the main\nreason for using progressive JPEG.\n\nThe IJG encoder library generates progressive JPEG files when given a\nsuitable \"scan script\" defining how to divide the data into scans.\nCreation of progressive JPEG files is otherwise transparent to the encoder.\nProgressive JPEG files can also be read transparently by the decoder library.\nIf the decoding application simply uses the library as defined above, it\nwill receive a final decoded image without any indication that the file was\nprogressive.  Of course, this approach does not allow incremental display.\nTo perform incremental display, an application needs to use the decoder\nlibrary's \"buffered-image\" mode, in which it receives a decoded image\nmultiple times.\n\nEach displayed scan requires about as much work to decode as a full JPEG\nimage of the same size, so the decoder must be fairly fast in relation to the\ndata transmission rate in order to make incremental display useful.  However,\nit is possible to skip displaying the image and simply add the incoming bits\nto the decoder's coefficient buffer.  This is fast because only Huffman\ndecoding need be done, not IDCT, upsampling, colorspace conversion, etc.\nThe IJG decoder library allows the application to switch dynamically between\ndisplaying the image and simply absorbing the incoming bits.  A properly\ncoded application can automatically adapt the number of display passes to\nsuit the time available as the image is received.  Also, a final\nhigher-quality display cycle can be performed from the buffered data after\nthe end of the file is reached.\n\nProgressive compression:\n\nTo create a progressive JPEG file (or a multiple-scan sequential JPEG file),\nset the scan_info cinfo field to point to an array of scan descriptors, and\nperform compression as usual.  Instead of constructing your own scan list,\nyou can call the jpeg_simple_progression() helper routine to create a\nrecommended progression sequence; this method should be used by all\napplications that don't want to get involved in the nitty-gritty of\nprogressive scan sequence design.  (If you want to provide user control of\nscan sequences, you may wish to borrow the scan script reading code found\nin rdswitch.c, so that you can read scan script files just like cjpeg's.)\nWhen scan_info is not NULL, the compression library will store DCT'd data\ninto a buffer array as jpeg_write_scanlines() is called, and will emit all\nthe requested scans during jpeg_finish_compress().  This implies that\nmultiple-scan output cannot be created with a suspending data destination\nmanager, since jpeg_finish_compress() does not support suspension.  We\nshould also note that the compressor currently forces Huffman optimization\nmode when creating a progressive JPEG file, because the default Huffman\ntables are unsuitable for progressive files.\n\nProgressive decompression:\n\nWhen buffered-image mode is not used, the decoder library will read all of\na multi-scan file during jpeg_start_decompress(), so that it can provide a\nfinal decoded image.  (Here \"multi-scan\" means either progressive or\nmulti-scan sequential.)  This makes multi-scan files transparent to the\ndecoding application.  However, existing applications that used suspending\ninput with version 5 of the IJG library will need to be modified to check\nfor a suspension return from jpeg_start_decompress().\n\nTo perform incremental display, an application must use the library's\nbuffered-image mode.  This is described in the next section.\n\n\nBuffered-image mode\n-------------------\n\nIn buffered-image mode, the library stores the partially decoded image in a\ncoefficient buffer, from which it can be read out as many times as desired.\nThis mode is typically used for incremental display of progressive JPEG files,\nbut it can be used with any JPEG file.  Each scan of a progressive JPEG file\nadds more data (more detail) to the buffered image.  The application can\ndisplay in lockstep with the source file (one display pass per input scan),\nor it can allow input processing to outrun display processing.  By making\ninput and display processing run independently, it is possible for the\napplication to adapt progressive display to a wide range of data transmission\nrates.\n\nThe basic control flow for buffered-image decoding is\n\n\tjpeg_create_decompress()\n\tset data source\n\tjpeg_read_header()\n\tset overall decompression parameters\n\tcinfo.buffered_image = TRUE;\t/* select buffered-image mode */\n\tjpeg_start_decompress()\n\tfor (each output pass) {\n\t    adjust output decompression parameters if required\n\t    jpeg_start_output()\t\t/* start a new output pass */\n\t    for (all scanlines in image) {\n\t        jpeg_read_scanlines()\n\t        display scanlines\n\t    }\n\t    jpeg_finish_output()\t/* terminate output pass */\n\t}\n\tjpeg_finish_decompress()\n\tjpeg_destroy_decompress()\n\nThis differs from ordinary unbuffered decoding in that there is an additional\nlevel of looping.  The application can choose how many output passes to make\nand how to display each pass.\n\nThe simplest approach to displaying progressive images is to do one display\npass for each scan appearing in the input file.  In this case the outer loop\ncondition is typically\n\twhile (! jpeg_input_complete(&cinfo))\nand the start-output call should read\n\tjpeg_start_output(&cinfo, cinfo.input_scan_number);\nThe second parameter to jpeg_start_output() indicates which scan of the input\nfile is to be displayed; the scans are numbered starting at 1 for this\npurpose.  (You can use a loop counter starting at 1 if you like, but using\nthe library's input scan counter is easier.)  The library automatically reads\ndata as necessary to complete each requested scan, and jpeg_finish_output()\nadvances to the next scan or end-of-image marker (hence input_scan_number\nwill be incremented by the time control arrives back at jpeg_start_output()).\nWith this technique, data is read from the input file only as needed, and\ninput and output processing run in lockstep.\n\nAfter reading the final scan and reaching the end of the input file, the\nbuffered image remains available; it can be read additional times by\nrepeating the jpeg_start_output()/jpeg_read_scanlines()/jpeg_finish_output()\nsequence.  For example, a useful technique is to use fast one-pass color\nquantization for display passes made while the image is arriving, followed by\na final display pass using two-pass quantization for highest quality.  This\nis done by changing the library parameters before the final output pass.\nChanging parameters between passes is discussed in detail below.\n\nIn general the last scan of a progressive file cannot be recognized as such\nuntil after it is read, so a post-input display pass is the best approach if\nyou want special processing in the final pass.\n\nWhen done with the image, be sure to call jpeg_finish_decompress() to release\nthe buffered image (or just use jpeg_destroy_decompress()).\n\nIf input data arrives faster than it can be displayed, the application can\ncause the library to decode input data in advance of what's needed to produce\noutput.  This is done by calling the routine jpeg_consume_input().\nThe return value is one of the following:\n\tJPEG_REACHED_SOS:    reached an SOS marker (the start of a new scan)\n\tJPEG_REACHED_EOI:    reached the EOI marker (end of image)\n\tJPEG_ROW_COMPLETED:  completed reading one MCU row of compressed data\n\tJPEG_SCAN_COMPLETED: completed reading last MCU row of current scan\n\tJPEG_SUSPENDED:      suspended before completing any of the above\n(JPEG_SUSPENDED can occur only if a suspending data source is used.)  This\nroutine can be called at any time after initializing the JPEG object.  It\nreads some additional data and returns when one of the indicated significant\nevents occurs.  (If called after the EOI marker is reached, it will\nimmediately return JPEG_REACHED_EOI without attempting to read more data.)\n\nThe library's output processing will automatically call jpeg_consume_input()\nwhenever the output processing overtakes the input; thus, simple lockstep\ndisplay requires no direct calls to jpeg_consume_input().  But by adding\ncalls to jpeg_consume_input(), you can absorb data in advance of what is\nbeing displayed.  This has two benefits:\n  * You can limit buildup of unprocessed data in your input buffer.\n  * You can eliminate extra display passes by paying attention to the\n    state of the library's input processing.\n\nThe first of these benefits only requires interspersing calls to\njpeg_consume_input() with your display operations and any other processing\nyou may be doing.  To avoid wasting cycles due to backtracking, it's best to\ncall jpeg_consume_input() only after a hundred or so new bytes have arrived.\nThis is discussed further under \"I/O suspension\", above.  (Note: the JPEG\nlibrary currently is not thread-safe.  You must not call jpeg_consume_input()\nfrom one thread of control if a different library routine is working on the\nsame JPEG object in another thread.)\n\nWhen input arrives fast enough that more than one new scan is available\nbefore you start a new output pass, you may as well skip the output pass\ncorresponding to the completed scan.  This occurs for free if you pass\ncinfo.input_scan_number as the target scan number to jpeg_start_output().\nThe input_scan_number field is simply the index of the scan currently being\nconsumed by the input processor.  You can ensure that this is up-to-date by\nemptying the input buffer just before calling jpeg_start_output(): call\njpeg_consume_input() repeatedly until it returns JPEG_SUSPENDED or\nJPEG_REACHED_EOI.\n\nThe target scan number passed to jpeg_start_output() is saved in the\ncinfo.output_scan_number field.  The library's output processing calls\njpeg_consume_input() whenever the current input scan number and row within\nthat scan is less than or equal to the current output scan number and row.\nThus, input processing can \"get ahead\" of the output processing but is not\nallowed to \"fall behind\".  You can achieve several different effects by\nmanipulating this interlock rule.  For example, if you pass a target scan\nnumber greater than the current input scan number, the output processor will\nwait until that scan starts to arrive before producing any output.  (To avoid\nan infinite loop, the target scan number is automatically reset to the last\nscan number when the end of image is reached.  Thus, if you specify a large\ntarget scan number, the library will just absorb the entire input file and\nthen perform an output pass.  This is effectively the same as what\njpeg_start_decompress() does when you don't select buffered-image mode.)\nWhen you pass a target scan number equal to the current input scan number,\nthe image is displayed no faster than the current input scan arrives.  The\nfinal possibility is to pass a target scan number less than the current input\nscan number; this disables the input/output interlock and causes the output\nprocessor to simply display whatever it finds in the image buffer, without\nwaiting for input.  (However, the library will not accept a target scan\nnumber less than one, so you can't avoid waiting for the first scan.)\n\nWhen data is arriving faster than the output display processing can advance\nthrough the image, jpeg_consume_input() will store data into the buffered\nimage beyond the point at which the output processing is reading data out\nagain.  If the input arrives fast enough, it may \"wrap around\" the buffer to\nthe point where the input is more than one whole scan ahead of the output.\nIf the output processing simply proceeds through its display pass without\npaying attention to the input, the effect seen on-screen is that the lower\npart of the image is one or more scans better in quality than the upper part.\nThen, when the next output scan is started, you have a choice of what target\nscan number to use.  The recommended choice is to use the current input scan\nnumber at that time, which implies that you've skipped the output scans\ncorresponding to the input scans that were completed while you processed the\nprevious output scan.  In this way, the decoder automatically adapts its\nspeed to the arriving data, by skipping output scans as necessary to keep up\nwith the arriving data.\n\nWhen using this strategy, you'll want to be sure that you perform a final\noutput pass after receiving all the data; otherwise your last display may not\nbe full quality across the whole screen.  So the right outer loop logic is\nsomething like this:\n\tdo {\n\t    absorb any waiting input by calling jpeg_consume_input()\n\t    final_pass = jpeg_input_complete(&cinfo);\n\t    adjust output decompression parameters if required\n\t    jpeg_start_output(&cinfo, cinfo.input_scan_number);\n\t    ...\n\t    jpeg_finish_output()\n\t} while (! final_pass);\nrather than quitting as soon as jpeg_input_complete() returns TRUE.  This\narrangement makes it simple to use higher-quality decoding parameters\nfor the final pass.  But if you don't want to use special parameters for\nthe final pass, the right loop logic is like this:\n\tfor (;;) {\n\t    absorb any waiting input by calling jpeg_consume_input()\n\t    jpeg_start_output(&cinfo, cinfo.input_scan_number);\n\t    ...\n\t    jpeg_finish_output()\n\t    if (jpeg_input_complete(&cinfo) &&\n\t        cinfo.input_scan_number == cinfo.output_scan_number)\n\t      break;\n\t}\nIn this case you don't need to know in advance whether an output pass is to\nbe the last one, so it's not necessary to have reached EOF before starting\nthe final output pass; rather, what you want to test is whether the output\npass was performed in sync with the final input scan.  This form of the loop\nwill avoid an extra output pass whenever the decoder is able (or nearly able)\nto keep up with the incoming data.\n\nWhen the data transmission speed is high, you might begin a display pass,\nthen find that much or all of the file has arrived before you can complete\nthe pass.  (You can detect this by noting the JPEG_REACHED_EOI return code\nfrom jpeg_consume_input(), or equivalently by testing jpeg_input_complete().)\nIn this situation you may wish to abort the current display pass and start a\nnew one using the newly arrived information.  To do so, just call\njpeg_finish_output() and then start a new pass with jpeg_start_output().\n\nA variant strategy is to abort and restart display if more than one complete\nscan arrives during an output pass; this can be detected by noting\nJPEG_REACHED_SOS returns and/or examining cinfo.input_scan_number.  This\nidea should be employed with caution, however, since the display process\nmight never get to the bottom of the image before being aborted, resulting\nin the lower part of the screen being several passes worse than the upper.\nIn most cases it's probably best to abort an output pass only if the whole\nfile has arrived and you want to begin the final output pass immediately.\n\nWhen receiving data across a communication link, we recommend always using\nthe current input scan number for the output target scan number; if a\nhigher-quality final pass is to be done, it should be started (aborting any\nincomplete output pass) as soon as the end of file is received.  However,\nmany other strategies are possible.  For example, the application can examine\nthe parameters of the current input scan and decide whether to display it or\nnot.  If the scan contains only chroma data, one might choose not to use it\nas the target scan, expecting that the scan will be small and will arrive\nquickly.  To skip to the next scan, call jpeg_consume_input() until it\nreturns JPEG_REACHED_SOS or JPEG_REACHED_EOI.  Or just use the next higher\nnumber as the target scan for jpeg_start_output(); but that method doesn't\nlet you inspect the next scan's parameters before deciding to display it.\n\n\nIn buffered-image mode, jpeg_start_decompress() never performs input and\nthus never suspends.  An application that uses input suspension with\nbuffered-image mode must be prepared for suspension returns from these\nroutines:\n* jpeg_start_output() performs input only if you request 2-pass quantization\n  and the target scan isn't fully read yet.  (This is discussed below.)\n* jpeg_read_scanlines(), as always, returns the number of scanlines that it\n  was able to produce before suspending.\n* jpeg_finish_output() will read any markers following the target scan,\n  up to the end of the file or the SOS marker that begins another scan.\n  (But it reads no input if jpeg_consume_input() has already reached the\n  end of the file or a SOS marker beyond the target output scan.)\n* jpeg_finish_decompress() will read until the end of file, and thus can\n  suspend if the end hasn't already been reached (as can be tested by\n  calling jpeg_input_complete()).\njpeg_start_output(), jpeg_finish_output(), and jpeg_finish_decompress()\nall return TRUE if they completed their tasks, FALSE if they had to suspend.\nIn the event of a FALSE return, the application must load more input data\nand repeat the call.  Applications that use non-suspending data sources need\nnot check the return values of these three routines.\n\n\nIt is possible to change decoding parameters between output passes in the\nbuffered-image mode.  The decoder library currently supports only very\nlimited changes of parameters.  ONLY THE FOLLOWING parameter changes are\nallowed after jpeg_start_decompress() is called:\n* dct_method can be changed before each call to jpeg_start_output().\n  For example, one could use a fast DCT method for early scans, changing\n  to a higher quality method for the final scan.\n* dither_mode can be changed before each call to jpeg_start_output();\n  of course this has no impact if not using color quantization.  Typically\n  one would use ordered dither for initial passes, then switch to\n  Floyd-Steinberg dither for the final pass.  Caution: changing dither mode\n  can cause more memory to be allocated by the library.  Although the amount\n  of memory involved is not large (a scanline or so), it may cause the\n  initial max_memory_to_use specification to be exceeded, which in the worst\n  case would result in an out-of-memory failure.\n* do_block_smoothing can be changed before each call to jpeg_start_output().\n  This setting is relevant only when decoding a progressive JPEG image.\n  During the first DC-only scan, block smoothing provides a very \"fuzzy\" look\n  instead of the very \"blocky\" look seen without it; which is better seems a\n  matter of personal taste.  But block smoothing is nearly always a win\n  during later stages, especially when decoding a successive-approximation\n  image: smoothing helps to hide the slight blockiness that otherwise shows\n  up on smooth gradients until the lowest coefficient bits are sent.\n* Color quantization mode can be changed under the rules described below.\n  You *cannot* change between full-color and quantized output (because that\n  would alter the required I/O buffer sizes), but you can change which\n  quantization method is used.\n\nWhen generating color-quantized output, changing quantization method is a\nvery useful way of switching between high-speed and high-quality display.\nThe library allows you to change among its three quantization methods:\n1. Single-pass quantization to a fixed color cube.\n   Selected by cinfo.two_pass_quantize = FALSE and cinfo.colormap = NULL.\n2. Single-pass quantization to an application-supplied colormap.\n   Selected by setting cinfo.colormap to point to the colormap (the value of\n   two_pass_quantize is ignored); also set cinfo.actual_number_of_colors.\n3. Two-pass quantization to a colormap chosen specifically for the image.\n   Selected by cinfo.two_pass_quantize = TRUE and cinfo.colormap = NULL.\n   (This is the default setting selected by jpeg_read_header, but it is\n   probably NOT what you want for the first pass of progressive display!)\nThese methods offer successively better quality and lesser speed.  However,\nonly the first method is available for quantizing in non-RGB color spaces.\n\nIMPORTANT: because the different quantizer methods have very different\nworking-storage requirements, the library requires you to indicate which\none(s) you intend to use before you call jpeg_start_decompress().  (If we did\nnot require this, the max_memory_to_use setting would be a complete fiction.)\nYou do this by setting one or more of these three cinfo fields to TRUE:\n\tenable_1pass_quant\t\tFixed color cube colormap\n\tenable_external_quant\t\tExternally-supplied colormap\n\tenable_2pass_quant\t\tTwo-pass custom colormap\nAll three are initialized FALSE by jpeg_read_header().  But\njpeg_start_decompress() automatically sets TRUE the one selected by the\ncurrent two_pass_quantize and colormap settings, so you only need to set the\nenable flags for any other quantization methods you plan to change to later.\n\nAfter setting the enable flags correctly at jpeg_start_decompress() time, you\ncan change to any enabled quantization method by setting two_pass_quantize\nand colormap properly just before calling jpeg_start_output().  The following\nspecial rules apply:\n1. You must explicitly set cinfo.colormap to NULL when switching to 1-pass\n   or 2-pass mode from a different mode, or when you want the 2-pass\n   quantizer to be re-run to generate a new colormap.\n2. To switch to an external colormap, or to change to a different external\n   colormap than was used on the prior pass, you must call\n   jpeg_new_colormap() after setting cinfo.colormap.\nNOTE: if you want to use the same colormap as was used in the prior pass,\nyou should not do either of these things.  This will save some nontrivial\nswitchover costs.\n(These requirements exist because cinfo.colormap will always be non-NULL\nafter completing a prior output pass, since both the 1-pass and 2-pass\nquantizers set it to point to their output colormaps.  Thus you have to\ndo one of these two things to notify the library that something has changed.\nYup, it's a bit klugy, but it's necessary to do it this way for backwards\ncompatibility.)\n\nNote that in buffered-image mode, the library generates any requested colormap\nduring jpeg_start_output(), not during jpeg_start_decompress().\n\nWhen using two-pass quantization, jpeg_start_output() makes a pass over the\nbuffered image to determine the optimum color map; it therefore may take a\nsignificant amount of time, whereas ordinarily it does little work.  The\nprogress monitor hook is called during this pass, if defined.  It is also\nimportant to realize that if the specified target scan number is greater than\nor equal to the current input scan number, jpeg_start_output() will attempt\nto consume input as it makes this pass.  If you use a suspending data source,\nyou need to check for a FALSE return from jpeg_start_output() under these\nconditions.  The combination of 2-pass quantization and a not-yet-fully-read\ntarget scan is the only case in which jpeg_start_output() will consume input.\n\n\nApplication authors who support buffered-image mode may be tempted to use it\nfor all JPEG images, even single-scan ones.  This will work, but it is\ninefficient: there is no need to create an image-sized coefficient buffer for\nsingle-scan images.  Requesting buffered-image mode for such an image wastes\nmemory.  Worse, it can cost time on large images, since the buffered data has\nto be swapped out or written to a temporary file.  If you are concerned about\nmaximum performance on baseline JPEG files, you should use buffered-image\nmode only when the incoming file actually has multiple scans.  This can be\ntested by calling jpeg_has_multiple_scans(), which will return a correct\nresult at any time after jpeg_read_header() completes.\n\nIt is also worth noting that when you use jpeg_consume_input() to let input\nprocessing get ahead of output processing, the resulting pattern of access to\nthe coefficient buffer is quite nonsequential.  It's best to use the memory\nmanager jmemnobs.c if you can (ie, if you have enough real or virtual main\nmemory).  If not, at least make sure that max_memory_to_use is set as high as\npossible.  If the JPEG memory manager has to use a temporary file, you will\nprobably see a lot of disk traffic and poor performance.  (This could be\nimproved with additional work on the memory manager, but we haven't gotten\naround to it yet.)\n\nIn some applications it may be convenient to use jpeg_consume_input() for all\ninput processing, including reading the initial markers; that is, you may\nwish to call jpeg_consume_input() instead of jpeg_read_header() during\nstartup.  This works, but note that you must check for JPEG_REACHED_SOS and\nJPEG_REACHED_EOI return codes as the equivalent of jpeg_read_header's codes.\nOnce the first SOS marker has been reached, you must call\njpeg_start_decompress() before jpeg_consume_input() will consume more input;\nit'll just keep returning JPEG_REACHED_SOS until you do.  If you read a\ntables-only file this way, jpeg_consume_input() will return JPEG_REACHED_EOI\nwithout ever returning JPEG_REACHED_SOS; be sure to check for this case.\nIf this happens, the decompressor will not read any more input until you call\njpeg_abort() to reset it.  It is OK to call jpeg_consume_input() even when not\nusing buffered-image mode, but in that case it's basically a no-op after the\ninitial markers have been read: it will just return JPEG_SUSPENDED.\n\n\nAbbreviated datastreams and multiple images\n-------------------------------------------\n\nA JPEG compression or decompression object can be reused to process multiple\nimages.  This saves a small amount of time per image by eliminating the\n\"create\" and \"destroy\" operations, but that isn't the real purpose of the\nfeature.  Rather, reuse of an object provides support for abbreviated JPEG\ndatastreams.  Object reuse can also simplify processing a series of images in\na single input or output file.  This section explains these features.\n\nA JPEG file normally contains several hundred bytes worth of quantization\nand Huffman tables.  In a situation where many images will be stored or\ntransmitted with identical tables, this may represent an annoying overhead.\nThe JPEG standard therefore permits tables to be omitted.  The standard\ndefines three classes of JPEG datastreams:\n  * \"Interchange\" datastreams contain an image and all tables needed to decode\n     the image.  These are the usual kind of JPEG file.\n  * \"Abbreviated image\" datastreams contain an image, but are missing some or\n    all of the tables needed to decode that image.\n  * \"Abbreviated table specification\" (henceforth \"tables-only\") datastreams\n    contain only table specifications.\nTo decode an abbreviated image, it is necessary to load the missing table(s)\ninto the decoder beforehand.  This can be accomplished by reading a separate\ntables-only file.  A variant scheme uses a series of images in which the first\nimage is an interchange (complete) datastream, while subsequent ones are\nabbreviated and rely on the tables loaded by the first image.  It is assumed\nthat once the decoder has read a table, it will remember that table until a\nnew definition for the same table number is encountered.\n\nIt is the application designer's responsibility to figure out how to associate\nthe correct tables with an abbreviated image.  While abbreviated datastreams\ncan be useful in a closed environment, their use is strongly discouraged in\nany situation where data exchange with other applications might be needed.\nCaveat designer.\n\nThe JPEG library provides support for reading and writing any combination of\ntables-only datastreams and abbreviated images.  In both compression and\ndecompression objects, a quantization or Huffman table will be retained for\nthe lifetime of the object, unless it is overwritten by a new table definition.\n\n\nTo create abbreviated image datastreams, it is only necessary to tell the\ncompressor not to emit some or all of the tables it is using.  Each\nquantization and Huffman table struct contains a boolean field \"sent_table\",\nwhich normally is initialized to FALSE.  For each table used by the image, the\nheader-writing process emits the table and sets sent_table = TRUE unless it is\nalready TRUE.  (In normal usage, this prevents outputting the same table\ndefinition multiple times, as would otherwise occur because the chroma\ncomponents typically share tables.)  Thus, setting this field to TRUE before\ncalling jpeg_start_compress() will prevent the table from being written at\nall.\n\nIf you want to create a \"pure\" abbreviated image file containing no tables,\njust call \"jpeg_suppress_tables(&cinfo, TRUE)\" after constructing all the\ntables.  If you want to emit some but not all tables, you'll need to set the\nindividual sent_table fields directly.\n\nTo create an abbreviated image, you must also call jpeg_start_compress()\nwith a second parameter of FALSE, not TRUE.  Otherwise jpeg_start_compress()\nwill force all the sent_table fields to FALSE.  (This is a safety feature to\nprevent abbreviated images from being created accidentally.)\n\nTo create a tables-only file, perform the same parameter setup that you\nnormally would, but instead of calling jpeg_start_compress() and so on, call\njpeg_write_tables(&cinfo).  This will write an abbreviated datastream\ncontaining only SOI, DQT and/or DHT markers, and EOI.  All the quantization\nand Huffman tables that are currently defined in the compression object will\nbe emitted unless their sent_tables flag is already TRUE, and then all the\nsent_tables flags will be set TRUE.\n\nA sure-fire way to create matching tables-only and abbreviated image files\nis to proceed as follows:\n\n\tcreate JPEG compression object\n\tset JPEG parameters\n\tset destination to tables-only file\n\tjpeg_write_tables(&cinfo);\n\tset destination to image file\n\tjpeg_start_compress(&cinfo, FALSE);\n\twrite data...\n\tjpeg_finish_compress(&cinfo);\n\nSince the JPEG parameters are not altered between writing the table file and\nthe abbreviated image file, the same tables are sure to be used.  Of course,\nyou can repeat the jpeg_start_compress() ... jpeg_finish_compress() sequence\nmany times to produce many abbreviated image files matching the table file.\n\nYou cannot suppress output of the computed Huffman tables when Huffman\noptimization is selected.  (If you could, there'd be no way to decode the\nimage...)  Generally, you don't want to set optimize_coding = TRUE when\nyou are trying to produce abbreviated files.\n\nIn some cases you might want to compress an image using tables which are\nnot stored in the application, but are defined in an interchange or\ntables-only file readable by the application.  This can be done by setting up\na JPEG decompression object to read the specification file, then copying the\ntables into your compression object.  See jpeg_copy_critical_parameters()\nfor an example of copying quantization tables.\n\n\nTo read abbreviated image files, you simply need to load the proper tables\ninto the decompression object before trying to read the abbreviated image.\nIf the proper tables are stored in the application program, you can just\nallocate the table structs and fill in their contents directly.  For example,\nto load a fixed quantization table into table slot \"n\":\n\n    if (cinfo.quant_tbl_ptrs[n] == NULL)\n      cinfo.quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) &cinfo);\n    quant_ptr = cinfo.quant_tbl_ptrs[n];\t/* quant_ptr is JQUANT_TBL* */\n    for (i = 0; i < 64; i++) {\n      /* Qtable[] is desired quantization table, in natural array order */\n      quant_ptr->quantval[i] = Qtable[i];\n    }\n\nCode to load a fixed Huffman table is typically (for AC table \"n\"):\n\n    if (cinfo.ac_huff_tbl_ptrs[n] == NULL)\n      cinfo.ac_huff_tbl_ptrs[n] = jpeg_alloc_huff_table((j_common_ptr) &cinfo);\n    huff_ptr = cinfo.ac_huff_tbl_ptrs[n];\t/* huff_ptr is JHUFF_TBL* */\n    for (i = 1; i <= 16; i++) {\n      /* counts[i] is number of Huffman codes of length i bits, i=1..16 */\n      huff_ptr->bits[i] = counts[i];\n    }\n    for (i = 0; i < 256; i++) {\n      /* symbols[] is the list of Huffman symbols, in code-length order */\n      huff_ptr->huffval[i] = symbols[i];\n    }\n\n(Note that trying to set cinfo.quant_tbl_ptrs[n] to point directly at a\nconstant JQUANT_TBL object is not safe.  If the incoming file happened to\ncontain a quantization table definition, your master table would get\noverwritten!  Instead allocate a working table copy and copy the master table\ninto it, as illustrated above.  Ditto for Huffman tables, of course.)\n\nYou might want to read the tables from a tables-only file, rather than\nhard-wiring them into your application.  The jpeg_read_header() call is\nsufficient to read a tables-only file.  You must pass a second parameter of\nFALSE to indicate that you do not require an image to be present.  Thus, the\ntypical scenario is\n\n\tcreate JPEG decompression object\n\tset source to tables-only file\n\tjpeg_read_header(&cinfo, FALSE);\n\tset source to abbreviated image file\n\tjpeg_read_header(&cinfo, TRUE);\n\tset decompression parameters\n\tjpeg_start_decompress(&cinfo);\n\tread data...\n\tjpeg_finish_decompress(&cinfo);\n\nIn some cases, you may want to read a file without knowing whether it contains\nan image or just tables.  In that case, pass FALSE and check the return value\nfrom jpeg_read_header(): it will be JPEG_HEADER_OK if an image was found,\nJPEG_HEADER_TABLES_ONLY if only tables were found.  (A third return value,\nJPEG_SUSPENDED, is possible when using a suspending data source manager.)\nNote that jpeg_read_header() will not complain if you read an abbreviated\nimage for which you haven't loaded the missing tables; the missing-table check\noccurs later, in jpeg_start_decompress().\n\n\nIt is possible to read a series of images from a single source file by\nrepeating the jpeg_read_header() ... jpeg_finish_decompress() sequence,\nwithout releasing/recreating the JPEG object or the data source module.\n(If you did reinitialize, any partial bufferload left in the data source\nbuffer at the end of one image would be discarded, causing you to lose the\nstart of the next image.)  When you use this method, stored tables are\nautomatically carried forward, so some of the images can be abbreviated images\nthat depend on tables from earlier images.\n\nIf you intend to write a series of images into a single destination file,\nyou might want to make a specialized data destination module that doesn't\nflush the output buffer at term_destination() time.  This would speed things\nup by some trifling amount.  Of course, you'd need to remember to flush the\nbuffer after the last image.  You can make the later images be abbreviated\nones by passing FALSE to jpeg_start_compress().\n\n\nSpecial markers\n---------------\n\nSome applications may need to insert or extract special data in the JPEG\ndatastream.  The JPEG standard provides marker types \"COM\" (comment) and\n\"APP0\" through \"APP15\" (application) to hold application-specific data.\nUnfortunately, the use of these markers is not specified by the standard.\nCOM markers are fairly widely used to hold user-supplied text.  The JFIF file\nformat spec uses APP0 markers with specified initial strings to hold certain\ndata.  Adobe applications use APP14 markers beginning with the string \"Adobe\"\nfor miscellaneous data.  Other APPn markers are rarely seen, but might\ncontain almost anything.\n\nIf you wish to store user-supplied text, we recommend you use COM markers\nand place readable 7-bit ASCII text in them.  Newline conventions are not\nstandardized --- expect to find LF (Unix style), CR/LF (DOS style), or CR\n(Mac style).  A robust COM reader should be able to cope with random binary\ngarbage, including nulls, since some applications generate COM markers\ncontaining non-ASCII junk.  (But yours should not be one of them.)\n\nFor program-supplied data, use an APPn marker, and be sure to begin it with an\nidentifying string so that you can tell whether the marker is actually yours.\nIt's probably best to avoid using APP0 or APP14 for any private markers.\n(NOTE: the upcoming SPIFF standard will use APP8 markers; we recommend you\nnot use APP8 markers for any private purposes, either.)\n\nKeep in mind that at most 65533 bytes can be put into one marker, but you\ncan have as many markers as you like.\n\nBy default, the IJG compression library will write a JFIF APP0 marker if the\nselected JPEG colorspace is grayscale or YCbCr, or an Adobe APP14 marker if\nthe selected colorspace is RGB, CMYK, or YCCK.  You can disable this, but\nwe don't recommend it.  The decompression library will recognize JFIF and\nAdobe markers and will set the JPEG colorspace properly when one is found.\n\n\nYou can write special markers immediately following the datastream header by\ncalling jpeg_write_marker() after jpeg_start_compress() and before the first\ncall to jpeg_write_scanlines().  When you do this, the markers appear after\nthe SOI and the JFIF APP0 and Adobe APP14 markers (if written), but before\nall else.  Specify the marker type parameter as \"JPEG_COM\" for COM or\n\"JPEG_APP0 + n\" for APPn.  (Actually, jpeg_write_marker will let you write\nany marker type, but we don't recommend writing any other kinds of marker.)\nFor example, to write a user comment string pointed to by comment_text:\n\tjpeg_write_marker(cinfo, JPEG_COM, comment_text, strlen(comment_text));\n\nIf it's not convenient to store all the marker data in memory at once,\nyou can instead call jpeg_write_m_header() followed by multiple calls to\njpeg_write_m_byte().  If you do it this way, it's your responsibility to\ncall jpeg_write_m_byte() exactly the number of times given in the length\nparameter to jpeg_write_m_header().  (This method lets you empty the\noutput buffer partway through a marker, which might be important when\nusing a suspending data destination module.  In any case, if you are using\na suspending destination, you should flush its buffer after inserting\nany special markers.  See \"I/O suspension\".)\n\nOr, if you prefer to synthesize the marker byte sequence yourself,\nyou can just cram it straight into the data destination module.\n\nIf you are writing JFIF 1.02 extension markers (thumbnail images), don't\nforget to set cinfo.JFIF_minor_version = 2 so that the encoder will write the\ncorrect JFIF version number in the JFIF header marker.  The library's default\nis to write version 1.01, but that's wrong if you insert any 1.02 extension\nmarkers.  (We could probably get away with just defaulting to 1.02, but there\nused to be broken decoders that would complain about unknown minor version\nnumbers.  To reduce compatibility risks it's safest not to write 1.02 unless\nyou are actually using 1.02 extensions.)\n\n\nWhen reading, two methods of handling special markers are available:\n1. You can ask the library to save the contents of COM and/or APPn markers\ninto memory, and then examine them at your leisure afterwards.\n2. You can supply your own routine to process COM and/or APPn markers\non-the-fly as they are read.\nThe first method is simpler to use, especially if you are using a suspending\ndata source; writing a marker processor that copes with input suspension is\nnot easy (consider what happens if the marker is longer than your available\ninput buffer).  However, the second method conserves memory since the marker\ndata need not be kept around after it's been processed.\n\nFor either method, you'd normally set up marker handling after creating a\ndecompression object and before calling jpeg_read_header(), because the\nmarkers of interest will typically be near the head of the file and so will\nbe scanned by jpeg_read_header.  Once you've established a marker handling\nmethod, it will be used for the life of that decompression object\n(potentially many datastreams), unless you change it.  Marker handling is\ndetermined separately for COM markers and for each APPn marker code.\n\n\nTo save the contents of special markers in memory, call\n\tjpeg_save_markers(cinfo, marker_code, length_limit)\nwhere marker_code is the marker type to save, JPEG_COM or JPEG_APP0+n.\n(To arrange to save all the special marker types, you need to call this\nroutine 17 times, for COM and APP0-APP15.)  If the incoming marker is longer\nthan length_limit data bytes, only length_limit bytes will be saved; this\nparameter allows you to avoid chewing up memory when you only need to see the\nfirst few bytes of a potentially large marker.  If you want to save all the\ndata, set length_limit to 0xFFFF; that is enough since marker lengths are only\n16 bits.  As a special case, setting length_limit to 0 prevents that marker\ntype from being saved at all.  (That is the default behavior, in fact.)\n\nAfter jpeg_read_header() completes, you can examine the special markers by\nfollowing the cinfo->marker_list pointer chain.  All the special markers in\nthe file appear in this list, in order of their occurrence in the file (but\nomitting any markers of types you didn't ask for).  Both the original data\nlength and the saved data length are recorded for each list entry; the latter\nwill not exceed length_limit for the particular marker type.  Note that these\nlengths exclude the marker length word, whereas the stored representation\nwithin the JPEG file includes it.  (Hence the maximum data length is really\nonly 65533.)\n\nIt is possible that additional special markers appear in the file beyond the\nSOS marker at which jpeg_read_header stops; if so, the marker list will be\nextended during reading of the rest of the file.  This is not expected to be\ncommon, however.  If you are short on memory you may want to reset the length\nlimit to zero for all marker types after finishing jpeg_read_header, to\nensure that the max_memory_to_use setting cannot be exceeded due to addition\nof later markers.\n\nThe marker list remains stored until you call jpeg_finish_decompress or\njpeg_abort, at which point the memory is freed and the list is set to empty.\n(jpeg_destroy also releases the storage, of course.)\n\nNote that the library is internally interested in APP0 and APP14 markers;\nif you try to set a small nonzero length limit on these types, the library\nwill silently force the length up to the minimum it wants.  (But you can set\na zero length limit to prevent them from being saved at all.)  Also, in a\n16-bit environment, the maximum length limit may be constrained to less than\n65533 by malloc() limitations.  It is therefore best not to assume that the\neffective length limit is exactly what you set it to be.\n\n\nIf you want to supply your own marker-reading routine, you do it by calling\njpeg_set_marker_processor().  A marker processor routine must have the\nsignature\n\tboolean jpeg_marker_parser_method (j_decompress_ptr cinfo)\nAlthough the marker code is not explicitly passed, the routine can find it\nin cinfo->unread_marker.  At the time of call, the marker proper has been\nread from the data source module.  The processor routine is responsible for\nreading the marker length word and the remaining parameter bytes, if any.\nReturn TRUE to indicate success.  (FALSE should be returned only if you are\nusing a suspending data source and it tells you to suspend.  See the standard\nmarker processors in jdmarker.c for appropriate coding methods if you need to\nuse a suspending data source.)\n\nIf you override the default APP0 or APP14 processors, it is up to you to\nrecognize JFIF and Adobe markers if you want colorspace recognition to occur\nproperly.  We recommend copying and extending the default processors if you\nwant to do that.  (A better idea is to save these marker types for later\nexamination by calling jpeg_save_markers(); that method doesn't interfere\nwith the library's own processing of these markers.)\n\njpeg_set_marker_processor() and jpeg_save_markers() are mutually exclusive\n--- if you call one it overrides any previous call to the other, for the\nparticular marker type specified.\n\nA simple example of an external COM processor can be found in djpeg.c.\nAlso, see jpegtran.c for an example of using jpeg_save_markers.\n\n\nRaw (downsampled) image data\n----------------------------\n\nSome applications need to supply already-downsampled image data to the JPEG\ncompressor, or to receive raw downsampled data from the decompressor.  The\nlibrary supports this requirement by allowing the application to write or\nread raw data, bypassing the normal preprocessing or postprocessing steps.\nThe interface is different from the standard one and is somewhat harder to\nuse.  If your interest is merely in bypassing color conversion, we recommend\nthat you use the standard interface and simply set jpeg_color_space =\nin_color_space (or jpeg_color_space = out_color_space for decompression).\nThe mechanism described in this section is necessary only to supply or\nreceive downsampled image data, in which not all components have the same\ndimensions.\n\n\nTo compress raw data, you must supply the data in the colorspace to be used\nin the JPEG file (please read the earlier section on Special color spaces)\nand downsampled to the sampling factors specified in the JPEG parameters.\nYou must supply the data in the format used internally by the JPEG library,\nnamely a JSAMPIMAGE array.  This is an array of pointers to two-dimensional\narrays, each of type JSAMPARRAY.  Each 2-D array holds the values for one\ncolor component.  This structure is necessary since the components are of\ndifferent sizes.  If the image dimensions are not a multiple of the MCU size,\nyou must also pad the data correctly (usually, this is done by replicating\nthe last column and/or row).  The data must be padded to a multiple of a DCT\nblock in each component: that is, each downsampled row must contain a\nmultiple of block_size valid samples, and there must be a multiple of\nblock_size sample rows for each component.  (For applications such as\nconversion of digital TV images, the standard image size is usually a\nmultiple of the DCT block size, so that no padding need actually be done.)\n\nThe procedure for compression of raw data is basically the same as normal\ncompression, except that you call jpeg_write_raw_data() in place of\njpeg_write_scanlines().  Before calling jpeg_start_compress(), you must do\nthe following:\n  * Set cinfo->raw_data_in to TRUE.  (It is set FALSE by jpeg_set_defaults().)\n    This notifies the library that you will be supplying raw data.\n    Furthermore, set cinfo->do_fancy_downsampling to FALSE if you want to use\n    real downsampled data.  (It is set TRUE by jpeg_set_defaults().)\n  * Ensure jpeg_color_space is correct --- an explicit jpeg_set_colorspace()\n    call is a good idea.  Note that since color conversion is bypassed,\n    in_color_space is ignored, except that jpeg_set_defaults() uses it to\n    choose the default jpeg_color_space setting.\n  * Ensure the sampling factors, cinfo->comp_info[i].h_samp_factor and\n    cinfo->comp_info[i].v_samp_factor, are correct.  Since these indicate the\n    dimensions of the data you are supplying, it's wise to set them\n    explicitly, rather than assuming the library's defaults are what you want.\n\nTo pass raw data to the library, call jpeg_write_raw_data() in place of\njpeg_write_scanlines().  The two routines work similarly except that\njpeg_write_raw_data takes a JSAMPIMAGE data array rather than JSAMPARRAY.\nThe scanlines count passed to and returned from jpeg_write_raw_data is\nmeasured in terms of the component with the largest v_samp_factor.\n\njpeg_write_raw_data() processes one MCU row per call, which is to say\nv_samp_factor*block_size sample rows of each component.  The passed num_lines\nvalue must be at least max_v_samp_factor*block_size, and the return value\nwill be exactly that amount (or possibly some multiple of that amount, in\nfuture library versions).  This is true even on the last call at the bottom\nof the image; don't forget to pad your data as necessary.\n\nThe required dimensions of the supplied data can be computed for each\ncomponent as\n\tcinfo->comp_info[i].width_in_blocks*block_size  samples per row\n\tcinfo->comp_info[i].height_in_blocks*block_size rows in image\nafter jpeg_start_compress() has initialized those fields.  If the valid data\nis smaller than this, it must be padded appropriately.  For some sampling\nfactors and image sizes, additional dummy DCT blocks are inserted to make\nthe image a multiple of the MCU dimensions.  The library creates such dummy\nblocks itself; it does not read them from your supplied data.  Therefore you\nneed never pad by more than block_size samples.  An example may help here.\nAssume 2h2v downsampling of YCbCr data, that is\n\tcinfo->comp_info[0].h_samp_factor = 2\t\tfor Y\n\tcinfo->comp_info[0].v_samp_factor = 2\n\tcinfo->comp_info[1].h_samp_factor = 1\t\tfor Cb\n\tcinfo->comp_info[1].v_samp_factor = 1\n\tcinfo->comp_info[2].h_samp_factor = 1\t\tfor Cr\n\tcinfo->comp_info[2].v_samp_factor = 1\nand suppose that the nominal image dimensions (cinfo->image_width and\ncinfo->image_height) are 101x101 pixels.  Then jpeg_start_compress() will\ncompute downsampled_width = 101 and width_in_blocks = 13 for Y,\ndownsampled_width = 51 and width_in_blocks = 7 for Cb and Cr (and the same\nfor the height fields).  You must pad the Y data to at least 13*8 = 104\ncolumns and rows, the Cb/Cr data to at least 7*8 = 56 columns and rows.  The\nMCU height is max_v_samp_factor = 2 DCT rows so you must pass at least 16\nscanlines on each call to jpeg_write_raw_data(), which is to say 16 actual\nsample rows of Y and 8 each of Cb and Cr.  A total of 7 MCU rows are needed,\nso you must pass a total of 7*16 = 112 \"scanlines\".  The last DCT block row\nof Y data is dummy, so it doesn't matter what you pass for it in the data\narrays, but the scanlines count must total up to 112 so that all of the Cb\nand Cr data gets passed.\n\nOutput suspension is supported with raw-data compression: if the data\ndestination module suspends, jpeg_write_raw_data() will return 0.\nIn this case the same data rows must be passed again on the next call.\n\n\nDecompression with raw data output implies bypassing all postprocessing.\nYou must deal with the color space and sampling factors present in the\nincoming file.  If your application only handles, say, 2h1v YCbCr data,\nyou must check for and fail on other color spaces or other sampling factors.\nThe library will not convert to a different color space for you.\n\nTo obtain raw data output, set cinfo->raw_data_out = TRUE before\njpeg_start_decompress() (it is set FALSE by jpeg_read_header()).  Be sure to\nverify that the color space and sampling factors are ones you can handle.\nFurthermore, set cinfo->do_fancy_upsampling = FALSE if you want to get real\ndownsampled data (it is set TRUE by jpeg_read_header()).\nThen call jpeg_read_raw_data() in place of jpeg_read_scanlines().  The\ndecompression process is otherwise the same as usual.\n\njpeg_read_raw_data() returns one MCU row per call, and thus you must pass a\nbuffer of at least max_v_samp_factor*block_size scanlines (scanline counting\nis the same as for raw-data compression).  The buffer you pass must be large\nenough to hold the actual data plus padding to DCT-block boundaries.  As with\ncompression, any entirely dummy DCT blocks are not processed so you need not\nallocate space for them, but the total scanline count includes them.  The\nabove example of computing buffer dimensions for raw-data compression is\nequally valid for decompression.\n\nInput suspension is supported with raw-data decompression: if the data source\nmodule suspends, jpeg_read_raw_data() will return 0.  You can also use\nbuffered-image mode to read raw data in multiple passes.\n\n\nReally raw data: DCT coefficients\n---------------------------------\n\nIt is possible to read or write the contents of a JPEG file as raw DCT\ncoefficients.  This facility is mainly intended for use in lossless\ntranscoding between different JPEG file formats.  Other possible applications\ninclude lossless cropping of a JPEG image, lossless reassembly of a\nmulti-strip or multi-tile TIFF/JPEG file into a single JPEG datastream, etc.\n\nTo read the contents of a JPEG file as DCT coefficients, open the file and do\njpeg_read_header() as usual.  But instead of calling jpeg_start_decompress()\nand jpeg_read_scanlines(), call jpeg_read_coefficients().  This will read the\nentire image into a set of virtual coefficient-block arrays, one array per\ncomponent.  The return value is a pointer to an array of virtual-array\ndescriptors.  Each virtual array can be accessed directly using the JPEG\nmemory manager's access_virt_barray method (see Memory management, below,\nand also read structure.txt's discussion of virtual array handling).  Or,\nfor simple transcoding to a different JPEG file format, the array list can\njust be handed directly to jpeg_write_coefficients().\n\nEach block in the block arrays contains quantized coefficient values in\nnormal array order (not JPEG zigzag order).  The block arrays contain only\nDCT blocks containing real data; any entirely-dummy blocks added to fill out\ninterleaved MCUs at the right or bottom edges of the image are discarded\nduring reading and are not stored in the block arrays.  (The size of each\nblock array can be determined from the width_in_blocks and height_in_blocks\nfields of the component's comp_info entry.)  This is also the data format\nexpected by jpeg_write_coefficients().\n\nWhen you are done using the virtual arrays, call jpeg_finish_decompress()\nto release the array storage and return the decompression object to an idle\nstate; or just call jpeg_destroy() if you don't need to reuse the object.\n\nIf you use a suspending data source, jpeg_read_coefficients() will return\nNULL if it is forced to suspend; a non-NULL return value indicates successful\ncompletion.  You need not test for a NULL return value when using a\nnon-suspending data source.\n\nIt is also possible to call jpeg_read_coefficients() to obtain access to the\ndecoder's coefficient arrays during a normal decode cycle in buffered-image\nmode.  This frammish might be useful for progressively displaying an incoming\nimage and then re-encoding it without loss.  To do this, decode in buffered-\nimage mode as discussed previously, then call jpeg_read_coefficients() after\nthe last jpeg_finish_output() call.  The arrays will be available for your use\nuntil you call jpeg_finish_decompress().\n\n\nTo write the contents of a JPEG file as DCT coefficients, you must provide\nthe DCT coefficients stored in virtual block arrays.  You can either pass\nblock arrays read from an input JPEG file by jpeg_read_coefficients(), or\nallocate virtual arrays from the JPEG compression object and fill them\nyourself.  In either case, jpeg_write_coefficients() is substituted for\njpeg_start_compress() and jpeg_write_scanlines().  Thus the sequence is\n  * Create compression object\n  * Set all compression parameters as necessary\n  * Request virtual arrays if needed\n  * jpeg_write_coefficients()\n  * jpeg_finish_compress()\n  * Destroy or re-use compression object\njpeg_write_coefficients() is passed a pointer to an array of virtual block\narray descriptors; the number of arrays is equal to cinfo.num_components.\n\nThe virtual arrays need only have been requested, not realized, before\njpeg_write_coefficients() is called.  A side-effect of\njpeg_write_coefficients() is to realize any virtual arrays that have been\nrequested from the compression object's memory manager.  Thus, when obtaining\nthe virtual arrays from the compression object, you should fill the arrays\nafter calling jpeg_write_coefficients().  The data is actually written out\nwhen you call jpeg_finish_compress(); jpeg_write_coefficients() only writes\nthe file header.\n\nWhen writing raw DCT coefficients, it is crucial that the JPEG quantization\ntables and sampling factors match the way the data was encoded, or the\nresulting file will be invalid.  For transcoding from an existing JPEG file,\nwe recommend using jpeg_copy_critical_parameters().  This routine initializes\nall the compression parameters to default values (like jpeg_set_defaults()),\nthen copies the critical information from a source decompression object.\nThe decompression object should have just been used to read the entire\nJPEG input file --- that is, it should be awaiting jpeg_finish_decompress().\n\njpeg_write_coefficients() marks all tables stored in the compression object\nas needing to be written to the output file (thus, it acts like\njpeg_start_compress(cinfo, TRUE)).  This is for safety's sake, to avoid\nemitting abbreviated JPEG files by accident.  If you really want to emit an\nabbreviated JPEG file, call jpeg_suppress_tables(), or set the tables'\nindividual sent_table flags, between calling jpeg_write_coefficients() and\njpeg_finish_compress().\n\n\nProgress monitoring\n-------------------\n\nSome applications may need to regain control from the JPEG library every so\noften.  The typical use of this feature is to produce a percent-done bar or\nother progress display.  (For a simple example, see cjpeg.c or djpeg.c.)\nAlthough you do get control back frequently during the data-transferring pass\n(the jpeg_read_scanlines or jpeg_write_scanlines loop), any additional passes\nwill occur inside jpeg_finish_compress or jpeg_start_decompress; those\nroutines may take a long time to execute, and you don't get control back\nuntil they are done.\n\nYou can define a progress-monitor routine which will be called periodically\nby the library.  No guarantees are made about how often this call will occur,\nso we don't recommend you use it for mouse tracking or anything like that.\nAt present, a call will occur once per MCU row, scanline, or sample row\ngroup, whichever unit is convenient for the current processing mode; so the\nwider the image, the longer the time between calls.  During the data\ntransferring pass, only one call occurs per call of jpeg_read_scanlines or\njpeg_write_scanlines, so don't pass a large number of scanlines at once if\nyou want fine resolution in the progress count.  (If you really need to use\nthe callback mechanism for time-critical tasks like mouse tracking, you could\ninsert additional calls inside some of the library's inner loops.)\n\nTo establish a progress-monitor callback, create a struct jpeg_progress_mgr,\nfill in its progress_monitor field with a pointer to your callback routine,\nand set cinfo->progress to point to the struct.  The callback will be called\nwhenever cinfo->progress is non-NULL.  (This pointer is set to NULL by\njpeg_create_compress or jpeg_create_decompress; the library will not change\nit thereafter.  So if you allocate dynamic storage for the progress struct,\nmake sure it will live as long as the JPEG object does.  Allocating from the\nJPEG memory manager with lifetime JPOOL_PERMANENT will work nicely.)  You\ncan use the same callback routine for both compression and decompression.\n\nThe jpeg_progress_mgr struct contains four fields which are set by the library:\n\tlong pass_counter;\t/* work units completed in this pass */\n\tlong pass_limit;\t/* total number of work units in this pass */\n\tint completed_passes;\t/* passes completed so far */\n\tint total_passes;\t/* total number of passes expected */\nDuring any one pass, pass_counter increases from 0 up to (not including)\npass_limit; the step size is usually but not necessarily 1.  The pass_limit\nvalue may change from one pass to another.  The expected total number of\npasses is in total_passes, and the number of passes already completed is in\ncompleted_passes.  Thus the fraction of work completed may be estimated as\n\t\tcompleted_passes + (pass_counter/pass_limit)\n\t\t--------------------------------------------\n\t\t\t\ttotal_passes\nignoring the fact that the passes may not be equal amounts of work.\n\nWhen decompressing, pass_limit can even change within a pass, because it\ndepends on the number of scans in the JPEG file, which isn't always known in\nadvance.  The computed fraction-of-work-done may jump suddenly (if the library\ndiscovers it has overestimated the number of scans) or even decrease (in the\nopposite case).  It is not wise to put great faith in the work estimate.\n\nWhen using the decompressor's buffered-image mode, the progress monitor work\nestimate is likely to be completely unhelpful, because the library has no way\nto know how many output passes will be demanded of it.  Currently, the library\nsets total_passes based on the assumption that there will be one more output\npass if the input file end hasn't yet been read (jpeg_input_complete() isn't\nTRUE), but no more output passes if the file end has been reached when the\noutput pass is started.  This means that total_passes will rise as additional\noutput passes are requested.  If you have a way of determining the input file\nsize, estimating progress based on the fraction of the file that's been read\nwill probably be more useful than using the library's value.\n\n\nMemory management\n-----------------\n\nThis section covers some key facts about the JPEG library's built-in memory\nmanager.  For more info, please read structure.txt's section about the memory\nmanager, and consult the source code if necessary.\n\nAll memory and temporary file allocation within the library is done via the\nmemory manager.  If necessary, you can replace the \"back end\" of the memory\nmanager to control allocation yourself (for example, if you don't want the\nlibrary to use malloc() and free() for some reason).\n\nSome data is allocated \"permanently\" and will not be freed until the JPEG\nobject is destroyed.  Most data is allocated \"per image\" and is freed by\njpeg_finish_compress, jpeg_finish_decompress, or jpeg_abort.  You can call the\nmemory manager yourself to allocate structures that will automatically be\nfreed at these times.  Typical code for this is\n  ptr = (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, size);\nUse JPOOL_PERMANENT to get storage that lasts as long as the JPEG object.\nUse alloc_large instead of alloc_small for anything bigger than a few Kbytes.\nThere are also alloc_sarray and alloc_barray routines that automatically\nbuild 2-D sample or block arrays.\n\nThe library's minimum space requirements to process an image depend on the\nimage's width, but not on its height, because the library ordinarily works\nwith \"strip\" buffers that are as wide as the image but just a few rows high.\nSome operating modes (eg, two-pass color quantization) require full-image\nbuffers.  Such buffers are treated as \"virtual arrays\": only the current strip\nneed be in memory, and the rest can be swapped out to a temporary file.\n\nIf you use the simplest memory manager back end (jmemnobs.c), then no\ntemporary files are used; virtual arrays are simply malloc()'d.  Images bigger\nthan memory can be processed only if your system supports virtual memory.\nThe other memory manager back ends support temporary files of various flavors\nand thus work in machines without virtual memory.  They may also be useful on\nUnix machines if you need to process images that exceed available swap space.\n\nWhen using temporary files, the library will make the in-memory buffers for\nits virtual arrays just big enough to stay within a \"maximum memory\" setting.\nYour application can set this limit by setting cinfo->mem->max_memory_to_use\nafter creating the JPEG object.  (Of course, there is still a minimum size for\nthe buffers, so the max-memory setting is effective only if it is bigger than\nthe minimum space needed.)  If you allocate any large structures yourself, you\nmust allocate them before jpeg_start_compress() or jpeg_start_decompress() in\norder to have them counted against the max memory limit.  Also keep in mind\nthat space allocated with alloc_small() is ignored, on the assumption that\nit's too small to be worth worrying about; so a reasonable safety margin\nshould be left when setting max_memory_to_use.\n\nIf you use the jmemname.c or jmemdos.c memory manager back end, it is\nimportant to clean up the JPEG object properly to ensure that the temporary\nfiles get deleted.  (This is especially crucial with jmemdos.c, where the\n\"temporary files\" may be extended-memory segments; if they are not freed,\nDOS will require a reboot to recover the memory.)  Thus, with these memory\nmanagers, it's a good idea to provide a signal handler that will trap any\nearly exit from your program.  The handler should call either jpeg_abort()\nor jpeg_destroy() for any active JPEG objects.  A handler is not needed with\njmemnobs.c, and shouldn't be necessary with jmemansi.c or jmemmac.c either,\nsince the C library is supposed to take care of deleting files made with\ntmpfile().\n\n\nMemory usage\n------------\n\nWorking memory requirements while performing compression or decompression\ndepend on image dimensions, image characteristics (such as colorspace and\nJPEG process), and operating mode (application-selected options).\n\nAs of v6b, the decompressor requires:\n 1. About 24K in more-or-less-fixed-size data.  This varies a bit depending\n    on operating mode and image characteristics (particularly color vs.\n    grayscale), but it doesn't depend on image dimensions.\n 2. Strip buffers (of size proportional to the image width) for IDCT and\n    upsampling results.  The worst case for commonly used sampling factors\n    is about 34 bytes * width in pixels for a color image.  A grayscale image\n    only needs about 8 bytes per pixel column.\n 3. A full-image DCT coefficient buffer is needed to decode a multi-scan JPEG\n    file (including progressive JPEGs), or whenever you select buffered-image\n    mode.  This takes 2 bytes/coefficient.  At typical 2x2 sampling, that's\n    3 bytes per pixel for a color image.  Worst case (1x1 sampling) requires\n    6 bytes/pixel.  For grayscale, figure 2 bytes/pixel.\n 4. To perform 2-pass color quantization, the decompressor also needs a\n    128K color lookup table and a full-image pixel buffer (3 bytes/pixel).\nThis does not count any memory allocated by the application, such as a\nbuffer to hold the final output image.\n\nThe above figures are valid for 8-bit JPEG data precision and a machine with\n32-bit ints.  For 9-bit to 12-bit JPEG data, double the size of the strip\nbuffers and quantization pixel buffer.  The \"fixed-size\" data will be\nsomewhat smaller with 16-bit ints, larger with 64-bit ints.  Also, CMYK\nor other unusual color spaces will require different amounts of space.\n\nThe full-image coefficient and pixel buffers, if needed at all, do not\nhave to be fully RAM resident; you can have the library use temporary\nfiles instead when the total memory usage would exceed a limit you set.\n(But if your OS supports virtual memory, it's probably better to just use\njmemnobs and let the OS do the swapping.)\n\nThe compressor's memory requirements are similar, except that it has no need\nfor color quantization.  Also, it needs a full-image DCT coefficient buffer\nif Huffman-table optimization is asked for, even if progressive mode is not\nrequested.\n\nIf you need more detailed information about memory usage in a particular\nsituation, you can enable the MEM_STATS code in jmemmgr.c.\n\n\nLibrary compile-time options\n----------------------------\n\nA number of compile-time options are available by modifying jmorecfg.h.\n\nThe IJG code currently supports 8-bit to 12-bit sample data precision by\ndefining BITS_IN_JSAMPLE as 8, 9, 10, 11, or 12.\nNote that a value larger than 8 causes JSAMPLE to be larger than a char,\nso it affects the surrounding application's image data.\nThe sample applications cjpeg and djpeg can support deeper than 8-bit data\nonly for PPM and GIF file formats; you must disable the other file formats\nto compile a 9-bit to 12-bit cjpeg or djpeg.  (install.txt has more\ninformation about that.)\nRun-time selection and conversion of data precision are currently not\nsupported and may be added later.\nException:  The transcoding part (jpegtran) supports all settings in a\nsingle instance, since it operates on the level of DCT coefficients and\nnot sample values.\n(If you need to include an 8-bit library and a 9-bit to 12-bit library for\ncompression or decompression in a single application, you could probably do\nit by defining NEED_SHORT_EXTERNAL_NAMES for just one of the copies.  You'd\nhave to access the 8-bit and the 9-bit to 12-bit copies from separate\napplication source files.  This is untested ... if you try it, we'd like to\nhear whether it works!)\n\nNote that the standard Huffman tables are only valid for 8-bit data precision.\nIf you selected more than 8-bit data precision, cjpeg uses arithmetic coding\nby default.  The Huffman encoder normally uses entropy optimization to\ncompute usable tables for higher precision.  Otherwise, you'll have to\nsupply different default Huffman tables.  You may also want to supply your\nown DCT quantization tables; the existing quality-scaling code has been\ndeveloped for 8-bit use, and probably doesn't generate especially good tables\nfor 9-bit to 12-bit.\n\nThe maximum number of components (color channels) in the image is determined\nby MAX_COMPONENTS.  The JPEG standard allows up to 255 components, but we\nexpect that few applications will need more than four or so.\n\nOn machines with unusual data type sizes, you may be able to improve\nperformance or reduce memory space by tweaking the various typedefs in\njmorecfg.h.  In particular, on some RISC CPUs, access to arrays of \"short\"s\nis quite slow; consider trading memory for speed by making JCOEF, INT16, and\nUINT16 be \"int\" or \"unsigned int\".  UINT8 is also a candidate to become int.\nYou probably don't want to make JSAMPLE be int unless you have lots of memory\nto burn.\n\nYou can reduce the size of the library by compiling out various optional\nfunctions.  To do this, undefine xxx_SUPPORTED symbols as necessary.\n\nYou can also save a few K by not having text error messages in the library;\nthe standard error message table occupies about 5Kb.  This is particularly\nreasonable for embedded applications where there's no good way to display \na message anyway.  To do this, remove the creation of the message table\n(jpeg_std_message_table[]) from jerror.c, and alter format_message to do\nsomething reasonable without it.  You could output the numeric value of the\nmessage code number, for example.  If you do this, you can also save a couple\nmore K by modifying the TRACEMSn() macros in jerror.h to expand to nothing;\nyou don't need trace capability anyway, right?\n\n\nPortability considerations\n--------------------------\n\nThe JPEG library has been written to be extremely portable; the sample\napplications cjpeg and djpeg are slightly less so.  This section summarizes\nthe design goals in this area.  (If you encounter any bugs that cause the\nlibrary to be less portable than is claimed here, we'd appreciate hearing\nabout them.)\n\nThe code works fine on ANSI C, C++, and pre-ANSI C compilers, using any of\nthe popular system include file setups, and some not-so-popular ones too.\nSee install.txt for configuration procedures.\n\nThe code is not dependent on the exact sizes of the C data types.  As\ndistributed, we make the assumptions that\n\tchar\tis at least 8 bits wide\n\tshort\tis at least 16 bits wide\n\tint\tis at least 16 bits wide\n\tlong\tis at least 32 bits wide\n(These are the minimum requirements of the ANSI C standard.)  Wider types will\nwork fine, although memory may be used inefficiently if char is much larger\nthan 8 bits or short is much bigger than 16 bits.  The code should work\nequally well with 16- or 32-bit ints.\n\nIn a system where these assumptions are not met, you may be able to make the\ncode work by modifying the typedefs in jmorecfg.h.  However, you will probably\nhave difficulty if int is less than 16 bits wide, since references to plain\nint abound in the code.\n\nchar can be either signed or unsigned, although the code runs faster if an\nunsigned char type is available.  If char is wider than 8 bits, you will need\nto redefine JOCTET and/or provide custom data source/destination managers so\nthat JOCTET represents exactly 8 bits of data on external storage.\n\nThe JPEG library proper does not assume ASCII representation of characters.\nBut some of the image file I/O modules in cjpeg/djpeg do have ASCII\ndependencies in file-header manipulation; so does cjpeg's select_file_type()\nroutine.\n\nThe JPEG library does not rely heavily on the C library.  In particular, C\nstdio is used only by the data source/destination modules and the error\nhandler, all of which are application-replaceable.  (cjpeg/djpeg are more\nheavily dependent on stdio.)  malloc and free are called only from the memory\nmanager \"back end\" module, so you can use a different memory allocator by\nreplacing that one file.\n\nThe code generally assumes that C names must be unique in the first 15\ncharacters.  However, global function names can be made unique in the\nfirst 6 characters by defining NEED_SHORT_EXTERNAL_NAMES.\n\nMore info about porting the code may be gleaned by reading jconfig.txt,\njmorecfg.h, and jinclude.h.\n\n\nNotes for MS-DOS implementors\n-----------------------------\n\nThe IJG code is designed to work efficiently in 80x86 \"small\" or \"medium\"\nmemory models (i.e., data pointers are 16 bits unless explicitly declared\n\"far\"; code pointers can be either size).  You may be able to use small\nmodel to compile cjpeg or djpeg by itself, but you will probably have to use\nmedium model for any larger application.  This won't make much difference in\nperformance.  You *will* take a noticeable performance hit if you use a\nlarge-data memory model (perhaps 10%-25%), and you should avoid \"huge\" model\nif at all possible.\n\nThe JPEG library typically needs 2Kb-3Kb of stack space.  It will also\nmalloc about 20K-30K of near heap space while executing (and lots of far\nheap, but that doesn't count in this calculation).  This figure will vary\ndepending on selected operating mode, and to a lesser extent on image size.\nThere is also about 5Kb-6Kb of constant data which will be allocated in the\nnear data segment (about 4Kb of this is the error message table).\nThus you have perhaps 20K available for other modules' static data and near\nheap space before you need to go to a larger memory model.  The C library's\nstatic data will account for several K of this, but that still leaves a good\ndeal for your needs.  (If you are tight on space, you could reduce the sizes\nof the I/O buffers allocated by jdatasrc.c and jdatadst.c, say from 4K to\n1K.  Another possibility is to move the error message table to far memory;\nthis should be doable with only localized hacking on jerror.c.)\n\nAbout 2K of the near heap space is \"permanent\" memory that will not be\nreleased until you destroy the JPEG object.  This is only an issue if you\nsave a JPEG object between compression or decompression operations.\n\nFar data space may also be a tight resource when you are dealing with large\nimages.  The most memory-intensive case is decompression with two-pass color\nquantization, or single-pass quantization to an externally supplied color\nmap.  This requires a 128Kb color lookup table plus strip buffers amounting\nto about 40 bytes per column for typical sampling ratios (eg, about 25600\nbytes for a 640-pixel-wide image).  You may not be able to process wide\nimages if you have large data structures of your own.\n\nOf course, all of these concerns vanish if you use a 32-bit flat-memory-model\ncompiler, such as DJGPP or Watcom C.  We highly recommend flat model if you\ncan use it; the JPEG library is significantly faster in flat model.\n"
  },
  {
    "path": "ltmain.sh",
    "content": "#! /bin/sh\n## DO NOT EDIT - This file generated from ./build-aux/ltmain.in\n##               by inline-source v2014-01-03.01\n\n# libtool (GNU libtool) 2.4.6\n# Provide generalized library-building support services.\n# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996\n\n# Copyright (C) 1996-2015 Free Software Foundation, Inc.\n# This is free software; see the source for copying conditions.  There is NO\n# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n# GNU Libtool is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# As a special exception to the GNU General Public License,\n# if you distribute this file as part of a program or library that\n# is built using GNU Libtool, you may include this file under the\n# same distribution terms that you use for the rest of that program.\n#\n# GNU Libtool is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n\nPROGRAM=libtool\nPACKAGE=libtool\nVERSION=\"2.4.6 Debian-2.4.6-2\"\npackage_revision=2.4.6\n\n\n## ------ ##\n## Usage. ##\n## ------ ##\n\n# Run './libtool --help' for help with using this script from the\n# command line.\n\n\n## ------------------------------- ##\n## User overridable command paths. ##\n## ------------------------------- ##\n\n# After configure completes, it has a better idea of some of the\n# shell tools we need than the defaults used by the functions shared\n# with bootstrap, so set those here where they can still be over-\n# ridden by the user, but otherwise take precedence.\n\n: ${AUTOCONF=\"autoconf\"}\n: ${AUTOMAKE=\"automake\"}\n\n\n## -------------------------- ##\n## Source external libraries. ##\n## -------------------------- ##\n\n# Much of our low-level functionality needs to be sourced from external\n# libraries, which are installed to $pkgauxdir.\n\n# Set a version string for this script.\nscriptversion=2015-01-20.17; # UTC\n\n# General shell script boiler plate, and helper functions.\n# Written by Gary V. Vaughan, 2004\n\n# Copyright (C) 2004-2015 Free Software Foundation, Inc.\n# This is free software; see the source for copying conditions.  There is NO\n# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n\n# As a special exception to the GNU General Public License, if you distribute\n# this file as part of a program or library that is built using GNU Libtool,\n# you may include this file under the same distribution terms that you use\n# for the rest of that program.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU\n# General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see <http://www.gnu.org/licenses/>.\n\n# Please report bugs or propose patches to gary@gnu.org.\n\n\n## ------ ##\n## Usage. ##\n## ------ ##\n\n# Evaluate this file near the top of your script to gain access to\n# the functions and variables defined here:\n#\n#   . `echo \"$0\" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh\n#\n# If you need to override any of the default environment variable\n# settings, do that before evaluating this file.\n\n\n## -------------------- ##\n## Shell normalisation. ##\n## -------------------- ##\n\n# Some shells need a little help to be as Bourne compatible as possible.\n# Before doing anything else, make sure all that help has been provided!\n\nDUALCASE=1; export DUALCASE # for MKS sh\nif test -n \"${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on ${1+\"$@\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '${1+\"$@\"}'='\"$@\"'\n  setopt NO_GLOB_SUBST\nelse\n  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac\nfi\n\n# NLS nuisances: We save the old values in case they are required later.\n_G_user_locale=\n_G_safe_locale=\nfor _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES\ndo\n  eval \"if test set = \\\"\\${$_G_var+set}\\\"; then\n          save_$_G_var=\\$$_G_var\n          $_G_var=C\n\t  export $_G_var\n\t  _G_user_locale=\\\"$_G_var=\\\\\\$save_\\$_G_var; \\$_G_user_locale\\\"\n\t  _G_safe_locale=\\\"$_G_var=C; \\$_G_safe_locale\\\"\n\tfi\"\ndone\n\n# CDPATH.\n(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n\n# Make sure IFS has a sensible default\nsp=' '\nnl='\n'\nIFS=\"$sp\t$nl\"\n\n# There are apparently some retarded systems that use ';' as a PATH separator!\nif test \"${PATH_SEPARATOR+set}\" != set; then\n  PATH_SEPARATOR=:\n  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {\n    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||\n      PATH_SEPARATOR=';'\n  }\nfi\n\n\n\n## ------------------------- ##\n## Locate command utilities. ##\n## ------------------------- ##\n\n\n# func_executable_p FILE\n# ----------------------\n# Check that FILE is an executable regular file.\nfunc_executable_p ()\n{\n    test -f \"$1\" && test -x \"$1\"\n}\n\n\n# func_path_progs PROGS_LIST CHECK_FUNC [PATH]\n# --------------------------------------------\n# Search for either a program that responds to --version with output\n# containing \"GNU\", or else returned by CHECK_FUNC otherwise, by\n# trying all the directories in PATH with each of the elements of\n# PROGS_LIST.\n#\n# CHECK_FUNC should accept the path to a candidate program, and\n# set $func_check_prog_result if it truncates its output less than\n# $_G_path_prog_max characters.\nfunc_path_progs ()\n{\n    _G_progs_list=$1\n    _G_check_func=$2\n    _G_PATH=${3-\"$PATH\"}\n\n    _G_path_prog_max=0\n    _G_path_prog_found=false\n    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}\n    for _G_dir in $_G_PATH; do\n      IFS=$_G_save_IFS\n      test -z \"$_G_dir\" && _G_dir=.\n      for _G_prog_name in $_G_progs_list; do\n        for _exeext in '' .EXE; do\n          _G_path_prog=$_G_dir/$_G_prog_name$_exeext\n          func_executable_p \"$_G_path_prog\" || continue\n          case `\"$_G_path_prog\" --version 2>&1` in\n            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;\n            *)     $_G_check_func $_G_path_prog\n\t\t   func_path_progs_result=$func_check_prog_result\n\t\t   ;;\n          esac\n          $_G_path_prog_found && break 3\n        done\n      done\n    done\n    IFS=$_G_save_IFS\n    test -z \"$func_path_progs_result\" && {\n      echo \"no acceptable sed could be found in \\$PATH\" >&2\n      exit 1\n    }\n}\n\n\n# We want to be able to use the functions in this file before configure\n# has figured out where the best binaries are kept, which means we have\n# to search for them ourselves - except when the results are already set\n# where we skip the searches.\n\n# Unless the user overrides by setting SED, search the path for either GNU\n# sed, or the sed that truncates its output the least.\ntest -z \"$SED\" && {\n  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/\n  for _G_i in 1 2 3 4 5 6 7; do\n    _G_sed_script=$_G_sed_script$nl$_G_sed_script\n  done\n  echo \"$_G_sed_script\" 2>/dev/null | sed 99q >conftest.sed\n  _G_sed_script=\n\n  func_check_prog_sed ()\n  {\n    _G_path_prog=$1\n\n    _G_count=0\n    printf 0123456789 >conftest.in\n    while :\n    do\n      cat conftest.in conftest.in >conftest.tmp\n      mv conftest.tmp conftest.in\n      cp conftest.in conftest.nl\n      echo '' >> conftest.nl\n      \"$_G_path_prog\" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break\n      diff conftest.out conftest.nl >/dev/null 2>&1 || break\n      _G_count=`expr $_G_count + 1`\n      if test \"$_G_count\" -gt \"$_G_path_prog_max\"; then\n        # Best one so far, save it but keep looking for a better one\n        func_check_prog_result=$_G_path_prog\n        _G_path_prog_max=$_G_count\n      fi\n      # 10*(2^10) chars as input seems more than enough\n      test 10 -lt \"$_G_count\" && break\n    done\n    rm -f conftest.in conftest.tmp conftest.nl conftest.out\n  }\n\n  func_path_progs \"sed gsed\" func_check_prog_sed $PATH:/usr/xpg4/bin\n  rm -f conftest.sed\n  SED=$func_path_progs_result\n}\n\n\n# Unless the user overrides by setting GREP, search the path for either GNU\n# grep, or the grep that truncates its output the least.\ntest -z \"$GREP\" && {\n  func_check_prog_grep ()\n  {\n    _G_path_prog=$1\n\n    _G_count=0\n    _G_path_prog_max=0\n    printf 0123456789 >conftest.in\n    while :\n    do\n      cat conftest.in conftest.in >conftest.tmp\n      mv conftest.tmp conftest.in\n      cp conftest.in conftest.nl\n      echo 'GREP' >> conftest.nl\n      \"$_G_path_prog\" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break\n      diff conftest.out conftest.nl >/dev/null 2>&1 || break\n      _G_count=`expr $_G_count + 1`\n      if test \"$_G_count\" -gt \"$_G_path_prog_max\"; then\n        # Best one so far, save it but keep looking for a better one\n        func_check_prog_result=$_G_path_prog\n        _G_path_prog_max=$_G_count\n      fi\n      # 10*(2^10) chars as input seems more than enough\n      test 10 -lt \"$_G_count\" && break\n    done\n    rm -f conftest.in conftest.tmp conftest.nl conftest.out\n  }\n\n  func_path_progs \"grep ggrep\" func_check_prog_grep $PATH:/usr/xpg4/bin\n  GREP=$func_path_progs_result\n}\n\n\n## ------------------------------- ##\n## User overridable command paths. ##\n## ------------------------------- ##\n\n# All uppercase variable names are used for environment variables.  These\n# variables can be overridden by the user before calling a script that\n# uses them if a suitable command of that name is not already available\n# in the command search PATH.\n\n: ${CP=\"cp -f\"}\n: ${ECHO=\"printf %s\\n\"}\n: ${EGREP=\"$GREP -E\"}\n: ${FGREP=\"$GREP -F\"}\n: ${LN_S=\"ln -s\"}\n: ${MAKE=\"make\"}\n: ${MKDIR=\"mkdir\"}\n: ${MV=\"mv -f\"}\n: ${RM=\"rm -f\"}\n: ${SHELL=\"${CONFIG_SHELL-/bin/sh}\"}\n\n\n## -------------------- ##\n## Useful sed snippets. ##\n## -------------------- ##\n\nsed_dirname='s|/[^/]*$||'\nsed_basename='s|^.*/||'\n\n# Sed substitution that helps us do robust quoting.  It backslashifies\n# metacharacters that are still active within double-quoted strings.\nsed_quote_subst='s|\\([`\"$\\\\]\\)|\\\\\\1|g'\n\n# Same as above, but do not quote variable references.\nsed_double_quote_subst='s/\\([\"`\\\\]\\)/\\\\\\1/g'\n\n# Sed substitution that turns a string into a regex matching for the\n# string literally.\nsed_make_literal_regex='s|[].[^$\\\\*\\/]|\\\\&|g'\n\n# Sed substitution that converts a w32 file name or path\n# that contains forward slashes, into one that contains\n# (escaped) backslashes.  A very naive implementation.\nsed_naive_backslashify='s|\\\\\\\\*|\\\\|g;s|/|\\\\|g;s|\\\\|\\\\\\\\|g'\n\n# Re-'\\' parameter expansions in output of sed_double_quote_subst that\n# were '\\'-ed in input to the same.  If an odd number of '\\' preceded a\n# '$' in input to sed_double_quote_subst, that '$' was protected from\n# expansion.  Since each input '\\' is now two '\\'s, look for any number\n# of runs of four '\\'s followed by two '\\'s and then a '$'.  '\\' that '$'.\n_G_bs='\\\\'\n_G_bs2='\\\\\\\\'\n_G_bs4='\\\\\\\\\\\\\\\\'\n_G_dollar='\\$'\nsed_double_backslash=\"\\\n  s/$_G_bs4/&\\\\\n/g\n  s/^$_G_bs2$_G_dollar/$_G_bs&/\n  s/\\\\([^$_G_bs]\\\\)$_G_bs2$_G_dollar/\\\\1$_G_bs2$_G_bs$_G_dollar/g\n  s/\\n//g\"\n\n\n## ----------------- ##\n## Global variables. ##\n## ----------------- ##\n\n# Except for the global variables explicitly listed below, the following\n# functions in the '^func_' namespace, and the '^require_' namespace\n# variables initialised in the 'Resource management' section, sourcing\n# this file will not pollute your global namespace with anything\n# else. There's no portable way to scope variables in Bourne shell\n# though, so actually running these functions will sometimes place\n# results into a variable named after the function, and often use\n# temporary variables in the '^_G_' namespace. If you are careful to\n# avoid using those namespaces casually in your sourcing script, things\n# should continue to work as you expect. And, of course, you can freely\n# overwrite any of the functions or variables defined here before\n# calling anything to customize them.\n\nEXIT_SUCCESS=0\nEXIT_FAILURE=1\nEXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.\nEXIT_SKIP=77\t  # $? = 77 is used to indicate a skipped test to automake.\n\n# Allow overriding, eg assuming that you follow the convention of\n# putting '$debug_cmd' at the start of all your functions, you can get\n# bash to show function call trace with:\n#\n#    debug_cmd='eval echo \"${FUNCNAME[0]} $*\" >&2' bash your-script-name\ndebug_cmd=${debug_cmd-\":\"}\nexit_cmd=:\n\n# By convention, finish your script with:\n#\n#    exit $exit_status\n#\n# so that you can set exit_status to non-zero if you want to indicate\n# something went wrong during execution without actually bailing out at\n# the point of failure.\nexit_status=$EXIT_SUCCESS\n\n# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh\n# is ksh but when the shell is invoked as \"sh\" and the current value of\n# the _XPG environment variable is not equal to 1 (one), the special\n# positional parameter $0, within a function call, is the name of the\n# function.\nprogpath=$0\n\n# The name of this program.\nprogname=`$ECHO \"$progpath\" |$SED \"$sed_basename\"`\n\n# Make sure we have an absolute progpath for reexecution:\ncase $progpath in\n  [\\\\/]*|[A-Za-z]:\\\\*) ;;\n  *[\\\\/]*)\n     progdir=`$ECHO \"$progpath\" |$SED \"$sed_dirname\"`\n     progdir=`cd \"$progdir\" && pwd`\n     progpath=$progdir/$progname\n     ;;\n  *)\n     _G_IFS=$IFS\n     IFS=${PATH_SEPARATOR-:}\n     for progdir in $PATH; do\n       IFS=$_G_IFS\n       test -x \"$progdir/$progname\" && break\n     done\n     IFS=$_G_IFS\n     test -n \"$progdir\" || progdir=`pwd`\n     progpath=$progdir/$progname\n     ;;\nesac\n\n\n## ----------------- ##\n## Standard options. ##\n## ----------------- ##\n\n# The following options affect the operation of the functions defined\n# below, and should be set appropriately depending on run-time para-\n# meters passed on the command line.\n\nopt_dry_run=false\nopt_quiet=false\nopt_verbose=false\n\n# Categories 'all' and 'none' are always available.  Append any others\n# you will pass as the first argument to func_warning from your own\n# code.\nwarning_categories=\n\n# By default, display warnings according to 'opt_warning_types'.  Set\n# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to\n# treat the next displayed warning as a fatal error.\nwarning_func=func_warn_and_continue\n\n# Set to 'all' to display all warnings, 'none' to suppress all\n# warnings, or a space delimited list of some subset of\n# 'warning_categories' to display only the listed warnings.\nopt_warning_types=all\n\n\n## -------------------- ##\n## Resource management. ##\n## -------------------- ##\n\n# This section contains definitions for functions that each ensure a\n# particular resource (a file, or a non-empty configuration variable for\n# example) is available, and if appropriate to extract default values\n# from pertinent package files. Call them using their associated\n# 'require_*' variable to ensure that they are executed, at most, once.\n#\n# It's entirely deliberate that calling these functions can set\n# variables that don't obey the namespace limitations obeyed by the rest\n# of this file, in order that that they be as useful as possible to\n# callers.\n\n\n# require_term_colors\n# -------------------\n# Allow display of bold text on terminals that support it.\nrequire_term_colors=func_require_term_colors\nfunc_require_term_colors ()\n{\n    $debug_cmd\n\n    test -t 1 && {\n      # COLORTERM and USE_ANSI_COLORS environment variables take\n      # precedence, because most terminfo databases neglect to describe\n      # whether color sequences are supported.\n      test -n \"${COLORTERM+set}\" && : ${USE_ANSI_COLORS=\"1\"}\n\n      if test 1 = \"$USE_ANSI_COLORS\"; then\n        # Standard ANSI escape sequences\n        tc_reset='\u001b[0m'\n        tc_bold='\u001b[1m';   tc_standout='\u001b[7m'\n        tc_red='\u001b[31m';   tc_green='\u001b[32m'\n        tc_blue='\u001b[34m';  tc_cyan='\u001b[36m'\n      else\n        # Otherwise trust the terminfo database after all.\n        test -n \"`tput sgr0 2>/dev/null`\" && {\n          tc_reset=`tput sgr0`\n          test -n \"`tput bold 2>/dev/null`\" && tc_bold=`tput bold`\n          tc_standout=$tc_bold\n          test -n \"`tput smso 2>/dev/null`\" && tc_standout=`tput smso`\n          test -n \"`tput setaf 1 2>/dev/null`\" && tc_red=`tput setaf 1`\n          test -n \"`tput setaf 2 2>/dev/null`\" && tc_green=`tput setaf 2`\n          test -n \"`tput setaf 4 2>/dev/null`\" && tc_blue=`tput setaf 4`\n          test -n \"`tput setaf 5 2>/dev/null`\" && tc_cyan=`tput setaf 5`\n        }\n      fi\n    }\n\n    require_term_colors=:\n}\n\n\n## ----------------- ##\n## Function library. ##\n## ----------------- ##\n\n# This section contains a variety of useful functions to call in your\n# scripts. Take note of the portable wrappers for features provided by\n# some modern shells, which will fall back to slower equivalents on\n# less featureful shells.\n\n\n# func_append VAR VALUE\n# ---------------------\n# Append VALUE onto the existing contents of VAR.\n\n  # We should try to minimise forks, especially on Windows where they are\n  # unreasonably slow, so skip the feature probes when bash or zsh are\n  # being used:\n  if test set = \"${BASH_VERSION+set}${ZSH_VERSION+set}\"; then\n    : ${_G_HAVE_ARITH_OP=\"yes\"}\n    : ${_G_HAVE_XSI_OPS=\"yes\"}\n    # The += operator was introduced in bash 3.1\n    case $BASH_VERSION in\n      [12].* | 3.0 | 3.0*) ;;\n      *)\n        : ${_G_HAVE_PLUSEQ_OP=\"yes\"}\n        ;;\n    esac\n  fi\n\n  # _G_HAVE_PLUSEQ_OP\n  # Can be empty, in which case the shell is probed, \"yes\" if += is\n  # useable or anything else if it does not work.\n  test -z \"$_G_HAVE_PLUSEQ_OP\" \\\n    && (eval 'x=a; x+=\" b\"; test \"a b\" = \"$x\"') 2>/dev/null \\\n    && _G_HAVE_PLUSEQ_OP=yes\n\nif test yes = \"$_G_HAVE_PLUSEQ_OP\"\nthen\n  # This is an XSI compatible shell, allowing a faster implementation...\n  eval 'func_append ()\n  {\n    $debug_cmd\n\n    eval \"$1+=\\$2\"\n  }'\nelse\n  # ...otherwise fall back to using expr, which is often a shell builtin.\n  func_append ()\n  {\n    $debug_cmd\n\n    eval \"$1=\\$$1\\$2\"\n  }\nfi\n\n\n# func_append_quoted VAR VALUE\n# ----------------------------\n# Quote VALUE and append to the end of shell variable VAR, separated\n# by a space.\nif test yes = \"$_G_HAVE_PLUSEQ_OP\"; then\n  eval 'func_append_quoted ()\n  {\n    $debug_cmd\n\n    func_quote_for_eval \"$2\"\n    eval \"$1+=\\\\ \\$func_quote_for_eval_result\"\n  }'\nelse\n  func_append_quoted ()\n  {\n    $debug_cmd\n\n    func_quote_for_eval \"$2\"\n    eval \"$1=\\$$1\\\\ \\$func_quote_for_eval_result\"\n  }\nfi\n\n\n# func_append_uniq VAR VALUE\n# --------------------------\n# Append unique VALUE onto the existing contents of VAR, assuming\n# entries are delimited by the first character of VALUE.  For example:\n#\n#   func_append_uniq options \" --another-option option-argument\"\n#\n# will only append to $options if \" --another-option option-argument \"\n# is not already present somewhere in $options already (note spaces at\n# each end implied by leading space in second argument).\nfunc_append_uniq ()\n{\n    $debug_cmd\n\n    eval _G_current_value='`$ECHO $'$1'`'\n    _G_delim=`expr \"$2\" : '\\(.\\)'`\n\n    case $_G_delim$_G_current_value$_G_delim in\n      *\"$2$_G_delim\"*) ;;\n      *) func_append \"$@\" ;;\n    esac\n}\n\n\n# func_arith TERM...\n# ------------------\n# Set func_arith_result to the result of evaluating TERMs.\n  test -z \"$_G_HAVE_ARITH_OP\" \\\n    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \\\n    && _G_HAVE_ARITH_OP=yes\n\nif test yes = \"$_G_HAVE_ARITH_OP\"; then\n  eval 'func_arith ()\n  {\n    $debug_cmd\n\n    func_arith_result=$(( $* ))\n  }'\nelse\n  func_arith ()\n  {\n    $debug_cmd\n\n    func_arith_result=`expr \"$@\"`\n  }\nfi\n\n\n# func_basename FILE\n# ------------------\n# Set func_basename_result to FILE with everything up to and including\n# the last / stripped.\nif test yes = \"$_G_HAVE_XSI_OPS\"; then\n  # If this shell supports suffix pattern removal, then use it to avoid\n  # forking. Hide the definitions single quotes in case the shell chokes\n  # on unsupported syntax...\n  _b='func_basename_result=${1##*/}'\n  _d='case $1 in\n        */*) func_dirname_result=${1%/*}$2 ;;\n        *  ) func_dirname_result=$3        ;;\n      esac'\n\nelse\n  # ...otherwise fall back to using sed.\n  _b='func_basename_result=`$ECHO \"$1\" |$SED \"$sed_basename\"`'\n  _d='func_dirname_result=`$ECHO \"$1\"  |$SED \"$sed_dirname\"`\n      if test \"X$func_dirname_result\" = \"X$1\"; then\n        func_dirname_result=$3\n      else\n        func_append func_dirname_result \"$2\"\n      fi'\nfi\n\neval 'func_basename ()\n{\n    $debug_cmd\n\n    '\"$_b\"'\n}'\n\n\n# func_dirname FILE APPEND NONDIR_REPLACEMENT\n# -------------------------------------------\n# Compute the dirname of FILE.  If nonempty, add APPEND to the result,\n# otherwise set result to NONDIR_REPLACEMENT.\neval 'func_dirname ()\n{\n    $debug_cmd\n\n    '\"$_d\"'\n}'\n\n\n# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT\n# --------------------------------------------------------\n# Perform func_basename and func_dirname in a single function\n# call:\n#   dirname:  Compute the dirname of FILE.  If nonempty,\n#             add APPEND to the result, otherwise set result\n#             to NONDIR_REPLACEMENT.\n#             value returned in \"$func_dirname_result\"\n#   basename: Compute filename of FILE.\n#             value retuned in \"$func_basename_result\"\n# For efficiency, we do not delegate to the functions above but instead\n# duplicate the functionality here.\neval 'func_dirname_and_basename ()\n{\n    $debug_cmd\n\n    '\"$_b\"'\n    '\"$_d\"'\n}'\n\n\n# func_echo ARG...\n# ----------------\n# Echo program name prefixed message.\nfunc_echo ()\n{\n    $debug_cmd\n\n    _G_message=$*\n\n    func_echo_IFS=$IFS\n    IFS=$nl\n    for _G_line in $_G_message; do\n      IFS=$func_echo_IFS\n      $ECHO \"$progname: $_G_line\"\n    done\n    IFS=$func_echo_IFS\n}\n\n\n# func_echo_all ARG...\n# --------------------\n# Invoke $ECHO with all args, space-separated.\nfunc_echo_all ()\n{\n    $ECHO \"$*\"\n}\n\n\n# func_echo_infix_1 INFIX ARG...\n# ------------------------------\n# Echo program name, followed by INFIX on the first line, with any\n# additional lines not showing INFIX.\nfunc_echo_infix_1 ()\n{\n    $debug_cmd\n\n    $require_term_colors\n\n    _G_infix=$1; shift\n    _G_indent=$_G_infix\n    _G_prefix=\"$progname: $_G_infix: \"\n    _G_message=$*\n\n    # Strip color escape sequences before counting printable length\n    for _G_tc in \"$tc_reset\" \"$tc_bold\" \"$tc_standout\" \"$tc_red\" \"$tc_green\" \"$tc_blue\" \"$tc_cyan\"\n    do\n      test -n \"$_G_tc\" && {\n        _G_esc_tc=`$ECHO \"$_G_tc\" | $SED \"$sed_make_literal_regex\"`\n        _G_indent=`$ECHO \"$_G_indent\" | $SED \"s|$_G_esc_tc||g\"`\n      }\n    done\n    _G_indent=\"$progname: \"`echo \"$_G_indent\" | $SED 's|.| |g'`\"  \" ## exclude from sc_prohibit_nested_quotes\n\n    func_echo_infix_1_IFS=$IFS\n    IFS=$nl\n    for _G_line in $_G_message; do\n      IFS=$func_echo_infix_1_IFS\n      $ECHO \"$_G_prefix$tc_bold$_G_line$tc_reset\" >&2\n      _G_prefix=$_G_indent\n    done\n    IFS=$func_echo_infix_1_IFS\n}\n\n\n# func_error ARG...\n# -----------------\n# Echo program name prefixed message to standard error.\nfunc_error ()\n{\n    $debug_cmd\n\n    $require_term_colors\n\n    func_echo_infix_1 \"  $tc_standout${tc_red}error$tc_reset\" \"$*\" >&2\n}\n\n\n# func_fatal_error ARG...\n# -----------------------\n# Echo program name prefixed message to standard error, and exit.\nfunc_fatal_error ()\n{\n    $debug_cmd\n\n    func_error \"$*\"\n    exit $EXIT_FAILURE\n}\n\n\n# func_grep EXPRESSION FILENAME\n# -----------------------------\n# Check whether EXPRESSION matches any line of FILENAME, without output.\nfunc_grep ()\n{\n    $debug_cmd\n\n    $GREP \"$1\" \"$2\" >/dev/null 2>&1\n}\n\n\n# func_len STRING\n# ---------------\n# Set func_len_result to the length of STRING. STRING may not\n# start with a hyphen.\n  test -z \"$_G_HAVE_XSI_OPS\" \\\n    && (eval 'x=a/b/c;\n      test 5aa/bb/cc = \"${#x}${x%%/*}${x%/*}${x#*/}${x##*/}\"') 2>/dev/null \\\n    && _G_HAVE_XSI_OPS=yes\n\nif test yes = \"$_G_HAVE_XSI_OPS\"; then\n  eval 'func_len ()\n  {\n    $debug_cmd\n\n    func_len_result=${#1}\n  }'\nelse\n  func_len ()\n  {\n    $debug_cmd\n\n    func_len_result=`expr \"$1\" : \".*\" 2>/dev/null || echo $max_cmd_len`\n  }\nfi\n\n\n# func_mkdir_p DIRECTORY-PATH\n# ---------------------------\n# Make sure the entire path to DIRECTORY-PATH is available.\nfunc_mkdir_p ()\n{\n    $debug_cmd\n\n    _G_directory_path=$1\n    _G_dir_list=\n\n    if test -n \"$_G_directory_path\" && test : != \"$opt_dry_run\"; then\n\n      # Protect directory names starting with '-'\n      case $_G_directory_path in\n        -*) _G_directory_path=./$_G_directory_path ;;\n      esac\n\n      # While some portion of DIR does not yet exist...\n      while test ! -d \"$_G_directory_path\"; do\n        # ...make a list in topmost first order.  Use a colon delimited\n\t# list incase some portion of path contains whitespace.\n        _G_dir_list=$_G_directory_path:$_G_dir_list\n\n        # If the last portion added has no slash in it, the list is done\n        case $_G_directory_path in */*) ;; *) break ;; esac\n\n        # ...otherwise throw away the child directory and loop\n        _G_directory_path=`$ECHO \"$_G_directory_path\" | $SED -e \"$sed_dirname\"`\n      done\n      _G_dir_list=`$ECHO \"$_G_dir_list\" | $SED 's|:*$||'`\n\n      func_mkdir_p_IFS=$IFS; IFS=:\n      for _G_dir in $_G_dir_list; do\n\tIFS=$func_mkdir_p_IFS\n        # mkdir can fail with a 'File exist' error if two processes\n        # try to create one of the directories concurrently.  Don't\n        # stop in that case!\n        $MKDIR \"$_G_dir\" 2>/dev/null || :\n      done\n      IFS=$func_mkdir_p_IFS\n\n      # Bail out if we (or some other process) failed to create a directory.\n      test -d \"$_G_directory_path\" || \\\n        func_fatal_error \"Failed to create '$1'\"\n    fi\n}\n\n\n# func_mktempdir [BASENAME]\n# -------------------------\n# Make a temporary directory that won't clash with other running\n# libtool processes, and avoids race conditions if possible.  If\n# given, BASENAME is the basename for that directory.\nfunc_mktempdir ()\n{\n    $debug_cmd\n\n    _G_template=${TMPDIR-/tmp}/${1-$progname}\n\n    if test : = \"$opt_dry_run\"; then\n      # Return a directory name, but don't create it in dry-run mode\n      _G_tmpdir=$_G_template-$$\n    else\n\n      # If mktemp works, use that first and foremost\n      _G_tmpdir=`mktemp -d \"$_G_template-XXXXXXXX\" 2>/dev/null`\n\n      if test ! -d \"$_G_tmpdir\"; then\n        # Failing that, at least try and use $RANDOM to avoid a race\n        _G_tmpdir=$_G_template-${RANDOM-0}$$\n\n        func_mktempdir_umask=`umask`\n        umask 0077\n        $MKDIR \"$_G_tmpdir\"\n        umask $func_mktempdir_umask\n      fi\n\n      # If we're not in dry-run mode, bomb out on failure\n      test -d \"$_G_tmpdir\" || \\\n        func_fatal_error \"cannot create temporary directory '$_G_tmpdir'\"\n    fi\n\n    $ECHO \"$_G_tmpdir\"\n}\n\n\n# func_normal_abspath PATH\n# ------------------------\n# Remove doubled-up and trailing slashes, \".\" path components,\n# and cancel out any \"..\" path components in PATH after making\n# it an absolute path.\nfunc_normal_abspath ()\n{\n    $debug_cmd\n\n    # These SED scripts presuppose an absolute path with a trailing slash.\n    _G_pathcar='s|^/\\([^/]*\\).*$|\\1|'\n    _G_pathcdr='s|^/[^/]*||'\n    _G_removedotparts=':dotsl\n\t\ts|/\\./|/|g\n\t\tt dotsl\n\t\ts|/\\.$|/|'\n    _G_collapseslashes='s|/\\{1,\\}|/|g'\n    _G_finalslash='s|/*$|/|'\n\n    # Start from root dir and reassemble the path.\n    func_normal_abspath_result=\n    func_normal_abspath_tpath=$1\n    func_normal_abspath_altnamespace=\n    case $func_normal_abspath_tpath in\n      \"\")\n        # Empty path, that just means $cwd.\n        func_stripname '' '/' \"`pwd`\"\n        func_normal_abspath_result=$func_stripname_result\n        return\n        ;;\n      # The next three entries are used to spot a run of precisely\n      # two leading slashes without using negated character classes;\n      # we take advantage of case's first-match behaviour.\n      ///*)\n        # Unusual form of absolute path, do nothing.\n        ;;\n      //*)\n        # Not necessarily an ordinary path; POSIX reserves leading '//'\n        # and for example Cygwin uses it to access remote file shares\n        # over CIFS/SMB, so we conserve a leading double slash if found.\n        func_normal_abspath_altnamespace=/\n        ;;\n      /*)\n        # Absolute path, do nothing.\n        ;;\n      *)\n        # Relative path, prepend $cwd.\n        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath\n        ;;\n    esac\n\n    # Cancel out all the simple stuff to save iterations.  We also want\n    # the path to end with a slash for ease of parsing, so make sure\n    # there is one (and only one) here.\n    func_normal_abspath_tpath=`$ECHO \"$func_normal_abspath_tpath\" | $SED \\\n          -e \"$_G_removedotparts\" -e \"$_G_collapseslashes\" -e \"$_G_finalslash\"`\n    while :; do\n      # Processed it all yet?\n      if test / = \"$func_normal_abspath_tpath\"; then\n        # If we ascended to the root using \"..\" the result may be empty now.\n        if test -z \"$func_normal_abspath_result\"; then\n          func_normal_abspath_result=/\n        fi\n        break\n      fi\n      func_normal_abspath_tcomponent=`$ECHO \"$func_normal_abspath_tpath\" | $SED \\\n          -e \"$_G_pathcar\"`\n      func_normal_abspath_tpath=`$ECHO \"$func_normal_abspath_tpath\" | $SED \\\n          -e \"$_G_pathcdr\"`\n      # Figure out what to do with it\n      case $func_normal_abspath_tcomponent in\n        \"\")\n          # Trailing empty path component, ignore it.\n          ;;\n        ..)\n          # Parent dir; strip last assembled component from result.\n          func_dirname \"$func_normal_abspath_result\"\n          func_normal_abspath_result=$func_dirname_result\n          ;;\n        *)\n          # Actual path component, append it.\n          func_append func_normal_abspath_result \"/$func_normal_abspath_tcomponent\"\n          ;;\n      esac\n    done\n    # Restore leading double-slash if one was found on entry.\n    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result\n}\n\n\n# func_notquiet ARG...\n# --------------------\n# Echo program name prefixed message only when not in quiet mode.\nfunc_notquiet ()\n{\n    $debug_cmd\n\n    $opt_quiet || func_echo ${1+\"$@\"}\n\n    # A bug in bash halts the script if the last line of a function\n    # fails when set -e is in force, so we need another command to\n    # work around that:\n    :\n}\n\n\n# func_relative_path SRCDIR DSTDIR\n# --------------------------------\n# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.\nfunc_relative_path ()\n{\n    $debug_cmd\n\n    func_relative_path_result=\n    func_normal_abspath \"$1\"\n    func_relative_path_tlibdir=$func_normal_abspath_result\n    func_normal_abspath \"$2\"\n    func_relative_path_tbindir=$func_normal_abspath_result\n\n    # Ascend the tree starting from libdir\n    while :; do\n      # check if we have found a prefix of bindir\n      case $func_relative_path_tbindir in\n        $func_relative_path_tlibdir)\n          # found an exact match\n          func_relative_path_tcancelled=\n          break\n          ;;\n        $func_relative_path_tlibdir*)\n          # found a matching prefix\n          func_stripname \"$func_relative_path_tlibdir\" '' \"$func_relative_path_tbindir\"\n          func_relative_path_tcancelled=$func_stripname_result\n          if test -z \"$func_relative_path_result\"; then\n            func_relative_path_result=.\n          fi\n          break\n          ;;\n        *)\n          func_dirname $func_relative_path_tlibdir\n          func_relative_path_tlibdir=$func_dirname_result\n          if test -z \"$func_relative_path_tlibdir\"; then\n            # Have to descend all the way to the root!\n            func_relative_path_result=../$func_relative_path_result\n            func_relative_path_tcancelled=$func_relative_path_tbindir\n            break\n          fi\n          func_relative_path_result=../$func_relative_path_result\n          ;;\n      esac\n    done\n\n    # Now calculate path; take care to avoid doubling-up slashes.\n    func_stripname '' '/' \"$func_relative_path_result\"\n    func_relative_path_result=$func_stripname_result\n    func_stripname '/' '/' \"$func_relative_path_tcancelled\"\n    if test -n \"$func_stripname_result\"; then\n      func_append func_relative_path_result \"/$func_stripname_result\"\n    fi\n\n    # Normalisation. If bindir is libdir, return '.' else relative path.\n    if test -n \"$func_relative_path_result\"; then\n      func_stripname './' '' \"$func_relative_path_result\"\n      func_relative_path_result=$func_stripname_result\n    fi\n\n    test -n \"$func_relative_path_result\" || func_relative_path_result=.\n\n    :\n}\n\n\n# func_quote_for_eval ARG...\n# --------------------------\n# Aesthetically quote ARGs to be evaled later.\n# This function returns two values:\n#   i) func_quote_for_eval_result\n#      double-quoted, suitable for a subsequent eval\n#  ii) func_quote_for_eval_unquoted_result\n#      has all characters that are still active within double\n#      quotes backslashified.\nfunc_quote_for_eval ()\n{\n    $debug_cmd\n\n    func_quote_for_eval_unquoted_result=\n    func_quote_for_eval_result=\n    while test 0 -lt $#; do\n      case $1 in\n        *[\\\\\\`\\\"\\$]*)\n\t  _G_unquoted_arg=`printf '%s\\n' \"$1\" |$SED \"$sed_quote_subst\"` ;;\n        *)\n          _G_unquoted_arg=$1 ;;\n      esac\n      if test -n \"$func_quote_for_eval_unquoted_result\"; then\n\tfunc_append func_quote_for_eval_unquoted_result \" $_G_unquoted_arg\"\n      else\n        func_append func_quote_for_eval_unquoted_result \"$_G_unquoted_arg\"\n      fi\n\n      case $_G_unquoted_arg in\n        # Double-quote args containing shell metacharacters to delay\n        # word splitting, command substitution and variable expansion\n        # for a subsequent eval.\n        # Many Bourne shells cannot handle close brackets correctly\n        # in scan sets, so we specify it separately.\n        *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n          _G_quoted_arg=\\\"$_G_unquoted_arg\\\"\n          ;;\n        *)\n          _G_quoted_arg=$_G_unquoted_arg\n\t  ;;\n      esac\n\n      if test -n \"$func_quote_for_eval_result\"; then\n\tfunc_append func_quote_for_eval_result \" $_G_quoted_arg\"\n      else\n        func_append func_quote_for_eval_result \"$_G_quoted_arg\"\n      fi\n      shift\n    done\n}\n\n\n# func_quote_for_expand ARG\n# -------------------------\n# Aesthetically quote ARG to be evaled later; same as above,\n# but do not quote variable references.\nfunc_quote_for_expand ()\n{\n    $debug_cmd\n\n    case $1 in\n      *[\\\\\\`\\\"]*)\n\t_G_arg=`$ECHO \"$1\" | $SED \\\n\t    -e \"$sed_double_quote_subst\" -e \"$sed_double_backslash\"` ;;\n      *)\n        _G_arg=$1 ;;\n    esac\n\n    case $_G_arg in\n      # Double-quote args containing shell metacharacters to delay\n      # word splitting and command substitution for a subsequent eval.\n      # Many Bourne shells cannot handle close brackets correctly\n      # in scan sets, so we specify it separately.\n      *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n        _G_arg=\\\"$_G_arg\\\"\n        ;;\n    esac\n\n    func_quote_for_expand_result=$_G_arg\n}\n\n\n# func_stripname PREFIX SUFFIX NAME\n# ---------------------------------\n# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.\n# PREFIX and SUFFIX must not contain globbing or regex special\n# characters, hashes, percent signs, but SUFFIX may contain a leading\n# dot (in which case that matches only a dot).\nif test yes = \"$_G_HAVE_XSI_OPS\"; then\n  eval 'func_stripname ()\n  {\n    $debug_cmd\n\n    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\n    # positional parameters, so assign one to ordinary variable first.\n    func_stripname_result=$3\n    func_stripname_result=${func_stripname_result#\"$1\"}\n    func_stripname_result=${func_stripname_result%\"$2\"}\n  }'\nelse\n  func_stripname ()\n  {\n    $debug_cmd\n\n    case $2 in\n      .*) func_stripname_result=`$ECHO \"$3\" | $SED -e \"s%^$1%%\" -e \"s%\\\\\\\\$2\\$%%\"`;;\n      *)  func_stripname_result=`$ECHO \"$3\" | $SED -e \"s%^$1%%\" -e \"s%$2\\$%%\"`;;\n    esac\n  }\nfi\n\n\n# func_show_eval CMD [FAIL_EXP]\n# -----------------------------\n# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is\n# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP\n# is given, then evaluate it.\nfunc_show_eval ()\n{\n    $debug_cmd\n\n    _G_cmd=$1\n    _G_fail_exp=${2-':'}\n\n    func_quote_for_expand \"$_G_cmd\"\n    eval \"func_notquiet $func_quote_for_expand_result\"\n\n    $opt_dry_run || {\n      eval \"$_G_cmd\"\n      _G_status=$?\n      if test 0 -ne \"$_G_status\"; then\n\teval \"(exit $_G_status); $_G_fail_exp\"\n      fi\n    }\n}\n\n\n# func_show_eval_locale CMD [FAIL_EXP]\n# ------------------------------------\n# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is\n# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP\n# is given, then evaluate it.  Use the saved locale for evaluation.\nfunc_show_eval_locale ()\n{\n    $debug_cmd\n\n    _G_cmd=$1\n    _G_fail_exp=${2-':'}\n\n    $opt_quiet || {\n      func_quote_for_expand \"$_G_cmd\"\n      eval \"func_echo $func_quote_for_expand_result\"\n    }\n\n    $opt_dry_run || {\n      eval \"$_G_user_locale\n\t    $_G_cmd\"\n      _G_status=$?\n      eval \"$_G_safe_locale\"\n      if test 0 -ne \"$_G_status\"; then\n\teval \"(exit $_G_status); $_G_fail_exp\"\n      fi\n    }\n}\n\n\n# func_tr_sh\n# ----------\n# Turn $1 into a string suitable for a shell variable name.\n# Result is stored in $func_tr_sh_result.  All characters\n# not in the set a-zA-Z0-9_ are replaced with '_'. Further,\n# if $1 begins with a digit, a '_' is prepended as well.\nfunc_tr_sh ()\n{\n    $debug_cmd\n\n    case $1 in\n    [0-9]* | *[!a-zA-Z0-9_]*)\n      func_tr_sh_result=`$ECHO \"$1\" | $SED -e 's/^\\([0-9]\\)/_\\1/' -e 's/[^a-zA-Z0-9_]/_/g'`\n      ;;\n    * )\n      func_tr_sh_result=$1\n      ;;\n    esac\n}\n\n\n# func_verbose ARG...\n# -------------------\n# Echo program name prefixed message in verbose mode only.\nfunc_verbose ()\n{\n    $debug_cmd\n\n    $opt_verbose && func_echo \"$*\"\n\n    :\n}\n\n\n# func_warn_and_continue ARG...\n# -----------------------------\n# Echo program name prefixed warning message to standard error.\nfunc_warn_and_continue ()\n{\n    $debug_cmd\n\n    $require_term_colors\n\n    func_echo_infix_1 \"${tc_red}warning$tc_reset\" \"$*\" >&2\n}\n\n\n# func_warning CATEGORY ARG...\n# ----------------------------\n# Echo program name prefixed warning message to standard error. Warning\n# messages can be filtered according to CATEGORY, where this function\n# elides messages where CATEGORY is not listed in the global variable\n# 'opt_warning_types'.\nfunc_warning ()\n{\n    $debug_cmd\n\n    # CATEGORY must be in the warning_categories list!\n    case \" $warning_categories \" in\n      *\" $1 \"*) ;;\n      *) func_internal_error \"invalid warning category '$1'\" ;;\n    esac\n\n    _G_category=$1\n    shift\n\n    case \" $opt_warning_types \" in\n      *\" $_G_category \"*) $warning_func ${1+\"$@\"} ;;\n    esac\n}\n\n\n# func_sort_ver VER1 VER2\n# -----------------------\n# 'sort -V' is not generally available.\n# Note this deviates from the version comparison in automake\n# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a\n# but this should suffice as we won't be specifying old\n# version formats or redundant trailing .0 in bootstrap.conf.\n# If we did want full compatibility then we should probably\n# use m4_version_compare from autoconf.\nfunc_sort_ver ()\n{\n    $debug_cmd\n\n    printf '%s\\n%s\\n' \"$1\" \"$2\" \\\n      | 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\n}\n\n# func_lt_ver PREV CURR\n# ---------------------\n# Return true if PREV and CURR are in the correct order according to\n# func_sort_ver, otherwise false.  Use it like this:\n#\n#  func_lt_ver \"$prev_ver\" \"$proposed_ver\" || func_fatal_error \"...\"\nfunc_lt_ver ()\n{\n    $debug_cmd\n\n    test \"x$1\" = x`func_sort_ver \"$1\" \"$2\" | $SED 1q`\n}\n\n\n# Local variables:\n# mode: shell-script\n# sh-indentation: 2\n# eval: (add-hook 'before-save-hook 'time-stamp)\n# time-stamp-pattern: \"10/scriptversion=%:y-%02m-%02d.%02H; # UTC\"\n# time-stamp-time-zone: \"UTC\"\n# End:\n#! /bin/sh\n\n# Set a version string for this script.\nscriptversion=2014-01-07.03; # UTC\n\n# A portable, pluggable option parser for Bourne shell.\n# Written by Gary V. Vaughan, 2010\n\n# Copyright (C) 2010-2015 Free Software Foundation, Inc.\n# This is free software; see the source for copying conditions.  There is NO\n# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n# Please report bugs or propose patches to gary@gnu.org.\n\n\n## ------ ##\n## Usage. ##\n## ------ ##\n\n# This file is a library for parsing options in your shell scripts along\n# with assorted other useful supporting features that you can make use\n# of too.\n#\n# For the simplest scripts you might need only:\n#\n#   #!/bin/sh\n#   . relative/path/to/funclib.sh\n#   . relative/path/to/options-parser\n#   scriptversion=1.0\n#   func_options ${1+\"$@\"}\n#   eval set dummy \"$func_options_result\"; shift\n#   ...rest of your script...\n#\n# In order for the '--version' option to work, you will need to have a\n# suitably formatted comment like the one at the top of this file\n# starting with '# Written by ' and ending with '# warranty; '.\n#\n# For '-h' and '--help' to work, you will also need a one line\n# description of your script's purpose in a comment directly above the\n# '# Written by ' line, like the one at the top of this file.\n#\n# The default options also support '--debug', which will turn on shell\n# execution tracing (see the comment above debug_cmd below for another\n# use), and '--verbose' and the func_verbose function to allow your script\n# to display verbose messages only when your user has specified\n# '--verbose'.\n#\n# After sourcing this file, you can plug processing for additional\n# options by amending the variables from the 'Configuration' section\n# below, and following the instructions in the 'Option parsing'\n# section further down.\n\n## -------------- ##\n## Configuration. ##\n## -------------- ##\n\n# You should override these variables in your script after sourcing this\n# file so that they reflect the customisations you have added to the\n# option parser.\n\n# The usage line for option parsing errors and the start of '-h' and\n# '--help' output messages. You can embed shell variables for delayed\n# expansion at the time the message is displayed, but you will need to\n# quote other shell meta-characters carefully to prevent them being\n# expanded when the contents are evaled.\nusage='$progpath [OPTION]...'\n\n# Short help message in response to '-h' and '--help'.  Add to this or\n# override it after sourcing this library to reflect the full set of\n# options your script accepts.\nusage_message=\"\\\n       --debug        enable verbose shell tracing\n   -W, --warnings=CATEGORY\n                      report the warnings falling in CATEGORY [all]\n   -v, --verbose      verbosely report processing\n       --version      print version information and exit\n   -h, --help         print short or long help message and exit\n\"\n\n# Additional text appended to 'usage_message' in response to '--help'.\nlong_help_message=\"\nWarning categories include:\n       'all'          show all warnings\n       'none'         turn off all the warnings\n       'error'        warnings are treated as fatal errors\"\n\n# Help message printed before fatal option parsing errors.\nfatal_help=\"Try '\\$progname --help' for more information.\"\n\n\n\n## ------------------------- ##\n## Hook function management. ##\n## ------------------------- ##\n\n# This section contains functions for adding, removing, and running hooks\n# to the main code.  A hook is just a named list of of function, that can\n# be run in order later on.\n\n# func_hookable FUNC_NAME\n# -----------------------\n# Declare that FUNC_NAME will run hooks added with\n# 'func_add_hook FUNC_NAME ...'.\nfunc_hookable ()\n{\n    $debug_cmd\n\n    func_append hookable_fns \" $1\"\n}\n\n\n# func_add_hook FUNC_NAME HOOK_FUNC\n# ---------------------------------\n# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must\n# first have been declared \"hookable\" by a call to 'func_hookable'.\nfunc_add_hook ()\n{\n    $debug_cmd\n\n    case \" $hookable_fns \" in\n      *\" $1 \"*) ;;\n      *) func_fatal_error \"'$1' does not accept hook functions.\" ;;\n    esac\n\n    eval func_append ${1}_hooks '\" $2\"'\n}\n\n\n# func_remove_hook FUNC_NAME HOOK_FUNC\n# ------------------------------------\n# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.\nfunc_remove_hook ()\n{\n    $debug_cmd\n\n    eval ${1}_hooks='`$ECHO \"\\$'$1'_hooks\" |$SED \"s| '$2'||\"`'\n}\n\n\n# func_run_hooks FUNC_NAME [ARG]...\n# ---------------------------------\n# Run all hook functions registered to FUNC_NAME.\n# It is assumed that the list of hook functions contains nothing more\n# than a whitespace-delimited list of legal shell function names, and\n# no effort is wasted trying to catch shell meta-characters or preserve\n# whitespace.\nfunc_run_hooks ()\n{\n    $debug_cmd\n\n    case \" $hookable_fns \" in\n      *\" $1 \"*) ;;\n      *) func_fatal_error \"'$1' does not support hook funcions.n\" ;;\n    esac\n\n    eval _G_hook_fns=\\$$1_hooks; shift\n\n    for _G_hook in $_G_hook_fns; do\n      eval $_G_hook '\"$@\"'\n\n      # store returned options list back into positional\n      # parameters for next 'cmd' execution.\n      eval _G_hook_result=\\$${_G_hook}_result\n      eval set dummy \"$_G_hook_result\"; shift\n    done\n\n    func_quote_for_eval ${1+\"$@\"}\n    func_run_hooks_result=$func_quote_for_eval_result\n}\n\n\n\n## --------------- ##\n## Option parsing. ##\n## --------------- ##\n\n# In order to add your own option parsing hooks, you must accept the\n# full positional parameter list in your hook function, remove any\n# options that you action, and then pass back the remaining unprocessed\n# options in '<hooked_function_name>_result', escaped suitably for\n# 'eval'.  Like this:\n#\n#    my_options_prep ()\n#    {\n#        $debug_cmd\n#\n#        # Extend the existing usage message.\n#        usage_message=$usage_message'\n#      -s, --silent       don'\\''t print informational messages\n#    '\n#\n#        func_quote_for_eval ${1+\"$@\"}\n#        my_options_prep_result=$func_quote_for_eval_result\n#    }\n#    func_add_hook func_options_prep my_options_prep\n#\n#\n#    my_silent_option ()\n#    {\n#        $debug_cmd\n#\n#        # Note that for efficiency, we parse as many options as we can\n#        # recognise in a loop before passing the remainder back to the\n#        # caller on the first unrecognised argument we encounter.\n#        while test $# -gt 0; do\n#          opt=$1; shift\n#          case $opt in\n#            --silent|-s) opt_silent=: ;;\n#            # Separate non-argument short options:\n#            -s*)         func_split_short_opt \"$_G_opt\"\n#                         set dummy \"$func_split_short_opt_name\" \\\n#                             \"-$func_split_short_opt_arg\" ${1+\"$@\"}\n#                         shift\n#                         ;;\n#            *)            set dummy \"$_G_opt\" \"$*\"; shift; break ;;\n#          esac\n#        done\n#\n#        func_quote_for_eval ${1+\"$@\"}\n#        my_silent_option_result=$func_quote_for_eval_result\n#    }\n#    func_add_hook func_parse_options my_silent_option\n#\n#\n#    my_option_validation ()\n#    {\n#        $debug_cmd\n#\n#        $opt_silent && $opt_verbose && func_fatal_help \"\\\n#    '--silent' and '--verbose' options are mutually exclusive.\"\n#\n#        func_quote_for_eval ${1+\"$@\"}\n#        my_option_validation_result=$func_quote_for_eval_result\n#    }\n#    func_add_hook func_validate_options my_option_validation\n#\n# You'll alse need to manually amend $usage_message to reflect the extra\n# options you parse.  It's preferable to append if you can, so that\n# multiple option parsing hooks can be added safely.\n\n\n# func_options [ARG]...\n# ---------------------\n# All the functions called inside func_options are hookable. See the\n# individual implementations for details.\nfunc_hookable func_options\nfunc_options ()\n{\n    $debug_cmd\n\n    func_options_prep ${1+\"$@\"}\n    eval func_parse_options \\\n        ${func_options_prep_result+\"$func_options_prep_result\"}\n    eval func_validate_options \\\n        ${func_parse_options_result+\"$func_parse_options_result\"}\n\n    eval func_run_hooks func_options \\\n        ${func_validate_options_result+\"$func_validate_options_result\"}\n\n    # save modified positional parameters for caller\n    func_options_result=$func_run_hooks_result\n}\n\n\n# func_options_prep [ARG]...\n# --------------------------\n# All initialisations required before starting the option parse loop.\n# Note that when calling hook functions, we pass through the list of\n# positional parameters.  If a hook function modifies that list, and\n# needs to propogate that back to rest of this script, then the complete\n# modified list must be put in 'func_run_hooks_result' before\n# returning.\nfunc_hookable func_options_prep\nfunc_options_prep ()\n{\n    $debug_cmd\n\n    # Option defaults:\n    opt_verbose=false\n    opt_warning_types=\n\n    func_run_hooks func_options_prep ${1+\"$@\"}\n\n    # save modified positional parameters for caller\n    func_options_prep_result=$func_run_hooks_result\n}\n\n\n# func_parse_options [ARG]...\n# ---------------------------\n# The main option parsing loop.\nfunc_hookable func_parse_options\nfunc_parse_options ()\n{\n    $debug_cmd\n\n    func_parse_options_result=\n\n    # this just eases exit handling\n    while test $# -gt 0; do\n      # Defer to hook functions for initial option parsing, so they\n      # get priority in the event of reusing an option name.\n      func_run_hooks func_parse_options ${1+\"$@\"}\n\n      # Adjust func_parse_options positional parameters to match\n      eval set dummy \"$func_run_hooks_result\"; shift\n\n      # Break out of the loop if we already parsed every option.\n      test $# -gt 0 || break\n\n      _G_opt=$1\n      shift\n      case $_G_opt in\n        --debug|-x)   debug_cmd='set -x'\n                      func_echo \"enabling shell trace mode\"\n                      $debug_cmd\n                      ;;\n\n        --no-warnings|--no-warning|--no-warn)\n                      set dummy --warnings none ${1+\"$@\"}\n                      shift\n\t\t      ;;\n\n        --warnings|--warning|-W)\n                      test $# = 0 && func_missing_arg $_G_opt && break\n                      case \" $warning_categories $1\" in\n                        *\" $1 \"*)\n                          # trailing space prevents matching last $1 above\n                          func_append_uniq opt_warning_types \" $1\"\n                          ;;\n                        *all)\n                          opt_warning_types=$warning_categories\n                          ;;\n                        *none)\n                          opt_warning_types=none\n                          warning_func=:\n                          ;;\n                        *error)\n                          opt_warning_types=$warning_categories\n                          warning_func=func_fatal_error\n                          ;;\n                        *)\n                          func_fatal_error \\\n                             \"unsupported warning category: '$1'\"\n                          ;;\n                      esac\n                      shift\n                      ;;\n\n        --verbose|-v) opt_verbose=: ;;\n        --version)    func_version ;;\n        -\\?|-h)       func_usage ;;\n        --help)       func_help ;;\n\n\t# Separate optargs to long options (plugins may need this):\n\t--*=*)        func_split_equals \"$_G_opt\"\n\t              set dummy \"$func_split_equals_lhs\" \\\n                          \"$func_split_equals_rhs\" ${1+\"$@\"}\n                      shift\n                      ;;\n\n       # Separate optargs to short options:\n        -W*)\n                      func_split_short_opt \"$_G_opt\"\n                      set dummy \"$func_split_short_opt_name\" \\\n                          \"$func_split_short_opt_arg\" ${1+\"$@\"}\n                      shift\n                      ;;\n\n        # Separate non-argument short options:\n        -\\?*|-h*|-v*|-x*)\n                      func_split_short_opt \"$_G_opt\"\n                      set dummy \"$func_split_short_opt_name\" \\\n                          \"-$func_split_short_opt_arg\" ${1+\"$@\"}\n                      shift\n                      ;;\n\n        --)           break ;;\n        -*)           func_fatal_help \"unrecognised option: '$_G_opt'\" ;;\n        *)            set dummy \"$_G_opt\" ${1+\"$@\"}; shift; break ;;\n      esac\n    done\n\n    # save modified positional parameters for caller\n    func_quote_for_eval ${1+\"$@\"}\n    func_parse_options_result=$func_quote_for_eval_result\n}\n\n\n# func_validate_options [ARG]...\n# ------------------------------\n# Perform any sanity checks on option settings and/or unconsumed\n# arguments.\nfunc_hookable func_validate_options\nfunc_validate_options ()\n{\n    $debug_cmd\n\n    # Display all warnings if -W was not given.\n    test -n \"$opt_warning_types\" || opt_warning_types=\" $warning_categories\"\n\n    func_run_hooks func_validate_options ${1+\"$@\"}\n\n    # Bail if the options were screwed!\n    $exit_cmd $EXIT_FAILURE\n\n    # save modified positional parameters for caller\n    func_validate_options_result=$func_run_hooks_result\n}\n\n\n\n## ----------------- ##\n## Helper functions. ##\n## ----------------- ##\n\n# This section contains the helper functions used by the rest of the\n# hookable option parser framework in ascii-betical order.\n\n\n# func_fatal_help ARG...\n# ----------------------\n# Echo program name prefixed message to standard error, followed by\n# a help hint, and exit.\nfunc_fatal_help ()\n{\n    $debug_cmd\n\n    eval \\$ECHO \\\"\"Usage: $usage\"\\\"\n    eval \\$ECHO \\\"\"$fatal_help\"\\\"\n    func_error ${1+\"$@\"}\n    exit $EXIT_FAILURE\n}\n\n\n# func_help\n# ---------\n# Echo long help message to standard output and exit.\nfunc_help ()\n{\n    $debug_cmd\n\n    func_usage_message\n    $ECHO \"$long_help_message\"\n    exit 0\n}\n\n\n# func_missing_arg ARGNAME\n# ------------------------\n# Echo program name prefixed message to standard error and set global\n# exit_cmd.\nfunc_missing_arg ()\n{\n    $debug_cmd\n\n    func_error \"Missing argument for '$1'.\"\n    exit_cmd=exit\n}\n\n\n# func_split_equals STRING\n# ------------------------\n# Set func_split_equals_lhs and func_split_equals_rhs shell variables after\n# splitting STRING at the '=' sign.\ntest -z \"$_G_HAVE_XSI_OPS\" \\\n    && (eval 'x=a/b/c;\n      test 5aa/bb/cc = \"${#x}${x%%/*}${x%/*}${x#*/}${x##*/}\"') 2>/dev/null \\\n    && _G_HAVE_XSI_OPS=yes\n\nif test yes = \"$_G_HAVE_XSI_OPS\"\nthen\n  # This is an XSI compatible shell, allowing a faster implementation...\n  eval 'func_split_equals ()\n  {\n      $debug_cmd\n\n      func_split_equals_lhs=${1%%=*}\n      func_split_equals_rhs=${1#*=}\n      test \"x$func_split_equals_lhs\" = \"x$1\" \\\n        && func_split_equals_rhs=\n  }'\nelse\n  # ...otherwise fall back to using expr, which is often a shell builtin.\n  func_split_equals ()\n  {\n      $debug_cmd\n\n      func_split_equals_lhs=`expr \"x$1\" : 'x\\([^=]*\\)'`\n      func_split_equals_rhs=\n      test \"x$func_split_equals_lhs\" = \"x$1\" \\\n        || func_split_equals_rhs=`expr \"x$1\" : 'x[^=]*=\\(.*\\)$'`\n  }\nfi #func_split_equals\n\n\n# func_split_short_opt SHORTOPT\n# -----------------------------\n# Set func_split_short_opt_name and func_split_short_opt_arg shell\n# variables after splitting SHORTOPT after the 2nd character.\nif test yes = \"$_G_HAVE_XSI_OPS\"\nthen\n  # This is an XSI compatible shell, allowing a faster implementation...\n  eval 'func_split_short_opt ()\n  {\n      $debug_cmd\n\n      func_split_short_opt_arg=${1#??}\n      func_split_short_opt_name=${1%\"$func_split_short_opt_arg\"}\n  }'\nelse\n  # ...otherwise fall back to using expr, which is often a shell builtin.\n  func_split_short_opt ()\n  {\n      $debug_cmd\n\n      func_split_short_opt_name=`expr \"x$1\" : 'x-\\(.\\)'`\n      func_split_short_opt_arg=`expr \"x$1\" : 'x-.\\(.*\\)$'`\n  }\nfi #func_split_short_opt\n\n\n# func_usage\n# ----------\n# Echo short help message to standard output and exit.\nfunc_usage ()\n{\n    $debug_cmd\n\n    func_usage_message\n    $ECHO \"Run '$progname --help |${PAGER-more}' for full usage\"\n    exit 0\n}\n\n\n# func_usage_message\n# ------------------\n# Echo short help message to standard output.\nfunc_usage_message ()\n{\n    $debug_cmd\n\n    eval \\$ECHO \\\"\"Usage: $usage\"\\\"\n    echo\n    $SED -n 's|^# ||\n        /^Written by/{\n          x;p;x\n        }\n\th\n\t/^Written by/q' < \"$progpath\"\n    echo\n    eval \\$ECHO \\\"\"$usage_message\"\\\"\n}\n\n\n# func_version\n# ------------\n# Echo version message to standard output and exit.\nfunc_version ()\n{\n    $debug_cmd\n\n    printf '%s\\n' \"$progname $scriptversion\"\n    $SED -n '\n        /(C)/!b go\n        :more\n        /\\./!{\n          N\n          s|\\n# | |\n          b more\n        }\n        :go\n        /^# Written by /,/# warranty; / {\n          s|^# ||\n          s|^# *$||\n          s|\\((C)\\)[ 0-9,-]*[ ,-]\\([1-9][0-9]* \\)|\\1 \\2|\n          p\n        }\n        /^# Written by / {\n          s|^# ||\n          p\n        }\n        /^warranty; /q' < \"$progpath\"\n\n    exit $?\n}\n\n\n# Local variables:\n# mode: shell-script\n# sh-indentation: 2\n# eval: (add-hook 'before-save-hook 'time-stamp)\n# time-stamp-pattern: \"10/scriptversion=%:y-%02m-%02d.%02H; # UTC\"\n# time-stamp-time-zone: \"UTC\"\n# End:\n\n# Set a version string.\nscriptversion='(GNU libtool) 2.4.6'\n\n\n# func_echo ARG...\n# ----------------\n# Libtool also displays the current mode in messages, so override\n# funclib.sh func_echo with this custom definition.\nfunc_echo ()\n{\n    $debug_cmd\n\n    _G_message=$*\n\n    func_echo_IFS=$IFS\n    IFS=$nl\n    for _G_line in $_G_message; do\n      IFS=$func_echo_IFS\n      $ECHO \"$progname${opt_mode+: $opt_mode}: $_G_line\"\n    done\n    IFS=$func_echo_IFS\n}\n\n\n# func_warning ARG...\n# -------------------\n# Libtool warnings are not categorized, so override funclib.sh\n# func_warning with this simpler definition.\nfunc_warning ()\n{\n    $debug_cmd\n\n    $warning_func ${1+\"$@\"}\n}\n\n\n## ---------------- ##\n## Options parsing. ##\n## ---------------- ##\n\n# Hook in the functions to make sure our own options are parsed during\n# the option parsing loop.\n\nusage='$progpath [OPTION]... [MODE-ARG]...'\n\n# Short help message in response to '-h'.\nusage_message=\"Options:\n       --config             show all configuration variables\n       --debug              enable verbose shell tracing\n   -n, --dry-run            display commands without modifying any files\n       --features           display basic configuration information and exit\n       --mode=MODE          use operation mode MODE\n       --no-warnings        equivalent to '-Wnone'\n       --preserve-dup-deps  don't remove duplicate dependency libraries\n       --quiet, --silent    don't print informational messages\n       --tag=TAG            use configuration variables from tag TAG\n   -v, --verbose            print more informational messages than default\n       --version            print version information\n   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]\n   -h, --help, --help-all   print short, long, or detailed help message\n\"\n\n# Additional text appended to 'usage_message' in response to '--help'.\nfunc_help ()\n{\n    $debug_cmd\n\n    func_usage_message\n    $ECHO \"$long_help_message\n\nMODE must be one of the following:\n\n       clean           remove files from the build directory\n       compile         compile a source file into a libtool object\n       execute         automatically set library path, then run a program\n       finish          complete the installation of libtool libraries\n       install         install libraries or executables\n       link            create a library or an executable\n       uninstall       remove libraries from an installed directory\n\nMODE-ARGS vary depending on the MODE.  When passed as first option,\n'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.\nTry '$progname --help --mode=MODE' for a more detailed description of MODE.\n\nWhen reporting a bug, please describe a test case to reproduce it and\ninclude the following information:\n\n       host-triplet:   $host\n       shell:          $SHELL\n       compiler:       $LTCC\n       compiler flags: $LTCFLAGS\n       linker:         $LD (gnu? $with_gnu_ld)\n       version:        $progname $scriptversion Debian-2.4.6-2\n       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`\n       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`\n\nReport bugs to <bug-libtool@gnu.org>.\nGNU libtool home page: <http://www.gnu.org/s/libtool/>.\nGeneral help using GNU software: <http://www.gnu.org/gethelp/>.\"\n    exit 0\n}\n\n\n# func_lo2o OBJECT-NAME\n# ---------------------\n# Transform OBJECT-NAME from a '.lo' suffix to the platform specific\n# object suffix.\n\nlo2o=s/\\\\.lo\\$/.$objext/\no2lo=s/\\\\.$objext\\$/.lo/\n\nif test yes = \"$_G_HAVE_XSI_OPS\"; then\n  eval 'func_lo2o ()\n  {\n    case $1 in\n      *.lo) func_lo2o_result=${1%.lo}.$objext ;;\n      *   ) func_lo2o_result=$1               ;;\n    esac\n  }'\n\n  # func_xform LIBOBJ-OR-SOURCE\n  # ---------------------------\n  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)\n  # suffix to a '.lo' libtool-object suffix.\n  eval 'func_xform ()\n  {\n    func_xform_result=${1%.*}.lo\n  }'\nelse\n  # ...otherwise fall back to using sed.\n  func_lo2o ()\n  {\n    func_lo2o_result=`$ECHO \"$1\" | $SED \"$lo2o\"`\n  }\n\n  func_xform ()\n  {\n    func_xform_result=`$ECHO \"$1\" | $SED 's|\\.[^.]*$|.lo|'`\n  }\nfi\n\n\n# func_fatal_configuration ARG...\n# -------------------------------\n# Echo program name prefixed message to standard error, followed by\n# a configuration failure hint, and exit.\nfunc_fatal_configuration ()\n{\n    func__fatal_error ${1+\"$@\"} \\\n      \"See the $PACKAGE documentation for more information.\" \\\n      \"Fatal configuration error.\"\n}\n\n\n# func_config\n# -----------\n# Display the configuration for all the tags in this script.\nfunc_config ()\n{\n    re_begincf='^# ### BEGIN LIBTOOL'\n    re_endcf='^# ### END LIBTOOL'\n\n    # Default configuration.\n    $SED \"1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\\$d\" < \"$progpath\"\n\n    # Now print the configurations for the tags.\n    for tagname in $taglist; do\n      $SED -n \"/$re_begincf TAG CONFIG: $tagname\\$/,/$re_endcf TAG CONFIG: $tagname\\$/p\" < \"$progpath\"\n    done\n\n    exit $?\n}\n\n\n# func_features\n# -------------\n# Display the features supported by this script.\nfunc_features ()\n{\n    echo \"host: $host\"\n    if test yes = \"$build_libtool_libs\"; then\n      echo \"enable shared libraries\"\n    else\n      echo \"disable shared libraries\"\n    fi\n    if test yes = \"$build_old_libs\"; then\n      echo \"enable static libraries\"\n    else\n      echo \"disable static libraries\"\n    fi\n\n    exit $?\n}\n\n\n# func_enable_tag TAGNAME\n# -----------------------\n# Verify that TAGNAME is valid, and either flag an error and exit, or\n# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist\n# variable here.\nfunc_enable_tag ()\n{\n    # Global variable:\n    tagname=$1\n\n    re_begincf=\"^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\\$\"\n    re_endcf=\"^# ### END LIBTOOL TAG CONFIG: $tagname\\$\"\n    sed_extractcf=/$re_begincf/,/$re_endcf/p\n\n    # Validate tagname.\n    case $tagname in\n      *[!-_A-Za-z0-9,/]*)\n        func_fatal_error \"invalid tag name: $tagname\"\n        ;;\n    esac\n\n    # Don't test for the \"default\" C tag, as we know it's\n    # there but not specially marked.\n    case $tagname in\n        CC) ;;\n    *)\n        if $GREP \"$re_begincf\" \"$progpath\" >/dev/null 2>&1; then\n\t  taglist=\"$taglist $tagname\"\n\n\t  # Evaluate the configuration.  Be careful to quote the path\n\t  # and the sed script, to avoid splitting on whitespace, but\n\t  # also don't use non-portable quotes within backquotes within\n\t  # quotes we have to do it in 2 steps:\n\t  extractedcf=`$SED -n -e \"$sed_extractcf\" < \"$progpath\"`\n\t  eval \"$extractedcf\"\n        else\n\t  func_error \"ignoring unknown tag $tagname\"\n        fi\n        ;;\n    esac\n}\n\n\n# func_check_version_match\n# ------------------------\n# Ensure that we are using m4 macros, and libtool script from the same\n# release of libtool.\nfunc_check_version_match ()\n{\n    if test \"$package_revision\" != \"$macro_revision\"; then\n      if test \"$VERSION\" != \"$macro_version\"; then\n        if test -z \"$macro_version\"; then\n          cat >&2 <<_LT_EOF\n$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the\n$progname: definition of this LT_INIT comes from an older release.\n$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION\n$progname: and run autoconf again.\n_LT_EOF\n        else\n          cat >&2 <<_LT_EOF\n$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the\n$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.\n$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION\n$progname: and run autoconf again.\n_LT_EOF\n        fi\n      else\n        cat >&2 <<_LT_EOF\n$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,\n$progname: but the definition of this LT_INIT comes from revision $macro_revision.\n$progname: You should recreate aclocal.m4 with macros from revision $package_revision\n$progname: of $PACKAGE $VERSION and run autoconf again.\n_LT_EOF\n      fi\n\n      exit $EXIT_MISMATCH\n    fi\n}\n\n\n# libtool_options_prep [ARG]...\n# -----------------------------\n# Preparation for options parsed by libtool.\nlibtool_options_prep ()\n{\n    $debug_mode\n\n    # Option defaults:\n    opt_config=false\n    opt_dlopen=\n    opt_dry_run=false\n    opt_help=false\n    opt_mode=\n    opt_preserve_dup_deps=false\n    opt_quiet=false\n\n    nonopt=\n    preserve_args=\n\n    # Shorthand for --mode=foo, only valid as the first argument\n    case $1 in\n    clean|clea|cle|cl)\n      shift; set dummy --mode clean ${1+\"$@\"}; shift\n      ;;\n    compile|compil|compi|comp|com|co|c)\n      shift; set dummy --mode compile ${1+\"$@\"}; shift\n      ;;\n    execute|execut|execu|exec|exe|ex|e)\n      shift; set dummy --mode execute ${1+\"$@\"}; shift\n      ;;\n    finish|finis|fini|fin|fi|f)\n      shift; set dummy --mode finish ${1+\"$@\"}; shift\n      ;;\n    install|instal|insta|inst|ins|in|i)\n      shift; set dummy --mode install ${1+\"$@\"}; shift\n      ;;\n    link|lin|li|l)\n      shift; set dummy --mode link ${1+\"$@\"}; shift\n      ;;\n    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)\n      shift; set dummy --mode uninstall ${1+\"$@\"}; shift\n      ;;\n    esac\n\n    # Pass back the list of options.\n    func_quote_for_eval ${1+\"$@\"}\n    libtool_options_prep_result=$func_quote_for_eval_result\n}\nfunc_add_hook func_options_prep libtool_options_prep\n\n\n# libtool_parse_options [ARG]...\n# ---------------------------------\n# Provide handling for libtool specific options.\nlibtool_parse_options ()\n{\n    $debug_cmd\n\n    # Perform our own loop to consume as many options as possible in\n    # each iteration.\n    while test $# -gt 0; do\n      _G_opt=$1\n      shift\n      case $_G_opt in\n        --dry-run|--dryrun|-n)\n                        opt_dry_run=:\n                        ;;\n\n        --config)       func_config ;;\n\n        --dlopen|-dlopen)\n                        opt_dlopen=\"${opt_dlopen+$opt_dlopen\n}$1\"\n                        shift\n                        ;;\n\n        --preserve-dup-deps)\n                        opt_preserve_dup_deps=: ;;\n\n        --features)     func_features ;;\n\n        --finish)       set dummy --mode finish ${1+\"$@\"}; shift ;;\n\n        --help)         opt_help=: ;;\n\n        --help-all)     opt_help=': help-all' ;;\n\n        --mode)         test $# = 0 && func_missing_arg $_G_opt && break\n                        opt_mode=$1\n                        case $1 in\n                          # Valid mode arguments:\n                          clean|compile|execute|finish|install|link|relink|uninstall) ;;\n\n                          # Catch anything else as an error\n                          *) func_error \"invalid argument for $_G_opt\"\n                             exit_cmd=exit\n                             break\n                             ;;\n                        esac\n                        shift\n                        ;;\n\n        --no-silent|--no-quiet)\n                        opt_quiet=false\n                        func_append preserve_args \" $_G_opt\"\n                        ;;\n\n        --no-warnings|--no-warning|--no-warn)\n                        opt_warning=false\n                        func_append preserve_args \" $_G_opt\"\n                        ;;\n\n        --no-verbose)\n                        opt_verbose=false\n                        func_append preserve_args \" $_G_opt\"\n                        ;;\n\n        --silent|--quiet)\n                        opt_quiet=:\n                        opt_verbose=false\n                        func_append preserve_args \" $_G_opt\"\n                        ;;\n\n        --tag)          test $# = 0 && func_missing_arg $_G_opt && break\n                        opt_tag=$1\n                        func_append preserve_args \" $_G_opt $1\"\n                        func_enable_tag \"$1\"\n                        shift\n                        ;;\n\n        --verbose|-v)   opt_quiet=false\n                        opt_verbose=:\n                        func_append preserve_args \" $_G_opt\"\n                        ;;\n\n\t# An option not handled by this hook function:\n        *)\t\tset dummy \"$_G_opt\" ${1+\"$@\"};\tshift; break  ;;\n      esac\n    done\n\n\n    # save modified positional parameters for caller\n    func_quote_for_eval ${1+\"$@\"}\n    libtool_parse_options_result=$func_quote_for_eval_result\n}\nfunc_add_hook func_parse_options libtool_parse_options\n\n\n\n# libtool_validate_options [ARG]...\n# ---------------------------------\n# Perform any sanity checks on option settings and/or unconsumed\n# arguments.\nlibtool_validate_options ()\n{\n    # save first non-option argument\n    if test 0 -lt $#; then\n      nonopt=$1\n      shift\n    fi\n\n    # preserve --debug\n    test : = \"$debug_cmd\" || func_append preserve_args \" --debug\"\n\n    case $host in\n      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452\n      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788\n      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)\n        # don't eliminate duplications in $postdeps and $predeps\n        opt_duplicate_compiler_generated_deps=:\n        ;;\n      *)\n        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps\n        ;;\n    esac\n\n    $opt_help || {\n      # Sanity checks first:\n      func_check_version_match\n\n      test yes != \"$build_libtool_libs\" \\\n        && test yes != \"$build_old_libs\" \\\n        && func_fatal_configuration \"not configured to build any kind of library\"\n\n      # Darwin sucks\n      eval std_shrext=\\\"$shrext_cmds\\\"\n\n      # Only execute mode is allowed to have -dlopen flags.\n      if test -n \"$opt_dlopen\" && test execute != \"$opt_mode\"; then\n        func_error \"unrecognized option '-dlopen'\"\n        $ECHO \"$help\" 1>&2\n        exit $EXIT_FAILURE\n      fi\n\n      # Change the help message to a mode-specific one.\n      generic_help=$help\n      help=\"Try '$progname --help --mode=$opt_mode' for more information.\"\n    }\n\n    # Pass back the unparsed argument list\n    func_quote_for_eval ${1+\"$@\"}\n    libtool_validate_options_result=$func_quote_for_eval_result\n}\nfunc_add_hook func_validate_options libtool_validate_options\n\n\n# Process options as early as possible so that --help and --version\n# can return quickly.\nfunc_options ${1+\"$@\"}\neval set dummy \"$func_options_result\"; shift\n\n\n\n## ----------- ##\n##    Main.    ##\n## ----------- ##\n\nmagic='%%%MAGIC variable%%%'\nmagic_exe='%%%MAGIC EXE variable%%%'\n\n# Global variables.\nextracted_archives=\nextracted_serial=0\n\n# If this variable is set in any of the actions, the command in it\n# will be execed at the end.  This prevents here-documents from being\n# left over by shells.\nexec_cmd=\n\n\n# A function that is used when there is no print builtin or printf.\nfunc_fallback_echo ()\n{\n  eval 'cat <<_LTECHO_EOF\n$1\n_LTECHO_EOF'\n}\n\n# func_generated_by_libtool\n# True iff stdin has been generated by Libtool. This function is only\n# a basic sanity check; it will hardly flush out determined imposters.\nfunc_generated_by_libtool_p ()\n{\n  $GREP \"^# Generated by .*$PACKAGE\" > /dev/null 2>&1\n}\n\n# func_lalib_p file\n# True iff FILE is a libtool '.la' library or '.lo' object file.\n# This function is only a basic sanity check; it will hardly flush out\n# determined imposters.\nfunc_lalib_p ()\n{\n    test -f \"$1\" &&\n      $SED -e 4q \"$1\" 2>/dev/null | func_generated_by_libtool_p\n}\n\n# func_lalib_unsafe_p file\n# True iff FILE is a libtool '.la' library or '.lo' object file.\n# This function implements the same check as func_lalib_p without\n# resorting to external programs.  To this end, it redirects stdin and\n# closes it afterwards, without saving the original file descriptor.\n# As a safety measure, use it only where a negative result would be\n# fatal anyway.  Works if 'file' does not exist.\nfunc_lalib_unsafe_p ()\n{\n    lalib_p=no\n    if test -f \"$1\" && test -r \"$1\" && exec 5<&0 <\"$1\"; then\n\tfor lalib_p_l in 1 2 3 4\n\tdo\n\t    read lalib_p_line\n\t    case $lalib_p_line in\n\t\t\\#\\ Generated\\ by\\ *$PACKAGE* ) lalib_p=yes; break;;\n\t    esac\n\tdone\n\texec 0<&5 5<&-\n    fi\n    test yes = \"$lalib_p\"\n}\n\n# func_ltwrapper_script_p file\n# True iff FILE is a libtool wrapper script\n# This function is only a basic sanity check; it will hardly flush out\n# determined imposters.\nfunc_ltwrapper_script_p ()\n{\n    test -f \"$1\" &&\n      $lt_truncate_bin < \"$1\" 2>/dev/null | func_generated_by_libtool_p\n}\n\n# func_ltwrapper_executable_p file\n# True iff FILE is a libtool wrapper executable\n# This function is only a basic sanity check; it will hardly flush out\n# determined imposters.\nfunc_ltwrapper_executable_p ()\n{\n    func_ltwrapper_exec_suffix=\n    case $1 in\n    *.exe) ;;\n    *) func_ltwrapper_exec_suffix=.exe ;;\n    esac\n    $GREP \"$magic_exe\" \"$1$func_ltwrapper_exec_suffix\" >/dev/null 2>&1\n}\n\n# func_ltwrapper_scriptname file\n# Assumes file is an ltwrapper_executable\n# uses $file to determine the appropriate filename for a\n# temporary ltwrapper_script.\nfunc_ltwrapper_scriptname ()\n{\n    func_dirname_and_basename \"$1\" \"\" \".\"\n    func_stripname '' '.exe' \"$func_basename_result\"\n    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper\n}\n\n# func_ltwrapper_p file\n# True iff FILE is a libtool wrapper script or wrapper executable\n# This function is only a basic sanity check; it will hardly flush out\n# determined imposters.\nfunc_ltwrapper_p ()\n{\n    func_ltwrapper_script_p \"$1\" || func_ltwrapper_executable_p \"$1\"\n}\n\n\n# func_execute_cmds commands fail_cmd\n# Execute tilde-delimited COMMANDS.\n# If FAIL_CMD is given, eval that upon failure.\n# FAIL_CMD may read-access the current command in variable CMD!\nfunc_execute_cmds ()\n{\n    $debug_cmd\n\n    save_ifs=$IFS; IFS='~'\n    for cmd in $1; do\n      IFS=$sp$nl\n      eval cmd=\\\"$cmd\\\"\n      IFS=$save_ifs\n      func_show_eval \"$cmd\" \"${2-:}\"\n    done\n    IFS=$save_ifs\n}\n\n\n# func_source file\n# Source FILE, adding directory component if necessary.\n# Note that it is not necessary on cygwin/mingw to append a dot to\n# FILE even if both FILE and FILE.exe exist: automatic-append-.exe\n# behavior happens only for exec(3), not for open(2)!  Also, sourcing\n# 'FILE.' does not work on cygwin managed mounts.\nfunc_source ()\n{\n    $debug_cmd\n\n    case $1 in\n    */* | *\\\\*)\t. \"$1\" ;;\n    *)\t\t. \"./$1\" ;;\n    esac\n}\n\n\n# func_resolve_sysroot PATH\n# Replace a leading = in PATH with a sysroot.  Store the result into\n# func_resolve_sysroot_result\nfunc_resolve_sysroot ()\n{\n  func_resolve_sysroot_result=$1\n  case $func_resolve_sysroot_result in\n  =*)\n    func_stripname '=' '' \"$func_resolve_sysroot_result\"\n    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result\n    ;;\n  esac\n}\n\n# func_replace_sysroot PATH\n# If PATH begins with the sysroot, replace it with = and\n# store the result into func_replace_sysroot_result.\nfunc_replace_sysroot ()\n{\n  case $lt_sysroot:$1 in\n  ?*:\"$lt_sysroot\"*)\n    func_stripname \"$lt_sysroot\" '' \"$1\"\n    func_replace_sysroot_result='='$func_stripname_result\n    ;;\n  *)\n    # Including no sysroot.\n    func_replace_sysroot_result=$1\n    ;;\n  esac\n}\n\n# func_infer_tag arg\n# Infer tagged configuration to use if any are available and\n# if one wasn't chosen via the \"--tag\" command line option.\n# Only attempt this if the compiler in the base compile\n# command doesn't match the default compiler.\n# arg is usually of the form 'gcc ...'\nfunc_infer_tag ()\n{\n    $debug_cmd\n\n    if test -n \"$available_tags\" && test -z \"$tagname\"; then\n      CC_quoted=\n      for arg in $CC; do\n\tfunc_append_quoted CC_quoted \"$arg\"\n      done\n      CC_expanded=`func_echo_all $CC`\n      CC_quoted_expanded=`func_echo_all $CC_quoted`\n      case $@ in\n      # Blanks in the command may have been stripped by the calling shell,\n      # but not from the CC environment variable when configure was run.\n      \" $CC \"* | \"$CC \"* | \" $CC_expanded \"* | \"$CC_expanded \"* | \\\n      \" $CC_quoted\"* | \"$CC_quoted \"* | \" $CC_quoted_expanded \"* | \"$CC_quoted_expanded \"*) ;;\n      # Blanks at the start of $base_compile will cause this to fail\n      # if we don't check for them as well.\n      *)\n\tfor z in $available_tags; do\n\t  if $GREP \"^# ### BEGIN LIBTOOL TAG CONFIG: $z$\" < \"$progpath\" > /dev/null; then\n\t    # Evaluate the configuration.\n\t    eval \"`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`\"\n\t    CC_quoted=\n\t    for arg in $CC; do\n\t      # Double-quote args containing other shell metacharacters.\n\t      func_append_quoted CC_quoted \"$arg\"\n\t    done\n\t    CC_expanded=`func_echo_all $CC`\n\t    CC_quoted_expanded=`func_echo_all $CC_quoted`\n\t    case \"$@ \" in\n\t    \" $CC \"* | \"$CC \"* | \" $CC_expanded \"* | \"$CC_expanded \"* | \\\n\t    \" $CC_quoted\"* | \"$CC_quoted \"* | \" $CC_quoted_expanded \"* | \"$CC_quoted_expanded \"*)\n\t      # The compiler in the base compile command matches\n\t      # the one in the tagged configuration.\n\t      # Assume this is the tagged configuration we want.\n\t      tagname=$z\n\t      break\n\t      ;;\n\t    esac\n\t  fi\n\tdone\n\t# If $tagname still isn't set, then no tagged configuration\n\t# was found and let the user know that the \"--tag\" command\n\t# line option must be used.\n\tif test -z \"$tagname\"; then\n\t  func_echo \"unable to infer tagged configuration\"\n\t  func_fatal_error \"specify a tag with '--tag'\"\n#\telse\n#\t  func_verbose \"using $tagname tagged configuration\"\n\tfi\n\t;;\n      esac\n    fi\n}\n\n\n\n# func_write_libtool_object output_name pic_name nonpic_name\n# Create a libtool object file (analogous to a \".la\" file),\n# but don't create it if we're doing a dry run.\nfunc_write_libtool_object ()\n{\n    write_libobj=$1\n    if test yes = \"$build_libtool_libs\"; then\n      write_lobj=\\'$2\\'\n    else\n      write_lobj=none\n    fi\n\n    if test yes = \"$build_old_libs\"; then\n      write_oldobj=\\'$3\\'\n    else\n      write_oldobj=none\n    fi\n\n    $opt_dry_run || {\n      cat >${write_libobj}T <<EOF\n# $write_libobj - a libtool object file\n# Generated by $PROGRAM (GNU $PACKAGE) $VERSION\n#\n# Please DO NOT delete this file!\n# It is necessary for linking the library.\n\n# Name of the PIC object.\npic_object=$write_lobj\n\n# Name of the non-PIC object\nnon_pic_object=$write_oldobj\n\nEOF\n      $MV \"${write_libobj}T\" \"$write_libobj\"\n    }\n}\n\n\n##################################################\n# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #\n##################################################\n\n# func_convert_core_file_wine_to_w32 ARG\n# Helper function used by file name conversion functions when $build is *nix,\n# and $host is mingw, cygwin, or some other w32 environment. Relies on a\n# correctly configured wine environment available, with the winepath program\n# in $build's $PATH.\n#\n# ARG is the $build file name to be converted to w32 format.\n# Result is available in $func_convert_core_file_wine_to_w32_result, and will\n# be empty on error (or when ARG is empty)\nfunc_convert_core_file_wine_to_w32 ()\n{\n  $debug_cmd\n\n  func_convert_core_file_wine_to_w32_result=$1\n  if test -n \"$1\"; then\n    # Unfortunately, winepath does not exit with a non-zero error code, so we\n    # are forced to check the contents of stdout. On the other hand, if the\n    # command is not found, the shell will set an exit code of 127 and print\n    # *an error message* to stdout. So we must check for both error code of\n    # zero AND non-empty stdout, which explains the odd construction:\n    func_convert_core_file_wine_to_w32_tmp=`winepath -w \"$1\" 2>/dev/null`\n    if test \"$?\" -eq 0 && test -n \"$func_convert_core_file_wine_to_w32_tmp\"; then\n      func_convert_core_file_wine_to_w32_result=`$ECHO \"$func_convert_core_file_wine_to_w32_tmp\" |\n        $SED -e \"$sed_naive_backslashify\"`\n    else\n      func_convert_core_file_wine_to_w32_result=\n    fi\n  fi\n}\n# end: func_convert_core_file_wine_to_w32\n\n\n# func_convert_core_path_wine_to_w32 ARG\n# Helper function used by path conversion functions when $build is *nix, and\n# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly\n# configured wine environment available, with the winepath program in $build's\n# $PATH. Assumes ARG has no leading or trailing path separator characters.\n#\n# ARG is path to be converted from $build format to win32.\n# Result is available in $func_convert_core_path_wine_to_w32_result.\n# Unconvertible file (directory) names in ARG are skipped; if no directory names\n# are convertible, then the result may be empty.\nfunc_convert_core_path_wine_to_w32 ()\n{\n  $debug_cmd\n\n  # unfortunately, winepath doesn't convert paths, only file names\n  func_convert_core_path_wine_to_w32_result=\n  if test -n \"$1\"; then\n    oldIFS=$IFS\n    IFS=:\n    for func_convert_core_path_wine_to_w32_f in $1; do\n      IFS=$oldIFS\n      func_convert_core_file_wine_to_w32 \"$func_convert_core_path_wine_to_w32_f\"\n      if test -n \"$func_convert_core_file_wine_to_w32_result\"; then\n        if test -z \"$func_convert_core_path_wine_to_w32_result\"; then\n          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result\n        else\n          func_append func_convert_core_path_wine_to_w32_result \";$func_convert_core_file_wine_to_w32_result\"\n        fi\n      fi\n    done\n    IFS=$oldIFS\n  fi\n}\n# end: func_convert_core_path_wine_to_w32\n\n\n# func_cygpath ARGS...\n# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when\n# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)\n# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or\n# (2), returns the Cygwin file name or path in func_cygpath_result (input\n# file name or path is assumed to be in w32 format, as previously converted\n# from $build's *nix or MSYS format). In case (3), returns the w32 file name\n# or path in func_cygpath_result (input file name or path is assumed to be in\n# Cygwin format). Returns an empty string on error.\n#\n# ARGS are passed to cygpath, with the last one being the file name or path to\n# be converted.\n#\n# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH\n# environment variable; do not put it in $PATH.\nfunc_cygpath ()\n{\n  $debug_cmd\n\n  if test -n \"$LT_CYGPATH\" && test -f \"$LT_CYGPATH\"; then\n    func_cygpath_result=`$LT_CYGPATH \"$@\" 2>/dev/null`\n    if test \"$?\" -ne 0; then\n      # on failure, ensure result is empty\n      func_cygpath_result=\n    fi\n  else\n    func_cygpath_result=\n    func_error \"LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'\"\n  fi\n}\n#end: func_cygpath\n\n\n# func_convert_core_msys_to_w32 ARG\n# Convert file name or path ARG from MSYS format to w32 format.  Return\n# result in func_convert_core_msys_to_w32_result.\nfunc_convert_core_msys_to_w32 ()\n{\n  $debug_cmd\n\n  # awkward: cmd appends spaces to result\n  func_convert_core_msys_to_w32_result=`( cmd //c echo \"$1\" ) 2>/dev/null |\n    $SED -e 's/[ ]*$//' -e \"$sed_naive_backslashify\"`\n}\n#end: func_convert_core_msys_to_w32\n\n\n# func_convert_file_check ARG1 ARG2\n# Verify that ARG1 (a file name in $build format) was converted to $host\n# format in ARG2. Otherwise, emit an error message, but continue (resetting\n# func_to_host_file_result to ARG1).\nfunc_convert_file_check ()\n{\n  $debug_cmd\n\n  if test -z \"$2\" && test -n \"$1\"; then\n    func_error \"Could not determine host file name corresponding to\"\n    func_error \"  '$1'\"\n    func_error \"Continuing, but uninstalled executables may not work.\"\n    # Fallback:\n    func_to_host_file_result=$1\n  fi\n}\n# end func_convert_file_check\n\n\n# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH\n# Verify that FROM_PATH (a path in $build format) was converted to $host\n# format in TO_PATH. Otherwise, emit an error message, but continue, resetting\n# func_to_host_file_result to a simplistic fallback value (see below).\nfunc_convert_path_check ()\n{\n  $debug_cmd\n\n  if test -z \"$4\" && test -n \"$3\"; then\n    func_error \"Could not determine the host path corresponding to\"\n    func_error \"  '$3'\"\n    func_error \"Continuing, but uninstalled executables may not work.\"\n    # Fallback.  This is a deliberately simplistic \"conversion\" and\n    # should not be \"improved\".  See libtool.info.\n    if test \"x$1\" != \"x$2\"; then\n      lt_replace_pathsep_chars=\"s|$1|$2|g\"\n      func_to_host_path_result=`echo \"$3\" |\n        $SED -e \"$lt_replace_pathsep_chars\"`\n    else\n      func_to_host_path_result=$3\n    fi\n  fi\n}\n# end func_convert_path_check\n\n\n# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG\n# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT\n# and appending REPL if ORIG matches BACKPAT.\nfunc_convert_path_front_back_pathsep ()\n{\n  $debug_cmd\n\n  case $4 in\n  $1 ) func_to_host_path_result=$3$func_to_host_path_result\n    ;;\n  esac\n  case $4 in\n  $2 ) func_append func_to_host_path_result \"$3\"\n    ;;\n  esac\n}\n# end func_convert_path_front_back_pathsep\n\n\n##################################################\n# $build to $host FILE NAME CONVERSION FUNCTIONS #\n##################################################\n# invoked via '$to_host_file_cmd ARG'\n#\n# In each case, ARG is the path to be converted from $build to $host format.\n# Result will be available in $func_to_host_file_result.\n\n\n# func_to_host_file ARG\n# Converts the file name ARG from $build format to $host format. Return result\n# in func_to_host_file_result.\nfunc_to_host_file ()\n{\n  $debug_cmd\n\n  $to_host_file_cmd \"$1\"\n}\n# end func_to_host_file\n\n\n# func_to_tool_file ARG LAZY\n# converts the file name ARG from $build format to toolchain format. Return\n# result in func_to_tool_file_result.  If the conversion in use is listed\n# in (the comma separated) LAZY, no conversion takes place.\nfunc_to_tool_file ()\n{\n  $debug_cmd\n\n  case ,$2, in\n    *,\"$to_tool_file_cmd\",*)\n      func_to_tool_file_result=$1\n      ;;\n    *)\n      $to_tool_file_cmd \"$1\"\n      func_to_tool_file_result=$func_to_host_file_result\n      ;;\n  esac\n}\n# end func_to_tool_file\n\n\n# func_convert_file_noop ARG\n# Copy ARG to func_to_host_file_result.\nfunc_convert_file_noop ()\n{\n  func_to_host_file_result=$1\n}\n# end func_convert_file_noop\n\n\n# func_convert_file_msys_to_w32 ARG\n# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic\n# conversion to w32 is not available inside the cwrapper.  Returns result in\n# func_to_host_file_result.\nfunc_convert_file_msys_to_w32 ()\n{\n  $debug_cmd\n\n  func_to_host_file_result=$1\n  if test -n \"$1\"; then\n    func_convert_core_msys_to_w32 \"$1\"\n    func_to_host_file_result=$func_convert_core_msys_to_w32_result\n  fi\n  func_convert_file_check \"$1\" \"$func_to_host_file_result\"\n}\n# end func_convert_file_msys_to_w32\n\n\n# func_convert_file_cygwin_to_w32 ARG\n# Convert file name ARG from Cygwin to w32 format.  Returns result in\n# func_to_host_file_result.\nfunc_convert_file_cygwin_to_w32 ()\n{\n  $debug_cmd\n\n  func_to_host_file_result=$1\n  if test -n \"$1\"; then\n    # because $build is cygwin, we call \"the\" cygpath in $PATH; no need to use\n    # LT_CYGPATH in this case.\n    func_to_host_file_result=`cygpath -m \"$1\"`\n  fi\n  func_convert_file_check \"$1\" \"$func_to_host_file_result\"\n}\n# end func_convert_file_cygwin_to_w32\n\n\n# func_convert_file_nix_to_w32 ARG\n# Convert file name ARG from *nix to w32 format.  Requires a wine environment\n# and a working winepath. Returns result in func_to_host_file_result.\nfunc_convert_file_nix_to_w32 ()\n{\n  $debug_cmd\n\n  func_to_host_file_result=$1\n  if test -n \"$1\"; then\n    func_convert_core_file_wine_to_w32 \"$1\"\n    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result\n  fi\n  func_convert_file_check \"$1\" \"$func_to_host_file_result\"\n}\n# end func_convert_file_nix_to_w32\n\n\n# func_convert_file_msys_to_cygwin ARG\n# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.\n# Returns result in func_to_host_file_result.\nfunc_convert_file_msys_to_cygwin ()\n{\n  $debug_cmd\n\n  func_to_host_file_result=$1\n  if test -n \"$1\"; then\n    func_convert_core_msys_to_w32 \"$1\"\n    func_cygpath -u \"$func_convert_core_msys_to_w32_result\"\n    func_to_host_file_result=$func_cygpath_result\n  fi\n  func_convert_file_check \"$1\" \"$func_to_host_file_result\"\n}\n# end func_convert_file_msys_to_cygwin\n\n\n# func_convert_file_nix_to_cygwin ARG\n# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed\n# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result\n# in func_to_host_file_result.\nfunc_convert_file_nix_to_cygwin ()\n{\n  $debug_cmd\n\n  func_to_host_file_result=$1\n  if test -n \"$1\"; then\n    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.\n    func_convert_core_file_wine_to_w32 \"$1\"\n    func_cygpath -u \"$func_convert_core_file_wine_to_w32_result\"\n    func_to_host_file_result=$func_cygpath_result\n  fi\n  func_convert_file_check \"$1\" \"$func_to_host_file_result\"\n}\n# end func_convert_file_nix_to_cygwin\n\n\n#############################################\n# $build to $host PATH CONVERSION FUNCTIONS #\n#############################################\n# invoked via '$to_host_path_cmd ARG'\n#\n# In each case, ARG is the path to be converted from $build to $host format.\n# The result will be available in $func_to_host_path_result.\n#\n# Path separators are also converted from $build format to $host format.  If\n# ARG begins or ends with a path separator character, it is preserved (but\n# converted to $host format) on output.\n#\n# All path conversion functions are named using the following convention:\n#   file name conversion function    : func_convert_file_X_to_Y ()\n#   path conversion function         : func_convert_path_X_to_Y ()\n# where, for any given $build/$host combination the 'X_to_Y' value is the\n# same.  If conversion functions are added for new $build/$host combinations,\n# the two new functions must follow this pattern, or func_init_to_host_path_cmd\n# will break.\n\n\n# func_init_to_host_path_cmd\n# Ensures that function \"pointer\" variable $to_host_path_cmd is set to the\n# appropriate value, based on the value of $to_host_file_cmd.\nto_host_path_cmd=\nfunc_init_to_host_path_cmd ()\n{\n  $debug_cmd\n\n  if test -z \"$to_host_path_cmd\"; then\n    func_stripname 'func_convert_file_' '' \"$to_host_file_cmd\"\n    to_host_path_cmd=func_convert_path_$func_stripname_result\n  fi\n}\n\n\n# func_to_host_path ARG\n# Converts the path ARG from $build format to $host format. Return result\n# in func_to_host_path_result.\nfunc_to_host_path ()\n{\n  $debug_cmd\n\n  func_init_to_host_path_cmd\n  $to_host_path_cmd \"$1\"\n}\n# end func_to_host_path\n\n\n# func_convert_path_noop ARG\n# Copy ARG to func_to_host_path_result.\nfunc_convert_path_noop ()\n{\n  func_to_host_path_result=$1\n}\n# end func_convert_path_noop\n\n\n# func_convert_path_msys_to_w32 ARG\n# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic\n# conversion to w32 is not available inside the cwrapper.  Returns result in\n# func_to_host_path_result.\nfunc_convert_path_msys_to_w32 ()\n{\n  $debug_cmd\n\n  func_to_host_path_result=$1\n  if test -n \"$1\"; then\n    # Remove leading and trailing path separator characters from ARG.  MSYS\n    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';\n    # and winepath ignores them completely.\n    func_stripname : : \"$1\"\n    func_to_host_path_tmp1=$func_stripname_result\n    func_convert_core_msys_to_w32 \"$func_to_host_path_tmp1\"\n    func_to_host_path_result=$func_convert_core_msys_to_w32_result\n    func_convert_path_check : \";\" \\\n      \"$func_to_host_path_tmp1\" \"$func_to_host_path_result\"\n    func_convert_path_front_back_pathsep \":*\" \"*:\" \";\" \"$1\"\n  fi\n}\n# end func_convert_path_msys_to_w32\n\n\n# func_convert_path_cygwin_to_w32 ARG\n# Convert path ARG from Cygwin to w32 format.  Returns result in\n# func_to_host_file_result.\nfunc_convert_path_cygwin_to_w32 ()\n{\n  $debug_cmd\n\n  func_to_host_path_result=$1\n  if test -n \"$1\"; then\n    # See func_convert_path_msys_to_w32:\n    func_stripname : : \"$1\"\n    func_to_host_path_tmp1=$func_stripname_result\n    func_to_host_path_result=`cygpath -m -p \"$func_to_host_path_tmp1\"`\n    func_convert_path_check : \";\" \\\n      \"$func_to_host_path_tmp1\" \"$func_to_host_path_result\"\n    func_convert_path_front_back_pathsep \":*\" \"*:\" \";\" \"$1\"\n  fi\n}\n# end func_convert_path_cygwin_to_w32\n\n\n# func_convert_path_nix_to_w32 ARG\n# Convert path ARG from *nix to w32 format.  Requires a wine environment and\n# a working winepath.  Returns result in func_to_host_file_result.\nfunc_convert_path_nix_to_w32 ()\n{\n  $debug_cmd\n\n  func_to_host_path_result=$1\n  if test -n \"$1\"; then\n    # See func_convert_path_msys_to_w32:\n    func_stripname : : \"$1\"\n    func_to_host_path_tmp1=$func_stripname_result\n    func_convert_core_path_wine_to_w32 \"$func_to_host_path_tmp1\"\n    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result\n    func_convert_path_check : \";\" \\\n      \"$func_to_host_path_tmp1\" \"$func_to_host_path_result\"\n    func_convert_path_front_back_pathsep \":*\" \"*:\" \";\" \"$1\"\n  fi\n}\n# end func_convert_path_nix_to_w32\n\n\n# func_convert_path_msys_to_cygwin ARG\n# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.\n# Returns result in func_to_host_file_result.\nfunc_convert_path_msys_to_cygwin ()\n{\n  $debug_cmd\n\n  func_to_host_path_result=$1\n  if test -n \"$1\"; then\n    # See func_convert_path_msys_to_w32:\n    func_stripname : : \"$1\"\n    func_to_host_path_tmp1=$func_stripname_result\n    func_convert_core_msys_to_w32 \"$func_to_host_path_tmp1\"\n    func_cygpath -u -p \"$func_convert_core_msys_to_w32_result\"\n    func_to_host_path_result=$func_cygpath_result\n    func_convert_path_check : : \\\n      \"$func_to_host_path_tmp1\" \"$func_to_host_path_result\"\n    func_convert_path_front_back_pathsep \":*\" \"*:\" : \"$1\"\n  fi\n}\n# end func_convert_path_msys_to_cygwin\n\n\n# func_convert_path_nix_to_cygwin ARG\n# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a\n# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in\n# func_to_host_file_result.\nfunc_convert_path_nix_to_cygwin ()\n{\n  $debug_cmd\n\n  func_to_host_path_result=$1\n  if test -n \"$1\"; then\n    # Remove leading and trailing path separator characters from\n    # ARG. msys behavior is inconsistent here, cygpath turns them\n    # into '.;' and ';.', and winepath ignores them completely.\n    func_stripname : : \"$1\"\n    func_to_host_path_tmp1=$func_stripname_result\n    func_convert_core_path_wine_to_w32 \"$func_to_host_path_tmp1\"\n    func_cygpath -u -p \"$func_convert_core_path_wine_to_w32_result\"\n    func_to_host_path_result=$func_cygpath_result\n    func_convert_path_check : : \\\n      \"$func_to_host_path_tmp1\" \"$func_to_host_path_result\"\n    func_convert_path_front_back_pathsep \":*\" \"*:\" : \"$1\"\n  fi\n}\n# end func_convert_path_nix_to_cygwin\n\n\n# func_dll_def_p FILE\n# True iff FILE is a Windows DLL '.def' file.\n# Keep in sync with _LT_DLL_DEF_P in libtool.m4\nfunc_dll_def_p ()\n{\n  $debug_cmd\n\n  func_dll_def_p_tmp=`$SED -n \\\n    -e 's/^[\t ]*//' \\\n    -e '/^\\(;.*\\)*$/d' \\\n    -e 's/^\\(EXPORTS\\|LIBRARY\\)\\([\t ].*\\)*$/DEF/p' \\\n    -e q \\\n    \"$1\"`\n  test DEF = \"$func_dll_def_p_tmp\"\n}\n\n\n# func_mode_compile arg...\nfunc_mode_compile ()\n{\n    $debug_cmd\n\n    # Get the compilation command and the source file.\n    base_compile=\n    srcfile=$nonopt  #  always keep a non-empty value in \"srcfile\"\n    suppress_opt=yes\n    suppress_output=\n    arg_mode=normal\n    libobj=\n    later=\n    pie_flag=\n\n    for arg\n    do\n      case $arg_mode in\n      arg  )\n\t# do not \"continue\".  Instead, add this to base_compile\n\tlastarg=$arg\n\targ_mode=normal\n\t;;\n\n      target )\n\tlibobj=$arg\n\targ_mode=normal\n\tcontinue\n\t;;\n\n      normal )\n\t# Accept any command-line options.\n\tcase $arg in\n\t-o)\n\t  test -n \"$libobj\" && \\\n\t    func_fatal_error \"you cannot specify '-o' more than once\"\n\t  arg_mode=target\n\t  continue\n\t  ;;\n\n\t-pie | -fpie | -fPIE)\n          func_append pie_flag \" $arg\"\n\t  continue\n\t  ;;\n\n\t-shared | -static | -prefer-pic | -prefer-non-pic)\n\t  func_append later \" $arg\"\n\t  continue\n\t  ;;\n\n\t-no-suppress)\n\t  suppress_opt=no\n\t  continue\n\t  ;;\n\n\t-Xcompiler)\n\t  arg_mode=arg  #  the next one goes into the \"base_compile\" arg list\n\t  continue      #  The current \"srcfile\" will either be retained or\n\t  ;;            #  replaced later.  I would guess that would be a bug.\n\n\t-Wc,*)\n\t  func_stripname '-Wc,' '' \"$arg\"\n\t  args=$func_stripname_result\n\t  lastarg=\n\t  save_ifs=$IFS; IFS=,\n\t  for arg in $args; do\n\t    IFS=$save_ifs\n\t    func_append_quoted lastarg \"$arg\"\n\t  done\n\t  IFS=$save_ifs\n\t  func_stripname ' ' '' \"$lastarg\"\n\t  lastarg=$func_stripname_result\n\n\t  # Add the arguments to base_compile.\n\t  func_append base_compile \" $lastarg\"\n\t  continue\n\t  ;;\n\n\t*)\n\t  # Accept the current argument as the source file.\n\t  # The previous \"srcfile\" becomes the current argument.\n\t  #\n\t  lastarg=$srcfile\n\t  srcfile=$arg\n\t  ;;\n\tesac  #  case $arg\n\t;;\n      esac    #  case $arg_mode\n\n      # Aesthetically quote the previous argument.\n      func_append_quoted base_compile \"$lastarg\"\n    done # for arg\n\n    case $arg_mode in\n    arg)\n      func_fatal_error \"you must specify an argument for -Xcompile\"\n      ;;\n    target)\n      func_fatal_error \"you must specify a target with '-o'\"\n      ;;\n    *)\n      # Get the name of the library object.\n      test -z \"$libobj\" && {\n\tfunc_basename \"$srcfile\"\n\tlibobj=$func_basename_result\n      }\n      ;;\n    esac\n\n    # Recognize several different file suffixes.\n    # If the user specifies -o file.o, it is replaced with file.lo\n    case $libobj in\n    *.[cCFSifmso] | \\\n    *.ada | *.adb | *.ads | *.asm | \\\n    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \\\n    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)\n      func_xform \"$libobj\"\n      libobj=$func_xform_result\n      ;;\n    esac\n\n    case $libobj in\n    *.lo) func_lo2o \"$libobj\"; obj=$func_lo2o_result ;;\n    *)\n      func_fatal_error \"cannot determine name of library object from '$libobj'\"\n      ;;\n    esac\n\n    func_infer_tag $base_compile\n\n    for arg in $later; do\n      case $arg in\n      -shared)\n\ttest yes = \"$build_libtool_libs\" \\\n\t  || func_fatal_configuration \"cannot build a shared library\"\n\tbuild_old_libs=no\n\tcontinue\n\t;;\n\n      -static)\n\tbuild_libtool_libs=no\n\tbuild_old_libs=yes\n\tcontinue\n\t;;\n\n      -prefer-pic)\n\tpic_mode=yes\n\tcontinue\n\t;;\n\n      -prefer-non-pic)\n\tpic_mode=no\n\tcontinue\n\t;;\n      esac\n    done\n\n    func_quote_for_eval \"$libobj\"\n    test \"X$libobj\" != \"X$func_quote_for_eval_result\" \\\n      && $ECHO \"X$libobj\" | $GREP '[]~#^*{};<>?\"'\"'\"'\t &()|`$[]' \\\n      && func_warning \"libobj name '$libobj' may not contain shell special characters.\"\n    func_dirname_and_basename \"$obj\" \"/\" \"\"\n    objname=$func_basename_result\n    xdir=$func_dirname_result\n    lobj=$xdir$objdir/$objname\n\n    test -z \"$base_compile\" && \\\n      func_fatal_help \"you must specify a compilation command\"\n\n    # Delete any leftover library objects.\n    if test yes = \"$build_old_libs\"; then\n      removelist=\"$obj $lobj $libobj ${libobj}T\"\n    else\n      removelist=\"$lobj $libobj ${libobj}T\"\n    fi\n\n    # On Cygwin there's no \"real\" PIC flag so we must build both object types\n    case $host_os in\n    cygwin* | mingw* | pw32* | os2* | cegcc*)\n      pic_mode=default\n      ;;\n    esac\n    if test no = \"$pic_mode\" && test pass_all != \"$deplibs_check_method\"; then\n      # non-PIC code in shared libraries is not supported\n      pic_mode=default\n    fi\n\n    # Calculate the filename of the output object if compiler does\n    # not support -o with -c\n    if test no = \"$compiler_c_o\"; then\n      output_obj=`$ECHO \"$srcfile\" | $SED 's%^.*/%%; s%\\.[^.]*$%%'`.$objext\n      lockfile=$output_obj.lock\n    else\n      output_obj=\n      need_locks=no\n      lockfile=\n    fi\n\n    # Lock this critical section if it is needed\n    # We use this script file to make the link, it avoids creating a new file\n    if test yes = \"$need_locks\"; then\n      until $opt_dry_run || ln \"$progpath\" \"$lockfile\" 2>/dev/null; do\n\tfunc_echo \"Waiting for $lockfile to be removed\"\n\tsleep 2\n      done\n    elif test warn = \"$need_locks\"; then\n      if test -f \"$lockfile\"; then\n\t$ECHO \"\\\n*** ERROR, $lockfile exists and contains:\n`cat $lockfile 2>/dev/null`\n\nThis indicates that another process is trying to use the same\ntemporary object file, and libtool could not work around it because\nyour compiler does not support '-c' and '-o' together.  If you\nrepeat this compilation, it may succeed, by chance, but you had better\navoid parallel builds (make -j) in this platform, or get a better\ncompiler.\"\n\n\t$opt_dry_run || $RM $removelist\n\texit $EXIT_FAILURE\n      fi\n      func_append removelist \" $output_obj\"\n      $ECHO \"$srcfile\" > \"$lockfile\"\n    fi\n\n    $opt_dry_run || $RM $removelist\n    func_append removelist \" $lockfile\"\n    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15\n\n    func_to_tool_file \"$srcfile\" func_convert_file_msys_to_w32\n    srcfile=$func_to_tool_file_result\n    func_quote_for_eval \"$srcfile\"\n    qsrcfile=$func_quote_for_eval_result\n\n    # Only build a PIC object if we are building libtool libraries.\n    if test yes = \"$build_libtool_libs\"; then\n      # Without this assignment, base_compile gets emptied.\n      fbsd_hideous_sh_bug=$base_compile\n\n      if test no != \"$pic_mode\"; then\n\tcommand=\"$base_compile $qsrcfile $pic_flag\"\n      else\n\t# Don't build PIC code\n\tcommand=\"$base_compile $qsrcfile\"\n      fi\n\n      func_mkdir_p \"$xdir$objdir\"\n\n      if test -z \"$output_obj\"; then\n\t# Place PIC objects in $objdir\n\tfunc_append command \" -o $lobj\"\n      fi\n\n      func_show_eval_locale \"$command\"\t\\\n          'test -n \"$output_obj\" && $RM $removelist; exit $EXIT_FAILURE'\n\n      if test warn = \"$need_locks\" &&\n\t test \"X`cat $lockfile 2>/dev/null`\" != \"X$srcfile\"; then\n\t$ECHO \"\\\n*** ERROR, $lockfile contains:\n`cat $lockfile 2>/dev/null`\n\nbut it should contain:\n$srcfile\n\nThis indicates that another process is trying to use the same\ntemporary object file, and libtool could not work around it because\nyour compiler does not support '-c' and '-o' together.  If you\nrepeat this compilation, it may succeed, by chance, but you had better\navoid parallel builds (make -j) in this platform, or get a better\ncompiler.\"\n\n\t$opt_dry_run || $RM $removelist\n\texit $EXIT_FAILURE\n      fi\n\n      # Just move the object if needed, then go on to compile the next one\n      if test -n \"$output_obj\" && test \"X$output_obj\" != \"X$lobj\"; then\n\tfunc_show_eval '$MV \"$output_obj\" \"$lobj\"' \\\n\t  'error=$?; $opt_dry_run || $RM $removelist; exit $error'\n      fi\n\n      # Allow error messages only from the first compilation.\n      if test yes = \"$suppress_opt\"; then\n\tsuppress_output=' >/dev/null 2>&1'\n      fi\n    fi\n\n    # Only build a position-dependent object if we build old libraries.\n    if test yes = \"$build_old_libs\"; then\n      if test yes != \"$pic_mode\"; then\n\t# Don't build PIC code\n\tcommand=\"$base_compile $qsrcfile$pie_flag\"\n      else\n\tcommand=\"$base_compile $qsrcfile $pic_flag\"\n      fi\n      if test yes = \"$compiler_c_o\"; then\n\tfunc_append command \" -o $obj\"\n      fi\n\n      # Suppress compiler output if we already did a PIC compilation.\n      func_append command \"$suppress_output\"\n      func_show_eval_locale \"$command\" \\\n        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'\n\n      if test warn = \"$need_locks\" &&\n\t test \"X`cat $lockfile 2>/dev/null`\" != \"X$srcfile\"; then\n\t$ECHO \"\\\n*** ERROR, $lockfile contains:\n`cat $lockfile 2>/dev/null`\n\nbut it should contain:\n$srcfile\n\nThis indicates that another process is trying to use the same\ntemporary object file, and libtool could not work around it because\nyour compiler does not support '-c' and '-o' together.  If you\nrepeat this compilation, it may succeed, by chance, but you had better\navoid parallel builds (make -j) in this platform, or get a better\ncompiler.\"\n\n\t$opt_dry_run || $RM $removelist\n\texit $EXIT_FAILURE\n      fi\n\n      # Just move the object if needed\n      if test -n \"$output_obj\" && test \"X$output_obj\" != \"X$obj\"; then\n\tfunc_show_eval '$MV \"$output_obj\" \"$obj\"' \\\n\t  'error=$?; $opt_dry_run || $RM $removelist; exit $error'\n      fi\n    fi\n\n    $opt_dry_run || {\n      func_write_libtool_object \"$libobj\" \"$objdir/$objname\" \"$objname\"\n\n      # Unlock the critical section if it was locked\n      if test no != \"$need_locks\"; then\n\tremovelist=$lockfile\n        $RM \"$lockfile\"\n      fi\n    }\n\n    exit $EXIT_SUCCESS\n}\n\n$opt_help || {\n  test compile = \"$opt_mode\" && func_mode_compile ${1+\"$@\"}\n}\n\nfunc_mode_help ()\n{\n    # We need to display help for each of the modes.\n    case $opt_mode in\n      \"\")\n        # Generic help is extracted from the usage comments\n        # at the start of this file.\n        func_help\n        ;;\n\n      clean)\n        $ECHO \\\n\"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...\n\nRemove files from the build directory.\n\nRM is the name of the program to use to delete files associated with each FILE\n(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed\nto RM.\n\nIf FILE is a libtool library, object or program, all the files associated\nwith it are deleted. Otherwise, only FILE itself is deleted using RM.\"\n        ;;\n\n      compile)\n      $ECHO \\\n\"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE\n\nCompile a source file into a libtool library object.\n\nThis mode accepts the following additional options:\n\n  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE\n  -no-suppress      do not suppress compiler output for multiple passes\n  -prefer-pic       try to build PIC objects only\n  -prefer-non-pic   try to build non-PIC objects only\n  -shared           do not build a '.o' file suitable for static linking\n  -static           only build a '.o' file suitable for static linking\n  -Wc,FLAG          pass FLAG directly to the compiler\n\nCOMPILE-COMMAND is a command to be used in creating a 'standard' object file\nfrom the given SOURCEFILE.\n\nThe output file name is determined by removing the directory component from\nSOURCEFILE, then substituting the C source code suffix '.c' with the\nlibrary object suffix, '.lo'.\"\n        ;;\n\n      execute)\n        $ECHO \\\n\"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...\n\nAutomatically set library path, then run a program.\n\nThis mode accepts the following additional options:\n\n  -dlopen FILE      add the directory containing FILE to the library path\n\nThis mode sets the library path environment variable according to '-dlopen'\nflags.\n\nIf any of the ARGS are libtool executable wrappers, then they are translated\ninto their corresponding uninstalled binary, and any of their required library\ndirectories are added to the library path.\n\nThen, COMMAND is executed, with ARGS as arguments.\"\n        ;;\n\n      finish)\n        $ECHO \\\n\"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...\n\nComplete the installation of libtool libraries.\n\nEach LIBDIR is a directory that contains libtool libraries.\n\nThe commands that this mode executes may require superuser privileges.  Use\nthe '--dry-run' option if you just want to see what would be executed.\"\n        ;;\n\n      install)\n        $ECHO \\\n\"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...\n\nInstall executables or libraries.\n\nINSTALL-COMMAND is the installation command.  The first component should be\neither the 'install' or 'cp' program.\n\nThe following components of INSTALL-COMMAND are treated specially:\n\n  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation\n\nThe rest of the components are interpreted as arguments to that command (only\nBSD-compatible install options are recognized).\"\n        ;;\n\n      link)\n        $ECHO \\\n\"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...\n\nLink object files or libraries together to form another library, or to\ncreate an executable program.\n\nLINK-COMMAND is a command using the C compiler that you would use to create\na program from several object files.\n\nThe following components of LINK-COMMAND are treated specially:\n\n  -all-static       do not do any dynamic linking at all\n  -avoid-version    do not add a version suffix if possible\n  -bindir BINDIR    specify path to binaries directory (for systems where\n                    libraries must be found in the PATH setting at runtime)\n  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime\n  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols\n  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)\n  -export-symbols SYMFILE\n                    try to export only the symbols listed in SYMFILE\n  -export-symbols-regex REGEX\n                    try to export only the symbols matching REGEX\n  -LLIBDIR          search LIBDIR for required installed libraries\n  -lNAME            OUTPUT-FILE requires the installed library libNAME\n  -module           build a library that can dlopened\n  -no-fast-install  disable the fast-install mode\n  -no-install       link a not-installable executable\n  -no-undefined     declare that a library does not refer to external symbols\n  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects\n  -objectlist FILE  use a list of object files found in FILE to specify objects\n  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)\n  -precious-files-regex REGEX\n                    don't remove output files matching REGEX\n  -release RELEASE  specify package release information\n  -rpath LIBDIR     the created library will eventually be installed in LIBDIR\n  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries\n  -shared           only do dynamic linking of libtool libraries\n  -shrext SUFFIX    override the standard shared library file extension\n  -static           do not do any dynamic linking of uninstalled libtool libraries\n  -static-libtool-libs\n                    do not do any dynamic linking of libtool libraries\n  -version-info CURRENT[:REVISION[:AGE]]\n                    specify library version info [each variable defaults to 0]\n  -weak LIBNAME     declare that the target provides the LIBNAME interface\n  -Wc,FLAG\n  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler\n  -Wl,FLAG\n  -Xlinker FLAG     pass linker-specific FLAG directly to the linker\n  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)\n\nAll other options (arguments beginning with '-') are ignored.\n\nEvery other argument is treated as a filename.  Files ending in '.la' are\ntreated as uninstalled libtool libraries, other files are standard or library\nobject files.\n\nIf the OUTPUT-FILE ends in '.la', then a libtool library is created,\nonly library objects ('.lo' files) may be specified, and '-rpath' is\nrequired, except when creating a convenience library.\n\nIf OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created\nusing 'ar' and 'ranlib', or on Windows using 'lib'.\n\nIf OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file\nis created, otherwise an executable program is created.\"\n        ;;\n\n      uninstall)\n        $ECHO \\\n\"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...\n\nRemove libraries from an installation directory.\n\nRM is the name of the program to use to delete files associated with each FILE\n(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed\nto RM.\n\nIf FILE is a libtool library, all the files associated with it are deleted.\nOtherwise, only FILE itself is deleted using RM.\"\n        ;;\n\n      *)\n        func_fatal_help \"invalid operation mode '$opt_mode'\"\n        ;;\n    esac\n\n    echo\n    $ECHO \"Try '$progname --help' for more information about other modes.\"\n}\n\n# Now that we've collected a possible --mode arg, show help if necessary\nif $opt_help; then\n  if test : = \"$opt_help\"; then\n    func_mode_help\n  else\n    {\n      func_help noexit\n      for opt_mode in compile link execute install finish uninstall clean; do\n\tfunc_mode_help\n      done\n    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'\n    {\n      func_help noexit\n      for opt_mode in compile link execute install finish uninstall clean; do\n\techo\n\tfunc_mode_help\n      done\n    } |\n    $SED '1d\n      /^When reporting/,/^Report/{\n\tH\n\td\n      }\n      $x\n      /information about other modes/d\n      /more detailed .*MODE/d\n      s/^Usage:.*--mode=\\([^ ]*\\) .*/Description of \\1 mode:/'\n  fi\n  exit $?\nfi\n\n\n# func_mode_execute arg...\nfunc_mode_execute ()\n{\n    $debug_cmd\n\n    # The first argument is the command name.\n    cmd=$nonopt\n    test -z \"$cmd\" && \\\n      func_fatal_help \"you must specify a COMMAND\"\n\n    # Handle -dlopen flags immediately.\n    for file in $opt_dlopen; do\n      test -f \"$file\" \\\n\t|| func_fatal_help \"'$file' is not a file\"\n\n      dir=\n      case $file in\n      *.la)\n\tfunc_resolve_sysroot \"$file\"\n\tfile=$func_resolve_sysroot_result\n\n\t# Check to see that this really is a libtool archive.\n\tfunc_lalib_unsafe_p \"$file\" \\\n\t  || func_fatal_help \"'$lib' is not a valid libtool archive\"\n\n\t# Read the libtool library.\n\tdlname=\n\tlibrary_names=\n\tfunc_source \"$file\"\n\n\t# Skip this library if it cannot be dlopened.\n\tif test -z \"$dlname\"; then\n\t  # Warn if it was a shared library.\n\t  test -n \"$library_names\" && \\\n\t    func_warning \"'$file' was not linked with '-export-dynamic'\"\n\t  continue\n\tfi\n\n\tfunc_dirname \"$file\" \"\" \".\"\n\tdir=$func_dirname_result\n\n\tif test -f \"$dir/$objdir/$dlname\"; then\n\t  func_append dir \"/$objdir\"\n\telse\n\t  if test ! -f \"$dir/$dlname\"; then\n\t    func_fatal_error \"cannot find '$dlname' in '$dir' or '$dir/$objdir'\"\n\t  fi\n\tfi\n\t;;\n\n      *.lo)\n\t# Just add the directory containing the .lo file.\n\tfunc_dirname \"$file\" \"\" \".\"\n\tdir=$func_dirname_result\n\t;;\n\n      *)\n\tfunc_warning \"'-dlopen' is ignored for non-libtool libraries and objects\"\n\tcontinue\n\t;;\n      esac\n\n      # Get the absolute pathname.\n      absdir=`cd \"$dir\" && pwd`\n      test -n \"$absdir\" && dir=$absdir\n\n      # Now add the directory to shlibpath_var.\n      if eval \"test -z \\\"\\$$shlibpath_var\\\"\"; then\n\teval \"$shlibpath_var=\\\"\\$dir\\\"\"\n      else\n\teval \"$shlibpath_var=\\\"\\$dir:\\$$shlibpath_var\\\"\"\n      fi\n    done\n\n    # This variable tells wrapper scripts just to set shlibpath_var\n    # rather than running their programs.\n    libtool_execute_magic=$magic\n\n    # Check if any of the arguments is a wrapper script.\n    args=\n    for file\n    do\n      case $file in\n      -* | *.la | *.lo ) ;;\n      *)\n\t# Do a test to see if this is really a libtool program.\n\tif func_ltwrapper_script_p \"$file\"; then\n\t  func_source \"$file\"\n\t  # Transform arg to wrapped name.\n\t  file=$progdir/$program\n\telif func_ltwrapper_executable_p \"$file\"; then\n\t  func_ltwrapper_scriptname \"$file\"\n\t  func_source \"$func_ltwrapper_scriptname_result\"\n\t  # Transform arg to wrapped name.\n\t  file=$progdir/$program\n\tfi\n\t;;\n      esac\n      # Quote arguments (to preserve shell metacharacters).\n      func_append_quoted args \"$file\"\n    done\n\n    if $opt_dry_run; then\n      # Display what would be done.\n      if test -n \"$shlibpath_var\"; then\n\teval \"\\$ECHO \\\"\\$shlibpath_var=\\$$shlibpath_var\\\"\"\n\techo \"export $shlibpath_var\"\n      fi\n      $ECHO \"$cmd$args\"\n      exit $EXIT_SUCCESS\n    else\n      if test -n \"$shlibpath_var\"; then\n\t# Export the shlibpath_var.\n\teval \"export $shlibpath_var\"\n      fi\n\n      # Restore saved environment variables\n      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES\n      do\n\teval \"if test \\\"\\${save_$lt_var+set}\\\" = set; then\n                $lt_var=\\$save_$lt_var; export $lt_var\n\t      else\n\t\t$lt_unset $lt_var\n\t      fi\"\n      done\n\n      # Now prepare to actually exec the command.\n      exec_cmd=\\$cmd$args\n    fi\n}\n\ntest execute = \"$opt_mode\" && func_mode_execute ${1+\"$@\"}\n\n\n# func_mode_finish arg...\nfunc_mode_finish ()\n{\n    $debug_cmd\n\n    libs=\n    libdirs=\n    admincmds=\n\n    for opt in \"$nonopt\" ${1+\"$@\"}\n    do\n      if test -d \"$opt\"; then\n\tfunc_append libdirs \" $opt\"\n\n      elif test -f \"$opt\"; then\n\tif func_lalib_unsafe_p \"$opt\"; then\n\t  func_append libs \" $opt\"\n\telse\n\t  func_warning \"'$opt' is not a valid libtool archive\"\n\tfi\n\n      else\n\tfunc_fatal_error \"invalid argument '$opt'\"\n      fi\n    done\n\n    if test -n \"$libs\"; then\n      if test -n \"$lt_sysroot\"; then\n        sysroot_regex=`$ECHO \"$lt_sysroot\" | $SED \"$sed_make_literal_regex\"`\n        sysroot_cmd=\"s/\\([ ']\\)$sysroot_regex/\\1/g;\"\n      else\n        sysroot_cmd=\n      fi\n\n      # Remove sysroot references\n      if $opt_dry_run; then\n        for lib in $libs; do\n          echo \"removing references to $lt_sysroot and '=' prefixes from $lib\"\n        done\n      else\n        tmpdir=`func_mktempdir`\n        for lib in $libs; do\n\t  $SED -e \"$sysroot_cmd s/\\([ ']-[LR]\\)=/\\1/g; s/\\([ ']\\)=/\\1/g\" $lib \\\n\t    > $tmpdir/tmp-la\n\t  mv -f $tmpdir/tmp-la $lib\n\tdone\n        ${RM}r \"$tmpdir\"\n      fi\n    fi\n\n    if test -n \"$finish_cmds$finish_eval\" && test -n \"$libdirs\"; then\n      for libdir in $libdirs; do\n\tif test -n \"$finish_cmds\"; then\n\t  # Do each command in the finish commands.\n\t  func_execute_cmds \"$finish_cmds\" 'admincmds=\"$admincmds\n'\"$cmd\"'\"'\n\tfi\n\tif test -n \"$finish_eval\"; then\n\t  # Do the single finish_eval.\n\t  eval cmds=\\\"$finish_eval\\\"\n\t  $opt_dry_run || eval \"$cmds\" || func_append admincmds \"\n       $cmds\"\n\tfi\n      done\n    fi\n\n    # Exit here if they wanted silent mode.\n    $opt_quiet && exit $EXIT_SUCCESS\n\n    if test -n \"$finish_cmds$finish_eval\" && test -n \"$libdirs\"; then\n      echo \"----------------------------------------------------------------------\"\n      echo \"Libraries have been installed in:\"\n      for libdir in $libdirs; do\n\t$ECHO \"   $libdir\"\n      done\n      echo\n      echo \"If you ever happen to want to link against installed libraries\"\n      echo \"in a given directory, LIBDIR, you must either use libtool, and\"\n      echo \"specify the full pathname of the library, or use the '-LLIBDIR'\"\n      echo \"flag during linking and do at least one of the following:\"\n      if test -n \"$shlibpath_var\"; then\n\techo \"   - add LIBDIR to the '$shlibpath_var' environment variable\"\n\techo \"     during execution\"\n      fi\n      if test -n \"$runpath_var\"; then\n\techo \"   - add LIBDIR to the '$runpath_var' environment variable\"\n\techo \"     during linking\"\n      fi\n      if test -n \"$hardcode_libdir_flag_spec\"; then\n\tlibdir=LIBDIR\n\teval flag=\\\"$hardcode_libdir_flag_spec\\\"\n\n\t$ECHO \"   - use the '$flag' linker flag\"\n      fi\n      if test -n \"$admincmds\"; then\n\t$ECHO \"   - have your system administrator run these commands:$admincmds\"\n      fi\n      if test -f /etc/ld.so.conf; then\n\techo \"   - have your system administrator add LIBDIR to '/etc/ld.so.conf'\"\n      fi\n      echo\n\n      echo \"See any operating system documentation about shared libraries for\"\n      case $host in\n\tsolaris2.[6789]|solaris2.1[0-9])\n\t  echo \"more information, such as the ld(1), crle(1) and ld.so(8) manual\"\n\t  echo \"pages.\"\n\t  ;;\n\t*)\n\t  echo \"more information, such as the ld(1) and ld.so(8) manual pages.\"\n\t  ;;\n      esac\n      echo \"----------------------------------------------------------------------\"\n    fi\n    exit $EXIT_SUCCESS\n}\n\ntest finish = \"$opt_mode\" && func_mode_finish ${1+\"$@\"}\n\n\n# func_mode_install arg...\nfunc_mode_install ()\n{\n    $debug_cmd\n\n    # There may be an optional sh(1) argument at the beginning of\n    # install_prog (especially on Windows NT).\n    if test \"$SHELL\" = \"$nonopt\" || test /bin/sh = \"$nonopt\" ||\n       # Allow the use of GNU shtool's install command.\n       case $nonopt in *shtool*) :;; *) false;; esac\n    then\n      # Aesthetically quote it.\n      func_quote_for_eval \"$nonopt\"\n      install_prog=\"$func_quote_for_eval_result \"\n      arg=$1\n      shift\n    else\n      install_prog=\n      arg=$nonopt\n    fi\n\n    # The real first argument should be the name of the installation program.\n    # Aesthetically quote it.\n    func_quote_for_eval \"$arg\"\n    func_append install_prog \"$func_quote_for_eval_result\"\n    install_shared_prog=$install_prog\n    case \" $install_prog \" in\n      *[\\\\\\ /]cp\\ *) install_cp=: ;;\n      *) install_cp=false ;;\n    esac\n\n    # We need to accept at least all the BSD install flags.\n    dest=\n    files=\n    opts=\n    prev=\n    install_type=\n    isdir=false\n    stripme=\n    no_mode=:\n    for arg\n    do\n      arg2=\n      if test -n \"$dest\"; then\n\tfunc_append files \" $dest\"\n\tdest=$arg\n\tcontinue\n      fi\n\n      case $arg in\n      -d) isdir=: ;;\n      -f)\n\tif $install_cp; then :; else\n\t  prev=$arg\n\tfi\n\t;;\n      -g | -m | -o)\n\tprev=$arg\n\t;;\n      -s)\n\tstripme=\" -s\"\n\tcontinue\n\t;;\n      -*)\n\t;;\n      *)\n\t# If the previous option needed an argument, then skip it.\n\tif test -n \"$prev\"; then\n\t  if test X-m = \"X$prev\" && test -n \"$install_override_mode\"; then\n\t    arg2=$install_override_mode\n\t    no_mode=false\n\t  fi\n\t  prev=\n\telse\n\t  dest=$arg\n\t  continue\n\tfi\n\t;;\n      esac\n\n      # Aesthetically quote the argument.\n      func_quote_for_eval \"$arg\"\n      func_append install_prog \" $func_quote_for_eval_result\"\n      if test -n \"$arg2\"; then\n\tfunc_quote_for_eval \"$arg2\"\n      fi\n      func_append install_shared_prog \" $func_quote_for_eval_result\"\n    done\n\n    test -z \"$install_prog\" && \\\n      func_fatal_help \"you must specify an install program\"\n\n    test -n \"$prev\" && \\\n      func_fatal_help \"the '$prev' option requires an argument\"\n\n    if test -n \"$install_override_mode\" && $no_mode; then\n      if $install_cp; then :; else\n\tfunc_quote_for_eval \"$install_override_mode\"\n\tfunc_append install_shared_prog \" -m $func_quote_for_eval_result\"\n      fi\n    fi\n\n    if test -z \"$files\"; then\n      if test -z \"$dest\"; then\n\tfunc_fatal_help \"no file or destination specified\"\n      else\n\tfunc_fatal_help \"you must specify a destination\"\n      fi\n    fi\n\n    # Strip any trailing slash from the destination.\n    func_stripname '' '/' \"$dest\"\n    dest=$func_stripname_result\n\n    # Check to see that the destination is a directory.\n    test -d \"$dest\" && isdir=:\n    if $isdir; then\n      destdir=$dest\n      destname=\n    else\n      func_dirname_and_basename \"$dest\" \"\" \".\"\n      destdir=$func_dirname_result\n      destname=$func_basename_result\n\n      # Not a directory, so check to see that there is only one file specified.\n      set dummy $files; shift\n      test \"$#\" -gt 1 && \\\n\tfunc_fatal_help \"'$dest' is not a directory\"\n    fi\n    case $destdir in\n    [\\\\/]* | [A-Za-z]:[\\\\/]*) ;;\n    *)\n      for file in $files; do\n\tcase $file in\n\t*.lo) ;;\n\t*)\n\t  func_fatal_help \"'$destdir' must be an absolute directory name\"\n\t  ;;\n\tesac\n      done\n      ;;\n    esac\n\n    # This variable tells wrapper scripts just to set variables rather\n    # than running their programs.\n    libtool_install_magic=$magic\n\n    staticlibs=\n    future_libdirs=\n    current_libdirs=\n    for file in $files; do\n\n      # Do each installation.\n      case $file in\n      *.$libext)\n\t# Do the static libraries later.\n\tfunc_append staticlibs \" $file\"\n\t;;\n\n      *.la)\n\tfunc_resolve_sysroot \"$file\"\n\tfile=$func_resolve_sysroot_result\n\n\t# Check to see that this really is a libtool archive.\n\tfunc_lalib_unsafe_p \"$file\" \\\n\t  || func_fatal_help \"'$file' is not a valid libtool archive\"\n\n\tlibrary_names=\n\told_library=\n\trelink_command=\n\tfunc_source \"$file\"\n\n\t# Add the libdir to current_libdirs if it is the destination.\n\tif test \"X$destdir\" = \"X$libdir\"; then\n\t  case \"$current_libdirs \" in\n\t  *\" $libdir \"*) ;;\n\t  *) func_append current_libdirs \" $libdir\" ;;\n\t  esac\n\telse\n\t  # Note the libdir as a future libdir.\n\t  case \"$future_libdirs \" in\n\t  *\" $libdir \"*) ;;\n\t  *) func_append future_libdirs \" $libdir\" ;;\n\t  esac\n\tfi\n\n\tfunc_dirname \"$file\" \"/\" \"\"\n\tdir=$func_dirname_result\n\tfunc_append dir \"$objdir\"\n\n\tif test -n \"$relink_command\"; then\n\t  # Determine the prefix the user has applied to our future dir.\n\t  inst_prefix_dir=`$ECHO \"$destdir\" | $SED -e \"s%$libdir\\$%%\"`\n\n\t  # Don't allow the user to place us outside of our expected\n\t  # location b/c this prevents finding dependent libraries that\n\t  # are installed to the same prefix.\n\t  # At present, this check doesn't affect windows .dll's that\n\t  # are installed into $libdir/../bin (currently, that works fine)\n\t  # but it's something to keep an eye on.\n\t  test \"$inst_prefix_dir\" = \"$destdir\" && \\\n\t    func_fatal_error \"error: cannot install '$file' to a directory not ending in $libdir\"\n\n\t  if test -n \"$inst_prefix_dir\"; then\n\t    # Stick the inst_prefix_dir data into the link command.\n\t    relink_command=`$ECHO \"$relink_command\" | $SED \"s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%\"`\n\t  else\n\t    relink_command=`$ECHO \"$relink_command\" | $SED \"s%@inst_prefix_dir@%%\"`\n\t  fi\n\n\t  func_warning \"relinking '$file'\"\n\t  func_show_eval \"$relink_command\" \\\n\t    'func_fatal_error \"error: relink '\\''$file'\\'' with the above command before installing it\"'\n\tfi\n\n\t# See the names of the shared library.\n\tset dummy $library_names; shift\n\tif test -n \"$1\"; then\n\t  realname=$1\n\t  shift\n\n\t  srcname=$realname\n\t  test -n \"$relink_command\" && srcname=${realname}T\n\n\t  # Install the shared library and build the symlinks.\n\t  func_show_eval \"$install_shared_prog $dir/$srcname $destdir/$realname\" \\\n\t      'exit $?'\n\t  tstripme=$stripme\n\t  case $host_os in\n\t  cygwin* | mingw* | pw32* | cegcc*)\n\t    case $realname in\n\t    *.dll.a)\n\t      tstripme=\n\t      ;;\n\t    esac\n\t    ;;\n\t  os2*)\n\t    case $realname in\n\t    *_dll.a)\n\t      tstripme=\n\t      ;;\n\t    esac\n\t    ;;\n\t  esac\n\t  if test -n \"$tstripme\" && test -n \"$striplib\"; then\n\t    func_show_eval \"$striplib $destdir/$realname\" 'exit $?'\n\t  fi\n\n\t  if test \"$#\" -gt 0; then\n\t    # Delete the old symlinks, and create new ones.\n\t    # Try 'ln -sf' first, because the 'ln' binary might depend on\n\t    # the symlink we replace!  Solaris /bin/ln does not understand -f,\n\t    # so we also need to try rm && ln -s.\n\t    for linkname\n\t    do\n\t      test \"$linkname\" != \"$realname\" \\\n\t\t&& func_show_eval \"(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })\"\n\t    done\n\t  fi\n\n\t  # Do each command in the postinstall commands.\n\t  lib=$destdir/$realname\n\t  func_execute_cmds \"$postinstall_cmds\" 'exit $?'\n\tfi\n\n\t# Install the pseudo-library for information purposes.\n\tfunc_basename \"$file\"\n\tname=$func_basename_result\n\tinstname=$dir/${name}i\n\tfunc_show_eval \"$install_prog $instname $destdir/$name\" 'exit $?'\n\n\t# Maybe install the static library, too.\n\ttest -n \"$old_library\" && func_append staticlibs \" $dir/$old_library\"\n\t;;\n\n      *.lo)\n\t# Install (i.e. copy) a libtool object.\n\n\t# Figure out destination file name, if it wasn't already specified.\n\tif test -n \"$destname\"; then\n\t  destfile=$destdir/$destname\n\telse\n\t  func_basename \"$file\"\n\t  destfile=$func_basename_result\n\t  destfile=$destdir/$destfile\n\tfi\n\n\t# Deduce the name of the destination old-style object file.\n\tcase $destfile in\n\t*.lo)\n\t  func_lo2o \"$destfile\"\n\t  staticdest=$func_lo2o_result\n\t  ;;\n\t*.$objext)\n\t  staticdest=$destfile\n\t  destfile=\n\t  ;;\n\t*)\n\t  func_fatal_help \"cannot copy a libtool object to '$destfile'\"\n\t  ;;\n\tesac\n\n\t# Install the libtool object if requested.\n\ttest -n \"$destfile\" && \\\n\t  func_show_eval \"$install_prog $file $destfile\" 'exit $?'\n\n\t# Install the old object if enabled.\n\tif test yes = \"$build_old_libs\"; then\n\t  # Deduce the name of the old-style object file.\n\t  func_lo2o \"$file\"\n\t  staticobj=$func_lo2o_result\n\t  func_show_eval \"$install_prog \\$staticobj \\$staticdest\" 'exit $?'\n\tfi\n\texit $EXIT_SUCCESS\n\t;;\n\n      *)\n\t# Figure out destination file name, if it wasn't already specified.\n\tif test -n \"$destname\"; then\n\t  destfile=$destdir/$destname\n\telse\n\t  func_basename \"$file\"\n\t  destfile=$func_basename_result\n\t  destfile=$destdir/$destfile\n\tfi\n\n\t# If the file is missing, and there is a .exe on the end, strip it\n\t# because it is most likely a libtool script we actually want to\n\t# install\n\tstripped_ext=\n\tcase $file in\n\t  *.exe)\n\t    if test ! -f \"$file\"; then\n\t      func_stripname '' '.exe' \"$file\"\n\t      file=$func_stripname_result\n\t      stripped_ext=.exe\n\t    fi\n\t    ;;\n\tesac\n\n\t# Do a test to see if this is really a libtool program.\n\tcase $host in\n\t*cygwin* | *mingw*)\n\t    if func_ltwrapper_executable_p \"$file\"; then\n\t      func_ltwrapper_scriptname \"$file\"\n\t      wrapper=$func_ltwrapper_scriptname_result\n\t    else\n\t      func_stripname '' '.exe' \"$file\"\n\t      wrapper=$func_stripname_result\n\t    fi\n\t    ;;\n\t*)\n\t    wrapper=$file\n\t    ;;\n\tesac\n\tif func_ltwrapper_script_p \"$wrapper\"; then\n\t  notinst_deplibs=\n\t  relink_command=\n\n\t  func_source \"$wrapper\"\n\n\t  # Check the variables that should have been set.\n\t  test -z \"$generated_by_libtool_version\" && \\\n\t    func_fatal_error \"invalid libtool wrapper script '$wrapper'\"\n\n\t  finalize=:\n\t  for lib in $notinst_deplibs; do\n\t    # Check to see that each library is installed.\n\t    libdir=\n\t    if test -f \"$lib\"; then\n\t      func_source \"$lib\"\n\t    fi\n\t    libfile=$libdir/`$ECHO \"$lib\" | $SED 's%^.*/%%g'`\n\t    if test -n \"$libdir\" && test ! -f \"$libfile\"; then\n\t      func_warning \"'$lib' has not been installed in '$libdir'\"\n\t      finalize=false\n\t    fi\n\t  done\n\n\t  relink_command=\n\t  func_source \"$wrapper\"\n\n\t  outputname=\n\t  if test no = \"$fast_install\" && test -n \"$relink_command\"; then\n\t    $opt_dry_run || {\n\t      if $finalize; then\n\t        tmpdir=`func_mktempdir`\n\t\tfunc_basename \"$file$stripped_ext\"\n\t\tfile=$func_basename_result\n\t        outputname=$tmpdir/$file\n\t        # Replace the output file specification.\n\t        relink_command=`$ECHO \"$relink_command\" | $SED 's%@OUTPUT@%'\"$outputname\"'%g'`\n\n\t        $opt_quiet || {\n\t          func_quote_for_expand \"$relink_command\"\n\t\t  eval \"func_echo $func_quote_for_expand_result\"\n\t        }\n\t        if eval \"$relink_command\"; then :\n\t          else\n\t\t  func_error \"error: relink '$file' with the above command before installing it\"\n\t\t  $opt_dry_run || ${RM}r \"$tmpdir\"\n\t\t  continue\n\t        fi\n\t        file=$outputname\n\t      else\n\t        func_warning \"cannot relink '$file'\"\n\t      fi\n\t    }\n\t  else\n\t    # Install the binary that we compiled earlier.\n\t    file=`$ECHO \"$file$stripped_ext\" | $SED \"s%\\([^/]*\\)$%$objdir/\\1%\"`\n\t  fi\n\tfi\n\n\t# remove .exe since cygwin /usr/bin/install will append another\n\t# one anyway\n\tcase $install_prog,$host in\n\t*/usr/bin/install*,*cygwin*)\n\t  case $file:$destfile in\n\t  *.exe:*.exe)\n\t    # this is ok\n\t    ;;\n\t  *.exe:*)\n\t    destfile=$destfile.exe\n\t    ;;\n\t  *:*.exe)\n\t    func_stripname '' '.exe' \"$destfile\"\n\t    destfile=$func_stripname_result\n\t    ;;\n\t  esac\n\t  ;;\n\tesac\n\tfunc_show_eval \"$install_prog\\$stripme \\$file \\$destfile\" 'exit $?'\n\t$opt_dry_run || if test -n \"$outputname\"; then\n\t  ${RM}r \"$tmpdir\"\n\tfi\n\t;;\n      esac\n    done\n\n    for file in $staticlibs; do\n      func_basename \"$file\"\n      name=$func_basename_result\n\n      # Set up the ranlib parameters.\n      oldlib=$destdir/$name\n      func_to_tool_file \"$oldlib\" func_convert_file_msys_to_w32\n      tool_oldlib=$func_to_tool_file_result\n\n      func_show_eval \"$install_prog \\$file \\$oldlib\" 'exit $?'\n\n      if test -n \"$stripme\" && test -n \"$old_striplib\"; then\n\tfunc_show_eval \"$old_striplib $tool_oldlib\" 'exit $?'\n      fi\n\n      # Do each command in the postinstall commands.\n      func_execute_cmds \"$old_postinstall_cmds\" 'exit $?'\n    done\n\n    test -n \"$future_libdirs\" && \\\n      func_warning \"remember to run '$progname --finish$future_libdirs'\"\n\n    if test -n \"$current_libdirs\"; then\n      # Maybe just do a dry run.\n      $opt_dry_run && current_libdirs=\" -n$current_libdirs\"\n      exec_cmd='$SHELL \"$progpath\" $preserve_args --finish$current_libdirs'\n    else\n      exit $EXIT_SUCCESS\n    fi\n}\n\ntest install = \"$opt_mode\" && func_mode_install ${1+\"$@\"}\n\n\n# func_generate_dlsyms outputname originator pic_p\n# Extract symbols from dlprefiles and create ${outputname}S.o with\n# a dlpreopen symbol table.\nfunc_generate_dlsyms ()\n{\n    $debug_cmd\n\n    my_outputname=$1\n    my_originator=$2\n    my_pic_p=${3-false}\n    my_prefix=`$ECHO \"$my_originator\" | $SED 's%[^a-zA-Z0-9]%_%g'`\n    my_dlsyms=\n\n    if test -n \"$dlfiles$dlprefiles\" || test no != \"$dlself\"; then\n      if test -n \"$NM\" && test -n \"$global_symbol_pipe\"; then\n\tmy_dlsyms=${my_outputname}S.c\n      else\n\tfunc_error \"not configured to extract global symbols from dlpreopened files\"\n      fi\n    fi\n\n    if test -n \"$my_dlsyms\"; then\n      case $my_dlsyms in\n      \"\") ;;\n      *.c)\n\t# Discover the nlist of each of the dlfiles.\n\tnlist=$output_objdir/$my_outputname.nm\n\n\tfunc_show_eval \"$RM $nlist ${nlist}S ${nlist}T\"\n\n\t# Parse the name list into a source file.\n\tfunc_verbose \"creating $output_objdir/$my_dlsyms\"\n\n\t$opt_dry_run || $ECHO > \"$output_objdir/$my_dlsyms\" \"\\\n/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */\n/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */\n\n#ifdef __cplusplus\nextern \\\"C\\\" {\n#endif\n\n#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))\n#pragma GCC diagnostic ignored \\\"-Wstrict-prototypes\\\"\n#endif\n\n/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */\n#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE\n/* DATA imports from DLLs on WIN32 can't be const, because runtime\n   relocations are performed -- see ld's documentation on pseudo-relocs.  */\n# define LT_DLSYM_CONST\n#elif defined __osf__\n/* This system does not cope well with relocations in const data.  */\n# define LT_DLSYM_CONST\n#else\n# define LT_DLSYM_CONST const\n#endif\n\n#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)\n\n/* External symbol declarations for the compiler. */\\\n\"\n\n\tif test yes = \"$dlself\"; then\n\t  func_verbose \"generating symbol list for '$output'\"\n\n\t  $opt_dry_run || echo ': @PROGRAM@ ' > \"$nlist\"\n\n\t  # Add our own program objects to the symbol list.\n\t  progfiles=`$ECHO \"$objs$old_deplibs\" | $SP2NL | $SED \"$lo2o\" | $NL2SP`\n\t  for progfile in $progfiles; do\n\t    func_to_tool_file \"$progfile\" func_convert_file_msys_to_w32\n\t    func_verbose \"extracting global C symbols from '$func_to_tool_file_result'\"\n\t    $opt_dry_run || eval \"$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'\"\n\t  done\n\n\t  if test -n \"$exclude_expsyms\"; then\n\t    $opt_dry_run || {\n\t      eval '$EGREP -v \" ($exclude_expsyms)$\" \"$nlist\" > \"$nlist\"T'\n\t      eval '$MV \"$nlist\"T \"$nlist\"'\n\t    }\n\t  fi\n\n\t  if test -n \"$export_symbols_regex\"; then\n\t    $opt_dry_run || {\n\t      eval '$EGREP -e \"$export_symbols_regex\" \"$nlist\" > \"$nlist\"T'\n\t      eval '$MV \"$nlist\"T \"$nlist\"'\n\t    }\n\t  fi\n\n\t  # Prepare the list of exported symbols\n\t  if test -z \"$export_symbols\"; then\n\t    export_symbols=$output_objdir/$outputname.exp\n\t    $opt_dry_run || {\n\t      $RM $export_symbols\n\t      eval \"$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \\(.*\\)$/\\1/p' \"'< \"$nlist\" > \"$export_symbols\"'\n\t      case $host in\n\t      *cygwin* | *mingw* | *cegcc* )\n                eval \"echo EXPORTS \"'> \"$output_objdir/$outputname.def\"'\n                eval 'cat \"$export_symbols\" >> \"$output_objdir/$outputname.def\"'\n\t        ;;\n\t      esac\n\t    }\n\t  else\n\t    $opt_dry_run || {\n\t      eval \"$SED -e 's/\\([].[*^$]\\)/\\\\\\\\\\1/g' -e 's/^/ /' -e 's/$/$/'\"' < \"$export_symbols\" > \"$output_objdir/$outputname.exp\"'\n\t      eval '$GREP -f \"$output_objdir/$outputname.exp\" < \"$nlist\" > \"$nlist\"T'\n\t      eval '$MV \"$nlist\"T \"$nlist\"'\n\t      case $host in\n\t        *cygwin* | *mingw* | *cegcc* )\n\t          eval \"echo EXPORTS \"'> \"$output_objdir/$outputname.def\"'\n\t          eval 'cat \"$nlist\" >> \"$output_objdir/$outputname.def\"'\n\t          ;;\n\t      esac\n\t    }\n\t  fi\n\tfi\n\n\tfor dlprefile in $dlprefiles; do\n\t  func_verbose \"extracting global C symbols from '$dlprefile'\"\n\t  func_basename \"$dlprefile\"\n\t  name=$func_basename_result\n          case $host in\n\t    *cygwin* | *mingw* | *cegcc* )\n\t      # if an import library, we need to obtain dlname\n\t      if func_win32_import_lib_p \"$dlprefile\"; then\n\t        func_tr_sh \"$dlprefile\"\n\t        eval \"curr_lafile=\\$libfile_$func_tr_sh_result\"\n\t        dlprefile_dlbasename=\n\t        if test -n \"$curr_lafile\" && func_lalib_p \"$curr_lafile\"; then\n\t          # Use subshell, to avoid clobbering current variable values\n\t          dlprefile_dlname=`source \"$curr_lafile\" && echo \"$dlname\"`\n\t          if test -n \"$dlprefile_dlname\"; then\n\t            func_basename \"$dlprefile_dlname\"\n\t            dlprefile_dlbasename=$func_basename_result\n\t          else\n\t            # no lafile. user explicitly requested -dlpreopen <import library>.\n\t            $sharedlib_from_linklib_cmd \"$dlprefile\"\n\t            dlprefile_dlbasename=$sharedlib_from_linklib_result\n\t          fi\n\t        fi\n\t        $opt_dry_run || {\n\t          if test -n \"$dlprefile_dlbasename\"; then\n\t            eval '$ECHO \": $dlprefile_dlbasename\" >> \"$nlist\"'\n\t          else\n\t            func_warning \"Could not compute DLL name from $name\"\n\t            eval '$ECHO \": $name \" >> \"$nlist\"'\n\t          fi\n\t          func_to_tool_file \"$dlprefile\" func_convert_file_msys_to_w32\n\t          eval \"$NM \\\"$func_to_tool_file_result\\\" 2>/dev/null | $global_symbol_pipe |\n\t            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'\"\n\t        }\n\t      else # not an import lib\n\t        $opt_dry_run || {\n\t          eval '$ECHO \": $name \" >> \"$nlist\"'\n\t          func_to_tool_file \"$dlprefile\" func_convert_file_msys_to_w32\n\t          eval \"$NM \\\"$func_to_tool_file_result\\\" 2>/dev/null | $global_symbol_pipe >> '$nlist'\"\n\t        }\n\t      fi\n\t    ;;\n\t    *)\n\t      $opt_dry_run || {\n\t        eval '$ECHO \": $name \" >> \"$nlist\"'\n\t        func_to_tool_file \"$dlprefile\" func_convert_file_msys_to_w32\n\t        eval \"$NM \\\"$func_to_tool_file_result\\\" 2>/dev/null | $global_symbol_pipe >> '$nlist'\"\n\t      }\n\t    ;;\n          esac\n\tdone\n\n\t$opt_dry_run || {\n\t  # Make sure we have at least an empty file.\n\t  test -f \"$nlist\" || : > \"$nlist\"\n\n\t  if test -n \"$exclude_expsyms\"; then\n\t    $EGREP -v \" ($exclude_expsyms)$\" \"$nlist\" > \"$nlist\"T\n\t    $MV \"$nlist\"T \"$nlist\"\n\t  fi\n\n\t  # Try sorting and uniquifying the output.\n\t  if $GREP -v \"^: \" < \"$nlist\" |\n\t      if sort -k 3 </dev/null >/dev/null 2>&1; then\n\t\tsort -k 3\n\t      else\n\t\tsort +2\n\t      fi |\n\t      uniq > \"$nlist\"S; then\n\t    :\n\t  else\n\t    $GREP -v \"^: \" < \"$nlist\" > \"$nlist\"S\n\t  fi\n\n\t  if test -f \"$nlist\"S; then\n\t    eval \"$global_symbol_to_cdecl\"' < \"$nlist\"S >> \"$output_objdir/$my_dlsyms\"'\n\t  else\n\t    echo '/* NONE */' >> \"$output_objdir/$my_dlsyms\"\n\t  fi\n\n\t  func_show_eval '$RM \"${nlist}I\"'\n\t  if test -n \"$global_symbol_to_import\"; then\n\t    eval \"$global_symbol_to_import\"' < \"$nlist\"S > \"$nlist\"I'\n\t  fi\n\n\t  echo >> \"$output_objdir/$my_dlsyms\" \"\\\n\n/* The mapping between symbol names and symbols.  */\ntypedef struct {\n  const char *name;\n  void *address;\n} lt_dlsymlist;\nextern LT_DLSYM_CONST lt_dlsymlist\nlt_${my_prefix}_LTX_preloaded_symbols[];\\\n\"\n\n\t  if test -s \"$nlist\"I; then\n\t    echo >> \"$output_objdir/$my_dlsyms\" \"\\\nstatic void lt_syminit(void)\n{\n  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;\n  for (; symbol->name; ++symbol)\n    {\"\n\t    $SED 's/.*/      if (STREQ (symbol->name, \\\"&\\\")) symbol->address = (void *) \\&&;/' < \"$nlist\"I >> \"$output_objdir/$my_dlsyms\"\n\t    echo >> \"$output_objdir/$my_dlsyms\" \"\\\n    }\n}\"\n\t  fi\n\t  echo >> \"$output_objdir/$my_dlsyms\" \"\\\nLT_DLSYM_CONST lt_dlsymlist\nlt_${my_prefix}_LTX_preloaded_symbols[] =\n{ {\\\"$my_originator\\\", (void *) 0},\"\n\n\t  if test -s \"$nlist\"I; then\n\t    echo >> \"$output_objdir/$my_dlsyms\" \"\\\n  {\\\"@INIT@\\\", (void *) &lt_syminit},\"\n\t  fi\n\n\t  case $need_lib_prefix in\n\t  no)\n\t    eval \"$global_symbol_to_c_name_address\" < \"$nlist\" >> \"$output_objdir/$my_dlsyms\"\n\t    ;;\n\t  *)\n\t    eval \"$global_symbol_to_c_name_address_lib_prefix\" < \"$nlist\" >> \"$output_objdir/$my_dlsyms\"\n\t    ;;\n\t  esac\n\t  echo >> \"$output_objdir/$my_dlsyms\" \"\\\n  {0, (void *) 0}\n};\n\n/* This works around a problem in FreeBSD linker */\n#ifdef FREEBSD_WORKAROUND\nstatic const void *lt_preloaded_setup() {\n  return lt_${my_prefix}_LTX_preloaded_symbols;\n}\n#endif\n\n#ifdef __cplusplus\n}\n#endif\\\n\"\n\t} # !$opt_dry_run\n\n\tpic_flag_for_symtable=\n\tcase \"$compile_command \" in\n\t*\" -static \"*) ;;\n\t*)\n\t  case $host in\n\t  # compiling the symbol table file with pic_flag works around\n\t  # a FreeBSD bug that causes programs to crash when -lm is\n\t  # linked before any other PIC object.  But we must not use\n\t  # pic_flag when linking with -static.  The problem exists in\n\t  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.\n\t  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)\n\t    pic_flag_for_symtable=\" $pic_flag -DFREEBSD_WORKAROUND\" ;;\n\t  *-*-hpux*)\n\t    pic_flag_for_symtable=\" $pic_flag\"  ;;\n\t  *)\n\t    $my_pic_p && pic_flag_for_symtable=\" $pic_flag\"\n\t    ;;\n\t  esac\n\t  ;;\n\tesac\n\tsymtab_cflags=\n\tfor arg in $LTCFLAGS; do\n\t  case $arg in\n\t  -pie | -fpie | -fPIE) ;;\n\t  *) func_append symtab_cflags \" $arg\" ;;\n\t  esac\n\tdone\n\n\t# Now compile the dynamic symbol file.\n\tfunc_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable \"$my_dlsyms\")' 'exit $?'\n\n\t# Clean up the generated files.\n\tfunc_show_eval '$RM \"$output_objdir/$my_dlsyms\" \"$nlist\" \"${nlist}S\" \"${nlist}T\" \"${nlist}I\"'\n\n\t# Transform the symbol file into the correct name.\n\tsymfileobj=$output_objdir/${my_outputname}S.$objext\n\tcase $host in\n\t*cygwin* | *mingw* | *cegcc* )\n\t  if test -f \"$output_objdir/$my_outputname.def\"; then\n\t    compile_command=`$ECHO \"$compile_command\" | $SED \"s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%\"`\n\t    finalize_command=`$ECHO \"$finalize_command\" | $SED \"s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%\"`\n\t  else\n\t    compile_command=`$ECHO \"$compile_command\" | $SED \"s%@SYMFILE@%$symfileobj%\"`\n\t    finalize_command=`$ECHO \"$finalize_command\" | $SED \"s%@SYMFILE@%$symfileobj%\"`\n\t  fi\n\t  ;;\n\t*)\n\t  compile_command=`$ECHO \"$compile_command\" | $SED \"s%@SYMFILE@%$symfileobj%\"`\n\t  finalize_command=`$ECHO \"$finalize_command\" | $SED \"s%@SYMFILE@%$symfileobj%\"`\n\t  ;;\n\tesac\n\t;;\n      *)\n\tfunc_fatal_error \"unknown suffix for '$my_dlsyms'\"\n\t;;\n      esac\n    else\n      # We keep going just in case the user didn't refer to\n      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe\n      # really was required.\n\n      # Nullify the symbol file.\n      compile_command=`$ECHO \"$compile_command\" | $SED \"s% @SYMFILE@%%\"`\n      finalize_command=`$ECHO \"$finalize_command\" | $SED \"s% @SYMFILE@%%\"`\n    fi\n}\n\n# func_cygming_gnu_implib_p ARG\n# This predicate returns with zero status (TRUE) if\n# ARG is a GNU/binutils-style import library. Returns\n# with nonzero status (FALSE) otherwise.\nfunc_cygming_gnu_implib_p ()\n{\n  $debug_cmd\n\n  func_to_tool_file \"$1\" func_convert_file_msys_to_w32\n  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)$'`\n  test -n \"$func_cygming_gnu_implib_tmp\"\n}\n\n# func_cygming_ms_implib_p ARG\n# This predicate returns with zero status (TRUE) if\n# ARG is an MS-style import library. Returns\n# with nonzero status (FALSE) otherwise.\nfunc_cygming_ms_implib_p ()\n{\n  $debug_cmd\n\n  func_to_tool_file \"$1\" func_convert_file_msys_to_w32\n  func_cygming_ms_implib_tmp=`$NM \"$func_to_tool_file_result\" | eval \"$global_symbol_pipe\" | $GREP '_NULL_IMPORT_DESCRIPTOR'`\n  test -n \"$func_cygming_ms_implib_tmp\"\n}\n\n# func_win32_libid arg\n# return the library type of file 'arg'\n#\n# Need a lot of goo to handle *both* DLLs and import libs\n# Has to be a shell function in order to 'eat' the argument\n# that is supplied when $file_magic_command is called.\n# Despite the name, also deal with 64 bit binaries.\nfunc_win32_libid ()\n{\n  $debug_cmd\n\n  win32_libid_type=unknown\n  win32_fileres=`file -L $1 2>/dev/null`\n  case $win32_fileres in\n  *ar\\ archive\\ import\\ library*) # definitely import\n    win32_libid_type=\"x86 archive import\"\n    ;;\n  *ar\\ archive*) # could be an import, or static\n    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.\n    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |\n       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then\n      case $nm_interface in\n      \"MS dumpbin\")\n\tif func_cygming_ms_implib_p \"$1\" ||\n\t   func_cygming_gnu_implib_p \"$1\"\n\tthen\n\t  win32_nmres=import\n\telse\n\t  win32_nmres=\n\tfi\n\t;;\n      *)\n\tfunc_to_tool_file \"$1\" func_convert_file_msys_to_w32\n\twin32_nmres=`eval $NM -f posix -A \\\"$func_to_tool_file_result\\\" |\n\t  $SED -n -e '\n\t    1,100{\n\t\t/ I /{\n\t\t    s|.*|import|\n\t\t    p\n\t\t    q\n\t\t}\n\t    }'`\n\t;;\n      esac\n      case $win32_nmres in\n      import*)  win32_libid_type=\"x86 archive import\";;\n      *)        win32_libid_type=\"x86 archive static\";;\n      esac\n    fi\n    ;;\n  *DLL*)\n    win32_libid_type=\"x86 DLL\"\n    ;;\n  *executable*) # but shell scripts are \"executable\" too...\n    case $win32_fileres in\n    *MS\\ Windows\\ PE\\ Intel*)\n      win32_libid_type=\"x86 DLL\"\n      ;;\n    esac\n    ;;\n  esac\n  $ECHO \"$win32_libid_type\"\n}\n\n# func_cygming_dll_for_implib ARG\n#\n# Platform-specific function to extract the\n# name of the DLL associated with the specified\n# import library ARG.\n# Invoked by eval'ing the libtool variable\n#    $sharedlib_from_linklib_cmd\n# Result is available in the variable\n#    $sharedlib_from_linklib_result\nfunc_cygming_dll_for_implib ()\n{\n  $debug_cmd\n\n  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify \"$1\"`\n}\n\n# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs\n#\n# The is the core of a fallback implementation of a\n# platform-specific function to extract the name of the\n# DLL associated with the specified import library LIBNAME.\n#\n# SECTION_NAME is either .idata$6 or .idata$7, depending\n# on the platform and compiler that created the implib.\n#\n# Echos the name of the DLL associated with the\n# specified import library.\nfunc_cygming_dll_for_implib_fallback_core ()\n{\n  $debug_cmd\n\n  match_literal=`$ECHO \"$1\" | $SED \"$sed_make_literal_regex\"`\n  $OBJDUMP -s --section \"$1\" \"$2\" 2>/dev/null |\n    $SED '/^Contents of section '\"$match_literal\"':/{\n      # Place marker at beginning of archive member dllname section\n      s/.*/====MARK====/\n      p\n      d\n    }\n    # These lines can sometimes be longer than 43 characters, but\n    # are always uninteresting\n    /:[\t ]*file format pe[i]\\{,1\\}-/d\n    /^In archive [^:]*:/d\n    # Ensure marker is printed\n    /^====MARK====/p\n    # Remove all lines with less than 43 characters\n    /^.\\{43\\}/!d\n    # From remaining lines, remove first 43 characters\n    s/^.\\{43\\}//' |\n    $SED -n '\n      # Join marker and all lines until next marker into a single line\n      /^====MARK====/ b para\n      H\n      $ b para\n      b\n      :para\n      x\n      s/\\n//g\n      # Remove the marker\n      s/^====MARK====//\n      # Remove trailing dots and whitespace\n      s/[\\. \\t]*$//\n      # Print\n      /./p' |\n    # we now have a list, one entry per line, of the stringified\n    # contents of the appropriate section of all members of the\n    # archive that possess that section. Heuristic: eliminate\n    # all those that have a first or second character that is\n    # a '.' (that is, objdump's representation of an unprintable\n    # character.) This should work for all archives with less than\n    # 0x302f exports -- but will fail for DLLs whose name actually\n    # begins with a literal '.' or a single character followed by\n    # a '.'.\n    #\n    # Of those that remain, print the first one.\n    $SED -e '/^\\./d;/^.\\./d;q'\n}\n\n# func_cygming_dll_for_implib_fallback ARG\n# Platform-specific function to extract the\n# name of the DLL associated with the specified\n# import library ARG.\n#\n# This fallback implementation is for use when $DLLTOOL\n# does not support the --identify-strict option.\n# Invoked by eval'ing the libtool variable\n#    $sharedlib_from_linklib_cmd\n# Result is available in the variable\n#    $sharedlib_from_linklib_result\nfunc_cygming_dll_for_implib_fallback ()\n{\n  $debug_cmd\n\n  if func_cygming_gnu_implib_p \"$1\"; then\n    # binutils import library\n    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' \"$1\"`\n  elif func_cygming_ms_implib_p \"$1\"; then\n    # ms-generated import library\n    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' \"$1\"`\n  else\n    # unknown\n    sharedlib_from_linklib_result=\n  fi\n}\n\n\n# func_extract_an_archive dir oldlib\nfunc_extract_an_archive ()\n{\n    $debug_cmd\n\n    f_ex_an_ar_dir=$1; shift\n    f_ex_an_ar_oldlib=$1\n    if test yes = \"$lock_old_archive_extraction\"; then\n      lockfile=$f_ex_an_ar_oldlib.lock\n      until $opt_dry_run || ln \"$progpath\" \"$lockfile\" 2>/dev/null; do\n\tfunc_echo \"Waiting for $lockfile to be removed\"\n\tsleep 2\n      done\n    fi\n    func_show_eval \"(cd \\$f_ex_an_ar_dir && $AR x \\\"\\$f_ex_an_ar_oldlib\\\")\" \\\n\t\t   'stat=$?; rm -f \"$lockfile\"; exit $stat'\n    if test yes = \"$lock_old_archive_extraction\"; then\n      $opt_dry_run || rm -f \"$lockfile\"\n    fi\n    if ($AR t \"$f_ex_an_ar_oldlib\" | sort | sort -uc >/dev/null 2>&1); then\n     :\n    else\n      func_fatal_error \"object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib\"\n    fi\n}\n\n\n# func_extract_archives gentop oldlib ...\nfunc_extract_archives ()\n{\n    $debug_cmd\n\n    my_gentop=$1; shift\n    my_oldlibs=${1+\"$@\"}\n    my_oldobjs=\n    my_xlib=\n    my_xabs=\n    my_xdir=\n\n    for my_xlib in $my_oldlibs; do\n      # Extract the objects.\n      case $my_xlib in\n\t[\\\\/]* | [A-Za-z]:[\\\\/]*) my_xabs=$my_xlib ;;\n\t*) my_xabs=`pwd`\"/$my_xlib\" ;;\n      esac\n      func_basename \"$my_xlib\"\n      my_xlib=$func_basename_result\n      my_xlib_u=$my_xlib\n      while :; do\n        case \" $extracted_archives \" in\n\t*\" $my_xlib_u \"*)\n\t  func_arith $extracted_serial + 1\n\t  extracted_serial=$func_arith_result\n\t  my_xlib_u=lt$extracted_serial-$my_xlib ;;\n\t*) break ;;\n\tesac\n      done\n      extracted_archives=\"$extracted_archives $my_xlib_u\"\n      my_xdir=$my_gentop/$my_xlib_u\n\n      func_mkdir_p \"$my_xdir\"\n\n      case $host in\n      *-darwin*)\n\tfunc_verbose \"Extracting $my_xabs\"\n\t# Do not bother doing anything if just a dry run\n\t$opt_dry_run || {\n\t  darwin_orig_dir=`pwd`\n\t  cd $my_xdir || exit $?\n\t  darwin_archive=$my_xabs\n\t  darwin_curdir=`pwd`\n\t  func_basename \"$darwin_archive\"\n\t  darwin_base_archive=$func_basename_result\n\t  darwin_arches=`$LIPO -info \"$darwin_archive\" 2>/dev/null | $GREP Architectures 2>/dev/null || true`\n\t  if test -n \"$darwin_arches\"; then\n\t    darwin_arches=`$ECHO \"$darwin_arches\" | $SED -e 's/.*are://'`\n\t    darwin_arch=\n\t    func_verbose \"$darwin_base_archive has multiple architectures $darwin_arches\"\n\t    for darwin_arch in  $darwin_arches; do\n\t      func_mkdir_p \"unfat-$$/$darwin_base_archive-$darwin_arch\"\n\t      $LIPO -thin $darwin_arch -output \"unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive\" \"$darwin_archive\"\n\t      cd \"unfat-$$/$darwin_base_archive-$darwin_arch\"\n\t      func_extract_an_archive \"`pwd`\" \"$darwin_base_archive\"\n\t      cd \"$darwin_curdir\"\n\t      $RM \"unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive\"\n\t    done # $darwin_arches\n            ## Okay now we've a bunch of thin objects, gotta fatten them up :)\n\t    darwin_filelist=`find unfat-$$ -type f -name \\*.o -print -o -name \\*.lo -print | $SED -e \"$sed_basename\" | sort -u`\n\t    darwin_file=\n\t    darwin_files=\n\t    for darwin_file in $darwin_filelist; do\n\t      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`\n\t      $LIPO -create -output \"$darwin_file\" $darwin_files\n\t    done # $darwin_filelist\n\t    $RM -rf unfat-$$\n\t    cd \"$darwin_orig_dir\"\n\t  else\n\t    cd $darwin_orig_dir\n\t    func_extract_an_archive \"$my_xdir\" \"$my_xabs\"\n\t  fi # $darwin_arches\n\t} # !$opt_dry_run\n\t;;\n      *)\n        func_extract_an_archive \"$my_xdir\" \"$my_xabs\"\n\t;;\n      esac\n      my_oldobjs=\"$my_oldobjs \"`find $my_xdir -name \\*.$objext -print -o -name \\*.lo -print | sort | $NL2SP`\n    done\n\n    func_extract_archives_result=$my_oldobjs\n}\n\n\n# func_emit_wrapper [arg=no]\n#\n# Emit a libtool wrapper script on stdout.\n# Don't directly open a file because we may want to\n# incorporate the script contents within a cygwin/mingw\n# wrapper executable.  Must ONLY be called from within\n# func_mode_link because it depends on a number of variables\n# set therein.\n#\n# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\n# variable will take.  If 'yes', then the emitted script\n# will assume that the directory where it is stored is\n# the $objdir directory.  This is a cygwin/mingw-specific\n# behavior.\nfunc_emit_wrapper ()\n{\n\tfunc_emit_wrapper_arg1=${1-no}\n\n\t$ECHO \"\\\n#! $SHELL\n\n# $output - temporary wrapper script for $objdir/$outputname\n# Generated by $PROGRAM (GNU $PACKAGE) $VERSION\n#\n# The $output program cannot be directly executed until all the libtool\n# libraries that it depends on are installed.\n#\n# This wrapper script should never be moved out of the build directory.\n# If it is, it will not operate correctly.\n\n# Sed substitution that helps us do robust quoting.  It backslashifies\n# metacharacters that are still active within double-quoted strings.\nsed_quote_subst='$sed_quote_subst'\n\n# Be Bourne compatible\nif test -n \\\"\\${ZSH_VERSION+set}\\\" && (emulate sh) >/dev/null 2>&1; then\n  emulate sh\n  NULLCMD=:\n  # Zsh 3.x and 4.x performs word splitting on \\${1+\\\"\\$@\\\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '\\${1+\\\"\\$@\\\"}'='\\\"\\$@\\\"'\n  setopt NO_GLOB_SUBST\nelse\n  case \\`(set -o) 2>/dev/null\\` in *posix*) set -o posix;; esac\nfi\nBIN_SH=xpg4; export BIN_SH # for Tru64\nDUALCASE=1; export DUALCASE # for MKS sh\n\n# The HP-UX ksh and POSIX shell print the target directory to stdout\n# if CDPATH is set.\n(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n\nrelink_command=\\\"$relink_command\\\"\n\n# This environment variable determines our operation mode.\nif test \\\"\\$libtool_install_magic\\\" = \\\"$magic\\\"; then\n  # install mode needs the following variables:\n  generated_by_libtool_version='$macro_version'\n  notinst_deplibs='$notinst_deplibs'\nelse\n  # When we are sourced in execute mode, \\$file and \\$ECHO are already set.\n  if test \\\"\\$libtool_execute_magic\\\" != \\\"$magic\\\"; then\n    file=\\\"\\$0\\\"\"\n\n    qECHO=`$ECHO \"$ECHO\" | $SED \"$sed_quote_subst\"`\n    $ECHO \"\\\n\n# A function that is used when there is no print builtin or printf.\nfunc_fallback_echo ()\n{\n  eval 'cat <<_LTECHO_EOF\n\\$1\n_LTECHO_EOF'\n}\n    ECHO=\\\"$qECHO\\\"\n  fi\n\n# Very basic option parsing. These options are (a) specific to\n# the libtool wrapper, (b) are identical between the wrapper\n# /script/ and the wrapper /executable/ that is used only on\n# windows platforms, and (c) all begin with the string \"--lt-\"\n# (application programs are unlikely to have options that match\n# this pattern).\n#\n# There are only two supported options: --lt-debug and\n# --lt-dump-script. There is, deliberately, no --lt-help.\n#\n# The first argument to this parsing function should be the\n# script's $0 value, followed by \"$@\".\nlt_option_debug=\nfunc_parse_lt_options ()\n{\n  lt_script_arg0=\\$0\n  shift\n  for lt_opt\n  do\n    case \\\"\\$lt_opt\\\" in\n    --lt-debug) lt_option_debug=1 ;;\n    --lt-dump-script)\n        lt_dump_D=\\`\\$ECHO \\\"X\\$lt_script_arg0\\\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\\`\n        test \\\"X\\$lt_dump_D\\\" = \\\"X\\$lt_script_arg0\\\" && lt_dump_D=.\n        lt_dump_F=\\`\\$ECHO \\\"X\\$lt_script_arg0\\\" | $SED -e 's/^X//' -e 's%^.*/%%'\\`\n        cat \\\"\\$lt_dump_D/\\$lt_dump_F\\\"\n        exit 0\n      ;;\n    --lt-*)\n        \\$ECHO \\\"Unrecognized --lt- option: '\\$lt_opt'\\\" 1>&2\n        exit 1\n      ;;\n    esac\n  done\n\n  # Print the debug banner immediately:\n  if test -n \\\"\\$lt_option_debug\\\"; then\n    echo \\\"$outputname:$output:\\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\\\" 1>&2\n  fi\n}\n\n# Used when --lt-debug. Prints its arguments to stdout\n# (redirection is the responsibility of the caller)\nfunc_lt_dump_args ()\n{\n  lt_dump_args_N=1;\n  for lt_arg\n  do\n    \\$ECHO \\\"$outputname:$output:\\$LINENO: newargv[\\$lt_dump_args_N]: \\$lt_arg\\\"\n    lt_dump_args_N=\\`expr \\$lt_dump_args_N + 1\\`\n  done\n}\n\n# Core function for launching the target application\nfunc_exec_program_core ()\n{\n\"\n  case $host in\n  # Backslashes separate directories on plain windows\n  *-*-mingw | *-*-os2* | *-cegcc*)\n    $ECHO \"\\\n      if test -n \\\"\\$lt_option_debug\\\"; then\n        \\$ECHO \\\"$outputname:$output:\\$LINENO: newargv[0]: \\$progdir\\\\\\\\\\$program\\\" 1>&2\n        func_lt_dump_args \\${1+\\\"\\$@\\\"} 1>&2\n      fi\n      exec \\\"\\$progdir\\\\\\\\\\$program\\\" \\${1+\\\"\\$@\\\"}\n\"\n    ;;\n\n  *)\n    $ECHO \"\\\n      if test -n \\\"\\$lt_option_debug\\\"; then\n        \\$ECHO \\\"$outputname:$output:\\$LINENO: newargv[0]: \\$progdir/\\$program\\\" 1>&2\n        func_lt_dump_args \\${1+\\\"\\$@\\\"} 1>&2\n      fi\n      exec \\\"\\$progdir/\\$program\\\" \\${1+\\\"\\$@\\\"}\n\"\n    ;;\n  esac\n  $ECHO \"\\\n      \\$ECHO \\\"\\$0: cannot exec \\$program \\$*\\\" 1>&2\n      exit 1\n}\n\n# A function to encapsulate launching the target application\n# Strips options in the --lt-* namespace from \\$@ and\n# launches target application with the remaining arguments.\nfunc_exec_program ()\n{\n  case \\\" \\$* \\\" in\n  *\\\\ --lt-*)\n    for lt_wr_arg\n    do\n      case \\$lt_wr_arg in\n      --lt-*) ;;\n      *) set x \\\"\\$@\\\" \\\"\\$lt_wr_arg\\\"; shift;;\n      esac\n      shift\n    done ;;\n  esac\n  func_exec_program_core \\${1+\\\"\\$@\\\"}\n}\n\n  # Parse options\n  func_parse_lt_options \\\"\\$0\\\" \\${1+\\\"\\$@\\\"}\n\n  # Find the directory that this script lives in.\n  thisdir=\\`\\$ECHO \\\"\\$file\\\" | $SED 's%/[^/]*$%%'\\`\n  test \\\"x\\$thisdir\\\" = \\\"x\\$file\\\" && thisdir=.\n\n  # Follow symbolic links until we get to the real thisdir.\n  file=\\`ls -ld \\\"\\$file\\\" | $SED -n 's/.*-> //p'\\`\n  while test -n \\\"\\$file\\\"; do\n    destdir=\\`\\$ECHO \\\"\\$file\\\" | $SED 's%/[^/]*\\$%%'\\`\n\n    # If there was a directory component, then change thisdir.\n    if test \\\"x\\$destdir\\\" != \\\"x\\$file\\\"; then\n      case \\\"\\$destdir\\\" in\n      [\\\\\\\\/]* | [A-Za-z]:[\\\\\\\\/]*) thisdir=\\\"\\$destdir\\\" ;;\n      *) thisdir=\\\"\\$thisdir/\\$destdir\\\" ;;\n      esac\n    fi\n\n    file=\\`\\$ECHO \\\"\\$file\\\" | $SED 's%^.*/%%'\\`\n    file=\\`ls -ld \\\"\\$thisdir/\\$file\\\" | $SED -n 's/.*-> //p'\\`\n  done\n\n  # Usually 'no', except on cygwin/mingw when embedded into\n  # the cwrapper.\n  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1\n  if test \\\"\\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\\\" = \\\"yes\\\"; then\n    # special case for '.'\n    if test \\\"\\$thisdir\\\" = \\\".\\\"; then\n      thisdir=\\`pwd\\`\n    fi\n    # remove .libs from thisdir\n    case \\\"\\$thisdir\\\" in\n    *[\\\\\\\\/]$objdir ) thisdir=\\`\\$ECHO \\\"\\$thisdir\\\" | $SED 's%[\\\\\\\\/][^\\\\\\\\/]*$%%'\\` ;;\n    $objdir )   thisdir=. ;;\n    esac\n  fi\n\n  # Try to get the absolute directory name.\n  absdir=\\`cd \\\"\\$thisdir\\\" && pwd\\`\n  test -n \\\"\\$absdir\\\" && thisdir=\\\"\\$absdir\\\"\n\"\n\n\tif test yes = \"$fast_install\"; then\n\t  $ECHO \"\\\n  program=lt-'$outputname'$exeext\n  progdir=\\\"\\$thisdir/$objdir\\\"\n\n  if test ! -f \\\"\\$progdir/\\$program\\\" ||\n     { file=\\`ls -1dt \\\"\\$progdir/\\$program\\\" \\\"\\$progdir/../\\$program\\\" 2>/dev/null | $SED 1q\\`; \\\\\n       test \\\"X\\$file\\\" != \\\"X\\$progdir/\\$program\\\"; }; then\n\n    file=\\\"\\$\\$-\\$program\\\"\n\n    if test ! -d \\\"\\$progdir\\\"; then\n      $MKDIR \\\"\\$progdir\\\"\n    else\n      $RM \\\"\\$progdir/\\$file\\\"\n    fi\"\n\n\t  $ECHO \"\\\n\n    # relink executable if necessary\n    if test -n \\\"\\$relink_command\\\"; then\n      if relink_command_output=\\`eval \\$relink_command 2>&1\\`; then :\n      else\n\t\\$ECHO \\\"\\$relink_command_output\\\" >&2\n\t$RM \\\"\\$progdir/\\$file\\\"\n\texit 1\n      fi\n    fi\n\n    $MV \\\"\\$progdir/\\$file\\\" \\\"\\$progdir/\\$program\\\" 2>/dev/null ||\n    { $RM \\\"\\$progdir/\\$program\\\";\n      $MV \\\"\\$progdir/\\$file\\\" \\\"\\$progdir/\\$program\\\"; }\n    $RM \\\"\\$progdir/\\$file\\\"\n  fi\"\n\telse\n\t  $ECHO \"\\\n  program='$outputname'\n  progdir=\\\"\\$thisdir/$objdir\\\"\n\"\n\tfi\n\n\t$ECHO \"\\\n\n  if test -f \\\"\\$progdir/\\$program\\\"; then\"\n\n\t# fixup the dll searchpath if we need to.\n\t#\n\t# Fix the DLL searchpath if we need to.  Do this before prepending\n\t# to shlibpath, because on Windows, both are PATH and uninstalled\n\t# libraries must come first.\n\tif test -n \"$dllsearchpath\"; then\n\t  $ECHO \"\\\n    # Add the dll search path components to the executable PATH\n    PATH=$dllsearchpath:\\$PATH\n\"\n\tfi\n\n\t# Export our shlibpath_var if we have one.\n\tif test yes = \"$shlibpath_overrides_runpath\" && test -n \"$shlibpath_var\" && test -n \"$temp_rpath\"; then\n\t  $ECHO \"\\\n    # Add our own library path to $shlibpath_var\n    $shlibpath_var=\\\"$temp_rpath\\$$shlibpath_var\\\"\n\n    # Some systems cannot cope with colon-terminated $shlibpath_var\n    # The second colon is a workaround for a bug in BeOS R4 sed\n    $shlibpath_var=\\`\\$ECHO \\\"\\$$shlibpath_var\\\" | $SED 's/::*\\$//'\\`\n\n    export $shlibpath_var\n\"\n\tfi\n\n\t$ECHO \"\\\n    if test \\\"\\$libtool_execute_magic\\\" != \\\"$magic\\\"; then\n      # Run the actual program with our arguments.\n      func_exec_program \\${1+\\\"\\$@\\\"}\n    fi\n  else\n    # The program doesn't exist.\n    \\$ECHO \\\"\\$0: error: '\\$progdir/\\$program' does not exist\\\" 1>&2\n    \\$ECHO \\\"This script is just a wrapper for \\$program.\\\" 1>&2\n    \\$ECHO \\\"See the $PACKAGE documentation for more information.\\\" 1>&2\n    exit 1\n  fi\nfi\\\n\"\n}\n\n\n# func_emit_cwrapperexe_src\n# emit the source code for a wrapper executable on stdout\n# Must ONLY be called from within func_mode_link because\n# it depends on a number of variable set therein.\nfunc_emit_cwrapperexe_src ()\n{\n\tcat <<EOF\n\n/* $cwrappersource - temporary wrapper executable for $objdir/$outputname\n   Generated by $PROGRAM (GNU $PACKAGE) $VERSION\n\n   The $output program cannot be directly executed until all the libtool\n   libraries that it depends on are installed.\n\n   This wrapper executable should never be moved out of the build directory.\n   If it is, it will not operate correctly.\n*/\nEOF\n\t    cat <<\"EOF\"\n#ifdef _MSC_VER\n# define _CRT_SECURE_NO_DEPRECATE 1\n#endif\n#include <stdio.h>\n#include <stdlib.h>\n#ifdef _MSC_VER\n# include <direct.h>\n# include <process.h>\n# include <io.h>\n#else\n# include <unistd.h>\n# include <stdint.h>\n# ifdef __CYGWIN__\n#  include <io.h>\n# endif\n#endif\n#include <malloc.h>\n#include <stdarg.h>\n#include <assert.h>\n#include <string.h>\n#include <ctype.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <sys/stat.h>\n\n#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)\n\n/* declarations of non-ANSI functions */\n#if defined __MINGW32__\n# ifdef __STRICT_ANSI__\nint _putenv (const char *);\n# endif\n#elif defined __CYGWIN__\n# ifdef __STRICT_ANSI__\nchar *realpath (const char *, char *);\nint putenv (char *);\nint setenv (const char *, const char *, int);\n# endif\n/* #elif defined other_platform || defined ... */\n#endif\n\n/* portability defines, excluding path handling macros */\n#if defined _MSC_VER\n# define setmode _setmode\n# define stat    _stat\n# define chmod   _chmod\n# define getcwd  _getcwd\n# define putenv  _putenv\n# define S_IXUSR _S_IEXEC\n#elif defined __MINGW32__\n# define setmode _setmode\n# define stat    _stat\n# define chmod   _chmod\n# define getcwd  _getcwd\n# define putenv  _putenv\n#elif defined __CYGWIN__\n# define HAVE_SETENV\n# define FOPEN_WB \"wb\"\n/* #elif defined other platforms ... */\n#endif\n\n#if defined PATH_MAX\n# define LT_PATHMAX PATH_MAX\n#elif defined MAXPATHLEN\n# define LT_PATHMAX MAXPATHLEN\n#else\n# define LT_PATHMAX 1024\n#endif\n\n#ifndef S_IXOTH\n# define S_IXOTH 0\n#endif\n#ifndef S_IXGRP\n# define S_IXGRP 0\n#endif\n\n/* path handling portability macros */\n#ifndef DIR_SEPARATOR\n# define DIR_SEPARATOR '/'\n# define PATH_SEPARATOR ':'\n#endif\n\n#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \\\n  defined __OS2__\n# define HAVE_DOS_BASED_FILE_SYSTEM\n# define FOPEN_WB \"wb\"\n# ifndef DIR_SEPARATOR_2\n#  define DIR_SEPARATOR_2 '\\\\'\n# endif\n# ifndef PATH_SEPARATOR_2\n#  define PATH_SEPARATOR_2 ';'\n# endif\n#endif\n\n#ifndef DIR_SEPARATOR_2\n# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)\n#else /* DIR_SEPARATOR_2 */\n# define IS_DIR_SEPARATOR(ch) \\\n\t(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))\n#endif /* DIR_SEPARATOR_2 */\n\n#ifndef PATH_SEPARATOR_2\n# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)\n#else /* PATH_SEPARATOR_2 */\n# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)\n#endif /* PATH_SEPARATOR_2 */\n\n#ifndef FOPEN_WB\n# define FOPEN_WB \"w\"\n#endif\n#ifndef _O_BINARY\n# define _O_BINARY 0\n#endif\n\n#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))\n#define XFREE(stale) do { \\\n  if (stale) { free (stale); stale = 0; } \\\n} while (0)\n\n#if defined LT_DEBUGWRAPPER\nstatic int lt_debug = 1;\n#else\nstatic int lt_debug = 0;\n#endif\n\nconst char *program_name = \"libtool-wrapper\"; /* in case xstrdup fails */\n\nvoid *xmalloc (size_t num);\nchar *xstrdup (const char *string);\nconst char *base_name (const char *name);\nchar *find_executable (const char *wrapper);\nchar *chase_symlinks (const char *pathspec);\nint make_executable (const char *path);\nint check_executable (const char *path);\nchar *strendzap (char *str, const char *pat);\nvoid lt_debugprintf (const char *file, int line, const char *fmt, ...);\nvoid lt_fatal (const char *file, int line, const char *message, ...);\nstatic const char *nonnull (const char *s);\nstatic const char *nonempty (const char *s);\nvoid lt_setenv (const char *name, const char *value);\nchar *lt_extend_str (const char *orig_value, const char *add, int to_end);\nvoid lt_update_exe_path (const char *name, const char *value);\nvoid lt_update_lib_path (const char *name, const char *value);\nchar **prepare_spawn (char **argv);\nvoid lt_dump_script (FILE *f);\nEOF\n\n\t    cat <<EOF\n#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)\n# define externally_visible volatile\n#else\n# define externally_visible __attribute__((externally_visible)) volatile\n#endif\nexternally_visible const char * MAGIC_EXE = \"$magic_exe\";\nconst char * LIB_PATH_VARNAME = \"$shlibpath_var\";\nEOF\n\n\t    if test yes = \"$shlibpath_overrides_runpath\" && test -n \"$shlibpath_var\" && test -n \"$temp_rpath\"; then\n              func_to_host_path \"$temp_rpath\"\n\t      cat <<EOF\nconst char * LIB_PATH_VALUE   = \"$func_to_host_path_result\";\nEOF\n\t    else\n\t      cat <<\"EOF\"\nconst char * LIB_PATH_VALUE   = \"\";\nEOF\n\t    fi\n\n\t    if test -n \"$dllsearchpath\"; then\n              func_to_host_path \"$dllsearchpath:\"\n\t      cat <<EOF\nconst char * EXE_PATH_VARNAME = \"PATH\";\nconst char * EXE_PATH_VALUE   = \"$func_to_host_path_result\";\nEOF\n\t    else\n\t      cat <<\"EOF\"\nconst char * EXE_PATH_VARNAME = \"\";\nconst char * EXE_PATH_VALUE   = \"\";\nEOF\n\t    fi\n\n\t    if test yes = \"$fast_install\"; then\n\t      cat <<EOF\nconst char * TARGET_PROGRAM_NAME = \"lt-$outputname\"; /* hopefully, no .exe */\nEOF\n\t    else\n\t      cat <<EOF\nconst char * TARGET_PROGRAM_NAME = \"$outputname\"; /* hopefully, no .exe */\nEOF\n\t    fi\n\n\n\t    cat <<\"EOF\"\n\n#define LTWRAPPER_OPTION_PREFIX         \"--lt-\"\n\nstatic const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;\nstatic const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX \"dump-script\";\nstatic const char *debug_opt            = LTWRAPPER_OPTION_PREFIX \"debug\";\n\nint\nmain (int argc, char *argv[])\n{\n  char **newargz;\n  int  newargc;\n  char *tmp_pathspec;\n  char *actual_cwrapper_path;\n  char *actual_cwrapper_name;\n  char *target_name;\n  char *lt_argv_zero;\n  int rval = 127;\n\n  int i;\n\n  program_name = (char *) xstrdup (base_name (argv[0]));\n  newargz = XMALLOC (char *, (size_t) argc + 1);\n\n  /* very simple arg parsing; don't want to rely on getopt\n   * also, copy all non cwrapper options to newargz, except\n   * argz[0], which is handled differently\n   */\n  newargc=0;\n  for (i = 1; i < argc; i++)\n    {\n      if (STREQ (argv[i], dumpscript_opt))\n\t{\nEOF\n\t    case $host in\n\t      *mingw* | *cygwin* )\n\t\t# make stdout use \"unix\" line endings\n\t\techo \"          setmode(1,_O_BINARY);\"\n\t\t;;\n\t      esac\n\n\t    cat <<\"EOF\"\n\t  lt_dump_script (stdout);\n\t  return 0;\n\t}\n      if (STREQ (argv[i], debug_opt))\n\t{\n          lt_debug = 1;\n          continue;\n\t}\n      if (STREQ (argv[i], ltwrapper_option_prefix))\n        {\n          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX\n             namespace, but it is not one of the ones we know about and\n             have already dealt with, above (inluding dump-script), then\n             report an error. Otherwise, targets might begin to believe\n             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX\n             namespace. The first time any user complains about this, we'll\n             need to make LTWRAPPER_OPTION_PREFIX a configure-time option\n             or a configure.ac-settable value.\n           */\n          lt_fatal (__FILE__, __LINE__,\n\t\t    \"unrecognized %s option: '%s'\",\n                    ltwrapper_option_prefix, argv[i]);\n        }\n      /* otherwise ... */\n      newargz[++newargc] = xstrdup (argv[i]);\n    }\n  newargz[++newargc] = NULL;\n\nEOF\n\t    cat <<EOF\n  /* The GNU banner must be the first non-error debug message */\n  lt_debugprintf (__FILE__, __LINE__, \"libtool wrapper (GNU $PACKAGE) $VERSION\\n\");\nEOF\n\t    cat <<\"EOF\"\n  lt_debugprintf (__FILE__, __LINE__, \"(main) argv[0]: %s\\n\", argv[0]);\n  lt_debugprintf (__FILE__, __LINE__, \"(main) program_name: %s\\n\", program_name);\n\n  tmp_pathspec = find_executable (argv[0]);\n  if (tmp_pathspec == NULL)\n    lt_fatal (__FILE__, __LINE__, \"couldn't find %s\", argv[0]);\n  lt_debugprintf (__FILE__, __LINE__,\n                  \"(main) found exe (before symlink chase) at: %s\\n\",\n\t\t  tmp_pathspec);\n\n  actual_cwrapper_path = chase_symlinks (tmp_pathspec);\n  lt_debugprintf (__FILE__, __LINE__,\n                  \"(main) found exe (after symlink chase) at: %s\\n\",\n\t\t  actual_cwrapper_path);\n  XFREE (tmp_pathspec);\n\n  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));\n  strendzap (actual_cwrapper_path, actual_cwrapper_name);\n\n  /* wrapper name transforms */\n  strendzap (actual_cwrapper_name, \".exe\");\n  tmp_pathspec = lt_extend_str (actual_cwrapper_name, \".exe\", 1);\n  XFREE (actual_cwrapper_name);\n  actual_cwrapper_name = tmp_pathspec;\n  tmp_pathspec = 0;\n\n  /* target_name transforms -- use actual target program name; might have lt- prefix */\n  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));\n  strendzap (target_name, \".exe\");\n  tmp_pathspec = lt_extend_str (target_name, \".exe\", 1);\n  XFREE (target_name);\n  target_name = tmp_pathspec;\n  tmp_pathspec = 0;\n\n  lt_debugprintf (__FILE__, __LINE__,\n\t\t  \"(main) libtool target name: %s\\n\",\n\t\t  target_name);\nEOF\n\n\t    cat <<EOF\n  newargz[0] =\n    XMALLOC (char, (strlen (actual_cwrapper_path) +\n\t\t    strlen (\"$objdir\") + 1 + strlen (actual_cwrapper_name) + 1));\n  strcpy (newargz[0], actual_cwrapper_path);\n  strcat (newargz[0], \"$objdir\");\n  strcat (newargz[0], \"/\");\nEOF\n\n\t    cat <<\"EOF\"\n  /* stop here, and copy so we don't have to do this twice */\n  tmp_pathspec = xstrdup (newargz[0]);\n\n  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */\n  strcat (newargz[0], actual_cwrapper_name);\n\n  /* DO want the lt- prefix here if it exists, so use target_name */\n  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);\n  XFREE (tmp_pathspec);\n  tmp_pathspec = NULL;\nEOF\n\n\t    case $host_os in\n\t      mingw*)\n\t    cat <<\"EOF\"\n  {\n    char* p;\n    while ((p = strchr (newargz[0], '\\\\')) != NULL)\n      {\n\t*p = '/';\n      }\n    while ((p = strchr (lt_argv_zero, '\\\\')) != NULL)\n      {\n\t*p = '/';\n      }\n  }\nEOF\n\t    ;;\n\t    esac\n\n\t    cat <<\"EOF\"\n  XFREE (target_name);\n  XFREE (actual_cwrapper_path);\n  XFREE (actual_cwrapper_name);\n\n  lt_setenv (\"BIN_SH\", \"xpg4\"); /* for Tru64 */\n  lt_setenv (\"DUALCASE\", \"1\");  /* for MSK sh */\n  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must\n     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)\n     because on Windows, both *_VARNAMEs are PATH but uninstalled\n     libraries must come first. */\n  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);\n  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);\n\n  lt_debugprintf (__FILE__, __LINE__, \"(main) lt_argv_zero: %s\\n\",\n\t\t  nonnull (lt_argv_zero));\n  for (i = 0; i < newargc; i++)\n    {\n      lt_debugprintf (__FILE__, __LINE__, \"(main) newargz[%d]: %s\\n\",\n\t\t      i, nonnull (newargz[i]));\n    }\n\nEOF\n\n\t    case $host_os in\n\t      mingw*)\n\t\tcat <<\"EOF\"\n  /* execv doesn't actually work on mingw as expected on unix */\n  newargz = prepare_spawn (newargz);\n  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);\n  if (rval == -1)\n    {\n      /* failed to start process */\n      lt_debugprintf (__FILE__, __LINE__,\n\t\t      \"(main) failed to launch target \\\"%s\\\": %s\\n\",\n\t\t      lt_argv_zero, nonnull (strerror (errno)));\n      return 127;\n    }\n  return rval;\nEOF\n\t\t;;\n\t      *)\n\t\tcat <<\"EOF\"\n  execv (lt_argv_zero, newargz);\n  return rval; /* =127, but avoids unused variable warning */\nEOF\n\t\t;;\n\t    esac\n\n\t    cat <<\"EOF\"\n}\n\nvoid *\nxmalloc (size_t num)\n{\n  void *p = (void *) malloc (num);\n  if (!p)\n    lt_fatal (__FILE__, __LINE__, \"memory exhausted\");\n\n  return p;\n}\n\nchar *\nxstrdup (const char *string)\n{\n  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),\n\t\t\t  string) : NULL;\n}\n\nconst char *\nbase_name (const char *name)\n{\n  const char *base;\n\n#if defined HAVE_DOS_BASED_FILE_SYSTEM\n  /* Skip over the disk name in MSDOS pathnames. */\n  if (isalpha ((unsigned char) name[0]) && name[1] == ':')\n    name += 2;\n#endif\n\n  for (base = name; *name; name++)\n    if (IS_DIR_SEPARATOR (*name))\n      base = name + 1;\n  return base;\n}\n\nint\ncheck_executable (const char *path)\n{\n  struct stat st;\n\n  lt_debugprintf (__FILE__, __LINE__, \"(check_executable): %s\\n\",\n                  nonempty (path));\n  if ((!path) || (!*path))\n    return 0;\n\n  if ((stat (path, &st) >= 0)\n      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))\n    return 1;\n  else\n    return 0;\n}\n\nint\nmake_executable (const char *path)\n{\n  int rval = 0;\n  struct stat st;\n\n  lt_debugprintf (__FILE__, __LINE__, \"(make_executable): %s\\n\",\n                  nonempty (path));\n  if ((!path) || (!*path))\n    return 0;\n\n  if (stat (path, &st) >= 0)\n    {\n      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);\n    }\n  return rval;\n}\n\n/* Searches for the full path of the wrapper.  Returns\n   newly allocated full path name if found, NULL otherwise\n   Does not chase symlinks, even on platforms that support them.\n*/\nchar *\nfind_executable (const char *wrapper)\n{\n  int has_slash = 0;\n  const char *p;\n  const char *p_next;\n  /* static buffer for getcwd */\n  char tmp[LT_PATHMAX + 1];\n  size_t tmp_len;\n  char *concat_name;\n\n  lt_debugprintf (__FILE__, __LINE__, \"(find_executable): %s\\n\",\n                  nonempty (wrapper));\n\n  if ((wrapper == NULL) || (*wrapper == '\\0'))\n    return NULL;\n\n  /* Absolute path? */\n#if defined HAVE_DOS_BASED_FILE_SYSTEM\n  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')\n    {\n      concat_name = xstrdup (wrapper);\n      if (check_executable (concat_name))\n\treturn concat_name;\n      XFREE (concat_name);\n    }\n  else\n    {\n#endif\n      if (IS_DIR_SEPARATOR (wrapper[0]))\n\t{\n\t  concat_name = xstrdup (wrapper);\n\t  if (check_executable (concat_name))\n\t    return concat_name;\n\t  XFREE (concat_name);\n\t}\n#if defined HAVE_DOS_BASED_FILE_SYSTEM\n    }\n#endif\n\n  for (p = wrapper; *p; p++)\n    if (*p == '/')\n      {\n\thas_slash = 1;\n\tbreak;\n      }\n  if (!has_slash)\n    {\n      /* no slashes; search PATH */\n      const char *path = getenv (\"PATH\");\n      if (path != NULL)\n\t{\n\t  for (p = path; *p; p = p_next)\n\t    {\n\t      const char *q;\n\t      size_t p_len;\n\t      for (q = p; *q; q++)\n\t\tif (IS_PATH_SEPARATOR (*q))\n\t\t  break;\n\t      p_len = (size_t) (q - p);\n\t      p_next = (*q == '\\0' ? q : q + 1);\n\t      if (p_len == 0)\n\t\t{\n\t\t  /* empty path: current directory */\n\t\t  if (getcwd (tmp, LT_PATHMAX) == NULL)\n\t\t    lt_fatal (__FILE__, __LINE__, \"getcwd failed: %s\",\n                              nonnull (strerror (errno)));\n\t\t  tmp_len = strlen (tmp);\n\t\t  concat_name =\n\t\t    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);\n\t\t  memcpy (concat_name, tmp, tmp_len);\n\t\t  concat_name[tmp_len] = '/';\n\t\t  strcpy (concat_name + tmp_len + 1, wrapper);\n\t\t}\n\t      else\n\t\t{\n\t\t  concat_name =\n\t\t    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);\n\t\t  memcpy (concat_name, p, p_len);\n\t\t  concat_name[p_len] = '/';\n\t\t  strcpy (concat_name + p_len + 1, wrapper);\n\t\t}\n\t      if (check_executable (concat_name))\n\t\treturn concat_name;\n\t      XFREE (concat_name);\n\t    }\n\t}\n      /* not found in PATH; assume curdir */\n    }\n  /* Relative path | not found in path: prepend cwd */\n  if (getcwd (tmp, LT_PATHMAX) == NULL)\n    lt_fatal (__FILE__, __LINE__, \"getcwd failed: %s\",\n              nonnull (strerror (errno)));\n  tmp_len = strlen (tmp);\n  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);\n  memcpy (concat_name, tmp, tmp_len);\n  concat_name[tmp_len] = '/';\n  strcpy (concat_name + tmp_len + 1, wrapper);\n\n  if (check_executable (concat_name))\n    return concat_name;\n  XFREE (concat_name);\n  return NULL;\n}\n\nchar *\nchase_symlinks (const char *pathspec)\n{\n#ifndef S_ISLNK\n  return xstrdup (pathspec);\n#else\n  char buf[LT_PATHMAX];\n  struct stat s;\n  char *tmp_pathspec = xstrdup (pathspec);\n  char *p;\n  int has_symlinks = 0;\n  while (strlen (tmp_pathspec) && !has_symlinks)\n    {\n      lt_debugprintf (__FILE__, __LINE__,\n\t\t      \"checking path component for symlinks: %s\\n\",\n\t\t      tmp_pathspec);\n      if (lstat (tmp_pathspec, &s) == 0)\n\t{\n\t  if (S_ISLNK (s.st_mode) != 0)\n\t    {\n\t      has_symlinks = 1;\n\t      break;\n\t    }\n\n\t  /* search backwards for last DIR_SEPARATOR */\n\t  p = tmp_pathspec + strlen (tmp_pathspec) - 1;\n\t  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))\n\t    p--;\n\t  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))\n\t    {\n\t      /* no more DIR_SEPARATORS left */\n\t      break;\n\t    }\n\t  *p = '\\0';\n\t}\n      else\n\t{\n\t  lt_fatal (__FILE__, __LINE__,\n\t\t    \"error accessing file \\\"%s\\\": %s\",\n\t\t    tmp_pathspec, nonnull (strerror (errno)));\n\t}\n    }\n  XFREE (tmp_pathspec);\n\n  if (!has_symlinks)\n    {\n      return xstrdup (pathspec);\n    }\n\n  tmp_pathspec = realpath (pathspec, buf);\n  if (tmp_pathspec == 0)\n    {\n      lt_fatal (__FILE__, __LINE__,\n\t\t\"could not follow symlinks for %s\", pathspec);\n    }\n  return xstrdup (tmp_pathspec);\n#endif\n}\n\nchar *\nstrendzap (char *str, const char *pat)\n{\n  size_t len, patlen;\n\n  assert (str != NULL);\n  assert (pat != NULL);\n\n  len = strlen (str);\n  patlen = strlen (pat);\n\n  if (patlen <= len)\n    {\n      str += len - patlen;\n      if (STREQ (str, pat))\n\t*str = '\\0';\n    }\n  return str;\n}\n\nvoid\nlt_debugprintf (const char *file, int line, const char *fmt, ...)\n{\n  va_list args;\n  if (lt_debug)\n    {\n      (void) fprintf (stderr, \"%s:%s:%d: \", program_name, file, line);\n      va_start (args, fmt);\n      (void) vfprintf (stderr, fmt, args);\n      va_end (args);\n    }\n}\n\nstatic void\nlt_error_core (int exit_status, const char *file,\n\t       int line, const char *mode,\n\t       const char *message, va_list ap)\n{\n  fprintf (stderr, \"%s:%s:%d: %s: \", program_name, file, line, mode);\n  vfprintf (stderr, message, ap);\n  fprintf (stderr, \".\\n\");\n\n  if (exit_status >= 0)\n    exit (exit_status);\n}\n\nvoid\nlt_fatal (const char *file, int line, const char *message, ...)\n{\n  va_list ap;\n  va_start (ap, message);\n  lt_error_core (EXIT_FAILURE, file, line, \"FATAL\", message, ap);\n  va_end (ap);\n}\n\nstatic const char *\nnonnull (const char *s)\n{\n  return s ? s : \"(null)\";\n}\n\nstatic const char *\nnonempty (const char *s)\n{\n  return (s && !*s) ? \"(empty)\" : nonnull (s);\n}\n\nvoid\nlt_setenv (const char *name, const char *value)\n{\n  lt_debugprintf (__FILE__, __LINE__,\n\t\t  \"(lt_setenv) setting '%s' to '%s'\\n\",\n                  nonnull (name), nonnull (value));\n  {\n#ifdef HAVE_SETENV\n    /* always make a copy, for consistency with !HAVE_SETENV */\n    char *str = xstrdup (value);\n    setenv (name, str, 1);\n#else\n    size_t len = strlen (name) + 1 + strlen (value) + 1;\n    char *str = XMALLOC (char, len);\n    sprintf (str, \"%s=%s\", name, value);\n    if (putenv (str) != EXIT_SUCCESS)\n      {\n        XFREE (str);\n      }\n#endif\n  }\n}\n\nchar *\nlt_extend_str (const char *orig_value, const char *add, int to_end)\n{\n  char *new_value;\n  if (orig_value && *orig_value)\n    {\n      size_t orig_value_len = strlen (orig_value);\n      size_t add_len = strlen (add);\n      new_value = XMALLOC (char, add_len + orig_value_len + 1);\n      if (to_end)\n        {\n          strcpy (new_value, orig_value);\n          strcpy (new_value + orig_value_len, add);\n        }\n      else\n        {\n          strcpy (new_value, add);\n          strcpy (new_value + add_len, orig_value);\n        }\n    }\n  else\n    {\n      new_value = xstrdup (add);\n    }\n  return new_value;\n}\n\nvoid\nlt_update_exe_path (const char *name, const char *value)\n{\n  lt_debugprintf (__FILE__, __LINE__,\n\t\t  \"(lt_update_exe_path) modifying '%s' by prepending '%s'\\n\",\n                  nonnull (name), nonnull (value));\n\n  if (name && *name && value && *value)\n    {\n      char *new_value = lt_extend_str (getenv (name), value, 0);\n      /* some systems can't cope with a ':'-terminated path #' */\n      size_t len = strlen (new_value);\n      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))\n        {\n          new_value[--len] = '\\0';\n        }\n      lt_setenv (name, new_value);\n      XFREE (new_value);\n    }\n}\n\nvoid\nlt_update_lib_path (const char *name, const char *value)\n{\n  lt_debugprintf (__FILE__, __LINE__,\n\t\t  \"(lt_update_lib_path) modifying '%s' by prepending '%s'\\n\",\n                  nonnull (name), nonnull (value));\n\n  if (name && *name && value && *value)\n    {\n      char *new_value = lt_extend_str (getenv (name), value, 0);\n      lt_setenv (name, new_value);\n      XFREE (new_value);\n    }\n}\n\nEOF\n\t    case $host_os in\n\t      mingw*)\n\t\tcat <<\"EOF\"\n\n/* Prepares an argument vector before calling spawn().\n   Note that spawn() does not by itself call the command interpreter\n     (getenv (\"COMSPEC\") != NULL ? getenv (\"COMSPEC\") :\n      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);\n         GetVersionEx(&v);\n         v.dwPlatformId == VER_PLATFORM_WIN32_NT;\n      }) ? \"cmd.exe\" : \"command.com\").\n   Instead it simply concatenates the arguments, separated by ' ', and calls\n   CreateProcess().  We must quote the arguments since Win32 CreateProcess()\n   interprets characters like ' ', '\\t', '\\\\', '\"' (but not '<' and '>') in a\n   special way:\n   - Space and tab are interpreted as delimiters. They are not treated as\n     delimiters if they are surrounded by double quotes: \"...\".\n   - Unescaped double quotes are removed from the input. Their only effect is\n     that within double quotes, space and tab are treated like normal\n     characters.\n   - Backslashes not followed by double quotes are not special.\n   - But 2*n+1 backslashes followed by a double quote become\n     n backslashes followed by a double quote (n >= 0):\n       \\\" -> \"\n       \\\\\\\" -> \\\"\n       \\\\\\\\\\\" -> \\\\\"\n */\n#define SHELL_SPECIAL_CHARS \"\\\"\\\\ \\001\\002\\003\\004\\005\\006\\007\\010\\011\\012\\013\\014\\015\\016\\017\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\033\\034\\035\\036\\037\"\n#define SHELL_SPACE_CHARS \" \\001\\002\\003\\004\\005\\006\\007\\010\\011\\012\\013\\014\\015\\016\\017\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\033\\034\\035\\036\\037\"\nchar **\nprepare_spawn (char **argv)\n{\n  size_t argc;\n  char **new_argv;\n  size_t i;\n\n  /* Count number of arguments.  */\n  for (argc = 0; argv[argc] != NULL; argc++)\n    ;\n\n  /* Allocate new argument vector.  */\n  new_argv = XMALLOC (char *, argc + 1);\n\n  /* Put quoted arguments into the new argument vector.  */\n  for (i = 0; i < argc; i++)\n    {\n      const char *string = argv[i];\n\n      if (string[0] == '\\0')\n\tnew_argv[i] = xstrdup (\"\\\"\\\"\");\n      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)\n\t{\n\t  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);\n\t  size_t length;\n\t  unsigned int backslashes;\n\t  const char *s;\n\t  char *quoted_string;\n\t  char *p;\n\n\t  length = 0;\n\t  backslashes = 0;\n\t  if (quote_around)\n\t    length++;\n\t  for (s = string; *s != '\\0'; s++)\n\t    {\n\t      char c = *s;\n\t      if (c == '\"')\n\t\tlength += backslashes + 1;\n\t      length++;\n\t      if (c == '\\\\')\n\t\tbackslashes++;\n\t      else\n\t\tbackslashes = 0;\n\t    }\n\t  if (quote_around)\n\t    length += backslashes + 1;\n\n\t  quoted_string = XMALLOC (char, length + 1);\n\n\t  p = quoted_string;\n\t  backslashes = 0;\n\t  if (quote_around)\n\t    *p++ = '\"';\n\t  for (s = string; *s != '\\0'; s++)\n\t    {\n\t      char c = *s;\n\t      if (c == '\"')\n\t\t{\n\t\t  unsigned int j;\n\t\t  for (j = backslashes + 1; j > 0; j--)\n\t\t    *p++ = '\\\\';\n\t\t}\n\t      *p++ = c;\n\t      if (c == '\\\\')\n\t\tbackslashes++;\n\t      else\n\t\tbackslashes = 0;\n\t    }\n\t  if (quote_around)\n\t    {\n\t      unsigned int j;\n\t      for (j = backslashes; j > 0; j--)\n\t\t*p++ = '\\\\';\n\t      *p++ = '\"';\n\t    }\n\t  *p = '\\0';\n\n\t  new_argv[i] = quoted_string;\n\t}\n      else\n\tnew_argv[i] = (char *) string;\n    }\n  new_argv[argc] = NULL;\n\n  return new_argv;\n}\nEOF\n\t\t;;\n\t    esac\n\n            cat <<\"EOF\"\nvoid lt_dump_script (FILE* f)\n{\nEOF\n\t    func_emit_wrapper yes |\n\t      $SED -n -e '\ns/^\\(.\\{79\\}\\)\\(..*\\)/\\1\\\n\\2/\nh\ns/\\([\\\\\"]\\)/\\\\\\1/g\ns/$/\\\\n/\ns/\\([^\\n]*\\).*/  fputs (\"\\1\", f);/p\ng\nD'\n            cat <<\"EOF\"\n}\nEOF\n}\n# end: func_emit_cwrapperexe_src\n\n# func_win32_import_lib_p ARG\n# True if ARG is an import lib, as indicated by $file_magic_cmd\nfunc_win32_import_lib_p ()\n{\n    $debug_cmd\n\n    case `eval $file_magic_cmd \\\"\\$1\\\" 2>/dev/null | $SED -e 10q` in\n    *import*) : ;;\n    *) false ;;\n    esac\n}\n\n# func_suncc_cstd_abi\n# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!\n# Several compiler flags select an ABI that is incompatible with the\n# Cstd library. Avoid specifying it if any are in CXXFLAGS.\nfunc_suncc_cstd_abi ()\n{\n    $debug_cmd\n\n    case \" $compile_command \" in\n    *\" -compat=g \"*|*\\ -std=c++[0-9][0-9]\\ *|*\" -library=stdcxx4 \"*|*\" -library=stlport4 \"*)\n      suncc_use_cstd_abi=no\n      ;;\n    *)\n      suncc_use_cstd_abi=yes\n      ;;\n    esac\n}\n\n# func_mode_link arg...\nfunc_mode_link ()\n{\n    $debug_cmd\n\n    case $host in\n    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)\n      # It is impossible to link a dll without this setting, and\n      # we shouldn't force the makefile maintainer to figure out\n      # what system we are compiling for in order to pass an extra\n      # flag for every libtool invocation.\n      # allow_undefined=no\n\n      # FIXME: Unfortunately, there are problems with the above when trying\n      # to make a dll that has undefined symbols, in which case not\n      # even a static library is built.  For now, we need to specify\n      # -no-undefined on the libtool link line when we can be certain\n      # that all symbols are satisfied, otherwise we get a static library.\n      allow_undefined=yes\n      ;;\n    *)\n      allow_undefined=yes\n      ;;\n    esac\n    libtool_args=$nonopt\n    base_compile=\"$nonopt $@\"\n    compile_command=$nonopt\n    finalize_command=$nonopt\n\n    compile_rpath=\n    finalize_rpath=\n    compile_shlibpath=\n    finalize_shlibpath=\n    convenience=\n    old_convenience=\n    deplibs=\n    old_deplibs=\n    compiler_flags=\n    linker_flags=\n    dllsearchpath=\n    lib_search_path=`pwd`\n    inst_prefix_dir=\n    new_inherited_linker_flags=\n\n    avoid_version=no\n    bindir=\n    dlfiles=\n    dlprefiles=\n    dlself=no\n    export_dynamic=no\n    export_symbols=\n    export_symbols_regex=\n    generated=\n    libobjs=\n    ltlibs=\n    module=no\n    no_install=no\n    objs=\n    os2dllname=\n    non_pic_objects=\n    precious_files_regex=\n    prefer_static_libs=no\n    preload=false\n    prev=\n    prevarg=\n    release=\n    rpath=\n    xrpath=\n    perm_rpath=\n    temp_rpath=\n    thread_safe=no\n    vinfo=\n    vinfo_number=no\n    weak_libs=\n    single_module=$wl-single_module\n    func_infer_tag $base_compile\n\n    # We need to know -static, to get the right output filenames.\n    for arg\n    do\n      case $arg in\n      -shared)\n\ttest yes != \"$build_libtool_libs\" \\\n\t  && func_fatal_configuration \"cannot build a shared library\"\n\tbuild_old_libs=no\n\tbreak\n\t;;\n      -all-static | -static | -static-libtool-libs)\n\tcase $arg in\n\t-all-static)\n\t  if test yes = \"$build_libtool_libs\" && test -z \"$link_static_flag\"; then\n\t    func_warning \"complete static linking is impossible in this configuration\"\n\t  fi\n\t  if test -n \"$link_static_flag\"; then\n\t    dlopen_self=$dlopen_self_static\n\t  fi\n\t  prefer_static_libs=yes\n\t  ;;\n\t-static)\n\t  if test -z \"$pic_flag\" && test -n \"$link_static_flag\"; then\n\t    dlopen_self=$dlopen_self_static\n\t  fi\n\t  prefer_static_libs=built\n\t  ;;\n\t-static-libtool-libs)\n\t  if test -z \"$pic_flag\" && test -n \"$link_static_flag\"; then\n\t    dlopen_self=$dlopen_self_static\n\t  fi\n\t  prefer_static_libs=yes\n\t  ;;\n\tesac\n\tbuild_libtool_libs=no\n\tbuild_old_libs=yes\n\tbreak\n\t;;\n      esac\n    done\n\n    # See if our shared archives depend on static archives.\n    test -n \"$old_archive_from_new_cmds\" && build_old_libs=yes\n\n    # Go through the arguments, transforming them on the way.\n    while test \"$#\" -gt 0; do\n      arg=$1\n      shift\n      func_quote_for_eval \"$arg\"\n      qarg=$func_quote_for_eval_unquoted_result\n      func_append libtool_args \" $func_quote_for_eval_result\"\n\n      # If the previous option needs an argument, assign it.\n      if test -n \"$prev\"; then\n\tcase $prev in\n\toutput)\n\t  func_append compile_command \" @OUTPUT@\"\n\t  func_append finalize_command \" @OUTPUT@\"\n\t  ;;\n\tesac\n\n\tcase $prev in\n\tbindir)\n\t  bindir=$arg\n\t  prev=\n\t  continue\n\t  ;;\n\tdlfiles|dlprefiles)\n\t  $preload || {\n\t    # Add the symbol object into the linking commands.\n\t    func_append compile_command \" @SYMFILE@\"\n\t    func_append finalize_command \" @SYMFILE@\"\n\t    preload=:\n\t  }\n\t  case $arg in\n\t  *.la | *.lo) ;;  # We handle these cases below.\n\t  force)\n\t    if test no = \"$dlself\"; then\n\t      dlself=needless\n\t      export_dynamic=yes\n\t    fi\n\t    prev=\n\t    continue\n\t    ;;\n\t  self)\n\t    if test dlprefiles = \"$prev\"; then\n\t      dlself=yes\n\t    elif test dlfiles = \"$prev\" && test yes != \"$dlopen_self\"; then\n\t      dlself=yes\n\t    else\n\t      dlself=needless\n\t      export_dynamic=yes\n\t    fi\n\t    prev=\n\t    continue\n\t    ;;\n\t  *)\n\t    if test dlfiles = \"$prev\"; then\n\t      func_append dlfiles \" $arg\"\n\t    else\n\t      func_append dlprefiles \" $arg\"\n\t    fi\n\t    prev=\n\t    continue\n\t    ;;\n\t  esac\n\t  ;;\n\texpsyms)\n\t  export_symbols=$arg\n\t  test -f \"$arg\" \\\n\t    || func_fatal_error \"symbol file '$arg' does not exist\"\n\t  prev=\n\t  continue\n\t  ;;\n\texpsyms_regex)\n\t  export_symbols_regex=$arg\n\t  prev=\n\t  continue\n\t  ;;\n\tframework)\n\t  case $host in\n\t    *-*-darwin*)\n\t      case \"$deplibs \" in\n\t\t*\" $qarg.ltframework \"*) ;;\n\t\t*) func_append deplibs \" $qarg.ltframework\" # this is fixed later\n\t\t   ;;\n\t      esac\n\t      ;;\n\t  esac\n\t  prev=\n\t  continue\n\t  ;;\n\tinst_prefix)\n\t  inst_prefix_dir=$arg\n\t  prev=\n\t  continue\n\t  ;;\n\tmllvm)\n\t  # Clang does not use LLVM to link, so we can simply discard any\n\t  # '-mllvm $arg' options when doing the link step.\n\t  prev=\n\t  continue\n\t  ;;\n\tobjectlist)\n\t  if test -f \"$arg\"; then\n\t    save_arg=$arg\n\t    moreargs=\n\t    for fil in `cat \"$save_arg\"`\n\t    do\n#\t      func_append moreargs \" $fil\"\n\t      arg=$fil\n\t      # A libtool-controlled object.\n\n\t      # Check to see that this really is a libtool object.\n\t      if func_lalib_unsafe_p \"$arg\"; then\n\t\tpic_object=\n\t\tnon_pic_object=\n\n\t\t# Read the .lo file\n\t\tfunc_source \"$arg\"\n\n\t\tif test -z \"$pic_object\" ||\n\t\t   test -z \"$non_pic_object\" ||\n\t\t   test none = \"$pic_object\" &&\n\t\t   test none = \"$non_pic_object\"; then\n\t\t  func_fatal_error \"cannot find name of object for '$arg'\"\n\t\tfi\n\n\t\t# Extract subdirectory from the argument.\n\t\tfunc_dirname \"$arg\" \"/\" \"\"\n\t\txdir=$func_dirname_result\n\n\t\tif test none != \"$pic_object\"; then\n\t\t  # Prepend the subdirectory the object is found in.\n\t\t  pic_object=$xdir$pic_object\n\n\t\t  if test dlfiles = \"$prev\"; then\n\t\t    if test yes = \"$build_libtool_libs\" && test yes = \"$dlopen_support\"; then\n\t\t      func_append dlfiles \" $pic_object\"\n\t\t      prev=\n\t\t      continue\n\t\t    else\n\t\t      # If libtool objects are unsupported, then we need to preload.\n\t\t      prev=dlprefiles\n\t\t    fi\n\t\t  fi\n\n\t\t  # CHECK ME:  I think I busted this.  -Ossama\n\t\t  if test dlprefiles = \"$prev\"; then\n\t\t    # Preload the old-style object.\n\t\t    func_append dlprefiles \" $pic_object\"\n\t\t    prev=\n\t\t  fi\n\n\t\t  # A PIC object.\n\t\t  func_append libobjs \" $pic_object\"\n\t\t  arg=$pic_object\n\t\tfi\n\n\t\t# Non-PIC object.\n\t\tif test none != \"$non_pic_object\"; then\n\t\t  # Prepend the subdirectory the object is found in.\n\t\t  non_pic_object=$xdir$non_pic_object\n\n\t\t  # A standard non-PIC object\n\t\t  func_append non_pic_objects \" $non_pic_object\"\n\t\t  if test -z \"$pic_object\" || test none = \"$pic_object\"; then\n\t\t    arg=$non_pic_object\n\t\t  fi\n\t\telse\n\t\t  # If the PIC object exists, use it instead.\n\t\t  # $xdir was prepended to $pic_object above.\n\t\t  non_pic_object=$pic_object\n\t\t  func_append non_pic_objects \" $non_pic_object\"\n\t\tfi\n\t      else\n\t\t# Only an error if not doing a dry-run.\n\t\tif $opt_dry_run; then\n\t\t  # Extract subdirectory from the argument.\n\t\t  func_dirname \"$arg\" \"/\" \"\"\n\t\t  xdir=$func_dirname_result\n\n\t\t  func_lo2o \"$arg\"\n\t\t  pic_object=$xdir$objdir/$func_lo2o_result\n\t\t  non_pic_object=$xdir$func_lo2o_result\n\t\t  func_append libobjs \" $pic_object\"\n\t\t  func_append non_pic_objects \" $non_pic_object\"\n\t        else\n\t\t  func_fatal_error \"'$arg' is not a valid libtool object\"\n\t\tfi\n\t      fi\n\t    done\n\t  else\n\t    func_fatal_error \"link input file '$arg' does not exist\"\n\t  fi\n\t  arg=$save_arg\n\t  prev=\n\t  continue\n\t  ;;\n\tos2dllname)\n\t  os2dllname=$arg\n\t  prev=\n\t  continue\n\t  ;;\n\tprecious_regex)\n\t  precious_files_regex=$arg\n\t  prev=\n\t  continue\n\t  ;;\n\trelease)\n\t  release=-$arg\n\t  prev=\n\t  continue\n\t  ;;\n\trpath | xrpath)\n\t  # We need an absolute path.\n\t  case $arg in\n\t  [\\\\/]* | [A-Za-z]:[\\\\/]*) ;;\n\t  *)\n\t    func_fatal_error \"only absolute run-paths are allowed\"\n\t    ;;\n\t  esac\n\t  if test rpath = \"$prev\"; then\n\t    case \"$rpath \" in\n\t    *\" $arg \"*) ;;\n\t    *) func_append rpath \" $arg\" ;;\n\t    esac\n\t  else\n\t    case \"$xrpath \" in\n\t    *\" $arg \"*) ;;\n\t    *) func_append xrpath \" $arg\" ;;\n\t    esac\n\t  fi\n\t  prev=\n\t  continue\n\t  ;;\n\tshrext)\n\t  shrext_cmds=$arg\n\t  prev=\n\t  continue\n\t  ;;\n\tweak)\n\t  func_append weak_libs \" $arg\"\n\t  prev=\n\t  continue\n\t  ;;\n\txcclinker)\n\t  func_append linker_flags \" $qarg\"\n\t  func_append compiler_flags \" $qarg\"\n\t  prev=\n\t  func_append compile_command \" $qarg\"\n\t  func_append finalize_command \" $qarg\"\n\t  continue\n\t  ;;\n\txcompiler)\n\t  func_append compiler_flags \" $qarg\"\n\t  prev=\n\t  func_append compile_command \" $qarg\"\n\t  func_append finalize_command \" $qarg\"\n\t  continue\n\t  ;;\n\txlinker)\n\t  func_append linker_flags \" $qarg\"\n\t  func_append compiler_flags \" $wl$qarg\"\n\t  prev=\n\t  func_append compile_command \" $wl$qarg\"\n\t  func_append finalize_command \" $wl$qarg\"\n\t  continue\n\t  ;;\n\t*)\n\t  eval \"$prev=\\\"\\$arg\\\"\"\n\t  prev=\n\t  continue\n\t  ;;\n\tesac\n      fi # test -n \"$prev\"\n\n      prevarg=$arg\n\n      case $arg in\n      -all-static)\n\tif test -n \"$link_static_flag\"; then\n\t  # See comment for -static flag below, for more details.\n\t  func_append compile_command \" $link_static_flag\"\n\t  func_append finalize_command \" $link_static_flag\"\n\tfi\n\tcontinue\n\t;;\n\n      -allow-undefined)\n\t# FIXME: remove this flag sometime in the future.\n\tfunc_fatal_error \"'-allow-undefined' must not be used because it is the default\"\n\t;;\n\n      -avoid-version)\n\tavoid_version=yes\n\tcontinue\n\t;;\n\n      -bindir)\n\tprev=bindir\n\tcontinue\n\t;;\n\n      -dlopen)\n\tprev=dlfiles\n\tcontinue\n\t;;\n\n      -dlpreopen)\n\tprev=dlprefiles\n\tcontinue\n\t;;\n\n      -export-dynamic)\n\texport_dynamic=yes\n\tcontinue\n\t;;\n\n      -export-symbols | -export-symbols-regex)\n\tif test -n \"$export_symbols\" || test -n \"$export_symbols_regex\"; then\n\t  func_fatal_error \"more than one -exported-symbols argument is not allowed\"\n\tfi\n\tif test X-export-symbols = \"X$arg\"; then\n\t  prev=expsyms\n\telse\n\t  prev=expsyms_regex\n\tfi\n\tcontinue\n\t;;\n\n      -framework)\n\tprev=framework\n\tcontinue\n\t;;\n\n      -inst-prefix-dir)\n\tprev=inst_prefix\n\tcontinue\n\t;;\n\n      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*\n      # so, if we see these flags be careful not to treat them like -L\n      -L[A-Z][A-Z]*:*)\n\tcase $with_gcc/$host in\n\tno/*-*-irix* | /*-*-irix*)\n\t  func_append compile_command \" $arg\"\n\t  func_append finalize_command \" $arg\"\n\t  ;;\n\tesac\n\tcontinue\n\t;;\n\n      -L*)\n\tfunc_stripname \"-L\" '' \"$arg\"\n\tif test -z \"$func_stripname_result\"; then\n\t  if test \"$#\" -gt 0; then\n\t    func_fatal_error \"require no space between '-L' and '$1'\"\n\t  else\n\t    func_fatal_error \"need path for '-L' option\"\n\t  fi\n\tfi\n\tfunc_resolve_sysroot \"$func_stripname_result\"\n\tdir=$func_resolve_sysroot_result\n\t# We need an absolute path.\n\tcase $dir in\n\t[\\\\/]* | [A-Za-z]:[\\\\/]*) ;;\n\t*)\n\t  absdir=`cd \"$dir\" && pwd`\n\t  test -z \"$absdir\" && \\\n\t    func_fatal_error \"cannot determine absolute directory name of '$dir'\"\n\t  dir=$absdir\n\t  ;;\n\tesac\n\tcase \"$deplibs \" in\n\t*\" -L$dir \"* | *\" $arg \"*)\n\t  # Will only happen for absolute or sysroot arguments\n\t  ;;\n\t*)\n\t  # Preserve sysroot, but never include relative directories\n\t  case $dir in\n\t    [\\\\/]* | [A-Za-z]:[\\\\/]* | =*) func_append deplibs \" $arg\" ;;\n\t    *) func_append deplibs \" -L$dir\" ;;\n\t  esac\n\t  func_append lib_search_path \" $dir\"\n\t  ;;\n\tesac\n\tcase $host in\n\t*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)\n\t  testbindir=`$ECHO \"$dir\" | $SED 's*/lib$*/bin*'`\n\t  case :$dllsearchpath: in\n\t  *\":$dir:\"*) ;;\n\t  ::) dllsearchpath=$dir;;\n\t  *) func_append dllsearchpath \":$dir\";;\n\t  esac\n\t  case :$dllsearchpath: in\n\t  *\":$testbindir:\"*) ;;\n\t  ::) dllsearchpath=$testbindir;;\n\t  *) func_append dllsearchpath \":$testbindir\";;\n\t  esac\n\t  ;;\n\tesac\n\tcontinue\n\t;;\n\n      -l*)\n\tif test X-lc = \"X$arg\" || test X-lm = \"X$arg\"; then\n\t  case $host in\n\t  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)\n\t    # These systems don't actually have a C or math library (as such)\n\t    continue\n\t    ;;\n\t  *-*-os2*)\n\t    # These systems don't actually have a C library (as such)\n\t    test X-lc = \"X$arg\" && continue\n\t    ;;\n\t  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)\n\t    # Do not include libc due to us having libc/libc_r.\n\t    test X-lc = \"X$arg\" && continue\n\t    ;;\n\t  *-*-rhapsody* | *-*-darwin1.[012])\n\t    # Rhapsody C and math libraries are in the System framework\n\t    func_append deplibs \" System.ltframework\"\n\t    continue\n\t    ;;\n\t  *-*-sco3.2v5* | *-*-sco5v6*)\n\t    # Causes problems with __ctype\n\t    test X-lc = \"X$arg\" && continue\n\t    ;;\n\t  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)\n\t    # Compiler inserts libc in the correct place for threads to work\n\t    test X-lc = \"X$arg\" && continue\n\t    ;;\n\t  esac\n\telif test X-lc_r = \"X$arg\"; then\n\t case $host in\n\t *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)\n\t   # Do not include libc_r directly, use -pthread flag.\n\t   continue\n\t   ;;\n\t esac\n\tfi\n\tfunc_append deplibs \" $arg\"\n\tcontinue\n\t;;\n\n      -mllvm)\n\tprev=mllvm\n\tcontinue\n\t;;\n\n      -module)\n\tmodule=yes\n\tcontinue\n\t;;\n\n      # Tru64 UNIX uses -model [arg] to determine the layout of C++\n      # classes, name mangling, and exception handling.\n      # Darwin uses the -arch flag to determine output architecture.\n      -model|-arch|-isysroot|--sysroot)\n\tfunc_append compiler_flags \" $arg\"\n\tfunc_append compile_command \" $arg\"\n\tfunc_append finalize_command \" $arg\"\n\tprev=xcompiler\n\tcontinue\n\t;;\n\n      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \\\n      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)\n\tfunc_append compiler_flags \" $arg\"\n\tfunc_append compile_command \" $arg\"\n\tfunc_append finalize_command \" $arg\"\n\tcase \"$new_inherited_linker_flags \" in\n\t    *\" $arg \"*) ;;\n\t    * ) func_append new_inherited_linker_flags \" $arg\" ;;\n\tesac\n\tcontinue\n\t;;\n\n      -multi_module)\n\tsingle_module=$wl-multi_module\n\tcontinue\n\t;;\n\n      -no-fast-install)\n\tfast_install=no\n\tcontinue\n\t;;\n\n      -no-install)\n\tcase $host in\n\t*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)\n\t  # The PATH hackery in wrapper scripts is required on Windows\n\t  # and Darwin in order for the loader to find any dlls it needs.\n\t  func_warning \"'-no-install' is ignored for $host\"\n\t  func_warning \"assuming '-no-fast-install' instead\"\n\t  fast_install=no\n\t  ;;\n\t*) no_install=yes ;;\n\tesac\n\tcontinue\n\t;;\n\n      -no-undefined)\n\tallow_undefined=no\n\tcontinue\n\t;;\n\n      -objectlist)\n\tprev=objectlist\n\tcontinue\n\t;;\n\n      -os2dllname)\n\tprev=os2dllname\n\tcontinue\n\t;;\n\n      -o) prev=output ;;\n\n      -precious-files-regex)\n\tprev=precious_regex\n\tcontinue\n\t;;\n\n      -release)\n\tprev=release\n\tcontinue\n\t;;\n\n      -rpath)\n\tprev=rpath\n\tcontinue\n\t;;\n\n      -R)\n\tprev=xrpath\n\tcontinue\n\t;;\n\n      -R*)\n\tfunc_stripname '-R' '' \"$arg\"\n\tdir=$func_stripname_result\n\t# We need an absolute path.\n\tcase $dir in\n\t[\\\\/]* | [A-Za-z]:[\\\\/]*) ;;\n\t=*)\n\t  func_stripname '=' '' \"$dir\"\n\t  dir=$lt_sysroot$func_stripname_result\n\t  ;;\n\t*)\n\t  func_fatal_error \"only absolute run-paths are allowed\"\n\t  ;;\n\tesac\n\tcase \"$xrpath \" in\n\t*\" $dir \"*) ;;\n\t*) func_append xrpath \" $dir\" ;;\n\tesac\n\tcontinue\n\t;;\n\n      -shared)\n\t# The effects of -shared are defined in a previous loop.\n\tcontinue\n\t;;\n\n      -shrext)\n\tprev=shrext\n\tcontinue\n\t;;\n\n      -static | -static-libtool-libs)\n\t# The effects of -static are defined in a previous loop.\n\t# We used to do the same as -all-static on platforms that\n\t# didn't have a PIC flag, but the assumption that the effects\n\t# would be equivalent was wrong.  It would break on at least\n\t# Digital Unix and AIX.\n\tcontinue\n\t;;\n\n      -thread-safe)\n\tthread_safe=yes\n\tcontinue\n\t;;\n\n      -version-info)\n\tprev=vinfo\n\tcontinue\n\t;;\n\n      -version-number)\n\tprev=vinfo\n\tvinfo_number=yes\n\tcontinue\n\t;;\n\n      -weak)\n        prev=weak\n\tcontinue\n\t;;\n\n      -Wc,*)\n\tfunc_stripname '-Wc,' '' \"$arg\"\n\targs=$func_stripname_result\n\targ=\n\tsave_ifs=$IFS; IFS=,\n\tfor flag in $args; do\n\t  IFS=$save_ifs\n          func_quote_for_eval \"$flag\"\n\t  func_append arg \" $func_quote_for_eval_result\"\n\t  func_append compiler_flags \" $func_quote_for_eval_result\"\n\tdone\n\tIFS=$save_ifs\n\tfunc_stripname ' ' '' \"$arg\"\n\targ=$func_stripname_result\n\t;;\n\n      -Wl,*)\n\tfunc_stripname '-Wl,' '' \"$arg\"\n\targs=$func_stripname_result\n\targ=\n\tsave_ifs=$IFS; IFS=,\n\tfor flag in $args; do\n\t  IFS=$save_ifs\n          func_quote_for_eval \"$flag\"\n\t  func_append arg \" $wl$func_quote_for_eval_result\"\n\t  func_append compiler_flags \" $wl$func_quote_for_eval_result\"\n\t  func_append linker_flags \" $func_quote_for_eval_result\"\n\tdone\n\tIFS=$save_ifs\n\tfunc_stripname ' ' '' \"$arg\"\n\targ=$func_stripname_result\n\t;;\n\n      -Xcompiler)\n\tprev=xcompiler\n\tcontinue\n\t;;\n\n      -Xlinker)\n\tprev=xlinker\n\tcontinue\n\t;;\n\n      -XCClinker)\n\tprev=xcclinker\n\tcontinue\n\t;;\n\n      # -msg_* for osf cc\n      -msg_*)\n\tfunc_quote_for_eval \"$arg\"\n\targ=$func_quote_for_eval_result\n\t;;\n\n      # Flags to be passed through unchanged, with rationale:\n      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler\n      # -r[0-9][0-9]*        specify processor for the SGI compiler\n      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler\n      # +DA*, +DD*           enable 64-bit mode for the HP compiler\n      # -q*                  compiler args for the IBM compiler\n      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC\n      # -F/path              path to uninstalled frameworks, gcc on darwin\n      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC\n      # -fstack-protector*   stack protector flags for GCC\n      # @file                GCC response files\n      # -tp=*                Portland pgcc target processor selection\n      # --sysroot=*          for sysroot support\n      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization\n      # -specs=*             GCC specs files\n      # -stdlib=*            select c++ std lib with clang\n      # -fsanitize=*         Clang/GCC memory and address sanitizer\n      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \\\n      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \\\n      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \\\n      -specs=*|-fsanitize=*)\n        func_quote_for_eval \"$arg\"\n\targ=$func_quote_for_eval_result\n        func_append compile_command \" $arg\"\n        func_append finalize_command \" $arg\"\n        func_append compiler_flags \" $arg\"\n        continue\n        ;;\n\n      -Z*)\n        if test os2 = \"`expr $host : '.*\\(os2\\)'`\"; then\n          # OS/2 uses -Zxxx to specify OS/2-specific options\n\t  compiler_flags=\"$compiler_flags $arg\"\n\t  func_append compile_command \" $arg\"\n\t  func_append finalize_command \" $arg\"\n\t  case $arg in\n\t  -Zlinker | -Zstack)\n\t    prev=xcompiler\n\t    ;;\n\t  esac\n\t  continue\n        else\n\t  # Otherwise treat like 'Some other compiler flag' below\n\t  func_quote_for_eval \"$arg\"\n\t  arg=$func_quote_for_eval_result\n        fi\n\t;;\n\n      # Some other compiler flag.\n      -* | +*)\n        func_quote_for_eval \"$arg\"\n\targ=$func_quote_for_eval_result\n\t;;\n\n      *.$objext)\n\t# A standard object.\n\tfunc_append objs \" $arg\"\n\t;;\n\n      *.lo)\n\t# A libtool-controlled object.\n\n\t# Check to see that this really is a libtool object.\n\tif func_lalib_unsafe_p \"$arg\"; then\n\t  pic_object=\n\t  non_pic_object=\n\n\t  # Read the .lo file\n\t  func_source \"$arg\"\n\n\t  if test -z \"$pic_object\" ||\n\t     test -z \"$non_pic_object\" ||\n\t     test none = \"$pic_object\" &&\n\t     test none = \"$non_pic_object\"; then\n\t    func_fatal_error \"cannot find name of object for '$arg'\"\n\t  fi\n\n\t  # Extract subdirectory from the argument.\n\t  func_dirname \"$arg\" \"/\" \"\"\n\t  xdir=$func_dirname_result\n\n\t  test none = \"$pic_object\" || {\n\t    # Prepend the subdirectory the object is found in.\n\t    pic_object=$xdir$pic_object\n\n\t    if test dlfiles = \"$prev\"; then\n\t      if test yes = \"$build_libtool_libs\" && test yes = \"$dlopen_support\"; then\n\t\tfunc_append dlfiles \" $pic_object\"\n\t\tprev=\n\t\tcontinue\n\t      else\n\t\t# If libtool objects are unsupported, then we need to preload.\n\t\tprev=dlprefiles\n\t      fi\n\t    fi\n\n\t    # CHECK ME:  I think I busted this.  -Ossama\n\t    if test dlprefiles = \"$prev\"; then\n\t      # Preload the old-style object.\n\t      func_append dlprefiles \" $pic_object\"\n\t      prev=\n\t    fi\n\n\t    # A PIC object.\n\t    func_append libobjs \" $pic_object\"\n\t    arg=$pic_object\n\t  }\n\n\t  # Non-PIC object.\n\t  if test none != \"$non_pic_object\"; then\n\t    # Prepend the subdirectory the object is found in.\n\t    non_pic_object=$xdir$non_pic_object\n\n\t    # A standard non-PIC object\n\t    func_append non_pic_objects \" $non_pic_object\"\n\t    if test -z \"$pic_object\" || test none = \"$pic_object\"; then\n\t      arg=$non_pic_object\n\t    fi\n\t  else\n\t    # If the PIC object exists, use it instead.\n\t    # $xdir was prepended to $pic_object above.\n\t    non_pic_object=$pic_object\n\t    func_append non_pic_objects \" $non_pic_object\"\n\t  fi\n\telse\n\t  # Only an error if not doing a dry-run.\n\t  if $opt_dry_run; then\n\t    # Extract subdirectory from the argument.\n\t    func_dirname \"$arg\" \"/\" \"\"\n\t    xdir=$func_dirname_result\n\n\t    func_lo2o \"$arg\"\n\t    pic_object=$xdir$objdir/$func_lo2o_result\n\t    non_pic_object=$xdir$func_lo2o_result\n\t    func_append libobjs \" $pic_object\"\n\t    func_append non_pic_objects \" $non_pic_object\"\n\t  else\n\t    func_fatal_error \"'$arg' is not a valid libtool object\"\n\t  fi\n\tfi\n\t;;\n\n      *.$libext)\n\t# An archive.\n\tfunc_append deplibs \" $arg\"\n\tfunc_append old_deplibs \" $arg\"\n\tcontinue\n\t;;\n\n      *.la)\n\t# A libtool-controlled library.\n\n\tfunc_resolve_sysroot \"$arg\"\n\tif test dlfiles = \"$prev\"; then\n\t  # This library was specified with -dlopen.\n\t  func_append dlfiles \" $func_resolve_sysroot_result\"\n\t  prev=\n\telif test dlprefiles = \"$prev\"; then\n\t  # The library was specified with -dlpreopen.\n\t  func_append dlprefiles \" $func_resolve_sysroot_result\"\n\t  prev=\n\telse\n\t  func_append deplibs \" $func_resolve_sysroot_result\"\n\tfi\n\tcontinue\n\t;;\n\n      # Some other compiler argument.\n      *)\n\t# Unknown arguments in both finalize_command and compile_command need\n\t# to be aesthetically quoted because they are evaled later.\n\tfunc_quote_for_eval \"$arg\"\n\targ=$func_quote_for_eval_result\n\t;;\n      esac # arg\n\n      # Now actually substitute the argument into the commands.\n      if test -n \"$arg\"; then\n\tfunc_append compile_command \" $arg\"\n\tfunc_append finalize_command \" $arg\"\n      fi\n    done # argument parsing loop\n\n    test -n \"$prev\" && \\\n      func_fatal_help \"the '$prevarg' option requires an argument\"\n\n    if test yes = \"$export_dynamic\" && test -n \"$export_dynamic_flag_spec\"; then\n      eval arg=\\\"$export_dynamic_flag_spec\\\"\n      func_append compile_command \" $arg\"\n      func_append finalize_command \" $arg\"\n    fi\n\n    oldlibs=\n    # calculate the name of the file, without its directory\n    func_basename \"$output\"\n    outputname=$func_basename_result\n    libobjs_save=$libobjs\n\n    if test -n \"$shlibpath_var\"; then\n      # get the directories listed in $shlibpath_var\n      eval shlib_search_path=\\`\\$ECHO \\\"\\$$shlibpath_var\\\" \\| \\$SED \\'s/:/ /g\\'\\`\n    else\n      shlib_search_path=\n    fi\n    eval sys_lib_search_path=\\\"$sys_lib_search_path_spec\\\"\n    eval sys_lib_dlsearch_path=\\\"$sys_lib_dlsearch_path_spec\\\"\n\n    # Definition is injected by LT_CONFIG during libtool generation.\n    func_munge_path_list sys_lib_dlsearch_path \"$LT_SYS_LIBRARY_PATH\"\n\n    func_dirname \"$output\" \"/\" \"\"\n    output_objdir=$func_dirname_result$objdir\n    func_to_tool_file \"$output_objdir/\"\n    tool_output_objdir=$func_to_tool_file_result\n    # Create the object directory.\n    func_mkdir_p \"$output_objdir\"\n\n    # Determine the type of output\n    case $output in\n    \"\")\n      func_fatal_help \"you must specify an output file\"\n      ;;\n    *.$libext) linkmode=oldlib ;;\n    *.lo | *.$objext) linkmode=obj ;;\n    *.la) linkmode=lib ;;\n    *) linkmode=prog ;; # Anything else should be a program.\n    esac\n\n    specialdeplibs=\n\n    libs=\n    # Find all interdependent deplibs by searching for libraries\n    # that are linked more than once (e.g. -la -lb -la)\n    for deplib in $deplibs; do\n      if $opt_preserve_dup_deps; then\n\tcase \"$libs \" in\n\t*\" $deplib \"*) func_append specialdeplibs \" $deplib\" ;;\n\tesac\n      fi\n      func_append libs \" $deplib\"\n    done\n\n    if test lib = \"$linkmode\"; then\n      libs=\"$predeps $libs $compiler_lib_search_path $postdeps\"\n\n      # Compute libraries that are listed more than once in $predeps\n      # $postdeps and mark them as special (i.e., whose duplicates are\n      # not to be eliminated).\n      pre_post_deps=\n      if $opt_duplicate_compiler_generated_deps; then\n\tfor pre_post_dep in $predeps $postdeps; do\n\t  case \"$pre_post_deps \" in\n\t  *\" $pre_post_dep \"*) func_append specialdeplibs \" $pre_post_deps\" ;;\n\t  esac\n\t  func_append pre_post_deps \" $pre_post_dep\"\n\tdone\n      fi\n      pre_post_deps=\n    fi\n\n    deplibs=\n    newdependency_libs=\n    newlib_search_path=\n    need_relink=no # whether we're linking any uninstalled libtool libraries\n    notinst_deplibs= # not-installed libtool libraries\n    notinst_path= # paths that contain not-installed libtool libraries\n\n    case $linkmode in\n    lib)\n\tpasses=\"conv dlpreopen link\"\n\tfor file in $dlfiles $dlprefiles; do\n\t  case $file in\n\t  *.la) ;;\n\t  *)\n\t    func_fatal_help \"libraries can '-dlopen' only libtool libraries: $file\"\n\t    ;;\n\t  esac\n\tdone\n\t;;\n    prog)\n\tcompile_deplibs=\n\tfinalize_deplibs=\n\talldeplibs=false\n\tnewdlfiles=\n\tnewdlprefiles=\n\tpasses=\"conv scan dlopen dlpreopen link\"\n\t;;\n    *)  passes=\"conv\"\n\t;;\n    esac\n\n    for pass in $passes; do\n      # The preopen pass in lib mode reverses $deplibs; put it back here\n      # so that -L comes before libs that need it for instance...\n      if test lib,link = \"$linkmode,$pass\"; then\n\t## FIXME: Find the place where the list is rebuilt in the wrong\n\t##        order, and fix it there properly\n        tmp_deplibs=\n\tfor deplib in $deplibs; do\n\t  tmp_deplibs=\"$deplib $tmp_deplibs\"\n\tdone\n\tdeplibs=$tmp_deplibs\n      fi\n\n      if test lib,link = \"$linkmode,$pass\" ||\n\t test prog,scan = \"$linkmode,$pass\"; then\n\tlibs=$deplibs\n\tdeplibs=\n      fi\n      if test prog = \"$linkmode\"; then\n\tcase $pass in\n\tdlopen) libs=$dlfiles ;;\n\tdlpreopen) libs=$dlprefiles ;;\n\tlink)\n\t  libs=\"$deplibs %DEPLIBS%\"\n\t  test \"X$link_all_deplibs\" != Xno && libs=\"$libs $dependency_libs\"\n\t  ;;\n\tesac\n      fi\n      if test lib,dlpreopen = \"$linkmode,$pass\"; then\n\t# Collect and forward deplibs of preopened libtool libs\n\tfor lib in $dlprefiles; do\n\t  # Ignore non-libtool-libs\n\t  dependency_libs=\n\t  func_resolve_sysroot \"$lib\"\n\t  case $lib in\n\t  *.la)\tfunc_source \"$func_resolve_sysroot_result\" ;;\n\t  esac\n\n\t  # Collect preopened libtool deplibs, except any this library\n\t  # has declared as weak libs\n\t  for deplib in $dependency_libs; do\n\t    func_basename \"$deplib\"\n            deplib_base=$func_basename_result\n\t    case \" $weak_libs \" in\n\t    *\" $deplib_base \"*) ;;\n\t    *) func_append deplibs \" $deplib\" ;;\n\t    esac\n\t  done\n\tdone\n\tlibs=$dlprefiles\n      fi\n      if test dlopen = \"$pass\"; then\n\t# Collect dlpreopened libraries\n\tsave_deplibs=$deplibs\n\tdeplibs=\n      fi\n\n      for deplib in $libs; do\n\tlib=\n\tfound=false\n\tcase $deplib in\n\t-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \\\n        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)\n\t  if test prog,link = \"$linkmode,$pass\"; then\n\t    compile_deplibs=\"$deplib $compile_deplibs\"\n\t    finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t  else\n\t    func_append compiler_flags \" $deplib\"\n\t    if test lib = \"$linkmode\"; then\n\t\tcase \"$new_inherited_linker_flags \" in\n\t\t    *\" $deplib \"*) ;;\n\t\t    * ) func_append new_inherited_linker_flags \" $deplib\" ;;\n\t\tesac\n\t    fi\n\t  fi\n\t  continue\n\t  ;;\n\t-l*)\n\t  if test lib != \"$linkmode\" && test prog != \"$linkmode\"; then\n\t    func_warning \"'-l' is ignored for archives/objects\"\n\t    continue\n\t  fi\n\t  func_stripname '-l' '' \"$deplib\"\n\t  name=$func_stripname_result\n\t  if test lib = \"$linkmode\"; then\n\t    searchdirs=\"$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path\"\n\t  else\n\t    searchdirs=\"$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path\"\n\t  fi\n\t  for searchdir in $searchdirs; do\n\t    for search_ext in .la $std_shrext .so .a; do\n\t      # Search the libtool library\n\t      lib=$searchdir/lib$name$search_ext\n\t      if test -f \"$lib\"; then\n\t\tif test .la = \"$search_ext\"; then\n\t\t  found=:\n\t\telse\n\t\t  found=false\n\t\tfi\n\t\tbreak 2\n\t      fi\n\t    done\n\t  done\n\t  if $found; then\n\t    # deplib is a libtool library\n\t    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,\n\t    # We need to do some special things here, and not later.\n\t    if test yes = \"$allow_libtool_libs_with_static_runtimes\"; then\n\t      case \" $predeps $postdeps \" in\n\t      *\" $deplib \"*)\n\t\tif func_lalib_p \"$lib\"; then\n\t\t  library_names=\n\t\t  old_library=\n\t\t  func_source \"$lib\"\n\t\t  for l in $old_library $library_names; do\n\t\t    ll=$l\n\t\t  done\n\t\t  if test \"X$ll\" = \"X$old_library\"; then # only static version available\n\t\t    found=false\n\t\t    func_dirname \"$lib\" \"\" \".\"\n\t\t    ladir=$func_dirname_result\n\t\t    lib=$ladir/$old_library\n\t\t    if test prog,link = \"$linkmode,$pass\"; then\n\t\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t\t    else\n\t\t      deplibs=\"$deplib $deplibs\"\n\t\t      test lib = \"$linkmode\" && newdependency_libs=\"$deplib $newdependency_libs\"\n\t\t    fi\n\t\t    continue\n\t\t  fi\n\t\tfi\n\t\t;;\n\t      *) ;;\n\t      esac\n\t    fi\n\t  else\n\t    # deplib doesn't seem to be a libtool library\n\t    if test prog,link = \"$linkmode,$pass\"; then\n\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t    else\n\t      deplibs=\"$deplib $deplibs\"\n\t      test lib = \"$linkmode\" && newdependency_libs=\"$deplib $newdependency_libs\"\n\t    fi\n\t    continue\n\t  fi\n\t  ;; # -l\n\t*.ltframework)\n\t  if test prog,link = \"$linkmode,$pass\"; then\n\t    compile_deplibs=\"$deplib $compile_deplibs\"\n\t    finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t  else\n\t    deplibs=\"$deplib $deplibs\"\n\t    if test lib = \"$linkmode\"; then\n\t\tcase \"$new_inherited_linker_flags \" in\n\t\t    *\" $deplib \"*) ;;\n\t\t    * ) func_append new_inherited_linker_flags \" $deplib\" ;;\n\t\tesac\n\t    fi\n\t  fi\n\t  continue\n\t  ;;\n\t-L*)\n\t  case $linkmode in\n\t  lib)\n\t    deplibs=\"$deplib $deplibs\"\n\t    test conv = \"$pass\" && continue\n\t    newdependency_libs=\"$deplib $newdependency_libs\"\n\t    func_stripname '-L' '' \"$deplib\"\n\t    func_resolve_sysroot \"$func_stripname_result\"\n\t    func_append newlib_search_path \" $func_resolve_sysroot_result\"\n\t    ;;\n\t  prog)\n\t    if test conv = \"$pass\"; then\n\t      deplibs=\"$deplib $deplibs\"\n\t      continue\n\t    fi\n\t    if test scan = \"$pass\"; then\n\t      deplibs=\"$deplib $deplibs\"\n\t    else\n\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t    fi\n\t    func_stripname '-L' '' \"$deplib\"\n\t    func_resolve_sysroot \"$func_stripname_result\"\n\t    func_append newlib_search_path \" $func_resolve_sysroot_result\"\n\t    ;;\n\t  *)\n\t    func_warning \"'-L' is ignored for archives/objects\"\n\t    ;;\n\t  esac # linkmode\n\t  continue\n\t  ;; # -L\n\t-R*)\n\t  if test link = \"$pass\"; then\n\t    func_stripname '-R' '' \"$deplib\"\n\t    func_resolve_sysroot \"$func_stripname_result\"\n\t    dir=$func_resolve_sysroot_result\n\t    # Make sure the xrpath contains only unique directories.\n\t    case \"$xrpath \" in\n\t    *\" $dir \"*) ;;\n\t    *) func_append xrpath \" $dir\" ;;\n\t    esac\n\t  fi\n\t  deplibs=\"$deplib $deplibs\"\n\t  continue\n\t  ;;\n\t*.la)\n\t  func_resolve_sysroot \"$deplib\"\n\t  lib=$func_resolve_sysroot_result\n\t  ;;\n\t*.$libext)\n\t  if test conv = \"$pass\"; then\n\t    deplibs=\"$deplib $deplibs\"\n\t    continue\n\t  fi\n\t  case $linkmode in\n\t  lib)\n\t    # Linking convenience modules into shared libraries is allowed,\n\t    # but linking other static libraries is non-portable.\n\t    case \" $dlpreconveniencelibs \" in\n\t    *\" $deplib \"*) ;;\n\t    *)\n\t      valid_a_lib=false\n\t      case $deplibs_check_method in\n\t\tmatch_pattern*)\n\t\t  set dummy $deplibs_check_method; shift\n\t\t  match_pattern_regex=`expr \"$deplibs_check_method\" : \"$1 \\(.*\\)\"`\n\t\t  if eval \"\\$ECHO \\\"$deplib\\\"\" 2>/dev/null | $SED 10q \\\n\t\t    | $EGREP \"$match_pattern_regex\" > /dev/null; then\n\t\t    valid_a_lib=:\n\t\t  fi\n\t\t;;\n\t\tpass_all)\n\t\t  valid_a_lib=:\n\t\t;;\n\t      esac\n\t      if $valid_a_lib; then\n\t\techo\n\t\t$ECHO \"*** Warning: Linking the shared library $output against the\"\n\t\t$ECHO \"*** static library $deplib is not portable!\"\n\t\tdeplibs=\"$deplib $deplibs\"\n\t      else\n\t\techo\n\t\t$ECHO \"*** Warning: Trying to link with static lib archive $deplib.\"\n\t\techo \"*** I have the capability to make that library automatically link in when\"\n\t\techo \"*** you link to this library.  But I can only do this if you have a\"\n\t\techo \"*** shared version of the library, which you do not appear to have\"\n\t\techo \"*** because the file extensions .$libext of this argument makes me believe\"\n\t\techo \"*** that it is just a static archive that I should not use here.\"\n\t      fi\n\t      ;;\n\t    esac\n\t    continue\n\t    ;;\n\t  prog)\n\t    if test link != \"$pass\"; then\n\t      deplibs=\"$deplib $deplibs\"\n\t    else\n\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t    fi\n\t    continue\n\t    ;;\n\t  esac # linkmode\n\t  ;; # *.$libext\n\t*.lo | *.$objext)\n\t  if test conv = \"$pass\"; then\n\t    deplibs=\"$deplib $deplibs\"\n\t  elif test prog = \"$linkmode\"; then\n\t    if test dlpreopen = \"$pass\" || test yes != \"$dlopen_support\" || test no = \"$build_libtool_libs\"; then\n\t      # If there is no dlopen support or we're linking statically,\n\t      # we need to preload.\n\t      func_append newdlprefiles \" $deplib\"\n\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t    else\n\t      func_append newdlfiles \" $deplib\"\n\t    fi\n\t  fi\n\t  continue\n\t  ;;\n\t%DEPLIBS%)\n\t  alldeplibs=:\n\t  continue\n\t  ;;\n\tesac # case $deplib\n\n\t$found || test -f \"$lib\" \\\n\t  || func_fatal_error \"cannot find the library '$lib' or unhandled argument '$deplib'\"\n\n\t# Check to see that this really is a libtool archive.\n\tfunc_lalib_unsafe_p \"$lib\" \\\n\t  || func_fatal_error \"'$lib' is not a valid libtool archive\"\n\n\tfunc_dirname \"$lib\" \"\" \".\"\n\tladir=$func_dirname_result\n\n\tdlname=\n\tdlopen=\n\tdlpreopen=\n\tlibdir=\n\tlibrary_names=\n\told_library=\n\tinherited_linker_flags=\n\t# If the library was installed with an old release of libtool,\n\t# it will not redefine variables installed, or shouldnotlink\n\tinstalled=yes\n\tshouldnotlink=no\n\tavoidtemprpath=\n\n\n\t# Read the .la file\n\tfunc_source \"$lib\"\n\n\t# Convert \"-framework foo\" to \"foo.ltframework\"\n\tif test -n \"$inherited_linker_flags\"; then\n\t  tmp_inherited_linker_flags=`$ECHO \"$inherited_linker_flags\" | $SED 's/-framework \\([^ $]*\\)/\\1.ltframework/g'`\n\t  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do\n\t    case \" $new_inherited_linker_flags \" in\n\t      *\" $tmp_inherited_linker_flag \"*) ;;\n\t      *) func_append new_inherited_linker_flags \" $tmp_inherited_linker_flag\";;\n\t    esac\n\t  done\n\tfi\n\tdependency_libs=`$ECHO \" $dependency_libs\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\tif test lib,link = \"$linkmode,$pass\" ||\n\t   test prog,scan = \"$linkmode,$pass\" ||\n\t   { test prog != \"$linkmode\" && test lib != \"$linkmode\"; }; then\n\t  test -n \"$dlopen\" && func_append dlfiles \" $dlopen\"\n\t  test -n \"$dlpreopen\" && func_append dlprefiles \" $dlpreopen\"\n\tfi\n\n\tif test conv = \"$pass\"; then\n\t  # Only check for convenience libraries\n\t  deplibs=\"$lib $deplibs\"\n\t  if test -z \"$libdir\"; then\n\t    if test -z \"$old_library\"; then\n\t      func_fatal_error \"cannot find name of link library for '$lib'\"\n\t    fi\n\t    # It is a libtool convenience library, so add in its objects.\n\t    func_append convenience \" $ladir/$objdir/$old_library\"\n\t    func_append old_convenience \" $ladir/$objdir/$old_library\"\n\t    tmp_libs=\n\t    for deplib in $dependency_libs; do\n\t      deplibs=\"$deplib $deplibs\"\n\t      if $opt_preserve_dup_deps; then\n\t\tcase \"$tmp_libs \" in\n\t\t*\" $deplib \"*) func_append specialdeplibs \" $deplib\" ;;\n\t\tesac\n\t      fi\n\t      func_append tmp_libs \" $deplib\"\n\t    done\n\t  elif test prog != \"$linkmode\" && test lib != \"$linkmode\"; then\n\t    func_fatal_error \"'$lib' is not a convenience library\"\n\t  fi\n\t  continue\n\tfi # $pass = conv\n\n\n\t# Get the name of the library we link against.\n\tlinklib=\n\tif test -n \"$old_library\" &&\n\t   { test yes = \"$prefer_static_libs\" ||\n\t     test built,no = \"$prefer_static_libs,$installed\"; }; then\n\t  linklib=$old_library\n\telse\n\t  for l in $old_library $library_names; do\n\t    linklib=$l\n\t  done\n\tfi\n\tif test -z \"$linklib\"; then\n\t  func_fatal_error \"cannot find name of link library for '$lib'\"\n\tfi\n\n\t# This library was specified with -dlopen.\n\tif test dlopen = \"$pass\"; then\n\t  test -z \"$libdir\" \\\n\t    && func_fatal_error \"cannot -dlopen a convenience library: '$lib'\"\n\t  if test -z \"$dlname\" ||\n\t     test yes != \"$dlopen_support\" ||\n\t     test no = \"$build_libtool_libs\"\n\t  then\n\t    # If there is no dlname, no dlopen support or we're linking\n\t    # statically, we need to preload.  We also need to preload any\n\t    # dependent libraries so libltdl's deplib preloader doesn't\n\t    # bomb out in the load deplibs phase.\n\t    func_append dlprefiles \" $lib $dependency_libs\"\n\t  else\n\t    func_append newdlfiles \" $lib\"\n\t  fi\n\t  continue\n\tfi # $pass = dlopen\n\n\t# We need an absolute path.\n\tcase $ladir in\n\t[\\\\/]* | [A-Za-z]:[\\\\/]*) abs_ladir=$ladir ;;\n\t*)\n\t  abs_ladir=`cd \"$ladir\" && pwd`\n\t  if test -z \"$abs_ladir\"; then\n\t    func_warning \"cannot determine absolute directory name of '$ladir'\"\n\t    func_warning \"passing it literally to the linker, although it might fail\"\n\t    abs_ladir=$ladir\n\t  fi\n\t  ;;\n\tesac\n\tfunc_basename \"$lib\"\n\tlaname=$func_basename_result\n\n\t# Find the relevant object directory and library name.\n\tif test yes = \"$installed\"; then\n\t  if test ! -f \"$lt_sysroot$libdir/$linklib\" && test -f \"$abs_ladir/$linklib\"; then\n\t    func_warning \"library '$lib' was moved.\"\n\t    dir=$ladir\n\t    absdir=$abs_ladir\n\t    libdir=$abs_ladir\n\t  else\n\t    dir=$lt_sysroot$libdir\n\t    absdir=$lt_sysroot$libdir\n\t  fi\n\t  test yes = \"$hardcode_automatic\" && avoidtemprpath=yes\n\telse\n\t  if test ! -f \"$ladir/$objdir/$linklib\" && test -f \"$abs_ladir/$linklib\"; then\n\t    dir=$ladir\n\t    absdir=$abs_ladir\n\t    # Remove this search path later\n\t    func_append notinst_path \" $abs_ladir\"\n\t  else\n\t    dir=$ladir/$objdir\n\t    absdir=$abs_ladir/$objdir\n\t    # Remove this search path later\n\t    func_append notinst_path \" $abs_ladir\"\n\t  fi\n\tfi # $installed = yes\n\tfunc_stripname 'lib' '.la' \"$laname\"\n\tname=$func_stripname_result\n\n\t# This library was specified with -dlpreopen.\n\tif test dlpreopen = \"$pass\"; then\n\t  if test -z \"$libdir\" && test prog = \"$linkmode\"; then\n\t    func_fatal_error \"only libraries may -dlpreopen a convenience library: '$lib'\"\n\t  fi\n\t  case $host in\n\t    # special handling for platforms with PE-DLLs.\n\t    *cygwin* | *mingw* | *cegcc* )\n\t      # Linker will automatically link against shared library if both\n\t      # static and shared are present.  Therefore, ensure we extract\n\t      # symbols from the import library if a shared library is present\n\t      # (otherwise, the dlopen module name will be incorrect).  We do\n\t      # this by putting the import library name into $newdlprefiles.\n\t      # We recover the dlopen module name by 'saving' the la file\n\t      # name in a special purpose variable, and (later) extracting the\n\t      # dlname from the la file.\n\t      if test -n \"$dlname\"; then\n\t        func_tr_sh \"$dir/$linklib\"\n\t        eval \"libfile_$func_tr_sh_result=\\$abs_ladir/\\$laname\"\n\t        func_append newdlprefiles \" $dir/$linklib\"\n\t      else\n\t        func_append newdlprefiles \" $dir/$old_library\"\n\t        # Keep a list of preopened convenience libraries to check\n\t        # that they are being used correctly in the link pass.\n\t        test -z \"$libdir\" && \\\n\t          func_append dlpreconveniencelibs \" $dir/$old_library\"\n\t      fi\n\t    ;;\n\t    * )\n\t      # Prefer using a static library (so that no silly _DYNAMIC symbols\n\t      # are required to link).\n\t      if test -n \"$old_library\"; then\n\t        func_append newdlprefiles \" $dir/$old_library\"\n\t        # Keep a list of preopened convenience libraries to check\n\t        # that they are being used correctly in the link pass.\n\t        test -z \"$libdir\" && \\\n\t          func_append dlpreconveniencelibs \" $dir/$old_library\"\n\t      # Otherwise, use the dlname, so that lt_dlopen finds it.\n\t      elif test -n \"$dlname\"; then\n\t        func_append newdlprefiles \" $dir/$dlname\"\n\t      else\n\t        func_append newdlprefiles \" $dir/$linklib\"\n\t      fi\n\t    ;;\n\t  esac\n\tfi # $pass = dlpreopen\n\n\tif test -z \"$libdir\"; then\n\t  # Link the convenience library\n\t  if test lib = \"$linkmode\"; then\n\t    deplibs=\"$dir/$old_library $deplibs\"\n\t  elif test prog,link = \"$linkmode,$pass\"; then\n\t    compile_deplibs=\"$dir/$old_library $compile_deplibs\"\n\t    finalize_deplibs=\"$dir/$old_library $finalize_deplibs\"\n\t  else\n\t    deplibs=\"$lib $deplibs\" # used for prog,scan pass\n\t  fi\n\t  continue\n\tfi\n\n\n\tif test prog = \"$linkmode\" && test link != \"$pass\"; then\n\t  func_append newlib_search_path \" $ladir\"\n\t  deplibs=\"$lib $deplibs\"\n\n\t  linkalldeplibs=false\n\t  if test no != \"$link_all_deplibs\" || test -z \"$library_names\" ||\n\t     test no = \"$build_libtool_libs\"; then\n\t    linkalldeplibs=:\n\t  fi\n\n\t  tmp_libs=\n\t  for deplib in $dependency_libs; do\n\t    case $deplib in\n\t    -L*) func_stripname '-L' '' \"$deplib\"\n\t         func_resolve_sysroot \"$func_stripname_result\"\n\t         func_append newlib_search_path \" $func_resolve_sysroot_result\"\n\t\t ;;\n\t    esac\n\t    # Need to link against all dependency_libs?\n\t    if $linkalldeplibs; then\n\t      deplibs=\"$deplib $deplibs\"\n\t    else\n\t      # Need to hardcode shared library paths\n\t      # or/and link against static libraries\n\t      newdependency_libs=\"$deplib $newdependency_libs\"\n\t    fi\n\t    if $opt_preserve_dup_deps; then\n\t      case \"$tmp_libs \" in\n\t      *\" $deplib \"*) func_append specialdeplibs \" $deplib\" ;;\n\t      esac\n\t    fi\n\t    func_append tmp_libs \" $deplib\"\n\t  done # for deplib\n\t  continue\n\tfi # $linkmode = prog...\n\n\tif test prog,link = \"$linkmode,$pass\"; then\n\t  if test -n \"$library_names\" &&\n\t     { { test no = \"$prefer_static_libs\" ||\n\t         test built,yes = \"$prefer_static_libs,$installed\"; } ||\n\t       test -z \"$old_library\"; }; then\n\t    # We need to hardcode the library path\n\t    if test -n \"$shlibpath_var\" && test -z \"$avoidtemprpath\"; then\n\t      # Make sure the rpath contains only unique directories.\n\t      case $temp_rpath: in\n\t      *\"$absdir:\"*) ;;\n\t      *) func_append temp_rpath \"$absdir:\" ;;\n\t      esac\n\t    fi\n\n\t    # Hardcode the library path.\n\t    # Skip directories that are in the system default run-time\n\t    # search path.\n\t    case \" $sys_lib_dlsearch_path \" in\n\t    *\" $absdir \"*) ;;\n\t    *)\n\t      case \"$compile_rpath \" in\n\t      *\" $absdir \"*) ;;\n\t      *) func_append compile_rpath \" $absdir\" ;;\n\t      esac\n\t      ;;\n\t    esac\n\t    case \" $sys_lib_dlsearch_path \" in\n\t    *\" $libdir \"*) ;;\n\t    *)\n\t      case \"$finalize_rpath \" in\n\t      *\" $libdir \"*) ;;\n\t      *) func_append finalize_rpath \" $libdir\" ;;\n\t      esac\n\t      ;;\n\t    esac\n\t  fi # $linkmode,$pass = prog,link...\n\n\t  if $alldeplibs &&\n\t     { test pass_all = \"$deplibs_check_method\" ||\n\t       { test yes = \"$build_libtool_libs\" &&\n\t\t test -n \"$library_names\"; }; }; then\n\t    # We only need to search for static libraries\n\t    continue\n\t  fi\n\tfi\n\n\tlink_static=no # Whether the deplib will be linked statically\n\tuse_static_libs=$prefer_static_libs\n\tif test built = \"$use_static_libs\" && test yes = \"$installed\"; then\n\t  use_static_libs=no\n\tfi\n\tif test -n \"$library_names\" &&\n\t   { test no = \"$use_static_libs\" || test -z \"$old_library\"; }; then\n\t  case $host in\n\t  *cygwin* | *mingw* | *cegcc* | *os2*)\n\t      # No point in relinking DLLs because paths are not encoded\n\t      func_append notinst_deplibs \" $lib\"\n\t      need_relink=no\n\t    ;;\n\t  *)\n\t    if test no = \"$installed\"; then\n\t      func_append notinst_deplibs \" $lib\"\n\t      need_relink=yes\n\t    fi\n\t    ;;\n\t  esac\n\t  # This is a shared library\n\n\t  # Warn about portability, can't link against -module's on some\n\t  # systems (darwin).  Don't bleat about dlopened modules though!\n\t  dlopenmodule=\n\t  for dlpremoduletest in $dlprefiles; do\n\t    if test \"X$dlpremoduletest\" = \"X$lib\"; then\n\t      dlopenmodule=$dlpremoduletest\n\t      break\n\t    fi\n\t  done\n\t  if test -z \"$dlopenmodule\" && test yes = \"$shouldnotlink\" && test link = \"$pass\"; then\n\t    echo\n\t    if test prog = \"$linkmode\"; then\n\t      $ECHO \"*** Warning: Linking the executable $output against the loadable module\"\n\t    else\n\t      $ECHO \"*** Warning: Linking the shared library $output against the loadable module\"\n\t    fi\n\t    $ECHO \"*** $linklib is not portable!\"\n\t  fi\n\t  if test lib = \"$linkmode\" &&\n\t     test yes = \"$hardcode_into_libs\"; then\n\t    # Hardcode the library path.\n\t    # Skip directories that are in the system default run-time\n\t    # search path.\n\t    case \" $sys_lib_dlsearch_path \" in\n\t    *\" $absdir \"*) ;;\n\t    *)\n\t      case \"$compile_rpath \" in\n\t      *\" $absdir \"*) ;;\n\t      *) func_append compile_rpath \" $absdir\" ;;\n\t      esac\n\t      ;;\n\t    esac\n\t    case \" $sys_lib_dlsearch_path \" in\n\t    *\" $libdir \"*) ;;\n\t    *)\n\t      case \"$finalize_rpath \" in\n\t      *\" $libdir \"*) ;;\n\t      *) func_append finalize_rpath \" $libdir\" ;;\n\t      esac\n\t      ;;\n\t    esac\n\t  fi\n\n\t  if test -n \"$old_archive_from_expsyms_cmds\"; then\n\t    # figure out the soname\n\t    set dummy $library_names\n\t    shift\n\t    realname=$1\n\t    shift\n\t    libname=`eval \"\\\\$ECHO \\\"$libname_spec\\\"\"`\n\t    # use dlname if we got it. it's perfectly good, no?\n\t    if test -n \"$dlname\"; then\n\t      soname=$dlname\n\t    elif test -n \"$soname_spec\"; then\n\t      # bleh windows\n\t      case $host in\n\t      *cygwin* | mingw* | *cegcc* | *os2*)\n\t        func_arith $current - $age\n\t\tmajor=$func_arith_result\n\t\tversuffix=-$major\n\t\t;;\n\t      esac\n\t      eval soname=\\\"$soname_spec\\\"\n\t    else\n\t      soname=$realname\n\t    fi\n\n\t    # Make a new name for the extract_expsyms_cmds to use\n\t    soroot=$soname\n\t    func_basename \"$soroot\"\n\t    soname=$func_basename_result\n\t    func_stripname 'lib' '.dll' \"$soname\"\n\t    newlib=libimp-$func_stripname_result.a\n\n\t    # If the library has no export list, then create one now\n\t    if test -f \"$output_objdir/$soname-def\"; then :\n\t    else\n\t      func_verbose \"extracting exported symbol list from '$soname'\"\n\t      func_execute_cmds \"$extract_expsyms_cmds\" 'exit $?'\n\t    fi\n\n\t    # Create $newlib\n\t    if test -f \"$output_objdir/$newlib\"; then :; else\n\t      func_verbose \"generating import library for '$soname'\"\n\t      func_execute_cmds \"$old_archive_from_expsyms_cmds\" 'exit $?'\n\t    fi\n\t    # make sure the library variables are pointing to the new library\n\t    dir=$output_objdir\n\t    linklib=$newlib\n\t  fi # test -n \"$old_archive_from_expsyms_cmds\"\n\n\t  if test prog = \"$linkmode\" || test relink != \"$opt_mode\"; then\n\t    add_shlibpath=\n\t    add_dir=\n\t    add=\n\t    lib_linked=yes\n\t    case $hardcode_action in\n\t    immediate | unsupported)\n\t      if test no = \"$hardcode_direct\"; then\n\t\tadd=$dir/$linklib\n\t\tcase $host in\n\t\t  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;\n\t\t  *-*-sysv4*uw2*) add_dir=-L$dir ;;\n\t\t  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \\\n\t\t    *-*-unixware7*) add_dir=-L$dir ;;\n\t\t  *-*-darwin* )\n\t\t    # if the lib is a (non-dlopened) module then we cannot\n\t\t    # link against it, someone is ignoring the earlier warnings\n\t\t    if /usr/bin/file -L $add 2> /dev/null |\n\t\t\t $GREP \": [^:]* bundle\" >/dev/null; then\n\t\t      if test \"X$dlopenmodule\" != \"X$lib\"; then\n\t\t\t$ECHO \"*** Warning: lib $linklib is a module, not a shared library\"\n\t\t\tif test -z \"$old_library\"; then\n\t\t\t  echo\n\t\t\t  echo \"*** And there doesn't seem to be a static archive available\"\n\t\t\t  echo \"*** The link will probably fail, sorry\"\n\t\t\telse\n\t\t\t  add=$dir/$old_library\n\t\t\tfi\n\t\t      elif test -n \"$old_library\"; then\n\t\t\tadd=$dir/$old_library\n\t\t      fi\n\t\t    fi\n\t\tesac\n\t      elif test no = \"$hardcode_minus_L\"; then\n\t\tcase $host in\n\t\t*-*-sunos*) add_shlibpath=$dir ;;\n\t\tesac\n\t\tadd_dir=-L$dir\n\t\tadd=-l$name\n\t      elif test no = \"$hardcode_shlibpath_var\"; then\n\t\tadd_shlibpath=$dir\n\t\tadd=-l$name\n\t      else\n\t\tlib_linked=no\n\t      fi\n\t      ;;\n\t    relink)\n\t      if test yes = \"$hardcode_direct\" &&\n\t         test no = \"$hardcode_direct_absolute\"; then\n\t\tadd=$dir/$linklib\n\t      elif test yes = \"$hardcode_minus_L\"; then\n\t\tadd_dir=-L$absdir\n\t\t# Try looking first in the location we're being installed to.\n\t\tif test -n \"$inst_prefix_dir\"; then\n\t\t  case $libdir in\n\t\t    [\\\\/]*)\n\t\t      func_append add_dir \" -L$inst_prefix_dir$libdir\"\n\t\t      ;;\n\t\t  esac\n\t\tfi\n\t\tadd=-l$name\n\t      elif test yes = \"$hardcode_shlibpath_var\"; then\n\t\tadd_shlibpath=$dir\n\t\tadd=-l$name\n\t      else\n\t\tlib_linked=no\n\t      fi\n\t      ;;\n\t    *) lib_linked=no ;;\n\t    esac\n\n\t    if test yes != \"$lib_linked\"; then\n\t      func_fatal_configuration \"unsupported hardcode properties\"\n\t    fi\n\n\t    if test -n \"$add_shlibpath\"; then\n\t      case :$compile_shlibpath: in\n\t      *\":$add_shlibpath:\"*) ;;\n\t      *) func_append compile_shlibpath \"$add_shlibpath:\" ;;\n\t      esac\n\t    fi\n\t    if test prog = \"$linkmode\"; then\n\t      test -n \"$add_dir\" && compile_deplibs=\"$add_dir $compile_deplibs\"\n\t      test -n \"$add\" && compile_deplibs=\"$add $compile_deplibs\"\n\t    else\n\t      test -n \"$add_dir\" && deplibs=\"$add_dir $deplibs\"\n\t      test -n \"$add\" && deplibs=\"$add $deplibs\"\n\t      if test yes != \"$hardcode_direct\" &&\n\t\t test yes != \"$hardcode_minus_L\" &&\n\t\t test yes = \"$hardcode_shlibpath_var\"; then\n\t\tcase :$finalize_shlibpath: in\n\t\t*\":$libdir:\"*) ;;\n\t\t*) func_append finalize_shlibpath \"$libdir:\" ;;\n\t\tesac\n\t      fi\n\t    fi\n\t  fi\n\n\t  if test prog = \"$linkmode\" || test relink = \"$opt_mode\"; then\n\t    add_shlibpath=\n\t    add_dir=\n\t    add=\n\t    # Finalize command for both is simple: just hardcode it.\n\t    if test yes = \"$hardcode_direct\" &&\n\t       test no = \"$hardcode_direct_absolute\"; then\n\t      add=$libdir/$linklib\n\t    elif test yes = \"$hardcode_minus_L\"; then\n\t      add_dir=-L$libdir\n\t      add=-l$name\n\t    elif test yes = \"$hardcode_shlibpath_var\"; then\n\t      case :$finalize_shlibpath: in\n\t      *\":$libdir:\"*) ;;\n\t      *) func_append finalize_shlibpath \"$libdir:\" ;;\n\t      esac\n\t      add=-l$name\n\t    elif test yes = \"$hardcode_automatic\"; then\n\t      if test -n \"$inst_prefix_dir\" &&\n\t\t test -f \"$inst_prefix_dir$libdir/$linklib\"; then\n\t\tadd=$inst_prefix_dir$libdir/$linklib\n\t      else\n\t\tadd=$libdir/$linklib\n\t      fi\n\t    else\n\t      # We cannot seem to hardcode it, guess we'll fake it.\n\t      add_dir=-L$libdir\n\t      # Try looking first in the location we're being installed to.\n\t      if test -n \"$inst_prefix_dir\"; then\n\t\tcase $libdir in\n\t\t  [\\\\/]*)\n\t\t    func_append add_dir \" -L$inst_prefix_dir$libdir\"\n\t\t    ;;\n\t\tesac\n\t      fi\n\t      add=-l$name\n\t    fi\n\n\t    if test prog = \"$linkmode\"; then\n\t      test -n \"$add_dir\" && finalize_deplibs=\"$add_dir $finalize_deplibs\"\n\t      test -n \"$add\" && finalize_deplibs=\"$add $finalize_deplibs\"\n\t    else\n\t      test -n \"$add_dir\" && deplibs=\"$add_dir $deplibs\"\n\t      test -n \"$add\" && deplibs=\"$add $deplibs\"\n\t    fi\n\t  fi\n\telif test prog = \"$linkmode\"; then\n\t  # Here we assume that one of hardcode_direct or hardcode_minus_L\n\t  # is not unsupported.  This is valid on all known static and\n\t  # shared platforms.\n\t  if test unsupported != \"$hardcode_direct\"; then\n\t    test -n \"$old_library\" && linklib=$old_library\n\t    compile_deplibs=\"$dir/$linklib $compile_deplibs\"\n\t    finalize_deplibs=\"$dir/$linklib $finalize_deplibs\"\n\t  else\n\t    compile_deplibs=\"-l$name -L$dir $compile_deplibs\"\n\t    finalize_deplibs=\"-l$name -L$dir $finalize_deplibs\"\n\t  fi\n\telif test yes = \"$build_libtool_libs\"; then\n\t  # Not a shared library\n\t  if test pass_all != \"$deplibs_check_method\"; then\n\t    # We're trying link a shared library against a static one\n\t    # but the system doesn't support it.\n\n\t    # Just print a warning and add the library to dependency_libs so\n\t    # that the program can be linked against the static library.\n\t    echo\n\t    $ECHO \"*** Warning: This system cannot link to static lib archive $lib.\"\n\t    echo \"*** I have the capability to make that library automatically link in when\"\n\t    echo \"*** you link to this library.  But I can only do this if you have a\"\n\t    echo \"*** shared version of the library, which you do not appear to have.\"\n\t    if test yes = \"$module\"; then\n\t      echo \"*** But as you try to build a module library, libtool will still create \"\n\t      echo \"*** a static module, that should work as long as the dlopening application\"\n\t      echo \"*** is linked with the -dlopen flag to resolve symbols at runtime.\"\n\t      if test -z \"$global_symbol_pipe\"; then\n\t\techo\n\t\techo \"*** However, this would only work if libtool was able to extract symbol\"\n\t\techo \"*** lists from a program, using 'nm' or equivalent, but libtool could\"\n\t\techo \"*** not find such a program.  So, this module is probably useless.\"\n\t\techo \"*** 'nm' from GNU binutils and a full rebuild may help.\"\n\t      fi\n\t      if test no = \"$build_old_libs\"; then\n\t\tbuild_libtool_libs=module\n\t\tbuild_old_libs=yes\n\t      else\n\t\tbuild_libtool_libs=no\n\t      fi\n\t    fi\n\t  else\n\t    deplibs=\"$dir/$old_library $deplibs\"\n\t    link_static=yes\n\t  fi\n\tfi # link shared/static library?\n\n\tif test lib = \"$linkmode\"; then\n\t  if test -n \"$dependency_libs\" &&\n\t     { test yes != \"$hardcode_into_libs\" ||\n\t       test yes = \"$build_old_libs\" ||\n\t       test yes = \"$link_static\"; }; then\n\t    # Extract -R from dependency_libs\n\t    temp_deplibs=\n\t    for libdir in $dependency_libs; do\n\t      case $libdir in\n\t      -R*) func_stripname '-R' '' \"$libdir\"\n\t           temp_xrpath=$func_stripname_result\n\t\t   case \" $xrpath \" in\n\t\t   *\" $temp_xrpath \"*) ;;\n\t\t   *) func_append xrpath \" $temp_xrpath\";;\n\t\t   esac;;\n\t      *) func_append temp_deplibs \" $libdir\";;\n\t      esac\n\t    done\n\t    dependency_libs=$temp_deplibs\n\t  fi\n\n\t  func_append newlib_search_path \" $absdir\"\n\t  # Link against this library\n\t  test no = \"$link_static\" && newdependency_libs=\"$abs_ladir/$laname $newdependency_libs\"\n\t  # ... and its dependency_libs\n\t  tmp_libs=\n\t  for deplib in $dependency_libs; do\n\t    newdependency_libs=\"$deplib $newdependency_libs\"\n\t    case $deplib in\n              -L*) func_stripname '-L' '' \"$deplib\"\n                   func_resolve_sysroot \"$func_stripname_result\";;\n              *) func_resolve_sysroot \"$deplib\" ;;\n            esac\n\t    if $opt_preserve_dup_deps; then\n\t      case \"$tmp_libs \" in\n\t      *\" $func_resolve_sysroot_result \"*)\n                func_append specialdeplibs \" $func_resolve_sysroot_result\" ;;\n\t      esac\n\t    fi\n\t    func_append tmp_libs \" $func_resolve_sysroot_result\"\n\t  done\n\n\t  if test no != \"$link_all_deplibs\"; then\n\t    # Add the search paths of all dependency libraries\n\t    for deplib in $dependency_libs; do\n\t      path=\n\t      case $deplib in\n\t      -L*) path=$deplib ;;\n\t      *.la)\n\t        func_resolve_sysroot \"$deplib\"\n\t        deplib=$func_resolve_sysroot_result\n\t        func_dirname \"$deplib\" \"\" \".\"\n\t\tdir=$func_dirname_result\n\t\t# We need an absolute path.\n\t\tcase $dir in\n\t\t[\\\\/]* | [A-Za-z]:[\\\\/]*) absdir=$dir ;;\n\t\t*)\n\t\t  absdir=`cd \"$dir\" && pwd`\n\t\t  if test -z \"$absdir\"; then\n\t\t    func_warning \"cannot determine absolute directory name of '$dir'\"\n\t\t    absdir=$dir\n\t\t  fi\n\t\t  ;;\n\t\tesac\n\t\tif $GREP \"^installed=no\" $deplib > /dev/null; then\n\t\tcase $host in\n\t\t*-*-darwin*)\n\t\t  depdepl=\n\t\t  eval deplibrary_names=`$SED -n -e 's/^library_names=\\(.*\\)$/\\1/p' $deplib`\n\t\t  if test -n \"$deplibrary_names\"; then\n\t\t    for tmp in $deplibrary_names; do\n\t\t      depdepl=$tmp\n\t\t    done\n\t\t    if test -f \"$absdir/$objdir/$depdepl\"; then\n\t\t      depdepl=$absdir/$objdir/$depdepl\n\t\t      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`\n                      if test -z \"$darwin_install_name\"; then\n                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`\n                      fi\n\t\t      func_append compiler_flags \" $wl-dylib_file $wl$darwin_install_name:$depdepl\"\n\t\t      func_append linker_flags \" -dylib_file $darwin_install_name:$depdepl\"\n\t\t      path=\n\t\t    fi\n\t\t  fi\n\t\t  ;;\n\t\t*)\n\t\t  path=-L$absdir/$objdir\n\t\t  ;;\n\t\tesac\n\t\telse\n\t\t  eval libdir=`$SED -n -e 's/^libdir=\\(.*\\)$/\\1/p' $deplib`\n\t\t  test -z \"$libdir\" && \\\n\t\t    func_fatal_error \"'$deplib' is not a valid libtool archive\"\n\t\t  test \"$absdir\" != \"$libdir\" && \\\n\t\t    func_warning \"'$deplib' seems to be moved\"\n\n\t\t  path=-L$absdir\n\t\tfi\n\t\t;;\n\t      esac\n\t      case \" $deplibs \" in\n\t      *\" $path \"*) ;;\n\t      *) deplibs=\"$path $deplibs\" ;;\n\t      esac\n\t    done\n\t  fi # link_all_deplibs != no\n\tfi # linkmode = lib\n      done # for deplib in $libs\n      if test link = \"$pass\"; then\n\tif test prog = \"$linkmode\"; then\n\t  compile_deplibs=\"$new_inherited_linker_flags $compile_deplibs\"\n\t  finalize_deplibs=\"$new_inherited_linker_flags $finalize_deplibs\"\n\telse\n\t  compiler_flags=\"$compiler_flags \"`$ECHO \" $new_inherited_linker_flags\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\tfi\n      fi\n      dependency_libs=$newdependency_libs\n      if test dlpreopen = \"$pass\"; then\n\t# Link the dlpreopened libraries before other libraries\n\tfor deplib in $save_deplibs; do\n\t  deplibs=\"$deplib $deplibs\"\n\tdone\n      fi\n      if test dlopen != \"$pass\"; then\n\ttest conv = \"$pass\" || {\n\t  # Make sure lib_search_path contains only unique directories.\n\t  lib_search_path=\n\t  for dir in $newlib_search_path; do\n\t    case \"$lib_search_path \" in\n\t    *\" $dir \"*) ;;\n\t    *) func_append lib_search_path \" $dir\" ;;\n\t    esac\n\t  done\n\t  newlib_search_path=\n\t}\n\n\tif test prog,link = \"$linkmode,$pass\"; then\n\t  vars=\"compile_deplibs finalize_deplibs\"\n\telse\n\t  vars=deplibs\n\tfi\n\tfor var in $vars dependency_libs; do\n\t  # Add libraries to $var in reverse order\n\t  eval tmp_libs=\\\"\\$$var\\\"\n\t  new_libs=\n\t  for deplib in $tmp_libs; do\n\t    # FIXME: Pedantically, this is the right thing to do, so\n\t    #        that some nasty dependency loop isn't accidentally\n\t    #        broken:\n\t    #new_libs=\"$deplib $new_libs\"\n\t    # Pragmatically, this seems to cause very few problems in\n\t    # practice:\n\t    case $deplib in\n\t    -L*) new_libs=\"$deplib $new_libs\" ;;\n\t    -R*) ;;\n\t    *)\n\t      # And here is the reason: when a library appears more\n\t      # than once as an explicit dependence of a library, or\n\t      # is implicitly linked in more than once by the\n\t      # compiler, it is considered special, and multiple\n\t      # occurrences thereof are not removed.  Compare this\n\t      # with having the same library being listed as a\n\t      # dependency of multiple other libraries: in this case,\n\t      # we know (pedantically, we assume) the library does not\n\t      # need to be listed more than once, so we keep only the\n\t      # last copy.  This is not always right, but it is rare\n\t      # enough that we require users that really mean to play\n\t      # such unportable linking tricks to link the library\n\t      # using -Wl,-lname, so that libtool does not consider it\n\t      # for duplicate removal.\n\t      case \" $specialdeplibs \" in\n\t      *\" $deplib \"*) new_libs=\"$deplib $new_libs\" ;;\n\t      *)\n\t\tcase \" $new_libs \" in\n\t\t*\" $deplib \"*) ;;\n\t\t*) new_libs=\"$deplib $new_libs\" ;;\n\t\tesac\n\t\t;;\n\t      esac\n\t      ;;\n\t    esac\n\t  done\n\t  tmp_libs=\n\t  for deplib in $new_libs; do\n\t    case $deplib in\n\t    -L*)\n\t      case \" $tmp_libs \" in\n\t      *\" $deplib \"*) ;;\n\t      *) func_append tmp_libs \" $deplib\" ;;\n\t      esac\n\t      ;;\n\t    *) func_append tmp_libs \" $deplib\" ;;\n\t    esac\n\t  done\n\t  eval $var=\\\"$tmp_libs\\\"\n\tdone # for var\n      fi\n\n      # Add Sun CC postdeps if required:\n      test CXX = \"$tagname\" && {\n        case $host_os in\n        linux*)\n          case `$CC -V 2>&1 | sed 5q` in\n          *Sun\\ C*) # Sun C++ 5.9\n            func_suncc_cstd_abi\n\n            if test no != \"$suncc_use_cstd_abi\"; then\n              func_append postdeps ' -library=Cstd -library=Crun'\n            fi\n            ;;\n          esac\n          ;;\n\n        solaris*)\n          func_cc_basename \"$CC\"\n          case $func_cc_basename_result in\n          CC* | sunCC*)\n            func_suncc_cstd_abi\n\n            if test no != \"$suncc_use_cstd_abi\"; then\n              func_append postdeps ' -library=Cstd -library=Crun'\n            fi\n            ;;\n          esac\n          ;;\n        esac\n      }\n\n      # Last step: remove runtime libs from dependency_libs\n      # (they stay in deplibs)\n      tmp_libs=\n      for i in $dependency_libs; do\n\tcase \" $predeps $postdeps $compiler_lib_search_path \" in\n\t*\" $i \"*)\n\t  i=\n\t  ;;\n\tesac\n\tif test -n \"$i\"; then\n\t  func_append tmp_libs \" $i\"\n\tfi\n      done\n      dependency_libs=$tmp_libs\n    done # for pass\n    if test prog = \"$linkmode\"; then\n      dlfiles=$newdlfiles\n    fi\n    if test prog = \"$linkmode\" || test lib = \"$linkmode\"; then\n      dlprefiles=$newdlprefiles\n    fi\n\n    case $linkmode in\n    oldlib)\n      if test -n \"$dlfiles$dlprefiles\" || test no != \"$dlself\"; then\n\tfunc_warning \"'-dlopen' is ignored for archives\"\n      fi\n\n      case \" $deplibs\" in\n      *\\ -l* | *\\ -L*)\n\tfunc_warning \"'-l' and '-L' are ignored for archives\" ;;\n      esac\n\n      test -n \"$rpath\" && \\\n\tfunc_warning \"'-rpath' is ignored for archives\"\n\n      test -n \"$xrpath\" && \\\n\tfunc_warning \"'-R' is ignored for archives\"\n\n      test -n \"$vinfo\" && \\\n\tfunc_warning \"'-version-info/-version-number' is ignored for archives\"\n\n      test -n \"$release\" && \\\n\tfunc_warning \"'-release' is ignored for archives\"\n\n      test -n \"$export_symbols$export_symbols_regex\" && \\\n\tfunc_warning \"'-export-symbols' is ignored for archives\"\n\n      # Now set the variables for building old libraries.\n      build_libtool_libs=no\n      oldlibs=$output\n      func_append objs \"$old_deplibs\"\n      ;;\n\n    lib)\n      # Make sure we only generate libraries of the form 'libNAME.la'.\n      case $outputname in\n      lib*)\n\tfunc_stripname 'lib' '.la' \"$outputname\"\n\tname=$func_stripname_result\n\teval shared_ext=\\\"$shrext_cmds\\\"\n\teval libname=\\\"$libname_spec\\\"\n\t;;\n      *)\n\ttest no = \"$module\" \\\n\t  && func_fatal_help \"libtool library '$output' must begin with 'lib'\"\n\n\tif test no != \"$need_lib_prefix\"; then\n\t  # Add the \"lib\" prefix for modules if required\n\t  func_stripname '' '.la' \"$outputname\"\n\t  name=$func_stripname_result\n\t  eval shared_ext=\\\"$shrext_cmds\\\"\n\t  eval libname=\\\"$libname_spec\\\"\n\telse\n\t  func_stripname '' '.la' \"$outputname\"\n\t  libname=$func_stripname_result\n\tfi\n\t;;\n      esac\n\n      if test -n \"$objs\"; then\n\tif test pass_all != \"$deplibs_check_method\"; then\n\t  func_fatal_error \"cannot build libtool library '$output' from non-libtool objects on this host:$objs\"\n\telse\n\t  echo\n\t  $ECHO \"*** Warning: Linking the shared library $output against the non-libtool\"\n\t  $ECHO \"*** objects $objs is not portable!\"\n\t  func_append libobjs \" $objs\"\n\tfi\n      fi\n\n      test no = \"$dlself\" \\\n\t|| func_warning \"'-dlopen self' is ignored for libtool libraries\"\n\n      set dummy $rpath\n      shift\n      test 1 -lt \"$#\" \\\n\t&& func_warning \"ignoring multiple '-rpath's for a libtool library\"\n\n      install_libdir=$1\n\n      oldlibs=\n      if test -z \"$rpath\"; then\n\tif test yes = \"$build_libtool_libs\"; then\n\t  # Building a libtool convenience library.\n\t  # Some compilers have problems with a '.al' extension so\n\t  # convenience libraries should have the same extension an\n\t  # archive normally would.\n\t  oldlibs=\"$output_objdir/$libname.$libext $oldlibs\"\n\t  build_libtool_libs=convenience\n\t  build_old_libs=yes\n\tfi\n\n\ttest -n \"$vinfo\" && \\\n\t  func_warning \"'-version-info/-version-number' is ignored for convenience libraries\"\n\n\ttest -n \"$release\" && \\\n\t  func_warning \"'-release' is ignored for convenience libraries\"\n      else\n\n\t# Parse the version information argument.\n\tsave_ifs=$IFS; IFS=:\n\tset dummy $vinfo 0 0 0\n\tshift\n\tIFS=$save_ifs\n\n\ttest -n \"$7\" && \\\n\t  func_fatal_help \"too many parameters to '-version-info'\"\n\n\t# convert absolute version numbers to libtool ages\n\t# this retains compatibility with .la files and attempts\n\t# to make the code below a bit more comprehensible\n\n\tcase $vinfo_number in\n\tyes)\n\t  number_major=$1\n\t  number_minor=$2\n\t  number_revision=$3\n\t  #\n\t  # There are really only two kinds -- those that\n\t  # use the current revision as the major version\n\t  # and those that subtract age and use age as\n\t  # a minor version.  But, then there is irix\n\t  # that has an extra 1 added just for fun\n\t  #\n\t  case $version_type in\n\t  # correct linux to gnu/linux during the next big refactor\n\t  darwin|freebsd-elf|linux|osf|windows|none)\n\t    func_arith $number_major + $number_minor\n\t    current=$func_arith_result\n\t    age=$number_minor\n\t    revision=$number_revision\n\t    ;;\n\t  freebsd-aout|qnx|sunos)\n\t    current=$number_major\n\t    revision=$number_minor\n\t    age=0\n\t    ;;\n\t  irix|nonstopux)\n\t    func_arith $number_major + $number_minor\n\t    current=$func_arith_result\n\t    age=$number_minor\n\t    revision=$number_minor\n\t    lt_irix_increment=no\n\t    ;;\n\t  *)\n\t    func_fatal_configuration \"$modename: unknown library version type '$version_type'\"\n\t    ;;\n\t  esac\n\t  ;;\n\tno)\n\t  current=$1\n\t  revision=$2\n\t  age=$3\n\t  ;;\n\tesac\n\n\t# Check that each of the things are valid numbers.\n\tcase $current in\n\t0|[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]) ;;\n\t*)\n\t  func_error \"CURRENT '$current' must be a nonnegative integer\"\n\t  func_fatal_error \"'$vinfo' is not valid version information\"\n\t  ;;\n\tesac\n\n\tcase $revision in\n\t0|[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]) ;;\n\t*)\n\t  func_error \"REVISION '$revision' must be a nonnegative integer\"\n\t  func_fatal_error \"'$vinfo' is not valid version information\"\n\t  ;;\n\tesac\n\n\tcase $age in\n\t0|[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]) ;;\n\t*)\n\t  func_error \"AGE '$age' must be a nonnegative integer\"\n\t  func_fatal_error \"'$vinfo' is not valid version information\"\n\t  ;;\n\tesac\n\n\tif test \"$age\" -gt \"$current\"; then\n\t  func_error \"AGE '$age' is greater than the current interface number '$current'\"\n\t  func_fatal_error \"'$vinfo' is not valid version information\"\n\tfi\n\n\t# Calculate the version variables.\n\tmajor=\n\tversuffix=\n\tverstring=\n\tcase $version_type in\n\tnone) ;;\n\n\tdarwin)\n\t  # Like Linux, but with the current version available in\n\t  # verstring for coding it into the library header\n\t  func_arith $current - $age\n\t  major=.$func_arith_result\n\t  versuffix=$major.$age.$revision\n\t  # Darwin ld doesn't like 0 for these options...\n\t  func_arith $current + 1\n\t  minor_current=$func_arith_result\n\t  xlcverstring=\"$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision\"\n\t  verstring=\"-compatibility_version $minor_current -current_version $minor_current.$revision\"\n          # On Darwin other compilers\n          case $CC in\n              nagfor*)\n                  verstring=\"$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision\"\n                  ;;\n              *)\n                  verstring=\"-compatibility_version $minor_current -current_version $minor_current.$revision\"\n                  ;;\n          esac\n\t  ;;\n\n\tfreebsd-aout)\n\t  major=.$current\n\t  versuffix=.$current.$revision\n\t  ;;\n\n\tfreebsd-elf)\n\t  func_arith $current - $age\n\t  major=.$func_arith_result\n\t  versuffix=$major.$age.$revision\n\t  ;;\n\n\tirix | nonstopux)\n\t  if test no = \"$lt_irix_increment\"; then\n\t    func_arith $current - $age\n\t  else\n\t    func_arith $current - $age + 1\n\t  fi\n\t  major=$func_arith_result\n\n\t  case $version_type in\n\t    nonstopux) verstring_prefix=nonstopux ;;\n\t    *)         verstring_prefix=sgi ;;\n\t  esac\n\t  verstring=$verstring_prefix$major.$revision\n\n\t  # Add in all the interfaces that we are compatible with.\n\t  loop=$revision\n\t  while test 0 -ne \"$loop\"; do\n\t    func_arith $revision - $loop\n\t    iface=$func_arith_result\n\t    func_arith $loop - 1\n\t    loop=$func_arith_result\n\t    verstring=$verstring_prefix$major.$iface:$verstring\n\t  done\n\n\t  # Before this point, $major must not contain '.'.\n\t  major=.$major\n\t  versuffix=$major.$revision\n\t  ;;\n\n\tlinux) # correct to gnu/linux during the next big refactor\n\t  func_arith $current - $age\n\t  major=.$func_arith_result\n\t  versuffix=$major.$age.$revision\n\t  ;;\n\n\tosf)\n\t  func_arith $current - $age\n\t  major=.$func_arith_result\n\t  versuffix=.$current.$age.$revision\n\t  verstring=$current.$age.$revision\n\n\t  # Add in all the interfaces that we are compatible with.\n\t  loop=$age\n\t  while test 0 -ne \"$loop\"; do\n\t    func_arith $current - $loop\n\t    iface=$func_arith_result\n\t    func_arith $loop - 1\n\t    loop=$func_arith_result\n\t    verstring=$verstring:$iface.0\n\t  done\n\n\t  # Make executables depend on our current version.\n\t  func_append verstring \":$current.0\"\n\t  ;;\n\n\tqnx)\n\t  major=.$current\n\t  versuffix=.$current\n\t  ;;\n\n\tsco)\n\t  major=.$current\n\t  versuffix=.$current\n\t  ;;\n\n\tsunos)\n\t  major=.$current\n\t  versuffix=.$current.$revision\n\t  ;;\n\n\twindows)\n\t  # Use '-' rather than '.', since we only want one\n\t  # extension on DOS 8.3 file systems.\n\t  func_arith $current - $age\n\t  major=$func_arith_result\n\t  versuffix=-$major\n\t  ;;\n\n\t*)\n\t  func_fatal_configuration \"unknown library version type '$version_type'\"\n\t  ;;\n\tesac\n\n\t# Clear the version info if we defaulted, and they specified a release.\n\tif test -z \"$vinfo\" && test -n \"$release\"; then\n\t  major=\n\t  case $version_type in\n\t  darwin)\n\t    # we can't check for \"0.0\" in archive_cmds due to quoting\n\t    # problems, so we reset it completely\n\t    verstring=\n\t    ;;\n\t  *)\n\t    verstring=0.0\n\t    ;;\n\t  esac\n\t  if test no = \"$need_version\"; then\n\t    versuffix=\n\t  else\n\t    versuffix=.0.0\n\t  fi\n\tfi\n\n\t# Remove version info from name if versioning should be avoided\n\tif test yes,no = \"$avoid_version,$need_version\"; then\n\t  major=\n\t  versuffix=\n\t  verstring=\n\tfi\n\n\t# Check to see if the archive will have undefined symbols.\n\tif test yes = \"$allow_undefined\"; then\n\t  if test unsupported = \"$allow_undefined_flag\"; then\n\t    if test yes = \"$build_old_libs\"; then\n\t      func_warning \"undefined symbols not allowed in $host shared libraries; building static only\"\n\t      build_libtool_libs=no\n\t    else\n\t      func_fatal_error \"can't build $host shared library unless -no-undefined is specified\"\n\t    fi\n\t  fi\n\telse\n\t  # Don't allow undefined symbols.\n\t  allow_undefined_flag=$no_undefined_flag\n\tfi\n\n      fi\n\n      func_generate_dlsyms \"$libname\" \"$libname\" :\n      func_append libobjs \" $symfileobj\"\n      test \" \" = \"$libobjs\" && libobjs=\n\n      if test relink != \"$opt_mode\"; then\n\t# Remove our outputs, but don't remove object files since they\n\t# may have been created when compiling PIC objects.\n\tremovelist=\n\ttempremovelist=`$ECHO \"$output_objdir/*\"`\n\tfor p in $tempremovelist; do\n\t  case $p in\n\t    *.$objext | *.gcno)\n\t       ;;\n\t    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)\n\t       if test -n \"$precious_files_regex\"; then\n\t\t if $ECHO \"$p\" | $EGREP -e \"$precious_files_regex\" >/dev/null 2>&1\n\t\t then\n\t\t   continue\n\t\t fi\n\t       fi\n\t       func_append removelist \" $p\"\n\t       ;;\n\t    *) ;;\n\t  esac\n\tdone\n\ttest -n \"$removelist\" && \\\n\t  func_show_eval \"${RM}r \\$removelist\"\n      fi\n\n      # Now set the variables for building old libraries.\n      if test yes = \"$build_old_libs\" && test convenience != \"$build_libtool_libs\"; then\n\tfunc_append oldlibs \" $output_objdir/$libname.$libext\"\n\n\t# Transform .lo files to .o files.\n\toldobjs=\"$objs \"`$ECHO \"$libobjs\" | $SP2NL | $SED \"/\\.$libext$/d; $lo2o\" | $NL2SP`\n      fi\n\n      # Eliminate all temporary directories.\n      #for path in $notinst_path; do\n      #\tlib_search_path=`$ECHO \"$lib_search_path \" | $SED \"s% $path % %g\"`\n      #\tdeplibs=`$ECHO \"$deplibs \" | $SED \"s% -L$path % %g\"`\n      #\tdependency_libs=`$ECHO \"$dependency_libs \" | $SED \"s% -L$path % %g\"`\n      #done\n\n      if test -n \"$xrpath\"; then\n\t# If the user specified any rpath flags, then add them.\n\ttemp_xrpath=\n\tfor libdir in $xrpath; do\n\t  func_replace_sysroot \"$libdir\"\n\t  func_append temp_xrpath \" -R$func_replace_sysroot_result\"\n\t  case \"$finalize_rpath \" in\n\t  *\" $libdir \"*) ;;\n\t  *) func_append finalize_rpath \" $libdir\" ;;\n\t  esac\n\tdone\n\tif test yes != \"$hardcode_into_libs\" || test yes = \"$build_old_libs\"; then\n\t  dependency_libs=\"$temp_xrpath $dependency_libs\"\n\tfi\n      fi\n\n      # Make sure dlfiles contains only unique files that won't be dlpreopened\n      old_dlfiles=$dlfiles\n      dlfiles=\n      for lib in $old_dlfiles; do\n\tcase \" $dlprefiles $dlfiles \" in\n\t*\" $lib \"*) ;;\n\t*) func_append dlfiles \" $lib\" ;;\n\tesac\n      done\n\n      # Make sure dlprefiles contains only unique files\n      old_dlprefiles=$dlprefiles\n      dlprefiles=\n      for lib in $old_dlprefiles; do\n\tcase \"$dlprefiles \" in\n\t*\" $lib \"*) ;;\n\t*) func_append dlprefiles \" $lib\" ;;\n\tesac\n      done\n\n      if test yes = \"$build_libtool_libs\"; then\n\tif test -n \"$rpath\"; then\n\t  case $host in\n\t  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)\n\t    # these systems don't actually have a c library (as such)!\n\t    ;;\n\t  *-*-rhapsody* | *-*-darwin1.[012])\n\t    # Rhapsody C library is in the System framework\n\t    func_append deplibs \" System.ltframework\"\n\t    ;;\n\t  *-*-netbsd*)\n\t    # Don't link with libc until the a.out ld.so is fixed.\n\t    ;;\n\t  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)\n\t    # Do not include libc due to us having libc/libc_r.\n\t    ;;\n\t  *-*-sco3.2v5* | *-*-sco5v6*)\n\t    # Causes problems with __ctype\n\t    ;;\n\t  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)\n\t    # Compiler inserts libc in the correct place for threads to work\n\t    ;;\n\t  *)\n\t    # Add libc to deplibs on all other systems if necessary.\n\t    if test yes = \"$build_libtool_need_lc\"; then\n\t      func_append deplibs \" -lc\"\n\t    fi\n\t    ;;\n\t  esac\n\tfi\n\n\t# Transform deplibs into only deplibs that can be linked in shared.\n\tname_save=$name\n\tlibname_save=$libname\n\trelease_save=$release\n\tversuffix_save=$versuffix\n\tmajor_save=$major\n\t# I'm not sure if I'm treating the release correctly.  I think\n\t# release should show up in the -l (ie -lgmp5) so we don't want to\n\t# add it in twice.  Is that correct?\n\trelease=\n\tversuffix=\n\tmajor=\n\tnewdeplibs=\n\tdroppeddeps=no\n\tcase $deplibs_check_method in\n\tpass_all)\n\t  # Don't check for shared/static.  Everything works.\n\t  # This might be a little naive.  We might want to check\n\t  # whether the library exists or not.  But this is on\n\t  # osf3 & osf4 and I'm not really sure... Just\n\t  # implementing what was already the behavior.\n\t  newdeplibs=$deplibs\n\t  ;;\n\ttest_compile)\n\t  # This code stresses the \"libraries are programs\" paradigm to its\n\t  # limits. Maybe even breaks it.  We compile a program, linking it\n\t  # against the deplibs as a proxy for the library.  Then we can check\n\t  # whether they linked in statically or dynamically with ldd.\n\t  $opt_dry_run || $RM conftest.c\n\t  cat > conftest.c <<EOF\n\t  int main() { return 0; }\nEOF\n\t  $opt_dry_run || $RM conftest\n\t  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then\n\t    ldd_output=`ldd conftest`\n\t    for i in $deplibs; do\n\t      case $i in\n\t      -l*)\n\t\tfunc_stripname -l '' \"$i\"\n\t\tname=$func_stripname_result\n\t\tif test yes = \"$allow_libtool_libs_with_static_runtimes\"; then\n\t\t  case \" $predeps $postdeps \" in\n\t\t  *\" $i \"*)\n\t\t    func_append newdeplibs \" $i\"\n\t\t    i=\n\t\t    ;;\n\t\t  esac\n\t\tfi\n\t\tif test -n \"$i\"; then\n\t\t  libname=`eval \"\\\\$ECHO \\\"$libname_spec\\\"\"`\n\t\t  deplib_matches=`eval \"\\\\$ECHO \\\"$library_names_spec\\\"\"`\n\t\t  set dummy $deplib_matches; shift\n\t\t  deplib_match=$1\n\t\t  if test `expr \"$ldd_output\" : \".*$deplib_match\"` -ne 0; then\n\t\t    func_append newdeplibs \" $i\"\n\t\t  else\n\t\t    droppeddeps=yes\n\t\t    echo\n\t\t    $ECHO \"*** Warning: dynamic linker does not accept needed library $i.\"\n\t\t    echo \"*** I have the capability to make that library automatically link in when\"\n\t\t    echo \"*** you link to this library.  But I can only do this if you have a\"\n\t\t    echo \"*** shared version of the library, which I believe you do not have\"\n\t\t    echo \"*** because a test_compile did reveal that the linker did not use it for\"\n\t\t    echo \"*** its dynamic dependency list that programs get resolved with at runtime.\"\n\t\t  fi\n\t\tfi\n\t\t;;\n\t      *)\n\t\tfunc_append newdeplibs \" $i\"\n\t\t;;\n\t      esac\n\t    done\n\t  else\n\t    # Error occurred in the first compile.  Let's try to salvage\n\t    # the situation: Compile a separate program for each library.\n\t    for i in $deplibs; do\n\t      case $i in\n\t      -l*)\n\t\tfunc_stripname -l '' \"$i\"\n\t\tname=$func_stripname_result\n\t\t$opt_dry_run || $RM conftest\n\t\tif $LTCC $LTCFLAGS -o conftest conftest.c $i; then\n\t\t  ldd_output=`ldd conftest`\n\t\t  if test yes = \"$allow_libtool_libs_with_static_runtimes\"; then\n\t\t    case \" $predeps $postdeps \" in\n\t\t    *\" $i \"*)\n\t\t      func_append newdeplibs \" $i\"\n\t\t      i=\n\t\t      ;;\n\t\t    esac\n\t\t  fi\n\t\t  if test -n \"$i\"; then\n\t\t    libname=`eval \"\\\\$ECHO \\\"$libname_spec\\\"\"`\n\t\t    deplib_matches=`eval \"\\\\$ECHO \\\"$library_names_spec\\\"\"`\n\t\t    set dummy $deplib_matches; shift\n\t\t    deplib_match=$1\n\t\t    if test `expr \"$ldd_output\" : \".*$deplib_match\"` -ne 0; then\n\t\t      func_append newdeplibs \" $i\"\n\t\t    else\n\t\t      droppeddeps=yes\n\t\t      echo\n\t\t      $ECHO \"*** Warning: dynamic linker does not accept needed library $i.\"\n\t\t      echo \"*** I have the capability to make that library automatically link in when\"\n\t\t      echo \"*** you link to this library.  But I can only do this if you have a\"\n\t\t      echo \"*** shared version of the library, which you do not appear to have\"\n\t\t      echo \"*** because a test_compile did reveal that the linker did not use this one\"\n\t\t      echo \"*** as a dynamic dependency that programs can get resolved with at runtime.\"\n\t\t    fi\n\t\t  fi\n\t\telse\n\t\t  droppeddeps=yes\n\t\t  echo\n\t\t  $ECHO \"*** Warning!  Library $i is needed by this library but I was not able to\"\n\t\t  echo \"*** make it link in!  You will probably need to install it or some\"\n\t\t  echo \"*** library that it depends on before this library will be fully\"\n\t\t  echo \"*** functional.  Installing it before continuing would be even better.\"\n\t\tfi\n\t\t;;\n\t      *)\n\t\tfunc_append newdeplibs \" $i\"\n\t\t;;\n\t      esac\n\t    done\n\t  fi\n\t  ;;\n\tfile_magic*)\n\t  set dummy $deplibs_check_method; shift\n\t  file_magic_regex=`expr \"$deplibs_check_method\" : \"$1 \\(.*\\)\"`\n\t  for a_deplib in $deplibs; do\n\t    case $a_deplib in\n\t    -l*)\n\t      func_stripname -l '' \"$a_deplib\"\n\t      name=$func_stripname_result\n\t      if test yes = \"$allow_libtool_libs_with_static_runtimes\"; then\n\t\tcase \" $predeps $postdeps \" in\n\t\t*\" $a_deplib \"*)\n\t\t  func_append newdeplibs \" $a_deplib\"\n\t\t  a_deplib=\n\t\t  ;;\n\t\tesac\n\t      fi\n\t      if test -n \"$a_deplib\"; then\n\t\tlibname=`eval \"\\\\$ECHO \\\"$libname_spec\\\"\"`\n\t\tif test -n \"$file_magic_glob\"; then\n\t\t  libnameglob=`func_echo_all \"$libname\" | $SED -e $file_magic_glob`\n\t\telse\n\t\t  libnameglob=$libname\n\t\tfi\n\t\ttest yes = \"$want_nocaseglob\" && nocaseglob=`shopt -p nocaseglob`\n\t\tfor i in $lib_search_path $sys_lib_search_path $shlib_search_path; do\n\t\t  if test yes = \"$want_nocaseglob\"; then\n\t\t    shopt -s nocaseglob\n\t\t    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`\n\t\t    $nocaseglob\n\t\t  else\n\t\t    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`\n\t\t  fi\n\t\t  for potent_lib in $potential_libs; do\n\t\t      # Follow soft links.\n\t\t      if ls -lLd \"$potent_lib\" 2>/dev/null |\n\t\t\t $GREP \" -> \" >/dev/null; then\n\t\t\tcontinue\n\t\t      fi\n\t\t      # The statement above tries to avoid entering an\n\t\t      # endless loop below, in case of cyclic links.\n\t\t      # We might still enter an endless loop, since a link\n\t\t      # loop can be closed while we follow links,\n\t\t      # but so what?\n\t\t      potlib=$potent_lib\n\t\t      while test -h \"$potlib\" 2>/dev/null; do\n\t\t\tpotliblink=`ls -ld $potlib | $SED 's/.* -> //'`\n\t\t\tcase $potliblink in\n\t\t\t[\\\\/]* | [A-Za-z]:[\\\\/]*) potlib=$potliblink;;\n\t\t\t*) potlib=`$ECHO \"$potlib\" | $SED 's|[^/]*$||'`\"$potliblink\";;\n\t\t\tesac\n\t\t      done\n\t\t      if eval $file_magic_cmd \\\"\\$potlib\\\" 2>/dev/null |\n\t\t\t $SED -e 10q |\n\t\t\t $EGREP \"$file_magic_regex\" > /dev/null; then\n\t\t\tfunc_append newdeplibs \" $a_deplib\"\n\t\t\ta_deplib=\n\t\t\tbreak 2\n\t\t      fi\n\t\t  done\n\t\tdone\n\t      fi\n\t      if test -n \"$a_deplib\"; then\n\t\tdroppeddeps=yes\n\t\techo\n\t\t$ECHO \"*** Warning: linker path does not have real file for library $a_deplib.\"\n\t\techo \"*** I have the capability to make that library automatically link in when\"\n\t\techo \"*** you link to this library.  But I can only do this if you have a\"\n\t\techo \"*** shared version of the library, which you do not appear to have\"\n\t\techo \"*** because I did check the linker path looking for a file starting\"\n\t\tif test -z \"$potlib\"; then\n\t\t  $ECHO \"*** with $libname but no candidates were found. (...for file magic test)\"\n\t\telse\n\t\t  $ECHO \"*** with $libname and none of the candidates passed a file format test\"\n\t\t  $ECHO \"*** using a file magic. Last file checked: $potlib\"\n\t\tfi\n\t      fi\n\t      ;;\n\t    *)\n\t      # Add a -L argument.\n\t      func_append newdeplibs \" $a_deplib\"\n\t      ;;\n\t    esac\n\t  done # Gone through all deplibs.\n\t  ;;\n\tmatch_pattern*)\n\t  set dummy $deplibs_check_method; shift\n\t  match_pattern_regex=`expr \"$deplibs_check_method\" : \"$1 \\(.*\\)\"`\n\t  for a_deplib in $deplibs; do\n\t    case $a_deplib in\n\t    -l*)\n\t      func_stripname -l '' \"$a_deplib\"\n\t      name=$func_stripname_result\n\t      if test yes = \"$allow_libtool_libs_with_static_runtimes\"; then\n\t\tcase \" $predeps $postdeps \" in\n\t\t*\" $a_deplib \"*)\n\t\t  func_append newdeplibs \" $a_deplib\"\n\t\t  a_deplib=\n\t\t  ;;\n\t\tesac\n\t      fi\n\t      if test -n \"$a_deplib\"; then\n\t\tlibname=`eval \"\\\\$ECHO \\\"$libname_spec\\\"\"`\n\t\tfor i in $lib_search_path $sys_lib_search_path $shlib_search_path; do\n\t\t  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`\n\t\t  for potent_lib in $potential_libs; do\n\t\t    potlib=$potent_lib # see symlink-check above in file_magic test\n\t\t    if eval \"\\$ECHO \\\"$potent_lib\\\"\" 2>/dev/null | $SED 10q | \\\n\t\t       $EGREP \"$match_pattern_regex\" > /dev/null; then\n\t\t      func_append newdeplibs \" $a_deplib\"\n\t\t      a_deplib=\n\t\t      break 2\n\t\t    fi\n\t\t  done\n\t\tdone\n\t      fi\n\t      if test -n \"$a_deplib\"; then\n\t\tdroppeddeps=yes\n\t\techo\n\t\t$ECHO \"*** Warning: linker path does not have real file for library $a_deplib.\"\n\t\techo \"*** I have the capability to make that library automatically link in when\"\n\t\techo \"*** you link to this library.  But I can only do this if you have a\"\n\t\techo \"*** shared version of the library, which you do not appear to have\"\n\t\techo \"*** because I did check the linker path looking for a file starting\"\n\t\tif test -z \"$potlib\"; then\n\t\t  $ECHO \"*** with $libname but no candidates were found. (...for regex pattern test)\"\n\t\telse\n\t\t  $ECHO \"*** with $libname and none of the candidates passed a file format test\"\n\t\t  $ECHO \"*** using a regex pattern. Last file checked: $potlib\"\n\t\tfi\n\t      fi\n\t      ;;\n\t    *)\n\t      # Add a -L argument.\n\t      func_append newdeplibs \" $a_deplib\"\n\t      ;;\n\t    esac\n\t  done # Gone through all deplibs.\n\t  ;;\n\tnone | unknown | *)\n\t  newdeplibs=\n\t  tmp_deplibs=`$ECHO \" $deplibs\" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`\n\t  if test yes = \"$allow_libtool_libs_with_static_runtimes\"; then\n\t    for i in $predeps $postdeps; do\n\t      # can't use Xsed below, because $i might contain '/'\n\t      tmp_deplibs=`$ECHO \" $tmp_deplibs\" | $SED \"s|$i||\"`\n\t    done\n\t  fi\n\t  case $tmp_deplibs in\n\t  *[!\\\t\\ ]*)\n\t    echo\n\t    if test none = \"$deplibs_check_method\"; then\n\t      echo \"*** Warning: inter-library dependencies are not supported in this platform.\"\n\t    else\n\t      echo \"*** Warning: inter-library dependencies are not known to be supported.\"\n\t    fi\n\t    echo \"*** All declared inter-library dependencies are being dropped.\"\n\t    droppeddeps=yes\n\t    ;;\n\t  esac\n\t  ;;\n\tesac\n\tversuffix=$versuffix_save\n\tmajor=$major_save\n\trelease=$release_save\n\tlibname=$libname_save\n\tname=$name_save\n\n\tcase $host in\n\t*-*-rhapsody* | *-*-darwin1.[012])\n\t  # On Rhapsody replace the C library with the System framework\n\t  newdeplibs=`$ECHO \" $newdeplibs\" | $SED 's/ -lc / System.ltframework /'`\n\t  ;;\n\tesac\n\n\tif test yes = \"$droppeddeps\"; then\n\t  if test yes = \"$module\"; then\n\t    echo\n\t    echo \"*** Warning: libtool could not satisfy all declared inter-library\"\n\t    $ECHO \"*** dependencies of module $libname.  Therefore, libtool will create\"\n\t    echo \"*** a static module, that should work as long as the dlopening\"\n\t    echo \"*** application is linked with the -dlopen flag.\"\n\t    if test -z \"$global_symbol_pipe\"; then\n\t      echo\n\t      echo \"*** However, this would only work if libtool was able to extract symbol\"\n\t      echo \"*** lists from a program, using 'nm' or equivalent, but libtool could\"\n\t      echo \"*** not find such a program.  So, this module is probably useless.\"\n\t      echo \"*** 'nm' from GNU binutils and a full rebuild may help.\"\n\t    fi\n\t    if test no = \"$build_old_libs\"; then\n\t      oldlibs=$output_objdir/$libname.$libext\n\t      build_libtool_libs=module\n\t      build_old_libs=yes\n\t    else\n\t      build_libtool_libs=no\n\t    fi\n\t  else\n\t    echo \"*** The inter-library dependencies that have been dropped here will be\"\n\t    echo \"*** automatically added whenever a program is linked with this library\"\n\t    echo \"*** or is declared to -dlopen it.\"\n\n\t    if test no = \"$allow_undefined\"; then\n\t      echo\n\t      echo \"*** Since this library must not contain undefined symbols,\"\n\t      echo \"*** because either the platform does not support them or\"\n\t      echo \"*** it was explicitly requested with -no-undefined,\"\n\t      echo \"*** libtool will only create a static version of it.\"\n\t      if test no = \"$build_old_libs\"; then\n\t\toldlibs=$output_objdir/$libname.$libext\n\t\tbuild_libtool_libs=module\n\t\tbuild_old_libs=yes\n\t      else\n\t\tbuild_libtool_libs=no\n\t      fi\n\t    fi\n\t  fi\n\tfi\n\t# Done checking deplibs!\n\tdeplibs=$newdeplibs\n      fi\n      # Time to change all our \"foo.ltframework\" stuff back to \"-framework foo\"\n      case $host in\n\t*-*-darwin*)\n\t  newdeplibs=`$ECHO \" $newdeplibs\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\t  new_inherited_linker_flags=`$ECHO \" $new_inherited_linker_flags\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\t  deplibs=`$ECHO \" $deplibs\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\t  ;;\n      esac\n\n      # move library search paths that coincide with paths to not yet\n      # installed libraries to the beginning of the library search list\n      new_libs=\n      for path in $notinst_path; do\n\tcase \" $new_libs \" in\n\t*\" -L$path/$objdir \"*) ;;\n\t*)\n\t  case \" $deplibs \" in\n\t  *\" -L$path/$objdir \"*)\n\t    func_append new_libs \" -L$path/$objdir\" ;;\n\t  esac\n\t  ;;\n\tesac\n      done\n      for deplib in $deplibs; do\n\tcase $deplib in\n\t-L*)\n\t  case \" $new_libs \" in\n\t  *\" $deplib \"*) ;;\n\t  *) func_append new_libs \" $deplib\" ;;\n\t  esac\n\t  ;;\n\t*) func_append new_libs \" $deplib\" ;;\n\tesac\n      done\n      deplibs=$new_libs\n\n      # All the library-specific variables (install_libdir is set above).\n      library_names=\n      old_library=\n      dlname=\n\n      # Test again, we may have decided not to build it any more\n      if test yes = \"$build_libtool_libs\"; then\n\t# Remove $wl instances when linking with ld.\n\t# FIXME: should test the right _cmds variable.\n\tcase $archive_cmds in\n\t  *\\$LD\\ *) wl= ;;\n        esac\n\tif test yes = \"$hardcode_into_libs\"; then\n\t  # Hardcode the library paths\n\t  hardcode_libdirs=\n\t  dep_rpath=\n\t  rpath=$finalize_rpath\n\t  test relink = \"$opt_mode\" || rpath=$compile_rpath$rpath\n\t  for libdir in $rpath; do\n\t    if test -n \"$hardcode_libdir_flag_spec\"; then\n\t      if test -n \"$hardcode_libdir_separator\"; then\n\t\tfunc_replace_sysroot \"$libdir\"\n\t\tlibdir=$func_replace_sysroot_result\n\t\tif test -z \"$hardcode_libdirs\"; then\n\t\t  hardcode_libdirs=$libdir\n\t\telse\n\t\t  # Just accumulate the unique libdirs.\n\t\t  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in\n\t\t  *\"$hardcode_libdir_separator$libdir$hardcode_libdir_separator\"*)\n\t\t    ;;\n\t\t  *)\n\t\t    func_append hardcode_libdirs \"$hardcode_libdir_separator$libdir\"\n\t\t    ;;\n\t\t  esac\n\t\tfi\n\t      else\n\t\teval flag=\\\"$hardcode_libdir_flag_spec\\\"\n\t\tfunc_append dep_rpath \" $flag\"\n\t      fi\n\t    elif test -n \"$runpath_var\"; then\n\t      case \"$perm_rpath \" in\n\t      *\" $libdir \"*) ;;\n\t      *) func_append perm_rpath \" $libdir\" ;;\n\t      esac\n\t    fi\n\t  done\n\t  # Substitute the hardcoded libdirs into the rpath.\n\t  if test -n \"$hardcode_libdir_separator\" &&\n\t     test -n \"$hardcode_libdirs\"; then\n\t    libdir=$hardcode_libdirs\n\t    eval \"dep_rpath=\\\"$hardcode_libdir_flag_spec\\\"\"\n\t  fi\n\t  if test -n \"$runpath_var\" && test -n \"$perm_rpath\"; then\n\t    # We should set the runpath_var.\n\t    rpath=\n\t    for dir in $perm_rpath; do\n\t      func_append rpath \"$dir:\"\n\t    done\n\t    eval \"$runpath_var='$rpath\\$$runpath_var'; export $runpath_var\"\n\t  fi\n\t  test -n \"$dep_rpath\" && deplibs=\"$dep_rpath $deplibs\"\n\tfi\n\n\tshlibpath=$finalize_shlibpath\n\ttest relink = \"$opt_mode\" || shlibpath=$compile_shlibpath$shlibpath\n\tif test -n \"$shlibpath\"; then\n\t  eval \"$shlibpath_var='$shlibpath\\$$shlibpath_var'; export $shlibpath_var\"\n\tfi\n\n\t# Get the real and link names of the library.\n\teval shared_ext=\\\"$shrext_cmds\\\"\n\teval library_names=\\\"$library_names_spec\\\"\n\tset dummy $library_names\n\tshift\n\trealname=$1\n\tshift\n\n\tif test -n \"$soname_spec\"; then\n\t  eval soname=\\\"$soname_spec\\\"\n\telse\n\t  soname=$realname\n\tfi\n\tif test -z \"$dlname\"; then\n\t  dlname=$soname\n\tfi\n\n\tlib=$output_objdir/$realname\n\tlinknames=\n\tfor link\n\tdo\n\t  func_append linknames \" $link\"\n\tdone\n\n\t# Use standard objects if they are pic\n\ttest -z \"$pic_flag\" && libobjs=`$ECHO \"$libobjs\" | $SP2NL | $SED \"$lo2o\" | $NL2SP`\n\ttest \"X$libobjs\" = \"X \" && libobjs=\n\n\tdelfiles=\n\tif test -n \"$export_symbols\" && test -n \"$include_expsyms\"; then\n\t  $opt_dry_run || cp \"$export_symbols\" \"$output_objdir/$libname.uexp\"\n\t  export_symbols=$output_objdir/$libname.uexp\n\t  func_append delfiles \" $export_symbols\"\n\tfi\n\n\torig_export_symbols=\n\tcase $host_os in\n\tcygwin* | mingw* | cegcc*)\n\t  if test -n \"$export_symbols\" && test -z \"$export_symbols_regex\"; then\n\t    # exporting using user supplied symfile\n\t    func_dll_def_p \"$export_symbols\" || {\n\t      # and it's NOT already a .def file. Must figure out\n\t      # which of the given symbols are data symbols and tag\n\t      # them as such. So, trigger use of export_symbols_cmds.\n\t      # export_symbols gets reassigned inside the \"prepare\n\t      # the list of exported symbols\" if statement, so the\n\t      # include_expsyms logic still works.\n\t      orig_export_symbols=$export_symbols\n\t      export_symbols=\n\t      always_export_symbols=yes\n\t    }\n\t  fi\n\t  ;;\n\tesac\n\n\t# Prepare the list of exported symbols\n\tif test -z \"$export_symbols\"; then\n\t  if test yes = \"$always_export_symbols\" || test -n \"$export_symbols_regex\"; then\n\t    func_verbose \"generating symbol list for '$libname.la'\"\n\t    export_symbols=$output_objdir/$libname.exp\n\t    $opt_dry_run || $RM $export_symbols\n\t    cmds=$export_symbols_cmds\n\t    save_ifs=$IFS; IFS='~'\n\t    for cmd1 in $cmds; do\n\t      IFS=$save_ifs\n\t      # Take the normal branch if the nm_file_list_spec branch\n\t      # doesn't work or if tool conversion is not needed.\n\t      case $nm_file_list_spec~$to_tool_file_cmd in\n\t\t*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)\n\t\t  try_normal_branch=yes\n\t\t  eval cmd=\\\"$cmd1\\\"\n\t\t  func_len \" $cmd\"\n\t\t  len=$func_len_result\n\t\t  ;;\n\t\t*)\n\t\t  try_normal_branch=no\n\t\t  ;;\n\t      esac\n\t      if test yes = \"$try_normal_branch\" \\\n\t\t && { test \"$len\" -lt \"$max_cmd_len\" \\\n\t\t      || test \"$max_cmd_len\" -le -1; }\n\t      then\n\t\tfunc_show_eval \"$cmd\" 'exit $?'\n\t\tskipped_export=false\n\t      elif test -n \"$nm_file_list_spec\"; then\n\t\tfunc_basename \"$output\"\n\t\toutput_la=$func_basename_result\n\t\tsave_libobjs=$libobjs\n\t\tsave_output=$output\n\t\toutput=$output_objdir/$output_la.nm\n\t\tfunc_to_tool_file \"$output\"\n\t\tlibobjs=$nm_file_list_spec$func_to_tool_file_result\n\t\tfunc_append delfiles \" $output\"\n\t\tfunc_verbose \"creating $NM input file list: $output\"\n\t\tfor obj in $save_libobjs; do\n\t\t  func_to_tool_file \"$obj\"\n\t\t  $ECHO \"$func_to_tool_file_result\"\n\t\tdone > \"$output\"\n\t\teval cmd=\\\"$cmd1\\\"\n\t\tfunc_show_eval \"$cmd\" 'exit $?'\n\t\toutput=$save_output\n\t\tlibobjs=$save_libobjs\n\t\tskipped_export=false\n\t      else\n\t\t# The command line is too long to execute in one step.\n\t\tfunc_verbose \"using reloadable object file for export list...\"\n\t\tskipped_export=:\n\t\t# Break out early, otherwise skipped_export may be\n\t\t# set to false by a later but shorter cmd.\n\t\tbreak\n\t      fi\n\t    done\n\t    IFS=$save_ifs\n\t    if test -n \"$export_symbols_regex\" && test : != \"$skipped_export\"; then\n\t      func_show_eval '$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"'\n\t      func_show_eval '$MV \"${export_symbols}T\" \"$export_symbols\"'\n\t    fi\n\t  fi\n\tfi\n\n\tif test -n \"$export_symbols\" && test -n \"$include_expsyms\"; then\n\t  tmp_export_symbols=$export_symbols\n\t  test -n \"$orig_export_symbols\" && tmp_export_symbols=$orig_export_symbols\n\t  $opt_dry_run || eval '$ECHO \"$include_expsyms\" | $SP2NL >> \"$tmp_export_symbols\"'\n\tfi\n\n\tif test : != \"$skipped_export\" && test -n \"$orig_export_symbols\"; then\n\t  # The given exports_symbols file has to be filtered, so filter it.\n\t  func_verbose \"filter symbol list for '$libname.la' to tag DATA exports\"\n\t  # FIXME: $output_objdir/$libname.filter potentially contains lots of\n\t  # 's' commands, which not all seds can handle. GNU sed should be fine\n\t  # though. Also, the filter scales superlinearly with the number of\n\t  # global variables. join(1) would be nice here, but unfortunately\n\t  # isn't a blessed tool.\n\t  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\\(.*\\)\\([ \\,].*\\),s|^\\1$|\\1\\2|,' < $export_symbols > $output_objdir/$libname.filter\n\t  func_append delfiles \" $export_symbols $output_objdir/$libname.filter\"\n\t  export_symbols=$output_objdir/$libname.def\n\t  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols\n\tfi\n\n\ttmp_deplibs=\n\tfor test_deplib in $deplibs; do\n\t  case \" $convenience \" in\n\t  *\" $test_deplib \"*) ;;\n\t  *)\n\t    func_append tmp_deplibs \" $test_deplib\"\n\t    ;;\n\t  esac\n\tdone\n\tdeplibs=$tmp_deplibs\n\n\tif test -n \"$convenience\"; then\n\t  if test -n \"$whole_archive_flag_spec\" &&\n\t    test yes = \"$compiler_needs_object\" &&\n\t    test -z \"$libobjs\"; then\n\t    # extract the archives, so we have objects to list.\n\t    # TODO: could optimize this to just extract one archive.\n\t    whole_archive_flag_spec=\n\t  fi\n\t  if test -n \"$whole_archive_flag_spec\"; then\n\t    save_libobjs=$libobjs\n\t    eval libobjs=\\\"\\$libobjs $whole_archive_flag_spec\\\"\n\t    test \"X$libobjs\" = \"X \" && libobjs=\n\t  else\n\t    gentop=$output_objdir/${outputname}x\n\t    func_append generated \" $gentop\"\n\n\t    func_extract_archives $gentop $convenience\n\t    func_append libobjs \" $func_extract_archives_result\"\n\t    test \"X$libobjs\" = \"X \" && libobjs=\n\t  fi\n\tfi\n\n\tif test yes = \"$thread_safe\" && test -n \"$thread_safe_flag_spec\"; then\n\t  eval flag=\\\"$thread_safe_flag_spec\\\"\n\t  func_append linker_flags \" $flag\"\n\tfi\n\n\t# Make a backup of the uninstalled library when relinking\n\tif test relink = \"$opt_mode\"; then\n\t  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?\n\tfi\n\n\t# Do each of the archive commands.\n\tif test yes = \"$module\" && test -n \"$module_cmds\"; then\n\t  if test -n \"$export_symbols\" && test -n \"$module_expsym_cmds\"; then\n\t    eval test_cmds=\\\"$module_expsym_cmds\\\"\n\t    cmds=$module_expsym_cmds\n\t  else\n\t    eval test_cmds=\\\"$module_cmds\\\"\n\t    cmds=$module_cmds\n\t  fi\n\telse\n\t  if test -n \"$export_symbols\" && test -n \"$archive_expsym_cmds\"; then\n\t    eval test_cmds=\\\"$archive_expsym_cmds\\\"\n\t    cmds=$archive_expsym_cmds\n\t  else\n\t    eval test_cmds=\\\"$archive_cmds\\\"\n\t    cmds=$archive_cmds\n\t  fi\n\tfi\n\n\tif test : != \"$skipped_export\" &&\n\t   func_len \" $test_cmds\" &&\n\t   len=$func_len_result &&\n\t   test \"$len\" -lt \"$max_cmd_len\" || test \"$max_cmd_len\" -le -1; then\n\t  :\n\telse\n\t  # The command line is too long to link in one step, link piecewise\n\t  # or, if using GNU ld and skipped_export is not :, use a linker\n\t  # script.\n\n\t  # Save the value of $output and $libobjs because we want to\n\t  # use them later.  If we have whole_archive_flag_spec, we\n\t  # want to use save_libobjs as it was before\n\t  # whole_archive_flag_spec was expanded, because we can't\n\t  # assume the linker understands whole_archive_flag_spec.\n\t  # This may have to be revisited, in case too many\n\t  # convenience libraries get linked in and end up exceeding\n\t  # the spec.\n\t  if test -z \"$convenience\" || test -z \"$whole_archive_flag_spec\"; then\n\t    save_libobjs=$libobjs\n\t  fi\n\t  save_output=$output\n\t  func_basename \"$output\"\n\t  output_la=$func_basename_result\n\n\t  # Clear the reloadable object creation command queue and\n\t  # initialize k to one.\n\t  test_cmds=\n\t  concat_cmds=\n\t  objlist=\n\t  last_robj=\n\t  k=1\n\n\t  if test -n \"$save_libobjs\" && test : != \"$skipped_export\" && test yes = \"$with_gnu_ld\"; then\n\t    output=$output_objdir/$output_la.lnkscript\n\t    func_verbose \"creating GNU ld script: $output\"\n\t    echo 'INPUT (' > $output\n\t    for obj in $save_libobjs\n\t    do\n\t      func_to_tool_file \"$obj\"\n\t      $ECHO \"$func_to_tool_file_result\" >> $output\n\t    done\n\t    echo ')' >> $output\n\t    func_append delfiles \" $output\"\n\t    func_to_tool_file \"$output\"\n\t    output=$func_to_tool_file_result\n\t  elif test -n \"$save_libobjs\" && test : != \"$skipped_export\" && test -n \"$file_list_spec\"; then\n\t    output=$output_objdir/$output_la.lnk\n\t    func_verbose \"creating linker input file list: $output\"\n\t    : > $output\n\t    set x $save_libobjs\n\t    shift\n\t    firstobj=\n\t    if test yes = \"$compiler_needs_object\"; then\n\t      firstobj=\"$1 \"\n\t      shift\n\t    fi\n\t    for obj\n\t    do\n\t      func_to_tool_file \"$obj\"\n\t      $ECHO \"$func_to_tool_file_result\" >> $output\n\t    done\n\t    func_append delfiles \" $output\"\n\t    func_to_tool_file \"$output\"\n\t    output=$firstobj\\\"$file_list_spec$func_to_tool_file_result\\\"\n\t  else\n\t    if test -n \"$save_libobjs\"; then\n\t      func_verbose \"creating reloadable object files...\"\n\t      output=$output_objdir/$output_la-$k.$objext\n\t      eval test_cmds=\\\"$reload_cmds\\\"\n\t      func_len \" $test_cmds\"\n\t      len0=$func_len_result\n\t      len=$len0\n\n\t      # Loop over the list of objects to be linked.\n\t      for obj in $save_libobjs\n\t      do\n\t\tfunc_len \" $obj\"\n\t\tfunc_arith $len + $func_len_result\n\t\tlen=$func_arith_result\n\t\tif test -z \"$objlist\" ||\n\t\t   test \"$len\" -lt \"$max_cmd_len\"; then\n\t\t  func_append objlist \" $obj\"\n\t\telse\n\t\t  # The command $test_cmds is almost too long, add a\n\t\t  # command to the queue.\n\t\t  if test 1 -eq \"$k\"; then\n\t\t    # The first file doesn't have a previous command to add.\n\t\t    reload_objs=$objlist\n\t\t    eval concat_cmds=\\\"$reload_cmds\\\"\n\t\t  else\n\t\t    # All subsequent reloadable object files will link in\n\t\t    # the last one created.\n\t\t    reload_objs=\"$objlist $last_robj\"\n\t\t    eval concat_cmds=\\\"\\$concat_cmds~$reload_cmds~\\$RM $last_robj\\\"\n\t\t  fi\n\t\t  last_robj=$output_objdir/$output_la-$k.$objext\n\t\t  func_arith $k + 1\n\t\t  k=$func_arith_result\n\t\t  output=$output_objdir/$output_la-$k.$objext\n\t\t  objlist=\" $obj\"\n\t\t  func_len \" $last_robj\"\n\t\t  func_arith $len0 + $func_len_result\n\t\t  len=$func_arith_result\n\t\tfi\n\t      done\n\t      # Handle the remaining objects by creating one last\n\t      # reloadable object file.  All subsequent reloadable object\n\t      # files will link in the last one created.\n\t      test -z \"$concat_cmds\" || concat_cmds=$concat_cmds~\n\t      reload_objs=\"$objlist $last_robj\"\n\t      eval concat_cmds=\\\"\\$concat_cmds$reload_cmds\\\"\n\t      if test -n \"$last_robj\"; then\n\t        eval concat_cmds=\\\"\\$concat_cmds~\\$RM $last_robj\\\"\n\t      fi\n\t      func_append delfiles \" $output\"\n\n\t    else\n\t      output=\n\t    fi\n\n\t    ${skipped_export-false} && {\n\t      func_verbose \"generating symbol list for '$libname.la'\"\n\t      export_symbols=$output_objdir/$libname.exp\n\t      $opt_dry_run || $RM $export_symbols\n\t      libobjs=$output\n\t      # Append the command to create the export file.\n\t      test -z \"$concat_cmds\" || concat_cmds=$concat_cmds~\n\t      eval concat_cmds=\\\"\\$concat_cmds$export_symbols_cmds\\\"\n\t      if test -n \"$last_robj\"; then\n\t\teval concat_cmds=\\\"\\$concat_cmds~\\$RM $last_robj\\\"\n\t      fi\n\t    }\n\n\t    test -n \"$save_libobjs\" &&\n\t      func_verbose \"creating a temporary reloadable object file: $output\"\n\n\t    # Loop through the commands generated above and execute them.\n\t    save_ifs=$IFS; IFS='~'\n\t    for cmd in $concat_cmds; do\n\t      IFS=$save_ifs\n\t      $opt_quiet || {\n\t\t  func_quote_for_expand \"$cmd\"\n\t\t  eval \"func_echo $func_quote_for_expand_result\"\n\t      }\n\t      $opt_dry_run || eval \"$cmd\" || {\n\t\tlt_exit=$?\n\n\t\t# Restore the uninstalled library and exit\n\t\tif test relink = \"$opt_mode\"; then\n\t\t  ( cd \"$output_objdir\" && \\\n\t\t    $RM \"${realname}T\" && \\\n\t\t    $MV \"${realname}U\" \"$realname\" )\n\t\tfi\n\n\t\texit $lt_exit\n\t      }\n\t    done\n\t    IFS=$save_ifs\n\n\t    if test -n \"$export_symbols_regex\" && ${skipped_export-false}; then\n\t      func_show_eval '$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"'\n\t      func_show_eval '$MV \"${export_symbols}T\" \"$export_symbols\"'\n\t    fi\n\t  fi\n\n          ${skipped_export-false} && {\n\t    if test -n \"$export_symbols\" && test -n \"$include_expsyms\"; then\n\t      tmp_export_symbols=$export_symbols\n\t      test -n \"$orig_export_symbols\" && tmp_export_symbols=$orig_export_symbols\n\t      $opt_dry_run || eval '$ECHO \"$include_expsyms\" | $SP2NL >> \"$tmp_export_symbols\"'\n\t    fi\n\n\t    if test -n \"$orig_export_symbols\"; then\n\t      # The given exports_symbols file has to be filtered, so filter it.\n\t      func_verbose \"filter symbol list for '$libname.la' to tag DATA exports\"\n\t      # FIXME: $output_objdir/$libname.filter potentially contains lots of\n\t      # 's' commands, which not all seds can handle. GNU sed should be fine\n\t      # though. Also, the filter scales superlinearly with the number of\n\t      # global variables. join(1) would be nice here, but unfortunately\n\t      # isn't a blessed tool.\n\t      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\\(.*\\)\\([ \\,].*\\),s|^\\1$|\\1\\2|,' < $export_symbols > $output_objdir/$libname.filter\n\t      func_append delfiles \" $export_symbols $output_objdir/$libname.filter\"\n\t      export_symbols=$output_objdir/$libname.def\n\t      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols\n\t    fi\n\t  }\n\n\t  libobjs=$output\n\t  # Restore the value of output.\n\t  output=$save_output\n\n\t  if test -n \"$convenience\" && test -n \"$whole_archive_flag_spec\"; then\n\t    eval libobjs=\\\"\\$libobjs $whole_archive_flag_spec\\\"\n\t    test \"X$libobjs\" = \"X \" && libobjs=\n\t  fi\n\t  # Expand the library linking commands again to reset the\n\t  # value of $libobjs for piecewise linking.\n\n\t  # Do each of the archive commands.\n\t  if test yes = \"$module\" && test -n \"$module_cmds\"; then\n\t    if test -n \"$export_symbols\" && test -n \"$module_expsym_cmds\"; then\n\t      cmds=$module_expsym_cmds\n\t    else\n\t      cmds=$module_cmds\n\t    fi\n\t  else\n\t    if test -n \"$export_symbols\" && test -n \"$archive_expsym_cmds\"; then\n\t      cmds=$archive_expsym_cmds\n\t    else\n\t      cmds=$archive_cmds\n\t    fi\n\t  fi\n\tfi\n\n\tif test -n \"$delfiles\"; then\n\t  # Append the command to remove temporary files to $cmds.\n\t  eval cmds=\\\"\\$cmds~\\$RM $delfiles\\\"\n\tfi\n\n\t# Add any objects from preloaded convenience libraries\n\tif test -n \"$dlprefiles\"; then\n\t  gentop=$output_objdir/${outputname}x\n\t  func_append generated \" $gentop\"\n\n\t  func_extract_archives $gentop $dlprefiles\n\t  func_append libobjs \" $func_extract_archives_result\"\n\t  test \"X$libobjs\" = \"X \" && libobjs=\n\tfi\n\n\tsave_ifs=$IFS; IFS='~'\n\tfor cmd in $cmds; do\n\t  IFS=$sp$nl\n\t  eval cmd=\\\"$cmd\\\"\n\t  IFS=$save_ifs\n\t  $opt_quiet || {\n\t    func_quote_for_expand \"$cmd\"\n\t    eval \"func_echo $func_quote_for_expand_result\"\n\t  }\n\t  $opt_dry_run || eval \"$cmd\" || {\n\t    lt_exit=$?\n\n\t    # Restore the uninstalled library and exit\n\t    if test relink = \"$opt_mode\"; then\n\t      ( cd \"$output_objdir\" && \\\n\t        $RM \"${realname}T\" && \\\n\t\t$MV \"${realname}U\" \"$realname\" )\n\t    fi\n\n\t    exit $lt_exit\n\t  }\n\tdone\n\tIFS=$save_ifs\n\n\t# Restore the uninstalled library and exit\n\tif test relink = \"$opt_mode\"; then\n\t  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?\n\n\t  if test -n \"$convenience\"; then\n\t    if test -z \"$whole_archive_flag_spec\"; then\n\t      func_show_eval '${RM}r \"$gentop\"'\n\t    fi\n\t  fi\n\n\t  exit $EXIT_SUCCESS\n\tfi\n\n\t# Create links to the real library.\n\tfor linkname in $linknames; do\n\t  if test \"$realname\" != \"$linkname\"; then\n\t    func_show_eval '(cd \"$output_objdir\" && $RM \"$linkname\" && $LN_S \"$realname\" \"$linkname\")' 'exit $?'\n\t  fi\n\tdone\n\n\t# If -module or -export-dynamic was specified, set the dlname.\n\tif test yes = \"$module\" || test yes = \"$export_dynamic\"; then\n\t  # On all known operating systems, these are identical.\n\t  dlname=$soname\n\tfi\n      fi\n      ;;\n\n    obj)\n      if test -n \"$dlfiles$dlprefiles\" || test no != \"$dlself\"; then\n\tfunc_warning \"'-dlopen' is ignored for objects\"\n      fi\n\n      case \" $deplibs\" in\n      *\\ -l* | *\\ -L*)\n\tfunc_warning \"'-l' and '-L' are ignored for objects\" ;;\n      esac\n\n      test -n \"$rpath\" && \\\n\tfunc_warning \"'-rpath' is ignored for objects\"\n\n      test -n \"$xrpath\" && \\\n\tfunc_warning \"'-R' is ignored for objects\"\n\n      test -n \"$vinfo\" && \\\n\tfunc_warning \"'-version-info' is ignored for objects\"\n\n      test -n \"$release\" && \\\n\tfunc_warning \"'-release' is ignored for objects\"\n\n      case $output in\n      *.lo)\n\ttest -n \"$objs$old_deplibs\" && \\\n\t  func_fatal_error \"cannot build library object '$output' from non-libtool objects\"\n\n\tlibobj=$output\n\tfunc_lo2o \"$libobj\"\n\tobj=$func_lo2o_result\n\t;;\n      *)\n\tlibobj=\n\tobj=$output\n\t;;\n      esac\n\n      # Delete the old objects.\n      $opt_dry_run || $RM $obj $libobj\n\n      # Objects from convenience libraries.  This assumes\n      # single-version convenience libraries.  Whenever we create\n      # different ones for PIC/non-PIC, this we'll have to duplicate\n      # the extraction.\n      reload_conv_objs=\n      gentop=\n      # if reload_cmds runs $LD directly, get rid of -Wl from\n      # whole_archive_flag_spec and hope we can get by with turning comma\n      # into space.\n      case $reload_cmds in\n        *\\$LD[\\ \\$]*) wl= ;;\n      esac\n      if test -n \"$convenience\"; then\n\tif test -n \"$whole_archive_flag_spec\"; then\n\t  eval tmp_whole_archive_flags=\\\"$whole_archive_flag_spec\\\"\n\t  test -n \"$wl\" || tmp_whole_archive_flags=`$ECHO \"$tmp_whole_archive_flags\" | $SED 's|,| |g'`\n\t  reload_conv_objs=$reload_objs\\ $tmp_whole_archive_flags\n\telse\n\t  gentop=$output_objdir/${obj}x\n\t  func_append generated \" $gentop\"\n\n\t  func_extract_archives $gentop $convenience\n\t  reload_conv_objs=\"$reload_objs $func_extract_archives_result\"\n\tfi\n      fi\n\n      # If we're not building shared, we need to use non_pic_objs\n      test yes = \"$build_libtool_libs\" || libobjs=$non_pic_objects\n\n      # Create the old-style object.\n      reload_objs=$objs$old_deplibs' '`$ECHO \"$libobjs\" | $SP2NL | $SED \"/\\.$libext$/d; /\\.lib$/d; $lo2o\" | $NL2SP`' '$reload_conv_objs\n\n      output=$obj\n      func_execute_cmds \"$reload_cmds\" 'exit $?'\n\n      # Exit if we aren't doing a library object file.\n      if test -z \"$libobj\"; then\n\tif test -n \"$gentop\"; then\n\t  func_show_eval '${RM}r \"$gentop\"'\n\tfi\n\n\texit $EXIT_SUCCESS\n      fi\n\n      test yes = \"$build_libtool_libs\" || {\n\tif test -n \"$gentop\"; then\n\t  func_show_eval '${RM}r \"$gentop\"'\n\tfi\n\n\t# Create an invalid libtool object if no PIC, so that we don't\n\t# accidentally link it into a program.\n\t# $show \"echo timestamp > $libobj\"\n\t# $opt_dry_run || eval \"echo timestamp > $libobj\" || exit $?\n\texit $EXIT_SUCCESS\n      }\n\n      if test -n \"$pic_flag\" || test default != \"$pic_mode\"; then\n\t# Only do commands if we really have different PIC objects.\n\treload_objs=\"$libobjs $reload_conv_objs\"\n\toutput=$libobj\n\tfunc_execute_cmds \"$reload_cmds\" 'exit $?'\n      fi\n\n      if test -n \"$gentop\"; then\n\tfunc_show_eval '${RM}r \"$gentop\"'\n      fi\n\n      exit $EXIT_SUCCESS\n      ;;\n\n    prog)\n      case $host in\n\t*cygwin*) func_stripname '' '.exe' \"$output\"\n\t          output=$func_stripname_result.exe;;\n      esac\n      test -n \"$vinfo\" && \\\n\tfunc_warning \"'-version-info' is ignored for programs\"\n\n      test -n \"$release\" && \\\n\tfunc_warning \"'-release' is ignored for programs\"\n\n      $preload \\\n\t&& test unknown,unknown,unknown = \"$dlopen_support,$dlopen_self,$dlopen_self_static\" \\\n\t&& func_warning \"'LT_INIT([dlopen])' not used. Assuming no dlopen support.\"\n\n      case $host in\n      *-*-rhapsody* | *-*-darwin1.[012])\n\t# On Rhapsody replace the C library is the System framework\n\tcompile_deplibs=`$ECHO \" $compile_deplibs\" | $SED 's/ -lc / System.ltframework /'`\n\tfinalize_deplibs=`$ECHO \" $finalize_deplibs\" | $SED 's/ -lc / System.ltframework /'`\n\t;;\n      esac\n\n      case $host in\n      *-*-darwin*)\n\t# Don't allow lazy linking, it breaks C++ global constructors\n\t# But is supposedly fixed on 10.4 or later (yay!).\n\tif test CXX = \"$tagname\"; then\n\t  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in\n\t    10.[0123])\n\t      func_append compile_command \" $wl-bind_at_load\"\n\t      func_append finalize_command \" $wl-bind_at_load\"\n\t    ;;\n\t  esac\n\tfi\n\t# Time to change all our \"foo.ltframework\" stuff back to \"-framework foo\"\n\tcompile_deplibs=`$ECHO \" $compile_deplibs\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\tfinalize_deplibs=`$ECHO \" $finalize_deplibs\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\t;;\n      esac\n\n\n      # move library search paths that coincide with paths to not yet\n      # installed libraries to the beginning of the library search list\n      new_libs=\n      for path in $notinst_path; do\n\tcase \" $new_libs \" in\n\t*\" -L$path/$objdir \"*) ;;\n\t*)\n\t  case \" $compile_deplibs \" in\n\t  *\" -L$path/$objdir \"*)\n\t    func_append new_libs \" -L$path/$objdir\" ;;\n\t  esac\n\t  ;;\n\tesac\n      done\n      for deplib in $compile_deplibs; do\n\tcase $deplib in\n\t-L*)\n\t  case \" $new_libs \" in\n\t  *\" $deplib \"*) ;;\n\t  *) func_append new_libs \" $deplib\" ;;\n\t  esac\n\t  ;;\n\t*) func_append new_libs \" $deplib\" ;;\n\tesac\n      done\n      compile_deplibs=$new_libs\n\n\n      func_append compile_command \" $compile_deplibs\"\n      func_append finalize_command \" $finalize_deplibs\"\n\n      if test -n \"$rpath$xrpath\"; then\n\t# If the user specified any rpath flags, then add them.\n\tfor libdir in $rpath $xrpath; do\n\t  # This is the magic to use -rpath.\n\t  case \"$finalize_rpath \" in\n\t  *\" $libdir \"*) ;;\n\t  *) func_append finalize_rpath \" $libdir\" ;;\n\t  esac\n\tdone\n      fi\n\n      # Now hardcode the library paths\n      rpath=\n      hardcode_libdirs=\n      for libdir in $compile_rpath $finalize_rpath; do\n\tif test -n \"$hardcode_libdir_flag_spec\"; then\n\t  if test -n \"$hardcode_libdir_separator\"; then\n\t    if test -z \"$hardcode_libdirs\"; then\n\t      hardcode_libdirs=$libdir\n\t    else\n\t      # Just accumulate the unique libdirs.\n\t      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in\n\t      *\"$hardcode_libdir_separator$libdir$hardcode_libdir_separator\"*)\n\t\t;;\n\t      *)\n\t\tfunc_append hardcode_libdirs \"$hardcode_libdir_separator$libdir\"\n\t\t;;\n\t      esac\n\t    fi\n\t  else\n\t    eval flag=\\\"$hardcode_libdir_flag_spec\\\"\n\t    func_append rpath \" $flag\"\n\t  fi\n\telif test -n \"$runpath_var\"; then\n\t  case \"$perm_rpath \" in\n\t  *\" $libdir \"*) ;;\n\t  *) func_append perm_rpath \" $libdir\" ;;\n\t  esac\n\tfi\n\tcase $host in\n\t*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)\n\t  testbindir=`$ECHO \"$libdir\" | $SED -e 's*/lib$*/bin*'`\n\t  case :$dllsearchpath: in\n\t  *\":$libdir:\"*) ;;\n\t  ::) dllsearchpath=$libdir;;\n\t  *) func_append dllsearchpath \":$libdir\";;\n\t  esac\n\t  case :$dllsearchpath: in\n\t  *\":$testbindir:\"*) ;;\n\t  ::) dllsearchpath=$testbindir;;\n\t  *) func_append dllsearchpath \":$testbindir\";;\n\t  esac\n\t  ;;\n\tesac\n      done\n      # Substitute the hardcoded libdirs into the rpath.\n      if test -n \"$hardcode_libdir_separator\" &&\n\t test -n \"$hardcode_libdirs\"; then\n\tlibdir=$hardcode_libdirs\n\teval rpath=\\\" $hardcode_libdir_flag_spec\\\"\n      fi\n      compile_rpath=$rpath\n\n      rpath=\n      hardcode_libdirs=\n      for libdir in $finalize_rpath; do\n\tif test -n \"$hardcode_libdir_flag_spec\"; then\n\t  if test -n \"$hardcode_libdir_separator\"; then\n\t    if test -z \"$hardcode_libdirs\"; then\n\t      hardcode_libdirs=$libdir\n\t    else\n\t      # Just accumulate the unique libdirs.\n\t      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in\n\t      *\"$hardcode_libdir_separator$libdir$hardcode_libdir_separator\"*)\n\t\t;;\n\t      *)\n\t\tfunc_append hardcode_libdirs \"$hardcode_libdir_separator$libdir\"\n\t\t;;\n\t      esac\n\t    fi\n\t  else\n\t    eval flag=\\\"$hardcode_libdir_flag_spec\\\"\n\t    func_append rpath \" $flag\"\n\t  fi\n\telif test -n \"$runpath_var\"; then\n\t  case \"$finalize_perm_rpath \" in\n\t  *\" $libdir \"*) ;;\n\t  *) func_append finalize_perm_rpath \" $libdir\" ;;\n\t  esac\n\tfi\n      done\n      # Substitute the hardcoded libdirs into the rpath.\n      if test -n \"$hardcode_libdir_separator\" &&\n\t test -n \"$hardcode_libdirs\"; then\n\tlibdir=$hardcode_libdirs\n\teval rpath=\\\" $hardcode_libdir_flag_spec\\\"\n      fi\n      finalize_rpath=$rpath\n\n      if test -n \"$libobjs\" && test yes = \"$build_old_libs\"; then\n\t# Transform all the library objects into standard objects.\n\tcompile_command=`$ECHO \"$compile_command\" | $SP2NL | $SED \"$lo2o\" | $NL2SP`\n\tfinalize_command=`$ECHO \"$finalize_command\" | $SP2NL | $SED \"$lo2o\" | $NL2SP`\n      fi\n\n      func_generate_dlsyms \"$outputname\" \"@PROGRAM@\" false\n\n      # template prelinking step\n      if test -n \"$prelink_cmds\"; then\n\tfunc_execute_cmds \"$prelink_cmds\" 'exit $?'\n      fi\n\n      wrappers_required=:\n      case $host in\n      *cegcc* | *mingw32ce*)\n        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.\n        wrappers_required=false\n        ;;\n      *cygwin* | *mingw* )\n        test yes = \"$build_libtool_libs\" || wrappers_required=false\n        ;;\n      *)\n        if test no = \"$need_relink\" || test yes != \"$build_libtool_libs\"; then\n          wrappers_required=false\n        fi\n        ;;\n      esac\n      $wrappers_required || {\n\t# Replace the output file specification.\n\tcompile_command=`$ECHO \"$compile_command\" | $SED 's%@OUTPUT@%'\"$output\"'%g'`\n\tlink_command=$compile_command$compile_rpath\n\n\t# We have no uninstalled library dependencies, so finalize right now.\n\texit_status=0\n\tfunc_show_eval \"$link_command\" 'exit_status=$?'\n\n\tif test -n \"$postlink_cmds\"; then\n\t  func_to_tool_file \"$output\"\n\t  postlink_cmds=`func_echo_all \"$postlink_cmds\" | $SED -e 's%@OUTPUT@%'\"$output\"'%g' -e 's%@TOOL_OUTPUT@%'\"$func_to_tool_file_result\"'%g'`\n\t  func_execute_cmds \"$postlink_cmds\" 'exit $?'\n\tfi\n\n\t# Delete the generated files.\n\tif test -f \"$output_objdir/${outputname}S.$objext\"; then\n\t  func_show_eval '$RM \"$output_objdir/${outputname}S.$objext\"'\n\tfi\n\n\texit $exit_status\n      }\n\n      if test -n \"$compile_shlibpath$finalize_shlibpath\"; then\n\tcompile_command=\"$shlibpath_var=\\\"$compile_shlibpath$finalize_shlibpath\\$$shlibpath_var\\\" $compile_command\"\n      fi\n      if test -n \"$finalize_shlibpath\"; then\n\tfinalize_command=\"$shlibpath_var=\\\"$finalize_shlibpath\\$$shlibpath_var\\\" $finalize_command\"\n      fi\n\n      compile_var=\n      finalize_var=\n      if test -n \"$runpath_var\"; then\n\tif test -n \"$perm_rpath\"; then\n\t  # We should set the runpath_var.\n\t  rpath=\n\t  for dir in $perm_rpath; do\n\t    func_append rpath \"$dir:\"\n\t  done\n\t  compile_var=\"$runpath_var=\\\"$rpath\\$$runpath_var\\\" \"\n\tfi\n\tif test -n \"$finalize_perm_rpath\"; then\n\t  # We should set the runpath_var.\n\t  rpath=\n\t  for dir in $finalize_perm_rpath; do\n\t    func_append rpath \"$dir:\"\n\t  done\n\t  finalize_var=\"$runpath_var=\\\"$rpath\\$$runpath_var\\\" \"\n\tfi\n      fi\n\n      if test yes = \"$no_install\"; then\n\t# We don't need to create a wrapper script.\n\tlink_command=$compile_var$compile_command$compile_rpath\n\t# Replace the output file specification.\n\tlink_command=`$ECHO \"$link_command\" | $SED 's%@OUTPUT@%'\"$output\"'%g'`\n\t# Delete the old output file.\n\t$opt_dry_run || $RM $output\n\t# Link the executable and exit\n\tfunc_show_eval \"$link_command\" 'exit $?'\n\n\tif test -n \"$postlink_cmds\"; then\n\t  func_to_tool_file \"$output\"\n\t  postlink_cmds=`func_echo_all \"$postlink_cmds\" | $SED -e 's%@OUTPUT@%'\"$output\"'%g' -e 's%@TOOL_OUTPUT@%'\"$func_to_tool_file_result\"'%g'`\n\t  func_execute_cmds \"$postlink_cmds\" 'exit $?'\n\tfi\n\n\texit $EXIT_SUCCESS\n      fi\n\n      case $hardcode_action,$fast_install in\n        relink,*)\n\t  # Fast installation is not supported\n\t  link_command=$compile_var$compile_command$compile_rpath\n\t  relink_command=$finalize_var$finalize_command$finalize_rpath\n\n\t  func_warning \"this platform does not like uninstalled shared libraries\"\n\t  func_warning \"'$output' will be relinked during installation\"\n\t  ;;\n        *,yes)\n\t  link_command=$finalize_var$compile_command$finalize_rpath\n\t  relink_command=`$ECHO \"$compile_var$compile_command$compile_rpath\" | $SED 's%@OUTPUT@%\\$progdir/\\$file%g'`\n          ;;\n\t*,no)\n\t  link_command=$compile_var$compile_command$compile_rpath\n\t  relink_command=$finalize_var$finalize_command$finalize_rpath\n          ;;\n\t*,needless)\n\t  link_command=$finalize_var$compile_command$finalize_rpath\n\t  relink_command=\n          ;;\n      esac\n\n      # Replace the output file specification.\n      link_command=`$ECHO \"$link_command\" | $SED 's%@OUTPUT@%'\"$output_objdir/$outputname\"'%g'`\n\n      # Delete the old output files.\n      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname\n\n      func_show_eval \"$link_command\" 'exit $?'\n\n      if test -n \"$postlink_cmds\"; then\n\tfunc_to_tool_file \"$output_objdir/$outputname\"\n\tpostlink_cmds=`func_echo_all \"$postlink_cmds\" | $SED -e 's%@OUTPUT@%'\"$output_objdir/$outputname\"'%g' -e 's%@TOOL_OUTPUT@%'\"$func_to_tool_file_result\"'%g'`\n\tfunc_execute_cmds \"$postlink_cmds\" 'exit $?'\n      fi\n\n      # Now create the wrapper script.\n      func_verbose \"creating $output\"\n\n      # Quote the relink command for shipping.\n      if test -n \"$relink_command\"; then\n\t# Preserve any variables that may affect compiler behavior\n\tfor var in $variables_saved_for_relink; do\n\t  if eval test -z \\\"\\${$var+set}\\\"; then\n\t    relink_command=\"{ test -z \\\"\\${$var+set}\\\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command\"\n\t  elif eval var_value=\\$$var; test -z \"$var_value\"; then\n\t    relink_command=\"$var=; export $var; $relink_command\"\n\t  else\n\t    func_quote_for_eval \"$var_value\"\n\t    relink_command=\"$var=$func_quote_for_eval_result; export $var; $relink_command\"\n\t  fi\n\tdone\n\trelink_command=\"(cd `pwd`; $relink_command)\"\n\trelink_command=`$ECHO \"$relink_command\" | $SED \"$sed_quote_subst\"`\n      fi\n\n      # Only actually do things if not in dry run mode.\n      $opt_dry_run || {\n\t# win32 will think the script is a binary if it has\n\t# a .exe suffix, so we strip it off here.\n\tcase $output in\n\t  *.exe) func_stripname '' '.exe' \"$output\"\n\t         output=$func_stripname_result ;;\n\tesac\n\t# test for cygwin because mv fails w/o .exe extensions\n\tcase $host in\n\t  *cygwin*)\n\t    exeext=.exe\n\t    func_stripname '' '.exe' \"$outputname\"\n\t    outputname=$func_stripname_result ;;\n\t  *) exeext= ;;\n\tesac\n\tcase $host in\n\t  *cygwin* | *mingw* )\n\t    func_dirname_and_basename \"$output\" \"\" \".\"\n\t    output_name=$func_basename_result\n\t    output_path=$func_dirname_result\n\t    cwrappersource=$output_path/$objdir/lt-$output_name.c\n\t    cwrapper=$output_path/$output_name.exe\n\t    $RM $cwrappersource $cwrapper\n\t    trap \"$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE\" 1 2 15\n\n\t    func_emit_cwrapperexe_src > $cwrappersource\n\n\t    # The wrapper executable is built using the $host compiler,\n\t    # because it contains $host paths and files. If cross-\n\t    # compiling, it, like the target executable, must be\n\t    # executed on the $host or under an emulation environment.\n\t    $opt_dry_run || {\n\t      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource\n\t      $STRIP $cwrapper\n\t    }\n\n\t    # Now, create the wrapper script for func_source use:\n\t    func_ltwrapper_scriptname $cwrapper\n\t    $RM $func_ltwrapper_scriptname_result\n\t    trap \"$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE\" 1 2 15\n\t    $opt_dry_run || {\n\t      # note: this script will not be executed, so do not chmod.\n\t      if test \"x$build\" = \"x$host\"; then\n\t\t$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result\n\t      else\n\t\tfunc_emit_wrapper no > $func_ltwrapper_scriptname_result\n\t      fi\n\t    }\n\t  ;;\n\t  * )\n\t    $RM $output\n\t    trap \"$RM $output; exit $EXIT_FAILURE\" 1 2 15\n\n\t    func_emit_wrapper no > $output\n\t    chmod +x $output\n\t  ;;\n\tesac\n      }\n      exit $EXIT_SUCCESS\n      ;;\n    esac\n\n    # See if we need to build an old-fashioned archive.\n    for oldlib in $oldlibs; do\n\n      case $build_libtool_libs in\n        convenience)\n\t  oldobjs=\"$libobjs_save $symfileobj\"\n\t  addlibs=$convenience\n\t  build_libtool_libs=no\n\t  ;;\n\tmodule)\n\t  oldobjs=$libobjs_save\n\t  addlibs=$old_convenience\n\t  build_libtool_libs=no\n          ;;\n\t*)\n\t  oldobjs=\"$old_deplibs $non_pic_objects\"\n\t  $preload && test -f \"$symfileobj\" \\\n\t    && func_append oldobjs \" $symfileobj\"\n\t  addlibs=$old_convenience\n\t  ;;\n      esac\n\n      if test -n \"$addlibs\"; then\n\tgentop=$output_objdir/${outputname}x\n\tfunc_append generated \" $gentop\"\n\n\tfunc_extract_archives $gentop $addlibs\n\tfunc_append oldobjs \" $func_extract_archives_result\"\n      fi\n\n      # Do each command in the archive commands.\n      if test -n \"$old_archive_from_new_cmds\" && test yes = \"$build_libtool_libs\"; then\n\tcmds=$old_archive_from_new_cmds\n      else\n\n\t# Add any objects from preloaded convenience libraries\n\tif test -n \"$dlprefiles\"; then\n\t  gentop=$output_objdir/${outputname}x\n\t  func_append generated \" $gentop\"\n\n\t  func_extract_archives $gentop $dlprefiles\n\t  func_append oldobjs \" $func_extract_archives_result\"\n\tfi\n\n\t# POSIX demands no paths to be encoded in archives.  We have\n\t# to avoid creating archives with duplicate basenames if we\n\t# might have to extract them afterwards, e.g., when creating a\n\t# static archive out of a convenience library, or when linking\n\t# the entirety of a libtool archive into another (currently\n\t# not supported by libtool).\n\tif (for obj in $oldobjs\n\t    do\n\t      func_basename \"$obj\"\n\t      $ECHO \"$func_basename_result\"\n\t    done | sort | sort -uc >/dev/null 2>&1); then\n\t  :\n\telse\n\t  echo \"copying selected object files to avoid basename conflicts...\"\n\t  gentop=$output_objdir/${outputname}x\n\t  func_append generated \" $gentop\"\n\t  func_mkdir_p \"$gentop\"\n\t  save_oldobjs=$oldobjs\n\t  oldobjs=\n\t  counter=1\n\t  for obj in $save_oldobjs\n\t  do\n\t    func_basename \"$obj\"\n\t    objbase=$func_basename_result\n\t    case \" $oldobjs \" in\n\t    \" \") oldobjs=$obj ;;\n\t    *[\\ /]\"$objbase \"*)\n\t      while :; do\n\t\t# Make sure we don't pick an alternate name that also\n\t\t# overlaps.\n\t\tnewobj=lt$counter-$objbase\n\t\tfunc_arith $counter + 1\n\t\tcounter=$func_arith_result\n\t\tcase \" $oldobjs \" in\n\t\t*[\\ /]\"$newobj \"*) ;;\n\t\t*) if test ! -f \"$gentop/$newobj\"; then break; fi ;;\n\t\tesac\n\t      done\n\t      func_show_eval \"ln $obj $gentop/$newobj || cp $obj $gentop/$newobj\"\n\t      func_append oldobjs \" $gentop/$newobj\"\n\t      ;;\n\t    *) func_append oldobjs \" $obj\" ;;\n\t    esac\n\t  done\n\tfi\n\tfunc_to_tool_file \"$oldlib\" func_convert_file_msys_to_w32\n\ttool_oldlib=$func_to_tool_file_result\n\teval cmds=\\\"$old_archive_cmds\\\"\n\n\tfunc_len \" $cmds\"\n\tlen=$func_len_result\n\tif test \"$len\" -lt \"$max_cmd_len\" || test \"$max_cmd_len\" -le -1; then\n\t  cmds=$old_archive_cmds\n\telif test -n \"$archiver_list_spec\"; then\n\t  func_verbose \"using command file archive linking...\"\n\t  for obj in $oldobjs\n\t  do\n\t    func_to_tool_file \"$obj\"\n\t    $ECHO \"$func_to_tool_file_result\"\n\t  done > $output_objdir/$libname.libcmd\n\t  func_to_tool_file \"$output_objdir/$libname.libcmd\"\n\t  oldobjs=\" $archiver_list_spec$func_to_tool_file_result\"\n\t  cmds=$old_archive_cmds\n\telse\n\t  # the command line is too long to link in one step, link in parts\n\t  func_verbose \"using piecewise archive linking...\"\n\t  save_RANLIB=$RANLIB\n\t  RANLIB=:\n\t  objlist=\n\t  concat_cmds=\n\t  save_oldobjs=$oldobjs\n\t  oldobjs=\n\t  # Is there a better way of finding the last object in the list?\n\t  for obj in $save_oldobjs\n\t  do\n\t    last_oldobj=$obj\n\t  done\n\t  eval test_cmds=\\\"$old_archive_cmds\\\"\n\t  func_len \" $test_cmds\"\n\t  len0=$func_len_result\n\t  len=$len0\n\t  for obj in $save_oldobjs\n\t  do\n\t    func_len \" $obj\"\n\t    func_arith $len + $func_len_result\n\t    len=$func_arith_result\n\t    func_append objlist \" $obj\"\n\t    if test \"$len\" -lt \"$max_cmd_len\"; then\n\t      :\n\t    else\n\t      # the above command should be used before it gets too long\n\t      oldobjs=$objlist\n\t      if test \"$obj\" = \"$last_oldobj\"; then\n\t\tRANLIB=$save_RANLIB\n\t      fi\n\t      test -z \"$concat_cmds\" || concat_cmds=$concat_cmds~\n\t      eval concat_cmds=\\\"\\$concat_cmds$old_archive_cmds\\\"\n\t      objlist=\n\t      len=$len0\n\t    fi\n\t  done\n\t  RANLIB=$save_RANLIB\n\t  oldobjs=$objlist\n\t  if test -z \"$oldobjs\"; then\n\t    eval cmds=\\\"\\$concat_cmds\\\"\n\t  else\n\t    eval cmds=\\\"\\$concat_cmds~\\$old_archive_cmds\\\"\n\t  fi\n\tfi\n      fi\n      func_execute_cmds \"$cmds\" 'exit $?'\n    done\n\n    test -n \"$generated\" && \\\n      func_show_eval \"${RM}r$generated\"\n\n    # Now create the libtool archive.\n    case $output in\n    *.la)\n      old_library=\n      test yes = \"$build_old_libs\" && old_library=$libname.$libext\n      func_verbose \"creating $output\"\n\n      # Preserve any variables that may affect compiler behavior\n      for var in $variables_saved_for_relink; do\n\tif eval test -z \\\"\\${$var+set}\\\"; then\n\t  relink_command=\"{ test -z \\\"\\${$var+set}\\\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command\"\n\telif eval var_value=\\$$var; test -z \"$var_value\"; then\n\t  relink_command=\"$var=; export $var; $relink_command\"\n\telse\n\t  func_quote_for_eval \"$var_value\"\n\t  relink_command=\"$var=$func_quote_for_eval_result; export $var; $relink_command\"\n\tfi\n      done\n      # Quote the link command for shipping.\n      relink_command=\"(cd `pwd`; $SHELL \\\"$progpath\\\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)\"\n      relink_command=`$ECHO \"$relink_command\" | $SED \"$sed_quote_subst\"`\n      if test yes = \"$hardcode_automatic\"; then\n\trelink_command=\n      fi\n\n      # Only create the output if not a dry run.\n      $opt_dry_run || {\n\tfor installed in no yes; do\n\t  if test yes = \"$installed\"; then\n\t    if test -z \"$install_libdir\"; then\n\t      break\n\t    fi\n\t    output=$output_objdir/${outputname}i\n\t    # Replace all uninstalled libtool libraries with the installed ones\n\t    newdependency_libs=\n\t    for deplib in $dependency_libs; do\n\t      case $deplib in\n\t      *.la)\n\t\tfunc_basename \"$deplib\"\n\t\tname=$func_basename_result\n\t\tfunc_resolve_sysroot \"$deplib\"\n\t\teval libdir=`$SED -n -e 's/^libdir=\\(.*\\)$/\\1/p' $func_resolve_sysroot_result`\n\t\ttest -z \"$libdir\" && \\\n\t\t  func_fatal_error \"'$deplib' is not a valid libtool archive\"\n\t\tfunc_append newdependency_libs \" ${lt_sysroot:+=}$libdir/$name\"\n\t\t;;\n\t      -L*)\n\t\tfunc_stripname -L '' \"$deplib\"\n\t\tfunc_replace_sysroot \"$func_stripname_result\"\n\t\tfunc_append newdependency_libs \" -L$func_replace_sysroot_result\"\n\t\t;;\n\t      -R*)\n\t\tfunc_stripname -R '' \"$deplib\"\n\t\tfunc_replace_sysroot \"$func_stripname_result\"\n\t\tfunc_append newdependency_libs \" -R$func_replace_sysroot_result\"\n\t\t;;\n\t      *) func_append newdependency_libs \" $deplib\" ;;\n\t      esac\n\t    done\n\t    dependency_libs=$newdependency_libs\n\t    newdlfiles=\n\n\t    for lib in $dlfiles; do\n\t      case $lib in\n\t      *.la)\n\t        func_basename \"$lib\"\n\t\tname=$func_basename_result\n\t\teval libdir=`$SED -n -e 's/^libdir=\\(.*\\)$/\\1/p' $lib`\n\t\ttest -z \"$libdir\" && \\\n\t\t  func_fatal_error \"'$lib' is not a valid libtool archive\"\n\t\tfunc_append newdlfiles \" ${lt_sysroot:+=}$libdir/$name\"\n\t\t;;\n\t      *) func_append newdlfiles \" $lib\" ;;\n\t      esac\n\t    done\n\t    dlfiles=$newdlfiles\n\t    newdlprefiles=\n\t    for lib in $dlprefiles; do\n\t      case $lib in\n\t      *.la)\n\t\t# Only pass preopened files to the pseudo-archive (for\n\t\t# eventual linking with the app. that links it) if we\n\t\t# didn't already link the preopened objects directly into\n\t\t# the library:\n\t\tfunc_basename \"$lib\"\n\t\tname=$func_basename_result\n\t\teval libdir=`$SED -n -e 's/^libdir=\\(.*\\)$/\\1/p' $lib`\n\t\ttest -z \"$libdir\" && \\\n\t\t  func_fatal_error \"'$lib' is not a valid libtool archive\"\n\t\tfunc_append newdlprefiles \" ${lt_sysroot:+=}$libdir/$name\"\n\t\t;;\n\t      esac\n\t    done\n\t    dlprefiles=$newdlprefiles\n\t  else\n\t    newdlfiles=\n\t    for lib in $dlfiles; do\n\t      case $lib in\n\t\t[\\\\/]* | [A-Za-z]:[\\\\/]*) abs=$lib ;;\n\t\t*) abs=`pwd`\"/$lib\" ;;\n\t      esac\n\t      func_append newdlfiles \" $abs\"\n\t    done\n\t    dlfiles=$newdlfiles\n\t    newdlprefiles=\n\t    for lib in $dlprefiles; do\n\t      case $lib in\n\t\t[\\\\/]* | [A-Za-z]:[\\\\/]*) abs=$lib ;;\n\t\t*) abs=`pwd`\"/$lib\" ;;\n\t      esac\n\t      func_append newdlprefiles \" $abs\"\n\t    done\n\t    dlprefiles=$newdlprefiles\n\t  fi\n\t  $RM $output\n\t  # place dlname in correct position for cygwin\n\t  # In fact, it would be nice if we could use this code for all target\n\t  # systems that can't hard-code library paths into their executables\n\t  # and that have no shared library path variable independent of PATH,\n\t  # but it turns out we can't easily determine that from inspecting\n\t  # libtool variables, so we have to hard-code the OSs to which it\n\t  # applies here; at the moment, that means platforms that use the PE\n\t  # object format with DLL files.  See the long comment at the top of\n\t  # tests/bindir.at for full details.\n\t  tdlname=$dlname\n\t  case $host,$output,$installed,$module,$dlname in\n\t    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)\n\t      # If a -bindir argument was supplied, place the dll there.\n\t      if test -n \"$bindir\"; then\n\t\tfunc_relative_path \"$install_libdir\" \"$bindir\"\n\t\ttdlname=$func_relative_path_result/$dlname\n\t      else\n\t\t# Otherwise fall back on heuristic.\n\t\ttdlname=../bin/$dlname\n\t      fi\n\t      ;;\n\t  esac\n\t  $ECHO > $output \"\\\n# $outputname - a libtool library file\n# Generated by $PROGRAM (GNU $PACKAGE) $VERSION\n#\n# Please DO NOT delete this file!\n# It is necessary for linking the library.\n\n# The name that we can dlopen(3).\ndlname='$tdlname'\n\n# Names of this library.\nlibrary_names='$library_names'\n\n# The name of the static archive.\nold_library='$old_library'\n\n# Linker flags that cannot go in dependency_libs.\ninherited_linker_flags='$new_inherited_linker_flags'\n\n# Libraries that this one depends upon.\ndependency_libs='$dependency_libs'\n\n# Names of additional weak libraries provided by this library\nweak_library_names='$weak_libs'\n\n# Version information for $libname.\ncurrent=$current\nage=$age\nrevision=$revision\n\n# Is this an already installed library?\ninstalled=$installed\n\n# Should we warn about portability when linking against -modules?\nshouldnotlink=$module\n\n# Files to dlopen/dlpreopen\ndlopen='$dlfiles'\ndlpreopen='$dlprefiles'\n\n# Directory that this library needs to be installed in:\nlibdir='$install_libdir'\"\n\t  if test no,yes = \"$installed,$need_relink\"; then\n\t    $ECHO >> $output \"\\\nrelink_command=\\\"$relink_command\\\"\"\n\t  fi\n\tdone\n      }\n\n      # Do a symbolic link so that the libtool archive can be found in\n      # LD_LIBRARY_PATH before the program is installed.\n      func_show_eval '( cd \"$output_objdir\" && $RM \"$outputname\" && $LN_S \"../$outputname\" \"$outputname\" )' 'exit $?'\n      ;;\n    esac\n    exit $EXIT_SUCCESS\n}\n\nif test link = \"$opt_mode\" || test relink = \"$opt_mode\"; then\n  func_mode_link ${1+\"$@\"}\nfi\n\n\n# func_mode_uninstall arg...\nfunc_mode_uninstall ()\n{\n    $debug_cmd\n\n    RM=$nonopt\n    files=\n    rmforce=false\n    exit_status=0\n\n    # This variable tells wrapper scripts just to set variables rather\n    # than running their programs.\n    libtool_install_magic=$magic\n\n    for arg\n    do\n      case $arg in\n      -f) func_append RM \" $arg\"; rmforce=: ;;\n      -*) func_append RM \" $arg\" ;;\n      *) func_append files \" $arg\" ;;\n      esac\n    done\n\n    test -z \"$RM\" && \\\n      func_fatal_help \"you must specify an RM program\"\n\n    rmdirs=\n\n    for file in $files; do\n      func_dirname \"$file\" \"\" \".\"\n      dir=$func_dirname_result\n      if test . = \"$dir\"; then\n\todir=$objdir\n      else\n\todir=$dir/$objdir\n      fi\n      func_basename \"$file\"\n      name=$func_basename_result\n      test uninstall = \"$opt_mode\" && odir=$dir\n\n      # Remember odir for removal later, being careful to avoid duplicates\n      if test clean = \"$opt_mode\"; then\n\tcase \" $rmdirs \" in\n\t  *\" $odir \"*) ;;\n\t  *) func_append rmdirs \" $odir\" ;;\n\tesac\n      fi\n\n      # Don't error if the file doesn't exist and rm -f was used.\n      if { test -L \"$file\"; } >/dev/null 2>&1 ||\n\t { test -h \"$file\"; } >/dev/null 2>&1 ||\n\t test -f \"$file\"; then\n\t:\n      elif test -d \"$file\"; then\n\texit_status=1\n\tcontinue\n      elif $rmforce; then\n\tcontinue\n      fi\n\n      rmfiles=$file\n\n      case $name in\n      *.la)\n\t# Possibly a libtool archive, so verify it.\n\tif func_lalib_p \"$file\"; then\n\t  func_source $dir/$name\n\n\t  # Delete the libtool libraries and symlinks.\n\t  for n in $library_names; do\n\t    func_append rmfiles \" $odir/$n\"\n\t  done\n\t  test -n \"$old_library\" && func_append rmfiles \" $odir/$old_library\"\n\n\t  case $opt_mode in\n\t  clean)\n\t    case \" $library_names \" in\n\t    *\" $dlname \"*) ;;\n\t    *) test -n \"$dlname\" && func_append rmfiles \" $odir/$dlname\" ;;\n\t    esac\n\t    test -n \"$libdir\" && func_append rmfiles \" $odir/$name $odir/${name}i\"\n\t    ;;\n\t  uninstall)\n\t    if test -n \"$library_names\"; then\n\t      # Do each command in the postuninstall commands.\n\t      func_execute_cmds \"$postuninstall_cmds\" '$rmforce || exit_status=1'\n\t    fi\n\n\t    if test -n \"$old_library\"; then\n\t      # Do each command in the old_postuninstall commands.\n\t      func_execute_cmds \"$old_postuninstall_cmds\" '$rmforce || exit_status=1'\n\t    fi\n\t    # FIXME: should reinstall the best remaining shared library.\n\t    ;;\n\t  esac\n\tfi\n\t;;\n\n      *.lo)\n\t# Possibly a libtool object, so verify it.\n\tif func_lalib_p \"$file\"; then\n\n\t  # Read the .lo file\n\t  func_source $dir/$name\n\n\t  # Add PIC object to the list of files to remove.\n\t  if test -n \"$pic_object\" && test none != \"$pic_object\"; then\n\t    func_append rmfiles \" $dir/$pic_object\"\n\t  fi\n\n\t  # Add non-PIC object to the list of files to remove.\n\t  if test -n \"$non_pic_object\" && test none != \"$non_pic_object\"; then\n\t    func_append rmfiles \" $dir/$non_pic_object\"\n\t  fi\n\tfi\n\t;;\n\n      *)\n\tif test clean = \"$opt_mode\"; then\n\t  noexename=$name\n\t  case $file in\n\t  *.exe)\n\t    func_stripname '' '.exe' \"$file\"\n\t    file=$func_stripname_result\n\t    func_stripname '' '.exe' \"$name\"\n\t    noexename=$func_stripname_result\n\t    # $file with .exe has already been added to rmfiles,\n\t    # add $file without .exe\n\t    func_append rmfiles \" $file\"\n\t    ;;\n\t  esac\n\t  # Do a test to see if this is a libtool program.\n\t  if func_ltwrapper_p \"$file\"; then\n\t    if func_ltwrapper_executable_p \"$file\"; then\n\t      func_ltwrapper_scriptname \"$file\"\n\t      relink_command=\n\t      func_source $func_ltwrapper_scriptname_result\n\t      func_append rmfiles \" $func_ltwrapper_scriptname_result\"\n\t    else\n\t      relink_command=\n\t      func_source $dir/$noexename\n\t    fi\n\n\t    # note $name still contains .exe if it was in $file originally\n\t    # as does the version of $file that was added into $rmfiles\n\t    func_append rmfiles \" $odir/$name $odir/${name}S.$objext\"\n\t    if test yes = \"$fast_install\" && test -n \"$relink_command\"; then\n\t      func_append rmfiles \" $odir/lt-$name\"\n\t    fi\n\t    if test \"X$noexename\" != \"X$name\"; then\n\t      func_append rmfiles \" $odir/lt-$noexename.c\"\n\t    fi\n\t  fi\n\tfi\n\t;;\n      esac\n      func_show_eval \"$RM $rmfiles\" 'exit_status=1'\n    done\n\n    # Try to remove the $objdir's in the directories where we deleted files\n    for dir in $rmdirs; do\n      if test -d \"$dir\"; then\n\tfunc_show_eval \"rmdir $dir >/dev/null 2>&1\"\n      fi\n    done\n\n    exit $exit_status\n}\n\nif test uninstall = \"$opt_mode\" || test clean = \"$opt_mode\"; then\n  func_mode_uninstall ${1+\"$@\"}\nfi\n\ntest -z \"$opt_mode\" && {\n  help=$generic_help\n  func_fatal_help \"you must specify a MODE\"\n}\n\ntest -z \"$exec_cmd\" && \\\n  func_fatal_help \"invalid operation mode '$opt_mode'\"\n\nif test -n \"$exec_cmd\"; then\n  eval exec \"$exec_cmd\"\n  exit $EXIT_FAILURE\nfi\n\nexit $exit_status\n\n\n# The TAGs below are defined such that we never get into a situation\n# where we disable both kinds of libraries.  Given conflicting\n# choices, we go for a static library, that is the most portable,\n# since we can't tell whether shared libraries were disabled because\n# the user asked for that or because the platform doesn't support\n# them.  This is particularly important on AIX, because we don't\n# support having both static and shared libraries enabled at the same\n# time on that platform, so we default to a shared-only configuration.\n# If a disable-shared tag is given, we'll fallback to a static-only\n# configuration.  But we'll never go from static-only to shared-only.\n\n# ### BEGIN LIBTOOL TAG CONFIG: disable-shared\nbuild_libtool_libs=no\nbuild_old_libs=yes\n# ### END LIBTOOL TAG CONFIG: disable-shared\n\n# ### BEGIN LIBTOOL TAG CONFIG: disable-static\nbuild_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`\n# ### END LIBTOOL TAG CONFIG: disable-static\n\n# Local Variables:\n# mode:shell-script\n# sh-indentation:2\n# End:\n"
  },
  {
    "path": "makcjpeg.st",
    "content": "; Project file for Independent JPEG Group's software\n;\n; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.\n; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding.\n;\n; To use this file, rename it to cjpeg.prj.\n; If you are using Turbo C, change filenames beginning with \"pc...\" to \"tc...\"\n; Read installation instructions before trying to make the program!\n;\n;\n;      * * * Output file * * *\ncjpeg.ttp\n;\n; * * * COMPILER OPTIONS * * *  \n.C[-P]        ; absolute calls\n.C[-M]        ; and no string merging, folks\n.C[-w-cln]    ; no \"constant is long\" warnings\n.C[-w-par]    ; no \"parameter xxxx unused\"\n.C[-w-rch]    ; no \"unreachable code\"\n.C[-wsig]     ; warn if significant digits may be lost\n=\n; * * * * List of modules * * * * \npcstart.o\ncjpeg.c\t\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h)\ncdjpeg.c\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nrdswitch.c\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nrdppm.c\t\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nrdgif.c\t\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nrdtarga.c\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nrdbmp.c\t\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nrdrle.c\t\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nlibjpeg.lib        ; built by libjpeg.prj\npcfltlib.lib       ; floating point library\n; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED\npcstdlib.lib       ; standard library\npcextlib.lib       ; extended library\n"
  },
  {
    "path": "makdjpeg.st",
    "content": "; Project file for Independent JPEG Group's software\n;\n; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.\n; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding.\n;\n; To use this file, rename it to djpeg.prj.\n; If you are using Turbo C, change filenames beginning with \"pc...\" to \"tc...\"\n; Read installation instructions before trying to make the program!\n;\n;\n;      * * * Output file * * *\ndjpeg.ttp\n;\n; * * * COMPILER OPTIONS * * *  \n.C[-P]        ; absolute calls\n.C[-M]        ; and no string merging, folks\n.C[-w-cln]    ; no \"constant is long\" warnings\n.C[-w-par]    ; no \"parameter xxxx unused\"\n.C[-w-rch]    ; no \"unreachable code\"\n.C[-wsig]     ; warn if significant digits may be lost\n=\n; * * * * List of modules * * * * \npcstart.o\ndjpeg.c\t\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h)\ncdjpeg.c\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nrdcolmap.c\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nwrppm.c\t\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nwrgif.c\t\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nwrtarga.c\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nwrbmp.c\t\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nwrrle.c\t\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nlibjpeg.lib        ; built by libjpeg.prj\npcfltlib.lib       ; floating point library\n; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED\npcstdlib.lib       ; standard library\npcextlib.lib       ; extended library\n"
  },
  {
    "path": "makeadsw.vc6",
    "content": "Microsoft Developer Studio Workspace File, Format Version 6.00\n# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELSCHT WERDEN!\n\n###############################################################################\n\nProject: \"cjpeg\"=\".\\cjpeg.dsp\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nProject: \"djpeg\"=\".\\djpeg.dsp\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nProject: \"jpegtran\"=\".\\jpegtran.dsp\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nProject: \"rdjpgcom\"=\".\\rdjpgcom.dsp\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nProject: \"wrjpgcom\"=\".\\wrjpgcom.dsp\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nGlobal:\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<3>\n{{{\n}}}\n\n###############################################################################\n\n"
  },
  {
    "path": "makeasln.v10",
    "content": "\nMicrosoft Visual Studio Solution File, Format Version 11.00\n# Visual C++ Express 2010\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"cjpeg\", \"cjpeg.vcxproj\", \"{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"djpeg\", \"djpeg.vcxproj\", \"{11043137-B453-4DFA-9010-4D2B9DC1545C}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"jpegtran\", \"jpegtran.vcxproj\", \"{025BAC50-51B5-4FFE-BC47-3F920BB4047E}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"rdjpgcom\", \"rdjpgcom.vcxproj\", \"{C81513DB-78DC-46BC-BC98-82E745203976}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"wrjpgcom\", \"wrjpgcom.vcxproj\", \"{B57065D4-DDDA-4668-BAF5-2D49270C973C}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tRelease|Win32 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.Build.0 = Release|Win32\n\t\t{11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.Build.0 = Release|Win32\n\t\t{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.Build.0 = Release|Win32\n\t\t{C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.Build.0 = Release|Win32\n\t\t{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "makecdep.vc6",
    "content": "# Microsoft Developer Studio erstellte Abhngigkeitsdatei, einbezogen von cjpeg.mak\n\n.\\cdjpeg.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\cjpeg.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\".\\jversion.h\"\\\n\t\n\n.\\rdbmp.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\rdgif.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\rdppm.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\rdrle.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\rdswitch.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\rdtarga.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n"
  },
  {
    "path": "makecdsp.vc6",
    "content": "# Microsoft Developer Studio Project File - Name=\"cjpeg\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** NICHT BEARBEITEN **\n\n# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\n\nCFG=cjpeg - Win32\n!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE\n!MESSAGE verwenden Sie den Befehl \"Makefile exportieren\" und fhren Sie den Befehl\n!MESSAGE \n!MESSAGE NMAKE /f \"cjpeg.mak\".\n!MESSAGE \n!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben\n!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:\n!MESSAGE \n!MESSAGE NMAKE /f \"cjpeg.mak\" CFG=\"cjpeg - Win32\"\n!MESSAGE \n!MESSAGE Fr die Konfiguration stehen zur Auswahl:\n!MESSAGE \n!MESSAGE \"cjpeg - Win32\" (basierend auf  \"Win32 (x86) Console Application\")\n!MESSAGE \n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \".\\cjpeg\\Release\"\n# PROP BASE Intermediate_Dir \".\\cjpeg\\Release\"\n# PROP BASE Target_Dir \".\\cjpeg\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \".\\cjpeg\\Release\"\n# PROP Intermediate_Dir \".\\cjpeg\\Release\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \".\\cjpeg\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /YX /c\n# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /YX /FD /c\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# ADD LINK32 Release\\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# Begin Target\n\n# Name \"cjpeg - Win32\"\n# Begin Group \"Quellcodedateien\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90\"\n# Begin Source File\n\nSOURCE=.\\cdjpeg.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\cjpeg.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\rdbmp.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\rdgif.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\rdppm.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\rdrle.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\rdswitch.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\rdtarga.c\n# End Source File\n# End Group\n# Begin Group \"Header-Dateien\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl;fi;fd\"\n# Begin Source File\n\nSOURCE=.\\cderror.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\cdjpeg.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jconfig.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jerror.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jinclude.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jmorecfg.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jpeglib.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jversion.h\n# End Source File\n# End Group\n# Begin Group \"Ressourcendateien\"\n\n# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe\"\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "makecfil.v10",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"cderror.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"cdjpeg.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jconfig.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jerror.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jinclude.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jmorecfg.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jpeglib.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jversion.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"cdjpeg.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"cjpeg.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"rdbmp.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"rdgif.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"rdppm.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"rdrle.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"rdswitch.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"rdtarga.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "makecmak.vc6",
    "content": "# Microsoft Developer Studio Generated NMAKE File, Based on cjpeg.dsp\n!IF \"$(CFG)\" == \"\"\nCFG=cjpeg - Win32\n!MESSAGE Keine Konfiguration angegeben. cjpeg - Win32 wird als Standard verwendet.\n!ENDIF \n\n!IF \"$(CFG)\" != \"cjpeg - Win32\"\n!MESSAGE Ungltige Konfiguration \"$(CFG)\" angegeben.\n!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben\n!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:\n!MESSAGE \n!MESSAGE NMAKE /f \"cjpeg.mak\" CFG=\"cjpeg - Win32\"\n!MESSAGE \n!MESSAGE Fr die Konfiguration stehen zur Auswahl:\n!MESSAGE \n!MESSAGE \"cjpeg - Win32\" (basierend auf  \"Win32 (x86) Console Application\")\n!MESSAGE \n!ERROR Eine ungltige Konfiguration wurde angegeben.\n!ENDIF \n\n!IF \"$(OS)\" == \"Windows_NT\"\nNULL=\n!ELSE \nNULL=nul\n!ENDIF \n\nCPP=cl.exe\nRSC=rc.exe\nOUTDIR=.\\cjpeg\\Release\nINTDIR=.\\cjpeg\\Release\n# Begin Custom Macros\nOutDir=.\\cjpeg\\Release\n# End Custom Macros\n\nALL : \"$(OUTDIR)\\cjpeg.exe\"\n\n\nCLEAN :\n\t-@erase \"$(INTDIR)\\cdjpeg.obj\"\n\t-@erase \"$(INTDIR)\\cjpeg.obj\"\n\t-@erase \"$(INTDIR)\\rdbmp.obj\"\n\t-@erase \"$(INTDIR)\\rdgif.obj\"\n\t-@erase \"$(INTDIR)\\rdppm.obj\"\n\t-@erase \"$(INTDIR)\\rdrle.obj\"\n\t-@erase \"$(INTDIR)\\rdswitch.obj\"\n\t-@erase \"$(INTDIR)\\rdtarga.obj\"\n\t-@erase \"$(INTDIR)\\vc60.idb\"\n\t-@erase \"$(OUTDIR)\\cjpeg.exe\"\n\n\"$(OUTDIR)\" :\n    if not exist \"$(OUTDIR)/$(NULL)\" mkdir \"$(OUTDIR)\"\n\nBSC32=bscmake.exe\nBSC32_FLAGS=/nologo /o\"$(OUTDIR)\\cjpeg.bsc\" \nBSC32_SBRS= \\\n\t\nLINK32=link.exe\nLINK32_FLAGS=Release\\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:\"$(OUTDIR)\\cjpeg.pdb\" /machine:I386 /out:\"$(OUTDIR)\\cjpeg.exe\" \nLINK32_OBJS= \\\n\t\"$(INTDIR)\\cdjpeg.obj\" \\\n\t\"$(INTDIR)\\cjpeg.obj\" \\\n\t\"$(INTDIR)\\rdbmp.obj\" \\\n\t\"$(INTDIR)\\rdgif.obj\" \\\n\t\"$(INTDIR)\\rdppm.obj\" \\\n\t\"$(INTDIR)\\rdrle.obj\" \\\n\t\"$(INTDIR)\\rdswitch.obj\" \\\n\t\"$(INTDIR)\\rdtarga.obj\"\n\n\"$(OUTDIR)\\cjpeg.exe\" : \"$(OUTDIR)\" $(DEF_FILE) $(LINK32_OBJS)\n    $(LINK32) @<<\n  $(LINK32_FLAGS) $(LINK32_OBJS)\n<<\n\nCPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /Fp\"$(INTDIR)\\cjpeg.pch\" /YX /Fo\"$(INTDIR)\\\\\" /Fd\"$(INTDIR)\\\\\" /FD /c \n\n.c{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cpp{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cxx{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.c{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cpp{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cxx{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n\n!IF \"$(NO_EXTERNAL_DEPS)\" != \"1\"\n!IF EXISTS(\"cjpeg.dep\")\n!INCLUDE \"cjpeg.dep\"\n!ELSE \n!MESSAGE Warning: cannot find \"cjpeg.dep\"\n!ENDIF \n!ENDIF \n\n\n!IF \"$(CFG)\" == \"cjpeg - Win32\"\nSOURCE=.\\cdjpeg.c\n\n\"$(INTDIR)\\cdjpeg.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\cjpeg.c\n\n\"$(INTDIR)\\cjpeg.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\rdbmp.c\n\n\"$(INTDIR)\\rdbmp.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\rdgif.c\n\n\"$(INTDIR)\\rdgif.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\rdppm.c\n\n\"$(INTDIR)\\rdppm.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\rdrle.c\n\n\"$(INTDIR)\\rdrle.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\rdswitch.c\n\n\"$(INTDIR)\\rdswitch.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\rdtarga.c\n\n\"$(INTDIR)\\rdtarga.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\n\n!ENDIF \n\n"
  },
  {
    "path": "makecvcx.v10",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>cjpeg</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n    <OutDir>$(ProjectName)\\$(Configuration)\\</OutDir>\n    <IntDir>$(ProjectName)\\$(Configuration)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <Optimization>Full</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>false</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>\n      <OmitFramePointers>true</OmitFramePointers>\n      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <AdditionalDependencies>Release\\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClInclude Include=\"cderror.h\" />\n    <ClInclude Include=\"cdjpeg.h\" />\n    <ClInclude Include=\"jconfig.h\" />\n    <ClInclude Include=\"jerror.h\" />\n    <ClInclude Include=\"jinclude.h\" />\n    <ClInclude Include=\"jmorecfg.h\" />\n    <ClInclude Include=\"jpeglib.h\" />\n    <ClInclude Include=\"jversion.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"cdjpeg.c\" />\n    <ClCompile Include=\"cjpeg.c\" />\n    <ClCompile Include=\"rdbmp.c\" />\n    <ClCompile Include=\"rdgif.c\" />\n    <ClCompile Include=\"rdppm.c\" />\n    <ClCompile Include=\"rdrle.c\" />\n    <ClCompile Include=\"rdswitch.c\" />\n    <ClCompile Include=\"rdtarga.c\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "makeddep.vc6",
    "content": "# Microsoft Developer Studio erstellte Abhngigkeitsdatei, einbezogen von djpeg.mak\n\n.\\cdjpeg.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\djpeg.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\".\\jversion.h\"\\\n\t\n\n.\\rdcolmap.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\wrbmp.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\wrgif.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\wrppm.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\wrrle.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\wrtarga.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n"
  },
  {
    "path": "makeddsp.vc6",
    "content": "# Microsoft Developer Studio Project File - Name=\"djpeg\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** NICHT BEARBEITEN **\n\n# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\n\nCFG=djpeg - Win32\n!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE\n!MESSAGE verwenden Sie den Befehl \"Makefile exportieren\" und fhren Sie den Befehl\n!MESSAGE \n!MESSAGE NMAKE /f \"djpeg.mak\".\n!MESSAGE \n!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben\n!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:\n!MESSAGE \n!MESSAGE NMAKE /f \"djpeg.mak\" CFG=\"djpeg - Win32\"\n!MESSAGE \n!MESSAGE Fr die Konfiguration stehen zur Auswahl:\n!MESSAGE \n!MESSAGE \"djpeg - Win32\" (basierend auf  \"Win32 (x86) Console Application\")\n!MESSAGE \n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \".\\djpeg\\Release\"\n# PROP BASE Intermediate_Dir \".\\djpeg\\Release\"\n# PROP BASE Target_Dir \".\\djpeg\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \".\\djpeg\\Release\"\n# PROP Intermediate_Dir \".\\djpeg\\Release\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \".\\djpeg\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /YX /c\n# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /YX /FD /c\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# ADD LINK32 Release\\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# Begin Target\n\n# Name \"djpeg - Win32\"\n# Begin Group \"Quellcodedateien\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90\"\n# Begin Source File\n\nSOURCE=.\\cdjpeg.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\djpeg.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\rdcolmap.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\wrbmp.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\wrgif.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\wrppm.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\wrrle.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\wrtarga.c\n# End Source File\n# End Group\n# Begin Group \"Header-Dateien\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl;fi;fd\"\n# Begin Source File\n\nSOURCE=.\\cderror.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\cdjpeg.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jconfig.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jerror.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jinclude.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jmorecfg.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jpeglib.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jversion.h\n# End Source File\n# End Group\n# Begin Group \"Ressourcendateien\"\n\n# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe\"\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "makedfil.v10",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"cderror.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"cdjpeg.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jconfig.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jerror.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jinclude.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jmorecfg.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jpeglib.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jversion.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"cdjpeg.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"djpeg.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"rdcolmap.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"wrbmp.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"wrgif.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"wrppm.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"wrrle.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"wrtarga.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "makedmak.vc6",
    "content": "# Microsoft Developer Studio Generated NMAKE File, Based on djpeg.dsp\n!IF \"$(CFG)\" == \"\"\nCFG=djpeg - Win32\n!MESSAGE Keine Konfiguration angegeben. djpeg - Win32 wird als Standard verwendet.\n!ENDIF \n\n!IF \"$(CFG)\" != \"djpeg - Win32\"\n!MESSAGE Ungltige Konfiguration \"$(CFG)\" angegeben.\n!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben\n!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:\n!MESSAGE \n!MESSAGE NMAKE /f \"djpeg.mak\" CFG=\"djpeg - Win32\"\n!MESSAGE \n!MESSAGE Fr die Konfiguration stehen zur Auswahl:\n!MESSAGE \n!MESSAGE \"djpeg - Win32\" (basierend auf  \"Win32 (x86) Console Application\")\n!MESSAGE \n!ERROR Eine ungltige Konfiguration wurde angegeben.\n!ENDIF \n\n!IF \"$(OS)\" == \"Windows_NT\"\nNULL=\n!ELSE \nNULL=nul\n!ENDIF \n\nCPP=cl.exe\nRSC=rc.exe\nOUTDIR=.\\djpeg\\Release\nINTDIR=.\\djpeg\\Release\n# Begin Custom Macros\nOutDir=.\\djpeg\\Release\n# End Custom Macros\n\nALL : \"$(OUTDIR)\\djpeg.exe\"\n\n\nCLEAN :\n\t-@erase \"$(INTDIR)\\cdjpeg.obj\"\n\t-@erase \"$(INTDIR)\\djpeg.obj\"\n\t-@erase \"$(INTDIR)\\rdcolmap.obj\"\n\t-@erase \"$(INTDIR)\\vc60.idb\"\n\t-@erase \"$(INTDIR)\\wrbmp.obj\"\n\t-@erase \"$(INTDIR)\\wrgif.obj\"\n\t-@erase \"$(INTDIR)\\wrppm.obj\"\n\t-@erase \"$(INTDIR)\\wrrle.obj\"\n\t-@erase \"$(INTDIR)\\wrtarga.obj\"\n\t-@erase \"$(OUTDIR)\\djpeg.exe\"\n\n\"$(OUTDIR)\" :\n    if not exist \"$(OUTDIR)/$(NULL)\" mkdir \"$(OUTDIR)\"\n\nBSC32=bscmake.exe\nBSC32_FLAGS=/nologo /o\"$(OUTDIR)\\djpeg.bsc\" \nBSC32_SBRS= \\\n\t\nLINK32=link.exe\nLINK32_FLAGS=Release\\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:\"$(OUTDIR)\\djpeg.pdb\" /machine:I386 /out:\"$(OUTDIR)\\djpeg.exe\" \nLINK32_OBJS= \\\n\t\"$(INTDIR)\\cdjpeg.obj\" \\\n\t\"$(INTDIR)\\djpeg.obj\" \\\n\t\"$(INTDIR)\\rdcolmap.obj\" \\\n\t\"$(INTDIR)\\wrbmp.obj\" \\\n\t\"$(INTDIR)\\wrgif.obj\" \\\n\t\"$(INTDIR)\\wrppm.obj\" \\\n\t\"$(INTDIR)\\wrrle.obj\" \\\n\t\"$(INTDIR)\\wrtarga.obj\"\n\n\"$(OUTDIR)\\djpeg.exe\" : \"$(OUTDIR)\" $(DEF_FILE) $(LINK32_OBJS)\n    $(LINK32) @<<\n  $(LINK32_FLAGS) $(LINK32_OBJS)\n<<\n\nCPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /Fp\"$(INTDIR)\\djpeg.pch\" /YX /Fo\"$(INTDIR)\\\\\" /Fd\"$(INTDIR)\\\\\" /FD /c \n\n.c{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cpp{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cxx{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.c{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cpp{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cxx{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n\n!IF \"$(NO_EXTERNAL_DEPS)\" != \"1\"\n!IF EXISTS(\"djpeg.dep\")\n!INCLUDE \"djpeg.dep\"\n!ELSE \n!MESSAGE Warning: cannot find \"djpeg.dep\"\n!ENDIF \n!ENDIF \n\n\n!IF \"$(CFG)\" == \"djpeg - Win32\"\nSOURCE=.\\cdjpeg.c\n\n\"$(INTDIR)\\cdjpeg.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\djpeg.c\n\n\"$(INTDIR)\\djpeg.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\rdcolmap.c\n\n\"$(INTDIR)\\rdcolmap.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\wrbmp.c\n\n\"$(INTDIR)\\wrbmp.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\wrgif.c\n\n\"$(INTDIR)\\wrgif.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\wrppm.c\n\n\"$(INTDIR)\\wrppm.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\wrrle.c\n\n\"$(INTDIR)\\wrrle.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\wrtarga.c\n\n\"$(INTDIR)\\wrtarga.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\n\n!ENDIF \n\n"
  },
  {
    "path": "makedvcx.v10",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{11043137-B453-4DFA-9010-4D2B9DC1545C}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>djpeg</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n    <OutDir>$(ProjectName)\\$(Configuration)\\</OutDir>\n    <IntDir>$(ProjectName)\\$(Configuration)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <Optimization>Full</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>false</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>\n      <OmitFramePointers>true</OmitFramePointers>\n      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <AdditionalDependencies>Release\\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClInclude Include=\"cderror.h\" />\n    <ClInclude Include=\"cdjpeg.h\" />\n    <ClInclude Include=\"jconfig.h\" />\n    <ClInclude Include=\"jerror.h\" />\n    <ClInclude Include=\"jinclude.h\" />\n    <ClInclude Include=\"jmorecfg.h\" />\n    <ClInclude Include=\"jpeglib.h\" />\n    <ClInclude Include=\"jversion.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"cdjpeg.c\" />\n    <ClCompile Include=\"djpeg.c\" />\n    <ClCompile Include=\"rdcolmap.c\" />\n    <ClCompile Include=\"wrbmp.c\" />\n    <ClCompile Include=\"wrgif.c\" />\n    <ClCompile Include=\"wrppm.c\" />\n    <ClCompile Include=\"wrrle.c\" />\n    <ClCompile Include=\"wrtarga.c\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "makefile.ansi",
    "content": "# Makefile for Independent JPEG Group's software\n\n# This makefile is suitable for Unix-like systems with ANSI-capable compilers.\n# If you have a non-ANSI compiler, makefile.unix is a better starting point.\n\n# Read installation instructions before saying \"make\" !!\n\n# The name of your C compiler:\nCC= cc\n\n# You may need to adjust these cc options:\nCFLAGS= -O\n# Generally, we recommend defining any configuration symbols in jconfig.h,\n# NOT via -D switches here.\n\n# Link-time cc options:\nLDFLAGS= \n\n# To link any special libraries, add the necessary -l commands here.\nLDLIBS= \n\n# Put here the object file name for the correct system-dependent memory\n# manager file.  For Unix this is usually jmemnobs.o, but you may want\n# to use jmemansi.o or jmemname.o if you have limited swap space.\nSYSDEPMEM= jmemnobs.o\n\n# miscellaneous OS-dependent stuff\n# linker\nLN= $(CC)\n# file deletion command\nRM= rm -f\n# library (.a) file creation command\nAR= ar rc\n# second step in .a creation (use \"touch\" if not needed)\nAR2= ranlib\n\n# End of configurable options.\n\n\n# source files: JPEG library proper\nLIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \\\n        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \\\n        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \\\n        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \\\n        jquant2.c jutils.c jmemmgr.c\n# memmgr back ends: compile only one of these into a working library\nSYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c\n# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom\nAPPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \\\n        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \\\n        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c\nSOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)\n# files included by source files\nINCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \\\n        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h\n# documentation, test, and support files\nDOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \\\n        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \\\n        coderules.txt filelist.txt change.log\nMKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \\\n        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \\\n        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \\\n        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \\\n        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \\\n        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \\\n        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \\\n        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \\\n        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \\\n        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \\\n        makefile.mms makefile.vms makvms.opt\nCONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \\\n        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \\\n        jconfig.vms\nCONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \\\n        missing ar-lib\nOTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map\nTESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \\\n        testimgp.jpg\nDISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \\\n        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)\n# library object files common to compression and decompression\nCOMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)\n# compression library object files\nCLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \\\n        jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \\\n        jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \\\n        jfdctflt.o jfdctint.o\n# decompression library object files\nDLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \\\n        jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \\\n        jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \\\n        jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o\n# These objectfiles are included in libjpeg.a\nLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)\n# object files for sample applications (excluding library files)\nCOBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \\\n        cdjpeg.o\nDOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \\\n        cdjpeg.o\nTROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o\n\n\nall: libjpeg.a cjpeg djpeg jpegtran rdjpgcom wrjpgcom\n\nlibjpeg.a: $(LIBOBJECTS)\n\t$(RM) libjpeg.a\n\t$(AR) libjpeg.a  $(LIBOBJECTS)\n\t$(AR2) libjpeg.a\n\ncjpeg: $(COBJECTS) libjpeg.a\n\t$(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.a $(LDLIBS)\n\ndjpeg: $(DOBJECTS) libjpeg.a\n\t$(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.a $(LDLIBS)\n\njpegtran: $(TROBJECTS) libjpeg.a\n\t$(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.a $(LDLIBS)\n\nrdjpgcom: rdjpgcom.o\n\t$(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)\n\nwrjpgcom: wrjpgcom.o\n\t$(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)\n\njconfig.h: jconfig.txt\n\techo You must prepare a system-dependent jconfig.h file.\n\techo Please read the installation directions in install.txt.\n\texit 1\n\nclean:\n\t$(RM) *.o cjpeg djpeg jpegtran libjpeg.a rdjpgcom wrjpgcom\n\t$(RM) core testout*\n\ntest: cjpeg djpeg jpegtran\n\t$(RM) testout*\n\t./djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg\n\t./djpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg\n\t./cjpeg -dct int -outfile testout.jpg  testimg.ppm\n\t./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg\n\t./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm\n\t./jpegtran -outfile testoutt.jpg testprog.jpg\n\tcmp testimg.ppm testout.ppm\n\tcmp testimg.bmp testout.bmp\n\tcmp testimg.jpg testout.jpg\n\tcmp testimg.ppm testoutp.ppm\n\tcmp testimgp.jpg testoutp.jpg\n\tcmp testorig.jpg testoutt.jpg\n\n\njaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h\njfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\ncjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\ndjpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\njpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h\nrdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h\nwrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h\ncdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\ntransupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h\nrdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\n"
  },
  {
    "path": "makefile.bcc",
    "content": "# Makefile for Independent JPEG Group's software\n\n# This makefile is suitable for Borland C on MS-DOS or OS/2.\n# It works with Borland C++ for DOS, revision 3.0 or later,\n# and has been tested with Borland C++ for OS/2.\n# Watch out for optimization bugs in the OS/2 compilers --- see notes below!\n# Thanks to Tom Wright and Ge' Weijers (original DOS) and\n# Ken Porter (OS/2) for this file.\n\n# Read installation instructions before saying \"make\" !!\n\n# Are we under DOS or OS/2?\n!if !$d(DOS) && !$d(OS2)\n!if $d(__OS2__)\nOS2=1\n!else\nDOS=1\n!endif\n!endif\n\n# The name of your C compiler:\nCC= bcc\n\n# You may need to adjust these cc options:\n!if $d(DOS)\nCFLAGS= -O2 -mm -w-par -w-stu -w-ccc -w-rch\n!else\nCFLAGS= -O1 -w-par -w-stu -w-ccc -w-rch\n!endif\n# -O2 enables full code optimization (for pre-3.0 Borland C++, use -O -G -Z).\n# -O2 is buggy in Borland OS/2 C++ revision 2.0, so use -O1 there for now.\n# If you have Borland OS/2 C++ revision 1.0, use -O or no optimization at all.\n# -mm selects medium memory model (near data, far code pointers; DOS only!)\n# -w-par suppresses warnings about unused function parameters\n# -w-stu suppresses warnings about incomplete structures\n# -w-ccc suppresses warnings about compile-time-constant conditions\n# -w-rch suppresses warnings about unreachable code\n# Generally, we recommend defining any configuration symbols in jconfig.h,\n# NOT via -D switches here.\n\n# Link-time cc options:\n!if $d(DOS)\nLDFLAGS= -mm\n# memory model option here must match CFLAGS!\n!else\nLDFLAGS=\n# -lai full-screen app\n# -lc case-significant link\n!endif\n\n# Put here the object file name for the correct system-dependent memory\n# manager file.\n# For DOS, we recommend jmemdos.c and jmemdosa.asm.\n# For OS/2, we recommend jmemnobs.c (flat memory!)\n# SYSDEPMEMLIB must list the same files with \"+\" signs for the librarian.\n!if $d(DOS)\nSYSDEPMEM= jmemdos.obj jmemdosa.obj\nSYSDEPMEMLIB= +jmemdos.obj +jmemdosa.obj\n!else\nSYSDEPMEM= jmemnobs.obj\nSYSDEPMEMLIB= +jmemnobs.obj\n!endif\n\n# End of configurable options.\n\n\n# source files: JPEG library proper\nLIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \\\n        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \\\n        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \\\n        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \\\n        jquant2.c jutils.c jmemmgr.c\n# memmgr back ends: compile only one of these into a working library\nSYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c\n# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom\nAPPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \\\n        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \\\n        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c\nSOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)\n# files included by source files\nINCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \\\n        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h\n# documentation, test, and support files\nDOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \\\n        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \\\n        coderules.txt filelist.txt change.log\nMKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \\\n        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \\\n        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \\\n        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \\\n        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \\\n        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \\\n        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \\\n        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \\\n        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \\\n        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \\\n        makefile.mms makefile.vms makvms.opt\nCONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \\\n        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \\\n        jconfig.vms\nCONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \\\n        missing ar-lib\nOTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map\nTESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \\\n        testimgp.jpg\nDISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \\\n        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)\n# library object files common to compression and decompression\nCOMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)\n# compression library object files\nCLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \\\n        jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \\\n        jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \\\n        jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj\n# decompression library object files\nDLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \\\n        jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \\\n        jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \\\n        jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \\\n        jdmerge.obj\n# These objectfiles are included in libjpeg.lib\nLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)\n# object files for sample applications (excluding library files)\nCOBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \\\n        rdswitch.obj cdjpeg.obj\nDOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \\\n        rdcolmap.obj cdjpeg.obj\nTROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj\n\n\nall: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe\n\nlibjpeg.lib: $(LIBOBJECTS)\n\t- del libjpeg.lib\n\ttlib libjpeg.lib /E /C @&&|\n+jcapimin.obj +jcapistd.obj +jcarith.obj +jctrans.obj +jcparam.obj &\n+jdatadst.obj +jcinit.obj +jcmaster.obj +jcmarker.obj +jcmainct.obj &\n+jcprepct.obj +jccoefct.obj +jccolor.obj +jcsample.obj +jchuff.obj &\n+jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj +jfdctint.obj +jdapimin.obj &\n+jdapistd.obj +jdarith.obj +jdtrans.obj +jdatasrc.obj +jdmaster.obj &\n+jdinput.obj +jdmarker.obj +jdhuff.obj +jdmainct.obj +jdcoefct.obj &\n+jdpostct.obj +jddctmgr.obj +jidctfst.obj +jidctflt.obj +jidctint.obj &\n+jdsample.obj +jdcolor.obj +jquant1.obj +jquant2.obj +jdmerge.obj &\n+jaricom.obj +jcomapi.obj +jutils.obj +jerror.obj +jmemmgr.obj &\n$(SYSDEPMEMLIB)\n|\n\ncjpeg.exe: $(COBJECTS) libjpeg.lib\n\t$(CC) $(LDFLAGS) -ecjpeg.exe $(COBJECTS) libjpeg.lib\n\ndjpeg.exe: $(DOBJECTS) libjpeg.lib\n\t$(CC) $(LDFLAGS) -edjpeg.exe $(DOBJECTS) libjpeg.lib\n\njpegtran.exe: $(TROBJECTS) libjpeg.lib\n\t$(CC) $(LDFLAGS) -ejpegtran.exe $(TROBJECTS) libjpeg.lib\n\nrdjpgcom.exe: rdjpgcom.c\n!if $d(DOS)\n\t$(CC) -ms -O rdjpgcom.c\n!else\n\t$(CC) $(CFLAGS) rdjpgcom.c\n!endif\n\n# On DOS, wrjpgcom needs large model so it can malloc a 64K chunk\nwrjpgcom.exe: wrjpgcom.c\n!if $d(DOS)\n\t$(CC) -ml -O wrjpgcom.c\n!else\n\t$(CC) $(CFLAGS) wrjpgcom.c\n!endif\n\n# This \"{}\" syntax allows Borland Make to \"batch\" source files.\n# In this way, each run of the compiler can build many modules.\n.c.obj:\n\t$(CC) $(CFLAGS) -c{ $<}\n\njconfig.h: jconfig.txt\n\techo You must prepare a system-dependent jconfig.h file.\n\techo Please read the installation directions in install.txt.\n\texit 1\n\nclean:\n\t- del *.obj\n\t- del libjpeg.lib\n\t- del cjpeg.exe\n\t- del djpeg.exe\n\t- del jpegtran.exe\n\t- del rdjpgcom.exe\n\t- del wrjpgcom.exe\n\t- del testout*.*\n\ntest: cjpeg.exe djpeg.exe jpegtran.exe\n\t- del testout*.*\n\tdjpeg -dct int -ppm -outfile testout.ppm  testorig.jpg\n\tdjpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg\n\tcjpeg -dct int -outfile testout.jpg  testimg.ppm\n\tdjpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg\n\tcjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm\n\tjpegtran -outfile testoutt.jpg testprog.jpg\n!if $d(DOS)\n\tfc /b testimg.ppm testout.ppm\n\tfc /b testimg.bmp testout.bmp\n\tfc /b testimg.jpg testout.jpg\n\tfc /b testimg.ppm testoutp.ppm\n\tfc /b testimgp.jpg testoutp.jpg\n\tfc /b testorig.jpg testoutt.jpg\n!else\n\techo n > n.tmp\n\tcomp testimg.ppm testout.ppm < n.tmp\n\tcomp testimg.bmp testout.bmp < n.tmp\n\tcomp testimg.jpg testout.jpg < n.tmp\n\tcomp testimg.ppm testoutp.ppm < n.tmp\n\tcomp testimgp.jpg testoutp.jpg < n.tmp\n\tcomp testorig.jpg testoutt.jpg < n.tmp\n\tdel n.tmp\n!endif\n\n\njaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h\njfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\ncjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\ndjpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\njpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h\nrdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h\nwrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h\ncdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\ntransupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h\nrdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\njmemdosa.obj: jmemdosa.asm\n\ttasm /mx jmemdosa.asm\n"
  },
  {
    "path": "makefile.dj",
    "content": "# Makefile for Independent JPEG Group's software\n\n# This makefile is for DJGPP (Delorie's GNU C port on MS-DOS), v2.0 or later.\n# Thanks to Frank J. Donahoe for this version.\n\n# Read installation instructions before saying \"make\" !!\n\n# The name of your C compiler:\nCC= gcc\n\n# You may need to adjust these cc options:\nCFLAGS= -O2 -Wall -I.\n# Generally, we recommend defining any configuration symbols in jconfig.h,\n# NOT via -D switches here.\n\n# Link-time cc options:\nLDFLAGS= -s\n\n# To link any special libraries, add the necessary -l commands here.\nLDLIBS= \n\n# Put here the object file name for the correct system-dependent memory\n# manager file.  For DJGPP this is usually jmemnobs.o, but you could\n# use jmemname.o if you want to use named temp files instead of swap space.\nSYSDEPMEM= jmemnobs.o\n\n# miscellaneous OS-dependent stuff\n# linker\nLN= $(CC)\n# file deletion command\nRM= del\n# library (.a) file creation command\nAR= ar rc\n# second step in .a creation (use \"touch\" if not needed)\nAR2= ranlib\n\n# End of configurable options.\n\n\n# source files: JPEG library proper\nLIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \\\n        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \\\n        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \\\n        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \\\n        jquant2.c jutils.c jmemmgr.c\n# memmgr back ends: compile only one of these into a working library\nSYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c\n# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom\nAPPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \\\n        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \\\n        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c\nSOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)\n# files included by source files\nINCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \\\n        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h\n# documentation, test, and support files\nDOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \\\n        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \\\n        coderules.txt filelist.txt change.log\nMKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \\\n        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \\\n        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \\\n        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \\\n        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \\\n        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \\\n        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \\\n        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \\\n        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \\\n        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \\\n        makefile.mms makefile.vms makvms.opt\nCONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \\\n        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \\\n        jconfig.vms\nCONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \\\n        missing ar-lib\nOTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map\nTESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \\\n        testimgp.jpg\nDISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \\\n        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)\n# library object files common to compression and decompression\nCOMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)\n# compression library object files\nCLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \\\n        jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \\\n        jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \\\n        jfdctflt.o jfdctint.o\n# decompression library object files\nDLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \\\n        jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \\\n        jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \\\n        jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o\n# These objectfiles are included in libjpeg.a\nLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)\n# object files for sample applications (excluding library files)\nCOBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \\\n        cdjpeg.o\nDOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \\\n        cdjpeg.o\nTROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o\n\n\nall: libjpeg.a cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe\n\nlibjpeg.a: $(LIBOBJECTS)\n\t$(RM) libjpeg.a\n\t$(AR) libjpeg.a  $(LIBOBJECTS)\n\t$(AR2) libjpeg.a\n\ncjpeg.exe: $(COBJECTS) libjpeg.a\n\t$(LN) $(LDFLAGS) -o cjpeg.exe $(COBJECTS) libjpeg.a $(LDLIBS)\n\ndjpeg.exe: $(DOBJECTS) libjpeg.a\n\t$(LN) $(LDFLAGS) -o djpeg.exe $(DOBJECTS) libjpeg.a $(LDLIBS)\n\njpegtran.exe: $(TROBJECTS) libjpeg.a\n\t$(LN) $(LDFLAGS) -o jpegtran.exe $(TROBJECTS) libjpeg.a $(LDLIBS)\n\nrdjpgcom.exe: rdjpgcom.o\n\t$(LN) $(LDFLAGS) -o rdjpgcom.exe rdjpgcom.o $(LDLIBS)\n\nwrjpgcom.exe: wrjpgcom.o\n\t$(LN) $(LDFLAGS) -o wrjpgcom.exe wrjpgcom.o $(LDLIBS)\n\njconfig.h: jconfig.txt\n\techo You must prepare a system-dependent jconfig.h file.\n\techo Please read the installation directions in install.txt.\n\texit 1\n\nclean:\n\t$(RM) *.o\n\t$(RM) cjpeg.exe\n\t$(RM) djpeg.exe\n\t$(RM) jpegtran.exe\n\t$(RM) rdjpgcom.exe\n\t$(RM) wrjpgcom.exe\n\t$(RM) libjpeg.a\n\t$(RM) testout*.*\n\ntest: cjpeg.exe djpeg.exe jpegtran.exe\n\t$(RM) testout*.*\n\t./djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg\n\t./djpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg\n\t./cjpeg -dct int -outfile testout.jpg  testimg.ppm\n\t./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg\n\t./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm\n\t./jpegtran -outfile testoutt.jpg testprog.jpg\n\tfc /b testimg.ppm testout.ppm\n\tfc /b testimg.bmp testout.bmp\n\tfc /b testimg.jpg testout.jpg\n\tfc /b testimg.ppm testoutp.ppm\n\tfc /b testimgp.jpg testoutp.jpg\n\tfc /b testorig.jpg testoutt.jpg\n\n\njaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h\njfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\ncjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\ndjpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\njpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h\nrdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h\nwrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h\ncdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\ntransupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h\nrdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\n"
  },
  {
    "path": "makefile.manx",
    "content": "# Makefile for Independent JPEG Group's software\n\n# This makefile is for Amiga systems using Manx Aztec C ver 5.x.\n# Thanks to D.J. James (djjames@cup.portal.com) for this version.\n\n# Read installation instructions before saying \"make\" !!\n\n# The name of your C compiler:\nCC= cc\n\n# You may need to adjust these cc options:\n# Uncomment for generic 68000 code (will work on any Amiga)\nARCHFLAGS= -sn\n\n# Uncomment for 68020/68030 code (faster, but won't run on 68000 CPU)\n#ARCHFLAGS= -c2\n\nCFLAGS= -MC -MD $(ARCHFLAGS) -spfam -r4\n\n# Link-time cc options:\nLDFLAGS= -g\n\n# To link any special libraries, add the necessary -l commands here.\nLDLIBS= -lml -lcl\n\n# Put here the object file name for the correct system-dependent memory\n# manager file.  For Amiga we recommend jmemname.o.\nSYSDEPMEM= jmemname.o\n\n# miscellaneous OS-dependent stuff\n# linker\nLN= ln\n# file deletion command\nRM= delete quiet\n# library (.lib) file creation command\nAR= lb\n\n# End of configurable options.\n\n\n# source files: JPEG library proper\nLIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \\\n        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \\\n        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \\\n        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \\\n        jquant2.c jutils.c jmemmgr.c\n# memmgr back ends: compile only one of these into a working library\nSYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c\n# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom\nAPPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \\\n        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \\\n        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c\nSOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)\n# files included by source files\nINCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \\\n        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h\n# documentation, test, and support files\nDOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \\\n        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \\\n        coderules.txt filelist.txt change.log\nMKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \\\n        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \\\n        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \\\n        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \\\n        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \\\n        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \\\n        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \\\n        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \\\n        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \\\n        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \\\n        makefile.mms makefile.vms makvms.opt\nCONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \\\n        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \\\n        jconfig.vms\nCONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \\\n        missing ar-lib\nOTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map\nTESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \\\n        testimgp.jpg\nDISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \\\n        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)\n# library object files common to compression and decompression\nCOMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)\n# compression library object files\nCLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \\\n        jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \\\n        jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \\\n        jfdctflt.o jfdctint.o\n# decompression library object files\nDLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \\\n        jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \\\n        jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \\\n        jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o\n# These objectfiles are included in libjpeg.lib\nLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)\n# object files for sample applications (excluding library files)\nCOBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \\\n        cdjpeg.o\nDOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \\\n        cdjpeg.o\nTROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o\n\n\nall: libjpeg.lib cjpeg djpeg jpegtran rdjpgcom wrjpgcom\n\nlibjpeg.lib: $(LIBOBJECTS)\n\t-$(RM) libjpeg.lib\n\t$(AR) libjpeg.lib  $(LIBOBJECTS)\n\ncjpeg: $(COBJECTS) libjpeg.lib\n\t$(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.lib $(LDLIBS)\n\ndjpeg: $(DOBJECTS) libjpeg.lib\n\t$(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.lib $(LDLIBS)\n\njpegtran: $(TROBJECTS) libjpeg.lib\n\t$(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.lib $(LDLIBS)\n\nrdjpgcom: rdjpgcom.o\n\t$(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)\n\nwrjpgcom: wrjpgcom.o\n\t$(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)\n\njconfig.h: jconfig.txt\n\techo You must prepare a system-dependent jconfig.h file.\n\techo Please read the installation directions in install.txt.\n\texit 1\n\nclean:\n\t-$(RM) *.o cjpeg djpeg jpegtran libjpeg.lib rdjpgcom wrjpgcom\n\t-$(RM) core testout*.*\n\ntest: cjpeg djpeg jpegtran\n\t-$(RM) testout*.*\n\tdjpeg -dct int -ppm -outfile testout.ppm  testorig.jpg\n\tdjpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg\n\tcjpeg -dct int -outfile testout.jpg  testimg.ppm\n\tdjpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg\n\tcjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm\n\tjpegtran -outfile testoutt.jpg testprog.jpg\n\tcmp testimg.ppm testout.ppm\n\tcmp testimg.bmp testout.bmp\n\tcmp testimg.jpg testout.jpg\n\tcmp testimg.ppm testoutp.ppm\n\tcmp testimgp.jpg testoutp.jpg\n\tcmp testorig.jpg testoutt.jpg\n\n\njaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h\njfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\ncjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\ndjpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\njpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h\nrdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h\nwrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h\ncdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\ntransupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h\nrdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\n"
  },
  {
    "path": "makefile.mc6",
    "content": "# Makefile for Independent JPEG Group's software\n\n# This makefile is for Microsoft C for MS-DOS, version 6.00A and up.\n# Use NMAKE, not Microsoft's brain-damaged MAKE.\n# Thanks to Alan Wright and Chris Turner of Olivetti Research Ltd.\n\n# Read installation instructions before saying \"nmake\" !!\n\n# You may need to adjust these compiler options:\nCFLAGS = -AM -Oecigt -Gs -W3\n# -AM medium memory model (or use -AS for small model, if you remove features)\n# -Oecigt -Gs  maximum safe optimisation (-Ol has bugs in MSC 6.00A)\n# -W3 warning level 3\n# You might also want to add -G2 if you have an 80286, etc.\n# Generally, we recommend defining any configuration symbols in jconfig.h,\n# NOT via -D switches here.\n\n# Jan-Herman Buining suggests the following switches for MS C 8.0 and a 486:\n# CFLAGS = /AM /f- /FPi87 /G3 /Gs /Gy /Ob1 /Oc /Oe /Og /Oi /Ol /On /Oo /Ot \\\n#          /OV4 /W3\n# except for jquant1.c, which must be compiled with /Oo- to avoid a compiler\n# crash.\n\n# Ingar Steinsland suggests the following switches when building\n# a 16-bit Windows DLL:\n# CFLAGS = -ALw -Gsw -Zpe -W3 -O2 -Zi -Zd\n\n# Put here the object file name for the correct system-dependent memory\n# manager file.  For DOS, we recommend jmemdos.c and jmemdosa.asm.\n# (But not for Windows; see install.txt if you use this makefile for Windows.)\nSYSDEPMEM= jmemdos.obj jmemdosa.obj\n# SYSDEPMEMLIB must list the same files with \"+\" signs for the librarian.\nSYSDEPMEMLIB= +jmemdos.obj +jmemdosa.obj\n\n# End of configurable options.\n\n\n# source files: JPEG library proper\nLIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \\\n        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \\\n        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \\\n        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \\\n        jquant2.c jutils.c jmemmgr.c\n# memmgr back ends: compile only one of these into a working library\nSYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c\n# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom\nAPPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \\\n        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \\\n        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c\nSOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)\n# files included by source files\nINCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \\\n        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h\n# documentation, test, and support files\nDOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \\\n        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \\\n        coderules.txt filelist.txt change.log\nMKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \\\n        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \\\n        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \\\n        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \\\n        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \\\n        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \\\n        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \\\n        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \\\n        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \\\n        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \\\n        makefile.mms makefile.vms makvms.opt\nCONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \\\n        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \\\n        jconfig.vms\nCONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \\\n        missing ar-lib\nOTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map\nTESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \\\n        testimgp.jpg\nDISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \\\n        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)\n# library object files common to compression and decompression\nCOMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)\n# compression library object files\nCLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \\\n        jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \\\n        jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \\\n        jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj\n# decompression library object files\nDLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \\\n        jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \\\n        jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \\\n        jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \\\n        jdmerge.obj\n# These objectfiles are included in libjpeg.lib\nLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)\n# object files for sample applications (excluding library files)\nCOBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \\\n        rdswitch.obj cdjpeg.obj\nDOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \\\n        rdcolmap.obj cdjpeg.obj\nTROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj\n\n# need linker response file because file list > 128 chars\nRFILE = libjpeg.ans\n\n\nall: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe\n\nlibjpeg.lib: $(LIBOBJECTS) $(RFILE)\n\tdel libjpeg.lib\n\tlib @$(RFILE)\n\n# linker response file for building libjpeg.lib\n$(RFILE) : makefile\n\tdel $(RFILE)\n\techo libjpeg.lib >$(RFILE)\n# silly want-to-create-it prompt:\n\techo y >>$(RFILE)\n\techo +jcapimin.obj +jcapistd.obj +jcarith.obj +jctrans.obj & >>$(RFILE)\n\techo +jcparam.obj +jdatadst.obj +jcinit.obj +jcmaster.obj & >>$(RFILE)\n\techo +jcmarker.obj +jcmainct.obj +jcprepct.obj & >>$(RFILE)\n\techo +jccoefct.obj +jccolor.obj +jcsample.obj +jchuff.obj & >>$(RFILE)\n\techo +jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj & >>$(RFILE)\n\techo +jfdctint.obj +jdapimin.obj +jdapistd.obj & >>$(RFILE)\n\techo +jdarith.obj +jdtrans.obj +jdatasrc.obj +jdmaster.obj & >>$(RFILE)\n\techo +jdinput.obj +jdmarker.obj +jdhuff.obj +jdmainct.obj & >>$(RFILE)\n\techo +jdcoefct.obj +jdpostct.obj +jddctmgr.obj & >>$(RFILE)\n\techo +jidctfst.obj +jidctflt.obj +jidctint.obj & >>$(RFILE)\n\techo +jdsample.obj +jdcolor.obj +jquant1.obj & >>$(RFILE)\n\techo +jquant2.obj +jdmerge.obj +jaricom.obj +jcomapi.obj & >>$(RFILE)\n\techo +jutils.obj +jerror.obj +jmemmgr.obj & >>$(RFILE)\n\techo $(SYSDEPMEMLIB) ; >>$(RFILE)\n\ncjpeg.exe: $(COBJECTS) libjpeg.lib\n\techo $(COBJECTS) >cjpeg.lst\n\tlink /STACK:4096 /EXEPACK @cjpeg.lst, cjpeg.exe, , libjpeg.lib, ;\n\tdel cjpeg.lst\n\ndjpeg.exe: $(DOBJECTS) libjpeg.lib\n\techo $(DOBJECTS) >djpeg.lst\n\tlink /STACK:4096 /EXEPACK @djpeg.lst, djpeg.exe, , libjpeg.lib, ;\n\tdel djpeg.lst\n\njpegtran.exe: $(TROBJECTS) libjpeg.lib\n\tlink /STACK:4096 /EXEPACK $(TROBJECTS), jpegtran.exe, , libjpeg.lib, ;\n\nrdjpgcom.exe: rdjpgcom.c\n\t$(CC) -AS -O -W3 rdjpgcom.c\n\n# wrjpgcom needs large model so it can malloc a 64K chunk\nwrjpgcom.exe: wrjpgcom.c\n\t$(CC) -AL -O -W3 wrjpgcom.c\n\njconfig.h: jconfig.txt\n\techo You must prepare a system-dependent jconfig.h file.\n\techo Please read the installation directions in install.txt.\n\texit 1\n\nclean:\n\tdel *.obj\n\tdel libjpeg.lib\n\tdel cjpeg.exe\n\tdel djpeg.exe\n\tdel jpegtran.exe\n\tdel rdjpgcom.exe\n\tdel wrjpgcom.exe\n\tdel testout*.*\n\ntest: cjpeg.exe djpeg.exe jpegtran.exe\n\tdel testout*.*\n\tdjpeg -dct int -ppm -outfile testout.ppm  testorig.jpg\n\tdjpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg\n\tcjpeg -dct int -outfile testout.jpg  testimg.ppm\n\tdjpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg\n\tcjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm\n\tjpegtran -outfile testoutt.jpg testprog.jpg\n\tfc /b testimg.ppm testout.ppm\n\tfc /b testimg.bmp testout.bmp\n\tfc /b testimg.jpg testout.jpg\n\tfc /b testimg.ppm testoutp.ppm\n\tfc /b testimgp.jpg testoutp.jpg\n\tfc /b testorig.jpg testoutt.jpg\n\n\njaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h\njfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\ncjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\ndjpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\njpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h\nrdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h\nwrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h\ncdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\ntransupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h\nrdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\njmemdosa.obj : jmemdosa.asm\n\tmasm /mx $*;\n"
  },
  {
    "path": "makefile.mms",
    "content": "# Makefile for Independent JPEG Group's software\n\n# This makefile is for use with MMS on Digital VMS systems.\n# Thanks to Rick Dyson (dyson@iowasp.physics.uiowa.edu)\n# and Tim Bell (tbell@netcom.com) for their help.\n\n# Read installation instructions before saying \"MMS\" !!\n\n# You may need to adjust these cc options:\nCFLAGS= $(CFLAGS) /NoDebug /Optimize\n# Generally, we recommend defining any configuration symbols in jconfig.h,\n# NOT via /Define switches here.\n.ifdef ALPHA\nOPT=\n.else\nOPT= ,Sys$Disk:[]MAKVMS.OPT/Option\n.endif\n\n# Put here the object file name for the correct system-dependent memory\n# manager file.  For Unix this is usually jmemnobs.o, but you may want\n# to use jmemansi.o or jmemname.o if you have limited swap space.\nSYSDEPMEM= jmemnobs.obj\n\n# End of configurable options.\n\n\n# source files: JPEG library proper\nLIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \\\n        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \\\n        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \\\n        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \\\n        jquant2.c jutils.c jmemmgr.c\n# memmgr back ends: compile only one of these into a working library\nSYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c\n# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom\nAPPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \\\n        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \\\n        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c\nSOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)\n# files included by source files\nINCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \\\n        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h\n# documentation, test, and support files\nDOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \\\n        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \\\n        coderules.txt filelist.txt change.log\nMKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \\\n        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \\\n        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \\\n        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \\\n        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \\\n        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \\\n        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \\\n        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \\\n        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \\\n        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \\\n        makefile.mms makefile.vms makvms.opt\nCONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \\\n        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \\\n        jconfig.vms\nCONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \\\n        missing ar-lib\nOTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map\nTESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \\\n        testimgp.jpg\nDISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \\\n        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)\n# library object files common to compression and decompression\nCOMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)\n# compression library object files\nCLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \\\n        jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \\\n        jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \\\n        jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj\n# decompression library object files\nDLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \\\n        jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \\\n        jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \\\n        jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \\\n        jdmerge.obj\n# These objectfiles are included in libjpeg.olb\nLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)\n# object files for sample applications (excluding library files)\nCOBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \\\n        rdswitch.obj cdjpeg.obj\nDOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \\\n        rdcolmap.obj cdjpeg.obj\nTROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj\n# objectfile lists with commas --- what a crock\nCOBJLIST= cjpeg.obj,rdppm.obj,rdgif.obj,rdtarga.obj,rdrle.obj,rdbmp.obj,\\\n          rdswitch.obj,cdjpeg.obj\nDOBJLIST= djpeg.obj,wrppm.obj,wrgif.obj,wrtarga.obj,wrrle.obj,wrbmp.obj,\\\n          rdcolmap.obj,cdjpeg.obj\nTROBJLIST= jpegtran.obj,rdswitch.obj,cdjpeg.obj,transupp.obj\nLIBOBJLIST= jaricom.obj,jcapimin.obj,jcapistd.obj,jcarith.obj,jctrans.obj,\\\n          jcparam.obj,jdatadst.obj,jcinit.obj,jcmaster.obj,jcmarker.obj,\\\n          jcmainct.obj,jcprepct.obj,jccoefct.obj,jccolor.obj,jcsample.obj,\\\n          jchuff.obj,jcdctmgr.obj,jfdctfst.obj,jfdctflt.obj,jfdctint.obj,\\\n          jdapimin.obj,jdapistd.obj,jdarith.obj,jdtrans.obj,jdatasrc.obj,\\\n          jdmaster.obj,jdinput.obj,jdmarker.obj,jdhuff.obj,jdmainct.obj,\\\n          jdcoefct.obj,jdpostct.obj,jddctmgr.obj,jidctfst.obj,jidctflt.obj,\\\n          jidctint.obj,jdsample.obj,jdcolor.obj,jquant1.obj,jquant2.obj,\\\n          jdmerge.obj,jcomapi.obj,jutils.obj,jerror.obj,jmemmgr.obj,$(SYSDEPMEM)\n\n\n.first\n\t@- Define /NoLog Sys Sys$Library\n\nALL : libjpeg.olb cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe\n\t@ Continue\n\nlibjpeg.olb : $(LIBOBJECTS)\n\tLibrary /Create libjpeg.olb $(LIBOBJLIST)\n\ncjpeg.exe : $(COBJECTS) libjpeg.olb\n\t$(LINK) $(LFLAGS) /Executable = cjpeg.exe $(COBJLIST),libjpeg.olb/Library$(OPT)\n\ndjpeg.exe : $(DOBJECTS) libjpeg.olb\n\t$(LINK) $(LFLAGS) /Executable = djpeg.exe $(DOBJLIST),libjpeg.olb/Library$(OPT)\n\njpegtran.exe : $(TROBJECTS) libjpeg.olb\n\t$(LINK) $(LFLAGS) /Executable = jpegtran.exe $(TROBJLIST),libjpeg.olb/Library$(OPT)\n\nrdjpgcom.exe : rdjpgcom.obj\n\t$(LINK) $(LFLAGS) /Executable = rdjpgcom.exe rdjpgcom.obj$(OPT)\n\nwrjpgcom.exe : wrjpgcom.obj\n\t$(LINK) $(LFLAGS) /Executable = wrjpgcom.exe wrjpgcom.obj$(OPT)\n\njconfig.h : jconfig.vms\n\t@- Copy jconfig.vms jconfig.h\n\nclean :\n\t@- Set Protection = Owner:RWED *.*;-1\n\t@- Set Protection = Owner:RWED *.OBJ\n\t- Purge /NoLog /NoConfirm *.*\n\t- Delete /NoLog /NoConfirm *.OBJ;\n\ntest : cjpeg.exe djpeg.exe jpegtran.exe\n\tmcr sys$disk:[]djpeg -dct int -ppm -outfile testout.ppm testorig.jpg\n\tmcr sys$disk:[]djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg\n\tmcr sys$disk:[]cjpeg -dct int      -outfile testout.jpg testimg.ppm\n\tmcr sys$disk:[]djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg\n\tmcr sys$disk:[]cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm\n\tmcr sys$disk:[]jpegtran -outfile testoutt.jpg testprog.jpg\n\t- Backup /Compare/Log\t  testimg.ppm testout.ppm\n\t- Backup /Compare/Log\t  testimg.bmp testout.bmp\n\t- Backup /Compare/Log\t  testimg.jpg testout.jpg\n\t- Backup /Compare/Log\t  testimg.ppm testoutp.ppm\n\t- Backup /Compare/Log\t  testimgp.jpg testoutp.jpg\n\t- Backup /Compare/Log\t  testorig.jpg testoutt.jpg\n\n\njaricom.obj : jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapimin.obj : jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapistd.obj : jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcarith.obj : jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccoefct.obj : jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccolor.obj : jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcdctmgr.obj : jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njchuff.obj : jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcinit.obj : jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmainct.obj : jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmarker.obj : jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmaster.obj : jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcomapi.obj : jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcparam.obj : jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcprepct.obj : jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcsample.obj : jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njctrans.obj : jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapimin.obj : jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapistd.obj : jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdarith.obj : jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdatadst.obj : jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdatasrc.obj : jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdcoefct.obj : jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdcolor.obj : jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njddctmgr.obj : jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njdhuff.obj : jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdinput.obj : jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmainct.obj : jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmarker.obj : jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmaster.obj : jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmerge.obj : jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdpostct.obj : jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdsample.obj : jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdtrans.obj : jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njerror.obj : jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h\njfdctflt.obj : jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctfst.obj : jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctint.obj : jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctflt.obj : jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctfst.obj : jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctint.obj : jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njquant1.obj : jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njquant2.obj : jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njutils.obj : jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njmemmgr.obj : jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemansi.obj : jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemname.obj : jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemnobs.obj : jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemdos.obj : jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemmac.obj : jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\ncjpeg.obj : cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\ndjpeg.obj : djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\njpegtran.obj : jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h\nrdjpgcom.obj : rdjpgcom.c jinclude.h jconfig.h\nwrjpgcom.obj : wrjpgcom.c jinclude.h jconfig.h\ncdjpeg.obj : cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdcolmap.obj : rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdswitch.obj : rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\ntransupp.obj : transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h\nrdppm.obj : rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrppm.obj : wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdgif.obj : rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrgif.obj : wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdtarga.obj : rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrtarga.obj : wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdbmp.obj : rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrbmp.obj : wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdrle.obj : rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrrle.obj : wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\n"
  },
  {
    "path": "makefile.sas",
    "content": "# Makefile for Independent JPEG Group's software\n\n# This makefile is for Amiga systems using SAS C 6.0 and up.\n# Thanks to Ed Hanway, Mark Rinfret, and Jim Zepeda.\n\n# Read installation instructions before saying \"make\" !!\n\n# The name of your C compiler:\nCC= sc\n\n# You may need to adjust these cc options:\n# Uncomment the following lines for generic 680x0 version\nARCHFLAGS= cpu=any\nSUFFIX=\n\n# Uncomment the following lines for 68030-only version\n#ARCHFLAGS= cpu=68030\n#SUFFIX=.030\n\nCFLAGS= nostackcheck data=near parms=register optimize $(ARCHFLAGS) \\\n\tignore=104 ignore=304 ignore=306\n# ignore=104 disables warnings for mismatched const qualifiers\n# ignore=304 disables warnings for variables being optimized out\n# ignore=306 disables warnings for the inlining of functions\n# Generally, we recommend defining any configuration symbols in jconfig.h,\n# NOT via define switches here.\n\n# Link-time cc options:\nLDFLAGS= SC SD ND BATCH\n\n# To link any special libraries, add the necessary commands here.\nLDLIBS= LIB:scm.lib LIB:sc.lib\n\n# Put here the object file name for the correct system-dependent memory\n# manager file.  For Amiga we recommend jmemname.o.\nSYSDEPMEM= jmemname.o\n\n# miscellaneous OS-dependent stuff\n# linker\nLN= slink\n# file deletion command\nRM= delete quiet\n# library (.lib) file creation command\nAR= oml\n\n# End of configurable options.\n\n\n# source files: JPEG library proper\nLIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \\\n        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \\\n        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \\\n        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \\\n        jquant2.c jutils.c jmemmgr.c\n# memmgr back ends: compile only one of these into a working library\nSYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c\n# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom\nAPPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \\\n        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \\\n        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c\nSOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)\n# files included by source files\nINCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \\\n        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h\n# documentation, test, and support files\nDOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \\\n        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \\\n        coderules.txt filelist.txt change.log\nMKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \\\n        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \\\n        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \\\n        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \\\n        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \\\n        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \\\n        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \\\n        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \\\n        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \\\n        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \\\n        makefile.mms makefile.vms makvms.opt\nCONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \\\n        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \\\n        jconfig.vms\nCONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \\\n        missing ar-lib\nOTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map\nTESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \\\n        testimgp.jpg\nDISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \\\n        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)\n# library object files common to compression and decompression\nCOMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)\n# compression library object files\nCLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \\\n        jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \\\n        jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \\\n        jfdctflt.o jfdctint.o\n# decompression library object files\nDLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \\\n        jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \\\n        jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \\\n        jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o\n# These objectfiles are included in libjpeg.lib\nLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)\n# object files for sample applications (excluding library files)\nCOBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \\\n        cdjpeg.o\nDOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \\\n        cdjpeg.o\nTROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o\n\n\nall: libjpeg.lib cjpeg$(SUFFIX) djpeg$(SUFFIX) jpegtran$(SUFFIX) rdjpgcom$(SUFFIX) wrjpgcom$(SUFFIX)\n\n# note: do several AR steps to avoid command line length limitations\n\nlibjpeg.lib: $(LIBOBJECTS)\n\t-$(RM) libjpeg.lib\n\t$(AR) libjpeg.lib r $(CLIBOBJECTS)\n\t$(AR) libjpeg.lib r $(DLIBOBJECTS)\n\t$(AR) libjpeg.lib r $(COMOBJECTS)\n\ncjpeg$(SUFFIX): $(COBJECTS) libjpeg.lib\n\t$(LN) <WITH <\n$(LDFLAGS)\nTO cjpeg$(SUFFIX)\nFROM LIB:c.o $(COBJECTS)\nLIB libjpeg.lib $(LDLIBS)\n<\n\ndjpeg$(SUFFIX): $(DOBJECTS) libjpeg.lib\n\t$(LN) <WITH <\n$(LDFLAGS)\nTO djpeg$(SUFFIX)\nFROM LIB:c.o $(DOBJECTS)\nLIB libjpeg.lib $(LDLIBS)\n<\n\njpegtran$(SUFFIX): $(TROBJECTS) libjpeg.lib\n\t$(LN) <WITH <\n$(LDFLAGS)\nTO jpegtran$(SUFFIX)\nFROM LIB:c.o $(TROBJECTS)\nLIB libjpeg.lib $(LDLIBS)\n<\n\nrdjpgcom$(SUFFIX): rdjpgcom.o\n\t$(LN) <WITH <\n$(LDFLAGS)\nTO rdjpgcom$(SUFFIX)\nFROM LIB:c.o rdjpgcom.o\nLIB $(LDLIBS)\n<\n\nwrjpgcom$(SUFFIX): wrjpgcom.o\n\t$(LN) <WITH <\n$(LDFLAGS)\nTO wrjpgcom$(SUFFIX)\nFROM LIB:c.o wrjpgcom.o\nLIB $(LDLIBS)\n<\n\njconfig.h: jconfig.txt\n\techo You must prepare a system-dependent jconfig.h file.\n\techo Please read the installation directions in install.txt.\n\texit 1\n\nclean:\n\t-$(RM) *.o cjpeg djpeg jpegtran cjpeg.030 djpeg.030 jpegtran.030\n\t-$(RM) rdjpgcom wrjpgcom rdjpgcom.030 wrjpgcom.030\n\t-$(RM) libjpeg.lib core testout*.*\n\ntest: cjpeg djpeg jpegtran\n\t-$(RM) testout*.*\n\tdjpeg -dct int -ppm -outfile testout.ppm  testorig.jpg\n\tdjpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg\n\tcjpeg -dct int -outfile testout.jpg  testimg.ppm\n\tdjpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg\n\tcjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm\n\tjpegtran -outfile testoutt.jpg testprog.jpg\n\tcmp testimg.ppm testout.ppm\n\tcmp testimg.bmp testout.bmp\n\tcmp testimg.jpg testout.jpg\n\tcmp testimg.ppm testoutp.ppm\n\tcmp testimgp.jpg testoutp.jpg\n\tcmp testorig.jpg testoutt.jpg\n\n\njaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h\njfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\ncjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\ndjpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\njpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h\nrdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h\nwrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h\ncdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\ntransupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h\nrdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\n"
  },
  {
    "path": "makefile.unix",
    "content": "# Makefile for Independent JPEG Group's software\n\n# This makefile is suitable for Unix-like systems with non-ANSI compilers.\n# If you have an ANSI compiler, makefile.ansi is a better starting point.\n\n# Read installation instructions before saying \"make\" !!\n\n# The name of your C compiler:\nCC= cc\n\n# You may need to adjust these cc options:\nCFLAGS= -O\n# Generally, we recommend defining any configuration symbols in jconfig.h,\n# NOT via -D switches here.\n# However, any special defines for ansi2knr.c may be included here:\nANSI2KNRFLAGS= \n\n# Link-time cc options:\nLDFLAGS= \n\n# To link any special libraries, add the necessary -l commands here.\nLDLIBS= \n\n# Put here the object file name for the correct system-dependent memory\n# manager file.  For Unix this is usually jmemnobs.o, but you may want\n# to use jmemansi.o or jmemname.o if you have limited swap space.\nSYSDEPMEM= jmemnobs.o\n\n# miscellaneous OS-dependent stuff\n# linker\nLN= $(CC)\n# file deletion command\nRM= rm -f\n# file rename command\nMV= mv\n# library (.a) file creation command\nAR= ar rc\n# second step in .a creation (use \"touch\" if not needed)\nAR2= ranlib\n\n# End of configurable options.\n\n\n# source files: JPEG library proper\nLIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \\\n        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \\\n        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \\\n        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \\\n        jquant2.c jutils.c jmemmgr.c\n# memmgr back ends: compile only one of these into a working library\nSYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c\n# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom\nAPPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \\\n        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \\\n        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c\nSOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)\n# files included by source files\nINCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \\\n        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h\n# documentation, test, and support files\nDOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \\\n        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \\\n        coderules.txt filelist.txt change.log\nMKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \\\n        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \\\n        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \\\n        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \\\n        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \\\n        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \\\n        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \\\n        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \\\n        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \\\n        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \\\n        makefile.mms makefile.vms makvms.opt\nCONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \\\n        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \\\n        jconfig.vms\nCONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \\\n        missing ar-lib\nOTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map\nTESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \\\n        testimgp.jpg\nDISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \\\n        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)\n# library object files common to compression and decompression\nCOMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)\n# compression library object files\nCLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \\\n        jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \\\n        jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \\\n        jfdctflt.o jfdctint.o\n# decompression library object files\nDLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \\\n        jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \\\n        jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \\\n        jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o\n# These objectfiles are included in libjpeg.a\nLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)\n# object files for sample applications (excluding library files)\nCOBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \\\n        cdjpeg.o\nDOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \\\n        cdjpeg.o\nTROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o\n\n\nall: ansi2knr libjpeg.a cjpeg djpeg jpegtran rdjpgcom wrjpgcom\n\n# This rule causes ansi2knr to be invoked.\n.c.o:\n\t./ansi2knr $*.c T$*.c\n\t$(CC) $(CFLAGS) -c T$*.c\n\t$(RM) T$*.c $*.o\n\t$(MV) T$*.o $*.o\n\nansi2knr: ansi2knr.c\n\t$(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c\n\nlibjpeg.a: ansi2knr $(LIBOBJECTS)\n\t$(RM) libjpeg.a\n\t$(AR) libjpeg.a  $(LIBOBJECTS)\n\t$(AR2) libjpeg.a\n\ncjpeg: ansi2knr $(COBJECTS) libjpeg.a\n\t$(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.a $(LDLIBS)\n\ndjpeg: ansi2knr $(DOBJECTS) libjpeg.a\n\t$(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.a $(LDLIBS)\n\njpegtran: ansi2knr $(TROBJECTS) libjpeg.a\n\t$(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.a $(LDLIBS)\n\nrdjpgcom: rdjpgcom.o\n\t$(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)\n\nwrjpgcom: wrjpgcom.o\n\t$(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)\n\njconfig.h: jconfig.txt\n\techo You must prepare a system-dependent jconfig.h file.\n\techo Please read the installation directions in install.txt.\n\texit 1\n\nclean:\n\t$(RM) *.o cjpeg djpeg jpegtran libjpeg.a rdjpgcom wrjpgcom\n\t$(RM) ansi2knr core testout*\n\ntest: cjpeg djpeg jpegtran\n\t$(RM) testout*\n\t./djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg\n\t./djpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg\n\t./cjpeg -dct int -outfile testout.jpg  testimg.ppm\n\t./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg\n\t./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm\n\t./jpegtran -outfile testoutt.jpg testprog.jpg\n\tcmp testimg.ppm testout.ppm\n\tcmp testimg.bmp testout.bmp\n\tcmp testimg.jpg testout.jpg\n\tcmp testimg.ppm testoutp.ppm\n\tcmp testimgp.jpg testoutp.jpg\n\tcmp testorig.jpg testoutt.jpg\n\n\njaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h\njfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\ncjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\ndjpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\njpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h\nrdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h\nwrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h\ncdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\ntransupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h\nrdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\n"
  },
  {
    "path": "makefile.vc",
    "content": "# Makefile for Independent JPEG Group's software\n\n# This makefile is for Microsoft Visual C++ on Windows NT (and 95?).\n# It builds the IJG library as a statically linkable library (.LIB),\n# and builds the sample applications as console-mode apps.\n# Thanks to Xingong Chang, Raymond Everly and others.\n\n# Read installation instructions before saying \"nmake\" !!\n# To build an optimized library without debug info, say \"nmake nodebug=1\".\n\n# Pull in standard variable definitions\n!include <win32.mak>\n\n# You may want to adjust these compiler options:\nCFLAGS= $(cflags) $(cdebug) $(cvars) -I.\n# Generally, we recommend defining any configuration symbols in jconfig.h,\n# NOT via -D switches here.\n\n# Link-time options:\nLDFLAGS= $(ldebug) $(conlflags)\n\n# To link any special libraries, add the necessary commands here.\nLDLIBS= $(conlibs)\n\n# Put here the object file name for the correct system-dependent memory\n# manager file.  For NT we suggest jmemnobs.obj, which expects the OS to\n# provide adequate virtual memory.\nSYSDEPMEM= jmemnobs.obj\n\n# miscellaneous OS-dependent stuff\n# file deletion command\nRM= del\n\n# End of configurable options.\n\n\n# source files: JPEG library proper\nLIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \\\n        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \\\n        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \\\n        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \\\n        jquant2.c jutils.c jmemmgr.c\n# memmgr back ends: compile only one of these into a working library\nSYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c\n# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom\nAPPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \\\n        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \\\n        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c\nSOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)\n# files included by source files\nINCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \\\n        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h\n# documentation, test, and support files\nDOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \\\n        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \\\n        coderules.txt filelist.txt change.log\nMKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \\\n        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \\\n        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \\\n        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \\\n        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \\\n        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \\\n        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \\\n        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \\\n        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \\\n        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \\\n        makefile.mms makefile.vms makvms.opt\nCONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \\\n        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \\\n        jconfig.vms\nCONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \\\n        missing ar-lib\nOTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map\nTESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \\\n        testimgp.jpg\nDISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \\\n        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)\n# library object files common to compression and decompression\nCOMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)\n# compression library object files\nCLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \\\n        jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \\\n        jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \\\n        jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj\n# decompression library object files\nDLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \\\n        jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \\\n        jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \\\n        jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \\\n        jdmerge.obj\n# These objectfiles are included in libjpeg.lib\nLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)\n# object files for sample applications (excluding library files)\nCOBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \\\n        rdswitch.obj cdjpeg.obj\nDOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \\\n        rdcolmap.obj cdjpeg.obj\nTROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj\n\n# Template command for compiling .c to .obj\n.c.obj:\n\t$(cc) $(CFLAGS) $*.c\n\n\nall: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe\n\nlibjpeg.lib: $(LIBOBJECTS)\n\t$(RM) libjpeg.lib\n\tlib -out:libjpeg.lib  $(LIBOBJECTS)\n\ncjpeg.exe: $(COBJECTS) libjpeg.lib\n\t$(link) $(LDFLAGS) -out:cjpeg.exe $(COBJECTS) libjpeg.lib $(LDLIBS)\n\ndjpeg.exe: $(DOBJECTS) libjpeg.lib\n\t$(link) $(LDFLAGS) -out:djpeg.exe $(DOBJECTS) libjpeg.lib $(LDLIBS)\n\njpegtran.exe: $(TROBJECTS) libjpeg.lib\n\t$(link) $(LDFLAGS) -out:jpegtran.exe $(TROBJECTS) libjpeg.lib $(LDLIBS)\n\nrdjpgcom.exe: rdjpgcom.obj\n\t$(link) $(LDFLAGS) -out:rdjpgcom.exe rdjpgcom.obj $(LDLIBS)\n\nwrjpgcom.exe: wrjpgcom.obj\n\t$(link) $(LDFLAGS) -out:wrjpgcom.exe wrjpgcom.obj $(LDLIBS)\n\n\nclean:\n\t$(RM) *.obj *.exe libjpeg.lib\n\t$(RM) testout*\n\nsetup-vc6:\n\tren jconfig.vc jconfig.h\n\tren makejdsw.vc6 jpeg.dsw\n\tren makeadsw.vc6 apps.dsw\n\tren makejmak.vc6 jpeg.mak\n\tren makejdep.vc6 jpeg.dep\n\tren makejdsp.vc6 jpeg.dsp\n\tren makecmak.vc6 cjpeg.mak\n\tren makecdep.vc6 cjpeg.dep\n\tren makecdsp.vc6 cjpeg.dsp\n\tren makedmak.vc6 djpeg.mak\n\tren makeddep.vc6 djpeg.dep\n\tren makeddsp.vc6 djpeg.dsp\n\tren maketmak.vc6 jpegtran.mak\n\tren maketdep.vc6 jpegtran.dep\n\tren maketdsp.vc6 jpegtran.dsp\n\tren makermak.vc6 rdjpgcom.mak\n\tren makerdep.vc6 rdjpgcom.dep\n\tren makerdsp.vc6 rdjpgcom.dsp\n\tren makewmak.vc6 wrjpgcom.mak\n\tren makewdep.vc6 wrjpgcom.dep\n\tren makewdsp.vc6 wrjpgcom.dsp\n\nsetup-v10:\n\tren jconfig.vc jconfig.h\n\tren makejsln.v10 jpeg.sln\n\tren makeasln.v10 apps.sln\n\tren makejvcx.v10 jpeg.vcxproj\n\tren makejfil.v10 jpeg.vcxproj.filters\n\tren makecvcx.v10 cjpeg.vcxproj\n\tren makecfil.v10 cjpeg.vcxproj.filters\n\tren makedvcx.v10 djpeg.vcxproj\n\tren makedfil.v10 djpeg.vcxproj.filters\n\tren maketvcx.v10 jpegtran.vcxproj\n\tren maketfil.v10 jpegtran.vcxproj.filters\n\tren makervcx.v10 rdjpgcom.vcxproj\n\tren makerfil.v10 rdjpgcom.vcxproj.filters\n\tren makewvcx.v10 wrjpgcom.vcxproj\n\tren makewfil.v10 wrjpgcom.vcxproj.filters\n\ntest:\n\tIF EXIST testout* $(RM) testout*\n\t.\\djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg\n\t.\\djpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg\n\t.\\cjpeg -dct int -outfile testout.jpg  testimg.ppm\n\t.\\djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg\n\t.\\cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm\n\t.\\jpegtran -outfile testoutt.jpg testprog.jpg\n\tfc /b testimg.ppm testout.ppm\n\tfc /b testimg.bmp testout.bmp\n\tfc /b testimg.jpg testout.jpg\n\tfc /b testimg.ppm testoutp.ppm\n\tfc /b testimgp.jpg testoutp.jpg\n\tfc /b testorig.jpg testoutt.jpg\n\ntest-build:\n\tIF EXIST testout* $(RM) testout*\n\t.\\djpeg\\Release\\djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg\n\t.\\djpeg\\Release\\djpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg\n\t.\\cjpeg\\Release\\cjpeg -dct int -outfile testout.jpg  testimg.ppm\n\t.\\djpeg\\Release\\djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg\n\t.\\cjpeg\\Release\\cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm\n\t.\\jpegtran\\Release\\jpegtran -outfile testoutt.jpg testprog.jpg\n\tfc /b testimg.ppm testout.ppm\n\tfc /b testimg.bmp testout.bmp\n\tfc /b testimg.jpg testout.jpg\n\tfc /b testimg.ppm testoutp.ppm\n\tfc /b testimgp.jpg testoutp.jpg\n\tfc /b testorig.jpg testoutt.jpg\n\n\njaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h\njfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\ncjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\ndjpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\njpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h\nrdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h\nwrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h\ncdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\ntransupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h\nrdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\n"
  },
  {
    "path": "makefile.vms",
    "content": "$! Makefile for Independent JPEG Group's software\n$!\n$! This is a command procedure for Digital VMS systems that do not have MMS.\n$! It builds the JPEG software by brute force, recompiling everything whether\n$! or not it is necessary.  It then runs the basic self-test.\n$! Thanks to Rick Dyson (dyson@iowasp.physics.uiowa.edu)\n$! and Tim Bell (tbell@netcom.com) for their help.\n$!\n$! Read installation instructions before running this!!\n$!\n$ If F$Mode () .eqs. \"INTERACTIVE\"\n$   Then\n$       VERIFY = F$Verify (0)\n$   Else\n$       VERIFY = F$Verify (1)\n$ EndIf\n$ On Control_Y Then GoTo End\n$ On Error     Then GoTo End\n$\n$ If F$GetSyi (\"HW_MODEL\") .gt. 1023 \n$   Then\n$       OPT = \"\"\n$   Else\n$       OPT = \",Sys$Disk:[]makvms.opt/Option\"\n$ EndIf\n$ \n$ DoCompile := CC /NoDebug /Optimize /NoList\n$!\n$ DoCompile jaricom.c\n$ DoCompile jcapimin.c\n$ DoCompile jcapistd.c\n$ DoCompile jcarith.c\n$ DoCompile jctrans.c\n$ DoCompile jcparam.c\n$ DoCompile jdatadst.c\n$ DoCompile jcinit.c\n$ DoCompile jcmaster.c\n$ DoCompile jcmarker.c\n$ DoCompile jcmainct.c\n$ DoCompile jcprepct.c\n$ DoCompile jccoefct.c\n$ DoCompile jccolor.c\n$ DoCompile jcsample.c\n$ DoCompile jchuff.c\n$ DoCompile jcdctmgr.c\n$ DoCompile jfdctfst.c\n$ DoCompile jfdctflt.c\n$ DoCompile jfdctint.c\n$ DoCompile jdapimin.c\n$ DoCompile jdapistd.c\n$ DoCompile jdarith.c\n$ DoCompile jdtrans.c\n$ DoCompile jdatasrc.c\n$ DoCompile jdmaster.c\n$ DoCompile jdinput.c\n$ DoCompile jdmarker.c\n$ DoCompile jdhuff.c\n$ DoCompile jdmainct.c\n$ DoCompile jdcoefct.c\n$ DoCompile jdpostct.c\n$ DoCompile jddctmgr.c\n$ DoCompile jidctfst.c\n$ DoCompile jidctflt.c\n$ DoCompile jidctint.c\n$ DoCompile jdsample.c\n$ DoCompile jdcolor.c\n$ DoCompile jquant1.c\n$ DoCompile jquant2.c\n$ DoCompile jdmerge.c\n$ DoCompile jcomapi.c\n$ DoCompile jutils.c\n$ DoCompile jerror.c\n$ DoCompile jmemmgr.c\n$ DoCompile jmemnobs.c\n$!\n$ Library /Create libjpeg.olb  jaricom.obj,jcapimin.obj,jcapistd.obj, -\n          jcarith.obj,jctrans.obj,jcparam.obj,jdatadst.obj,jcinit.obj, -\n          jcmaster.obj,jcmarker.obj,jcmainct.obj,jcprepct.obj,jccoefct.obj, -\n          jccolor.obj,jcsample.obj,jchuff.obj,jcdctmgr.obj,jfdctfst.obj, -\n          jfdctflt.obj,jfdctint.obj,jdapimin.obj,jdapistd.obj,jdarith.obj, -\n          jdtrans.obj,jdatasrc.obj,jdmaster.obj,jdinput.obj,jdmarker.obj, -\n          jdhuff.obj,jdmainct.obj,jdcoefct.obj,jdpostct.obj,jddctmgr.obj, -\n          jidctfst.obj,jidctflt.obj,jidctint.obj,jdsample.obj,jdcolor.obj, -\n          jquant1.obj,jquant2.obj,jdmerge.obj,jcomapi.obj,jutils.obj, -\n          jerror.obj,jmemmgr.obj,jmemnobs.obj\n$!\n$ DoCompile cjpeg.c\n$ DoCompile rdppm.c\n$ DoCompile rdgif.c\n$ DoCompile rdtarga.c\n$ DoCompile rdrle.c\n$ DoCompile rdbmp.c\n$ DoCompile rdswitch.c\n$ DoCompile cdjpeg.c\n$!\n$ Link /NoMap /Executable = cjpeg.exe  cjpeg.obj,rdppm.obj,rdgif.obj, -\n          rdtarga.obj,rdrle.obj,rdbmp.obj,rdswitch.obj,cdjpeg.obj,libjpeg.olb/Library'OPT'\n$!\n$ DoCompile djpeg.c\n$ DoCompile wrppm.c\n$ DoCompile wrgif.c\n$ DoCompile wrtarga.c\n$ DoCompile wrrle.c\n$ DoCompile wrbmp.c\n$ DoCompile rdcolmap.c\n$ DoCompile cdjpeg.c\n$!\n$ Link /NoMap /Executable = djpeg.exe  djpeg.obj,wrppm.obj,wrgif.obj, -\n          wrtarga.obj,wrrle.obj,wrbmp.obj,rdcolmap.obj,cdjpeg.obj,libjpeg.olb/Library'OPT'\n$!\n$ DoCompile jpegtran.c\n$ DoCompile rdswitch.c\n$ DoCompile cdjpeg.c\n$ DoCompile transupp.c\n$!\n$ Link /NoMap /Executable = jpegtran.exe  jpegtran.obj,rdswitch.obj, -\n          cdjpeg.obj,transupp.obj,libjpeg.olb/Library'OPT'\n$!\n$ DoCompile rdjpgcom.c\n$ Link /NoMap /Executable = rdjpgcom.exe  rdjpgcom.obj'OPT'\n$!\n$ DoCompile wrjpgcom.c\n$ Link /NoMap /Executable = wrjpgcom.exe  wrjpgcom.obj'OPT'\n$!\n$! Run the self-test\n$!\n$ mcr sys$disk:[]djpeg -dct int -ppm -outfile testout.ppm testorig.jpg\n$ mcr sys$disk:[]djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg\n$ mcr sys$disk:[]cjpeg -dct int      -outfile testout.jpg testimg.ppm\n$ mcr sys$disk:[]djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg\n$ mcr sys$disk:[]cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm\n$ mcr sys$disk:[]jpegtran -outfile testoutt.jpg testprog.jpg\n$ Backup /Compare/Log testimg.ppm testout.ppm\n$ Backup /Compare/Log testimg.bmp testout.bmp\n$ Backup /Compare/Log testimg.jpg testout.jpg\n$ Backup /Compare/Log testimg.ppm testoutp.ppm\n$ Backup /Compare/Log testimgp.jpg testoutp.jpg\n$ Backup /Compare/Log testorig.jpg testoutt.jpg\n$!\n$End:\n$   If Verify Then Set Verify\n$ Exit\n"
  },
  {
    "path": "makefile.wat",
    "content": "# Makefile for Independent JPEG Group's software\n\n# This makefile is suitable for Watcom C/C++ 10.0 on MS-DOS (using\n# dos4g extender), OS/2, and Windows NT console mode.\n# Thanks to Janos Haide, jhaide@btrvtech.com.\n\n# Read installation instructions before saying \"wmake\" !!\n\n# Uncomment line for desired system\nSYSTEM=DOS\n#SYSTEM=OS2\n#SYSTEM=NT\n\n# The name of your C compiler:\nCC= wcl386\n\n# You may need to adjust these cc options:\nCFLAGS= -4r -ort -wx -zq -bt=$(SYSTEM)\n# Caution: avoid -ol or -ox; these generate bad code with 10.0 or 10.0a.\n# Generally, we recommend defining any configuration symbols in jconfig.h,\n# NOT via -D switches here.\n\n# Link-time cc options:\n!ifeq SYSTEM DOS\nLDFLAGS= -zq -l=dos4g\n!else ifeq SYSTEM OS2\nLDFLAGS= -zq -l=os2v2\n!else ifeq SYSTEM NT\nLDFLAGS= -zq -l=nt\n!endif\n\n# Put here the object file name for the correct system-dependent memory\n# manager file.  jmemnobs should work fine for dos4g or OS/2 environment.\nSYSDEPMEM= jmemnobs.obj\n\n# End of configurable options.\n\n\n# source files: JPEG library proper\nLIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c &\n        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c &\n        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c &\n        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c &\n        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c &\n        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c &\n        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c &\n        jquant2.c jutils.c jmemmgr.c\n# memmgr back ends: compile only one of these into a working library\nSYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c\n# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom\nAPPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c &\n        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c &\n        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c\nSOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)\n# files included by source files\nINCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h &\n        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h\n# documentation, test, and support files\nDOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 &\n        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt &\n        coderules.txt filelist.txt change.log\nMKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc &\n        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 &\n        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 &\n        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 &\n        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 &\n        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 &\n        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 &\n        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 &\n        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st &\n        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas &\n        makefile.mms makefile.vms makvms.opt\nCONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat &\n        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas &\n        jconfig.vms\nCONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp &\n        missing ar-lib\nOTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map\nTESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg &\n        testimgp.jpg\nDISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) &\n        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)\n# library object files common to compression and decompression\nCOMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)\n# compression library object files\nCLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj &\n        jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj &\n        jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj &\n        jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj\n# decompression library object files\nDLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj &\n        jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj &\n        jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj &\n        jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj &\n        jdmerge.obj\n# These objectfiles are included in libjpeg.lib\nLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)\n# object files for sample applications (excluding library files)\nCOBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj &\n        rdswitch.obj cdjpeg.obj\nDOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj &\n        rdcolmap.obj cdjpeg.obj\nTROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj\n\n\nall: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe\n\nlibjpeg.lib: $(LIBOBJECTS)\n\t- del libjpeg.lib\n\t* wlib -n libjpeg.lib $(LIBOBJECTS)\n\ncjpeg.exe: $(COBJECTS) libjpeg.lib\n\t$(CC) $(LDFLAGS) $(COBJECTS) libjpeg.lib\n\ndjpeg.exe: $(DOBJECTS) libjpeg.lib\n\t$(CC) $(LDFLAGS) $(DOBJECTS) libjpeg.lib\n\njpegtran.exe: $(TROBJECTS) libjpeg.lib\n\t$(CC) $(LDFLAGS) $(TROBJECTS) libjpeg.lib\n\nrdjpgcom.exe: rdjpgcom.c\n\t$(CC) $(CFLAGS) $(LDFLAGS) rdjpgcom.c\n\nwrjpgcom.exe: wrjpgcom.c\n\t$(CC) $(CFLAGS) $(LDFLAGS) wrjpgcom.c\n\n.c.obj:\n\t$(CC) $(CFLAGS) -c $<\n\njconfig.h: jconfig.txt\n\techo You must prepare a system-dependent jconfig.h file.\n\techo Please read the installation directions in install.txt.\n\texit 1\n\nclean: .SYMBOLIC\n\t- del *.obj\n\t- del libjpeg.lib\n\t- del cjpeg.exe\n\t- del djpeg.exe\n\t- del jpegtran.exe\n\t- del rdjpgcom.exe\n\t- del wrjpgcom.exe\n\t- del testout*.*\n\ntest: cjpeg.exe djpeg.exe jpegtran.exe  .SYMBOLIC\n\t- del testout*.*\n\tdjpeg -dct int -ppm -outfile testout.ppm  testorig.jpg\n\tdjpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg\n\tcjpeg -dct int -outfile testout.jpg  testimg.ppm\n\tdjpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg\n\tcjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm\n\tjpegtran -outfile testoutt.jpg testprog.jpg\n!ifeq SYSTEM DOS\n\tfc /b testimg.ppm testout.ppm\n\tfc /b testimg.bmp testout.bmp\n\tfc /b testimg.jpg testout.jpg\n\tfc /b testimg.ppm testoutp.ppm\n\tfc /b testimgp.jpg testoutp.jpg\n\tfc /b testorig.jpg testoutt.jpg\n!else\n\techo n > n.tmp\n\tcomp testimg.ppm testout.ppm < n.tmp\n\tcomp testimg.bmp testout.bmp < n.tmp\n\tcomp testimg.jpg testout.jpg < n.tmp\n\tcomp testimg.ppm testoutp.ppm < n.tmp\n\tcomp testimgp.jpg testoutp.jpg < n.tmp\n\tcomp testorig.jpg testoutt.jpg < n.tmp\n\tdel n.tmp\n!endif\n\n\njaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h\njdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h\njfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h\njquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h\njmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\njmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h\ncjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\ndjpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h\njpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h\nrdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h\nwrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h\ncdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\ntransupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h\nrdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nrdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\nwrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h\n"
  },
  {
    "path": "makejdep.vc6",
    "content": "# Microsoft Developer Studio erstellte Abhngigkeitsdatei, einbezogen von jpeg.mak\n\n.\\jaricom.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jcapimin.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jcapistd.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jcarith.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jccoefct.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jccolor.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jcdctmgr.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jdct.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jchuff.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jcinit.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jcmainct.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jcmarker.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jcmaster.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jcomapi.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jcparam.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jcprepct.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jcsample.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jctrans.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdapimin.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdapistd.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdarith.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdatadst.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdatasrc.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdcoefct.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdcolor.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jddctmgr.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jdct.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdhuff.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdinput.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdmainct.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdmarker.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdmaster.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdmerge.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdpostct.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdsample.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jdtrans.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jerror.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\".\\jversion.h\"\\\n\t\n\n.\\jfdctflt.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jdct.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jfdctfst.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jdct.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jfdctint.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jdct.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jidctflt.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jdct.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jidctfst.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jdct.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jidctint.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jdct.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jmemmgr.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmemsys.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jmemnobs.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmemsys.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jquant1.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jquant2.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jutils.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n"
  },
  {
    "path": "makejdsp.vc6",
    "content": "# Microsoft Developer Studio Project File - Name=\"jpeg\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** NICHT BEARBEITEN **\n\n# TARGTYPE \"Win32 (x86) Static Library\" 0x0104\n\nCFG=jpeg - Win32\n!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE\n!MESSAGE verwenden Sie den Befehl \"Makefile exportieren\" und fhren Sie den Befehl\n!MESSAGE \n!MESSAGE NMAKE /f \"jpeg.mak\".\n!MESSAGE \n!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben\n!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:\n!MESSAGE \n!MESSAGE NMAKE /f \"jpeg.mak\" CFG=\"jpeg - Win32\"\n!MESSAGE \n!MESSAGE Fr die Konfiguration stehen zur Auswahl:\n!MESSAGE \n!MESSAGE \"jpeg - Win32\" (basierend auf  \"Win32 (x86) Static Library\")\n!MESSAGE \n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \".\\Release\"\n# PROP BASE Intermediate_Dir \".\\Release\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \".\\Release\"\n# PROP Intermediate_Dir \".\\Release\"\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /YX /c\n# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /YX /FD /c\n# ADD BASE RSC /l 0x407\n# ADD RSC /l 0x407\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLIB32=link.exe -lib\n# ADD BASE LIB32 /nologo\n# ADD LIB32 /nologo\n# Begin Target\n\n# Name \"jpeg - Win32\"\n# Begin Group \"Quellcodedateien\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90\"\n# Begin Source File\n\nSOURCE=.\\jaricom.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jcapimin.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jcapistd.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jcarith.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jccoefct.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jccolor.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jcdctmgr.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jchuff.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jcinit.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jcmainct.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jcmarker.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jcmaster.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jcomapi.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jcparam.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jcprepct.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jcsample.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jctrans.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdapimin.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdapistd.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdarith.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdatadst.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdatasrc.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdcoefct.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdcolor.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jddctmgr.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdhuff.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdinput.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdmainct.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdmarker.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdmaster.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdmerge.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdpostct.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdsample.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdtrans.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jerror.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jfdctflt.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jfdctfst.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jfdctint.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jidctflt.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jidctfst.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jidctint.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jmemmgr.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jmemnobs.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jquant1.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jquant2.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jutils.c\n# End Source File\n# End Group\n# Begin Group \"Header-Dateien\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl;fi;fd\"\n# Begin Source File\n\nSOURCE=.\\jconfig.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jdct.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jerror.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jinclude.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jmemsys.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jmorecfg.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jpegint.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jpeglib.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jversion.h\n# End Source File\n# End Group\n# Begin Group \"Ressourcendateien\"\n\n# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe\"\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "makejdsw.vc6",
    "content": "Microsoft Developer Studio Workspace File, Format Version 6.00\n# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELSCHT WERDEN!\n\n###############################################################################\n\nProject: \"jpeg\"=\".\\jpeg.dsp\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nGlobal:\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<3>\n{{{\n}}}\n\n###############################################################################\n\n"
  },
  {
    "path": "makejfil.v10",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"jconfig.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jdct.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jerror.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jinclude.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jmemsys.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jmorecfg.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jpegint.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jpeglib.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jversion.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"jaricom.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jcapimin.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jcapistd.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jcarith.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jccoefct.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jccolor.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jcdctmgr.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jchuff.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jcinit.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jcmainct.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jcmarker.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jcmaster.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jcomapi.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jcparam.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jcprepct.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jcsample.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jctrans.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdapimin.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdapistd.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdarith.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdatadst.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdatasrc.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdcoefct.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdcolor.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jddctmgr.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdhuff.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdinput.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdmainct.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdmarker.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdmaster.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdmerge.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdpostct.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdsample.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jdtrans.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jerror.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jfdctflt.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jfdctfst.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jfdctint.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jidctflt.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jidctfst.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jidctint.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jmemmgr.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jmemnobs.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jquant1.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jquant2.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jutils.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "makejmak.vc6",
    "content": "# Microsoft Developer Studio Generated NMAKE File, Based on jpeg.dsp\n!IF \"$(CFG)\" == \"\"\nCFG=jpeg - Win32\n!MESSAGE Keine Konfiguration angegeben. jpeg - Win32 wird als Standard verwendet.\n!ENDIF \n\n!IF \"$(CFG)\" != \"jpeg - Win32\"\n!MESSAGE Ungltige Konfiguration \"$(CFG)\" angegeben.\n!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben\n!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:\n!MESSAGE \n!MESSAGE NMAKE /f \"jpeg.mak\" CFG=\"jpeg - Win32\"\n!MESSAGE \n!MESSAGE Fr die Konfiguration stehen zur Auswahl:\n!MESSAGE \n!MESSAGE \"jpeg - Win32\" (basierend auf  \"Win32 (x86) Static Library\")\n!MESSAGE \n!ERROR Eine ungltige Konfiguration wurde angegeben.\n!ENDIF \n\n!IF \"$(OS)\" == \"Windows_NT\"\nNULL=\n!ELSE \nNULL=nul\n!ENDIF \n\nOUTDIR=.\\Release\nINTDIR=.\\Release\n# Begin Custom Macros\nOutDir=.\\Release\n# End Custom Macros\n\nALL : \"$(OUTDIR)\\jpeg.lib\"\n\n\nCLEAN :\n\t-@erase \"$(INTDIR)\\jaricom.obj\"\n\t-@erase \"$(INTDIR)\\jcapimin.obj\"\n\t-@erase \"$(INTDIR)\\jcapistd.obj\"\n\t-@erase \"$(INTDIR)\\jcarith.obj\"\n\t-@erase \"$(INTDIR)\\jccoefct.obj\"\n\t-@erase \"$(INTDIR)\\jccolor.obj\"\n\t-@erase \"$(INTDIR)\\jcdctmgr.obj\"\n\t-@erase \"$(INTDIR)\\jchuff.obj\"\n\t-@erase \"$(INTDIR)\\jcinit.obj\"\n\t-@erase \"$(INTDIR)\\jcmainct.obj\"\n\t-@erase \"$(INTDIR)\\jcmarker.obj\"\n\t-@erase \"$(INTDIR)\\jcmaster.obj\"\n\t-@erase \"$(INTDIR)\\jcomapi.obj\"\n\t-@erase \"$(INTDIR)\\jcparam.obj\"\n\t-@erase \"$(INTDIR)\\jcprepct.obj\"\n\t-@erase \"$(INTDIR)\\jcsample.obj\"\n\t-@erase \"$(INTDIR)\\jctrans.obj\"\n\t-@erase \"$(INTDIR)\\jdapimin.obj\"\n\t-@erase \"$(INTDIR)\\jdapistd.obj\"\n\t-@erase \"$(INTDIR)\\jdarith.obj\"\n\t-@erase \"$(INTDIR)\\jdatadst.obj\"\n\t-@erase \"$(INTDIR)\\jdatasrc.obj\"\n\t-@erase \"$(INTDIR)\\jdcoefct.obj\"\n\t-@erase \"$(INTDIR)\\jdcolor.obj\"\n\t-@erase \"$(INTDIR)\\jddctmgr.obj\"\n\t-@erase \"$(INTDIR)\\jdhuff.obj\"\n\t-@erase \"$(INTDIR)\\jdinput.obj\"\n\t-@erase \"$(INTDIR)\\jdmainct.obj\"\n\t-@erase \"$(INTDIR)\\jdmarker.obj\"\n\t-@erase \"$(INTDIR)\\jdmaster.obj\"\n\t-@erase \"$(INTDIR)\\jdmerge.obj\"\n\t-@erase \"$(INTDIR)\\jdpostct.obj\"\n\t-@erase \"$(INTDIR)\\jdsample.obj\"\n\t-@erase \"$(INTDIR)\\jdtrans.obj\"\n\t-@erase \"$(INTDIR)\\jerror.obj\"\n\t-@erase \"$(INTDIR)\\jfdctflt.obj\"\n\t-@erase \"$(INTDIR)\\jfdctfst.obj\"\n\t-@erase \"$(INTDIR)\\jfdctint.obj\"\n\t-@erase \"$(INTDIR)\\jidctflt.obj\"\n\t-@erase \"$(INTDIR)\\jidctfst.obj\"\n\t-@erase \"$(INTDIR)\\jidctint.obj\"\n\t-@erase \"$(INTDIR)\\jmemmgr.obj\"\n\t-@erase \"$(INTDIR)\\jmemnobs.obj\"\n\t-@erase \"$(INTDIR)\\jquant1.obj\"\n\t-@erase \"$(INTDIR)\\jquant2.obj\"\n\t-@erase \"$(INTDIR)\\jutils.obj\"\n\t-@erase \"$(INTDIR)\\vc60.idb\"\n\t-@erase \"$(OUTDIR)\\jpeg.lib\"\n\n\"$(OUTDIR)\" :\n    if not exist \"$(OUTDIR)/$(NULL)\" mkdir \"$(OUTDIR)\"\n\nCPP=cl.exe\nCPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /Fp\"$(INTDIR)\\jpeg.pch\" /YX /Fo\"$(INTDIR)\\\\\" /Fd\"$(INTDIR)\\\\\" /FD /c \n\n.c{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cpp{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cxx{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.c{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cpp{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cxx{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\nRSC=rc.exe\nBSC32=bscmake.exe\nBSC32_FLAGS=/nologo /o\"$(OUTDIR)\\jpeg.bsc\" \nBSC32_SBRS= \\\n\t\nLIB32=link.exe -lib\nLIB32_FLAGS=/nologo /out:\"$(OUTDIR)\\jpeg.lib\" \nLIB32_OBJS= \\\n\t\"$(INTDIR)\\jaricom.obj\" \\\n\t\"$(INTDIR)\\jcapimin.obj\" \\\n\t\"$(INTDIR)\\jcapistd.obj\" \\\n\t\"$(INTDIR)\\jcarith.obj\" \\\n\t\"$(INTDIR)\\jccoefct.obj\" \\\n\t\"$(INTDIR)\\jccolor.obj\" \\\n\t\"$(INTDIR)\\jcdctmgr.obj\" \\\n\t\"$(INTDIR)\\jchuff.obj\" \\\n\t\"$(INTDIR)\\jcinit.obj\" \\\n\t\"$(INTDIR)\\jcmainct.obj\" \\\n\t\"$(INTDIR)\\jcmarker.obj\" \\\n\t\"$(INTDIR)\\jcmaster.obj\" \\\n\t\"$(INTDIR)\\jcomapi.obj\" \\\n\t\"$(INTDIR)\\jcparam.obj\" \\\n\t\"$(INTDIR)\\jcprepct.obj\" \\\n\t\"$(INTDIR)\\jcsample.obj\" \\\n\t\"$(INTDIR)\\jctrans.obj\" \\\n\t\"$(INTDIR)\\jdapimin.obj\" \\\n\t\"$(INTDIR)\\jdapistd.obj\" \\\n\t\"$(INTDIR)\\jdarith.obj\" \\\n\t\"$(INTDIR)\\jdatadst.obj\" \\\n\t\"$(INTDIR)\\jdatasrc.obj\" \\\n\t\"$(INTDIR)\\jdcoefct.obj\" \\\n\t\"$(INTDIR)\\jdcolor.obj\" \\\n\t\"$(INTDIR)\\jddctmgr.obj\" \\\n\t\"$(INTDIR)\\jdhuff.obj\" \\\n\t\"$(INTDIR)\\jdinput.obj\" \\\n\t\"$(INTDIR)\\jdmainct.obj\" \\\n\t\"$(INTDIR)\\jdmarker.obj\" \\\n\t\"$(INTDIR)\\jdmaster.obj\" \\\n\t\"$(INTDIR)\\jdmerge.obj\" \\\n\t\"$(INTDIR)\\jdpostct.obj\" \\\n\t\"$(INTDIR)\\jdsample.obj\" \\\n\t\"$(INTDIR)\\jdtrans.obj\" \\\n\t\"$(INTDIR)\\jerror.obj\" \\\n\t\"$(INTDIR)\\jfdctflt.obj\" \\\n\t\"$(INTDIR)\\jfdctfst.obj\" \\\n\t\"$(INTDIR)\\jfdctint.obj\" \\\n\t\"$(INTDIR)\\jidctflt.obj\" \\\n\t\"$(INTDIR)\\jidctfst.obj\" \\\n\t\"$(INTDIR)\\jidctint.obj\" \\\n\t\"$(INTDIR)\\jmemmgr.obj\" \\\n\t\"$(INTDIR)\\jmemnobs.obj\" \\\n\t\"$(INTDIR)\\jquant1.obj\" \\\n\t\"$(INTDIR)\\jquant2.obj\" \\\n\t\"$(INTDIR)\\jutils.obj\"\n\n\"$(OUTDIR)\\jpeg.lib\" : \"$(OUTDIR)\" $(DEF_FILE) $(LIB32_OBJS)\n    $(LIB32) @<<\n  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)\n<<\n\n\n!IF \"$(NO_EXTERNAL_DEPS)\" != \"1\"\n!IF EXISTS(\"jpeg.dep\")\n!INCLUDE \"jpeg.dep\"\n!ELSE \n!MESSAGE Warning: cannot find \"jpeg.dep\"\n!ENDIF \n!ENDIF \n\n\n!IF \"$(CFG)\" == \"jpeg - Win32\"\nSOURCE=.\\jaricom.c\n\n\"$(INTDIR)\\jaricom.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jcapimin.c\n\n\"$(INTDIR)\\jcapimin.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jcapistd.c\n\n\"$(INTDIR)\\jcapistd.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jcarith.c\n\n\"$(INTDIR)\\jcarith.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jccoefct.c\n\n\"$(INTDIR)\\jccoefct.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jccolor.c\n\n\"$(INTDIR)\\jccolor.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jcdctmgr.c\n\n\"$(INTDIR)\\jcdctmgr.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jchuff.c\n\n\"$(INTDIR)\\jchuff.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jcinit.c\n\n\"$(INTDIR)\\jcinit.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jcmainct.c\n\n\"$(INTDIR)\\jcmainct.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jcmarker.c\n\n\"$(INTDIR)\\jcmarker.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jcmaster.c\n\n\"$(INTDIR)\\jcmaster.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jcomapi.c\n\n\"$(INTDIR)\\jcomapi.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jcparam.c\n\n\"$(INTDIR)\\jcparam.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jcprepct.c\n\n\"$(INTDIR)\\jcprepct.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jcsample.c\n\n\"$(INTDIR)\\jcsample.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jctrans.c\n\n\"$(INTDIR)\\jctrans.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdapimin.c\n\n\"$(INTDIR)\\jdapimin.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdapistd.c\n\n\"$(INTDIR)\\jdapistd.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdarith.c\n\n\"$(INTDIR)\\jdarith.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdatadst.c\n\n\"$(INTDIR)\\jdatadst.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdatasrc.c\n\n\"$(INTDIR)\\jdatasrc.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdcoefct.c\n\n\"$(INTDIR)\\jdcoefct.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdcolor.c\n\n\"$(INTDIR)\\jdcolor.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jddctmgr.c\n\n\"$(INTDIR)\\jddctmgr.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdhuff.c\n\n\"$(INTDIR)\\jdhuff.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdinput.c\n\n\"$(INTDIR)\\jdinput.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdmainct.c\n\n\"$(INTDIR)\\jdmainct.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdmarker.c\n\n\"$(INTDIR)\\jdmarker.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdmaster.c\n\n\"$(INTDIR)\\jdmaster.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdmerge.c\n\n\"$(INTDIR)\\jdmerge.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdpostct.c\n\n\"$(INTDIR)\\jdpostct.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdsample.c\n\n\"$(INTDIR)\\jdsample.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jdtrans.c\n\n\"$(INTDIR)\\jdtrans.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jerror.c\n\n\"$(INTDIR)\\jerror.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jfdctflt.c\n\n\"$(INTDIR)\\jfdctflt.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jfdctfst.c\n\n\"$(INTDIR)\\jfdctfst.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jfdctint.c\n\n\"$(INTDIR)\\jfdctint.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jidctflt.c\n\n\"$(INTDIR)\\jidctflt.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jidctfst.c\n\n\"$(INTDIR)\\jidctfst.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jidctint.c\n\n\"$(INTDIR)\\jidctint.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jmemmgr.c\n\n\"$(INTDIR)\\jmemmgr.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jmemnobs.c\n\n\"$(INTDIR)\\jmemnobs.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jquant1.c\n\n\"$(INTDIR)\\jquant1.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jquant2.c\n\n\"$(INTDIR)\\jquant2.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jutils.c\n\n\"$(INTDIR)\\jutils.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\n\n!ENDIF \n\n"
  },
  {
    "path": "makejsln.v10",
    "content": "\nMicrosoft Visual Studio Solution File, Format Version 11.00\n# Visual C++ Express 2010\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"jpeg\", \"jpeg.vcxproj\", \"{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tRelease|Win32 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "makejvcx.v10",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"jconfig.h\" />\n    <ClInclude Include=\"jdct.h\" />\n    <ClInclude Include=\"jerror.h\" />\n    <ClInclude Include=\"jinclude.h\" />\n    <ClInclude Include=\"jmemsys.h\" />\n    <ClInclude Include=\"jmorecfg.h\" />\n    <ClInclude Include=\"jpegint.h\" />\n    <ClInclude Include=\"jpeglib.h\" />\n    <ClInclude Include=\"jversion.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"jaricom.c\" />\n    <ClCompile Include=\"jcapimin.c\" />\n    <ClCompile Include=\"jcapistd.c\" />\n    <ClCompile Include=\"jcarith.c\" />\n    <ClCompile Include=\"jccoefct.c\" />\n    <ClCompile Include=\"jccolor.c\" />\n    <ClCompile Include=\"jcdctmgr.c\" />\n    <ClCompile Include=\"jchuff.c\" />\n    <ClCompile Include=\"jcinit.c\" />\n    <ClCompile Include=\"jcmainct.c\" />\n    <ClCompile Include=\"jcmarker.c\" />\n    <ClCompile Include=\"jcmaster.c\" />\n    <ClCompile Include=\"jcomapi.c\" />\n    <ClCompile Include=\"jcparam.c\" />\n    <ClCompile Include=\"jcprepct.c\" />\n    <ClCompile Include=\"jcsample.c\" />\n    <ClCompile Include=\"jctrans.c\" />\n    <ClCompile Include=\"jdapimin.c\" />\n    <ClCompile Include=\"jdapistd.c\" />\n    <ClCompile Include=\"jdarith.c\" />\n    <ClCompile Include=\"jdatadst.c\" />\n    <ClCompile Include=\"jdatasrc.c\" />\n    <ClCompile Include=\"jdcoefct.c\" />\n    <ClCompile Include=\"jdcolor.c\" />\n    <ClCompile Include=\"jddctmgr.c\" />\n    <ClCompile Include=\"jdhuff.c\" />\n    <ClCompile Include=\"jdinput.c\" />\n    <ClCompile Include=\"jdmainct.c\" />\n    <ClCompile Include=\"jdmarker.c\" />\n    <ClCompile Include=\"jdmaster.c\" />\n    <ClCompile Include=\"jdmerge.c\" />\n    <ClCompile Include=\"jdpostct.c\" />\n    <ClCompile Include=\"jdsample.c\" />\n    <ClCompile Include=\"jdtrans.c\" />\n    <ClCompile Include=\"jerror.c\" />\n    <ClCompile Include=\"jfdctflt.c\" />\n    <ClCompile Include=\"jfdctfst.c\" />\n    <ClCompile Include=\"jfdctint.c\" />\n    <ClCompile Include=\"jidctflt.c\" />\n    <ClCompile Include=\"jidctfst.c\" />\n    <ClCompile Include=\"jidctint.c\" />\n    <ClCompile Include=\"jmemmgr.c\" />\n    <ClCompile Include=\"jmemnobs.c\" />\n    <ClCompile Include=\"jquant1.c\" />\n    <ClCompile Include=\"jquant2.c\">\n      <Optimization Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">Disabled</Optimization>\n      <BufferSecurityCheck Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</BufferSecurityCheck>\n    </ClCompile>\n    <ClCompile Include=\"jutils.c\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>jpeg</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup />\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <Optimization>Full</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>false</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>\n      <OmitFramePointers>true</OmitFramePointers>\n      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "makeproj.mac",
    "content": "--\n-- makeproj.mac\n--\n-- This AppleScript builds Code Warrior PRO Release 2 project files for the\n-- libjpeg library as well as the test programs 'cjpeg', 'djpeg', 'jpegtran'.\n-- (We'd distribute real project files, except they're not text\n-- and would create maintenance headaches.)\n--\n-- The script then compiles and links the library and the test programs.\n-- NOTE: if you haven't already created a 'jconfig.h' file, the script\n-- automatically copies 'jconfig.mac' to 'jconfig.h'.\n--\n-- To use this script, you must have AppleScript 1.1 or later installed\n-- and a suitable AppleScript editor like Script Editor or Script Debugger\n-- (http://www.latenightsw.com). Open this file with your AppleScript\n-- editor and execute the \"run\" command to build the projects.\n--\n-- Thanks to Dan Sears and Don Agro for this script.\n-- Questions about this script can be addressed to dogpark@interlog.com\n--\n\non run\n\n\tchoose folder with prompt \">>> Select IJG source folder <<<\"\n\tset ijg_folder to result\n\n\tchoose folder with prompt \">>> Select MetroWerks folder <<<\"\n\tset cw_folder to result\n\n\t-- if jconfig.h doesn't already exist, copy jconfig.mac\n\n\ttell application \"Finder\"\n\t\tif not (exists file \"jconfig.h\" of ijg_folder) then\n\t\t\tduplicate {file \"jconfig.mac\" of folder ijg_folder}\n\t\t\tselect file \"jconfig.mac copy\" of folder ijg_folder\n\t\t\tset name of selection to \"jconfig.h\"\n\t\tend if\n\tend tell\n\n\ttell application \"CodeWarrior IDE 2.1\"\n\t  with timeout of 10000 seconds\n\n\t\t-- create libjpeg project\n\n\t\tactivate\n\t\tCreate Project (ijg_folder as string) & \"libjpeg.proj\"\n\t\tSet Preferences of panel \"Target Settings\" to {Target Name:\"libjpeg\"}\n\t\tSet Preferences of panel \"PPC Project\" to {File Name:\"libjpeg\"}\n\t\tSet Preferences of panel \"Target Settings\" to {Linker:\"MacOS PPC Linker\"}\n\t\tSet Preferences of panel \"PPC Project\" to {Project Type:library}\n\t\tSet Preferences of panel \"C/C++ Compiler\" to {ANSI Strict:true}\n\t\tSet Preferences of panel \"C/C++ Compiler\" to {Enums Always Ints:true}\n\t\tSet Preferences of panel \"PPC Codegen\" to {Struct Alignment:PowerPC}\n\t\tSet Preferences of panel \"PPC Linker\" to {Generate SYM File:false}\n\n\t\tAdd Files (ijg_folder as string) & \"jaricom.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jcapimin.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jcapistd.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jcarith.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jctrans.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jcparam.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdatadst.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jcinit.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jcmaster.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jcmarker.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jcmainct.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jcprepct.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jccoefct.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jccolor.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jcsample.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jchuff.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jcdctmgr.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jfdctfst.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jfdctflt.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jfdctint.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdapimin.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdapistd.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdarith.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdtrans.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdatasrc.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdmaster.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdinput.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdmarker.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdhuff.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdmainct.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdcoefct.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdpostct.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jddctmgr.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jidctfst.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jidctflt.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jidctint.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdsample.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdcolor.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jquant1.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jquant2.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jdmerge.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jcomapi.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jutils.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jerror.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jmemmgr.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"jmemmac.c\" To Segment 1\n\n\t\t-- compile and link the library\n\n\t\tMake Project\n\t\tClose Project\n\n\t\t-- create cjpeg project\n\n\t\tactivate\n\t\tCreate Project (ijg_folder as string) & \"cjpeg.proj\"\n\t\tSet Preferences of panel \"Target Settings\" to {Target Name:\"cjpeg\"}\n\t\tSet Preferences of panel \"PPC Project\" to {File Name:\"cjpeg\"}\n\t\tSet Preferences of panel \"Target Settings\" to {Linker:\"MacOS PPC Linker\"}\n\t\tSet Preferences of panel \"C/C++ Compiler\" to {ANSI Strict:true}\n\t\tSet Preferences of panel \"C/C++ Compiler\" to {Enums Always Ints:true}\n\t\tSet Preferences of panel \"PPC Codegen\" to {Struct Alignment:PowerPC}\n\t\tSet Preferences of panel \"PPC Linker\" to {Generate SYM File:false}\n\n\t\tAdd Files (ijg_folder as string) & \"cjpeg.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"rdppm.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"rdgif.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"rdtarga.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"rdrle.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"rdbmp.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"rdswitch.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"cdjpeg.c\" To Segment 1\n\n\t\tAdd Files (ijg_folder as string) & \"libjpeg\" To Segment 2\n\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib\" To Segment 3\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib\" To Segment 3\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib\" To Segment 3\n\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib\" To Segment 4\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib\" To Segment 4\n\n\t\t-- compile and link cjpeg\n\n\t\tMake Project\n\t\tClose Project\n\n\t\t-- create djpeg project\n\n\t\tactivate\n\t\tCreate Project (ijg_folder as string) & \"djpeg.proj\"\n\t\tSet Preferences of panel \"Target Settings\" to {Target Name:\"djpeg\"}\n\t\tSet Preferences of panel \"PPC Project\" to {File Name:\"djpeg\"}\n\t\tSet Preferences of panel \"Target Settings\" to {Linker:\"MacOS PPC Linker\"}\n\t\tSet Preferences of panel \"C/C++ Compiler\" to {ANSI Strict:true}\n\t\tSet Preferences of panel \"C/C++ Compiler\" to {Enums Always Ints:true}\n\t\tSet Preferences of panel \"PPC Codegen\" to {Struct Alignment:PowerPC}\n\t\tSet Preferences of panel \"PPC Linker\" to {Generate SYM File:false}\n\n\t\tAdd Files (ijg_folder as string) & \"djpeg.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"wrppm.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"wrgif.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"wrtarga.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"wrrle.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"wrbmp.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"rdcolmap.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"cdjpeg.c\" To Segment 1\n\n\t\tAdd Files (ijg_folder as string) & \"libjpeg\" To Segment 2\n\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib\" To Segment 3\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib\" To Segment 3\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib\" To Segment 3\n\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib\" To Segment 4\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib\" To Segment 4\n\n\t\t-- compile and link djpeg\n\n\t\tMake Project\n\t\tClose Project\n\n\t\t-- create jpegtran project\n\n\t\tactivate\n\t\tCreate Project (ijg_folder as string) & \"jpegtran.proj\"\n\t\tSet Preferences of panel \"Target Settings\" to {Target Name:\"jpegtran\"}\n\t\tSet Preferences of panel \"PPC Project\" to {File Name:\"jpegtran\"}\n\t\tSet Preferences of panel \"Target Settings\" to {Linker:\"MacOS PPC Linker\"}\n\t\tSet Preferences of panel \"C/C++ Compiler\" to {ANSI Strict:true}\n\t\tSet Preferences of panel \"C/C++ Compiler\" to {Enums Always Ints:true}\n\t\tSet Preferences of panel \"PPC Codegen\" to {Struct Alignment:PowerPC}\n\t\tSet Preferences of panel \"PPC Linker\" to {Generate SYM File:false}\n\n\t\tAdd Files (ijg_folder as string) & \"jpegtran.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"rdswitch.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"cdjpeg.c\" To Segment 1\n\t\tAdd Files (ijg_folder as string) & \"transupp.c\" To Segment 1\n\n\t\tAdd Files (ijg_folder as string) & \"libjpeg\" To Segment 2\n\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib\" To Segment 3\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib\" To Segment 3\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib\" To Segment 3\n\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib\" To Segment 4\n\t\tAdd Files (cw_folder as string) & \"Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib\" To Segment 4\n\n\t\t-- compile and link jpegtran\n\n\t\tMake Project\n\t\tClose Project\n\n\t\tquit\n\n\t  end timeout\n\tend tell\nend run\n"
  },
  {
    "path": "makerdep.vc6",
    "content": "# Microsoft Developer Studio erstellte Abhngigkeitsdatei, einbezogen von rdjpgcom.mak\n\n.\\rdjpgcom.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jinclude.h\"\\\n\t\n"
  },
  {
    "path": "makerdsp.vc6",
    "content": "# Microsoft Developer Studio Project File - Name=\"rdjpgcom\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** NICHT BEARBEITEN **\n\n# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\n\nCFG=rdjpgcom - Win32\n!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE\n!MESSAGE verwenden Sie den Befehl \"Makefile exportieren\" und fhren Sie den Befehl\n!MESSAGE \n!MESSAGE NMAKE /f \"rdjpgcom.mak\".\n!MESSAGE \n!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben\n!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:\n!MESSAGE \n!MESSAGE NMAKE /f \"rdjpgcom.mak\" CFG=\"rdjpgcom - Win32\"\n!MESSAGE \n!MESSAGE Fr die Konfiguration stehen zur Auswahl:\n!MESSAGE \n!MESSAGE \"rdjpgcom - Win32\" (basierend auf  \"Win32 (x86) Console Application\")\n!MESSAGE \n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \".\\rdjpgcom\\Release\"\n# PROP BASE Intermediate_Dir \".\\rdjpgcom\\Release\"\n# PROP BASE Target_Dir \".\\rdjpgcom\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \".\\rdjpgcom\\Release\"\n# PROP Intermediate_Dir \".\\rdjpgcom\\Release\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \".\\rdjpgcom\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /YX /c\n# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /YX /FD /c\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# ADD LINK32 Release\\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# Begin Target\n\n# Name \"rdjpgcom - Win32\"\n# Begin Group \"Quellcodedateien\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90\"\n# Begin Source File\n\nSOURCE=.\\rdjpgcom.c\n# End Source File\n# End Group\n# Begin Group \"Header-Dateien\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl;fi;fd\"\n# Begin Source File\n\nSOURCE=.\\jconfig.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jinclude.h\n# End Source File\n# End Group\n# Begin Group \"Ressourcendateien\"\n\n# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe\"\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "makerfil.v10",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"jconfig.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jinclude.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"rdjpgcom.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "makermak.vc6",
    "content": "# Microsoft Developer Studio Generated NMAKE File, Based on rdjpgcom.dsp\n!IF \"$(CFG)\" == \"\"\nCFG=rdjpgcom - Win32\n!MESSAGE Keine Konfiguration angegeben. rdjpgcom - Win32 wird als Standard verwendet.\n!ENDIF \n\n!IF \"$(CFG)\" != \"rdjpgcom - Win32\"\n!MESSAGE Ungltige Konfiguration \"$(CFG)\" angegeben.\n!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben\n!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:\n!MESSAGE \n!MESSAGE NMAKE /f \"rdjpgcom.mak\" CFG=\"rdjpgcom - Win32\"\n!MESSAGE \n!MESSAGE Fr die Konfiguration stehen zur Auswahl:\n!MESSAGE \n!MESSAGE \"rdjpgcom - Win32\" (basierend auf  \"Win32 (x86) Console Application\")\n!MESSAGE \n!ERROR Eine ungltige Konfiguration wurde angegeben.\n!ENDIF \n\n!IF \"$(OS)\" == \"Windows_NT\"\nNULL=\n!ELSE \nNULL=nul\n!ENDIF \n\nCPP=cl.exe\nRSC=rc.exe\nOUTDIR=.\\rdjpgcom\\Release\nINTDIR=.\\rdjpgcom\\Release\n# Begin Custom Macros\nOutDir=.\\rdjpgcom\\Release\n# End Custom Macros\n\nALL : \"$(OUTDIR)\\rdjpgcom.exe\"\n\n\nCLEAN :\n\t-@erase \"$(INTDIR)\\rdjpgcom.obj\"\n\t-@erase \"$(INTDIR)\\vc60.idb\"\n\t-@erase \"$(OUTDIR)\\rdjpgcom.exe\"\n\n\"$(OUTDIR)\" :\n    if not exist \"$(OUTDIR)/$(NULL)\" mkdir \"$(OUTDIR)\"\n\nBSC32=bscmake.exe\nBSC32_FLAGS=/nologo /o\"$(OUTDIR)\\rdjpgcom.bsc\" \nBSC32_SBRS= \\\n\t\nLINK32=link.exe\nLINK32_FLAGS=Release\\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:\"$(OUTDIR)\\rdjpgcom.pdb\" /machine:I386 /out:\"$(OUTDIR)\\rdjpgcom.exe\" \nLINK32_OBJS= \\\n\t\"$(INTDIR)\\rdjpgcom.obj\"\n\n\"$(OUTDIR)\\rdjpgcom.exe\" : \"$(OUTDIR)\" $(DEF_FILE) $(LINK32_OBJS)\n    $(LINK32) @<<\n  $(LINK32_FLAGS) $(LINK32_OBJS)\n<<\n\nCPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /Fp\"$(INTDIR)\\rdjpgcom.pch\" /YX /Fo\"$(INTDIR)\\\\\" /Fd\"$(INTDIR)\\\\\" /FD /c \n\n.c{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cpp{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cxx{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.c{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cpp{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cxx{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n\n!IF \"$(NO_EXTERNAL_DEPS)\" != \"1\"\n!IF EXISTS(\"rdjpgcom.dep\")\n!INCLUDE \"rdjpgcom.dep\"\n!ELSE \n!MESSAGE Warning: cannot find \"rdjpgcom.dep\"\n!ENDIF \n!ENDIF \n\n\n!IF \"$(CFG)\" == \"rdjpgcom - Win32\"\nSOURCE=.\\rdjpgcom.c\n\n\"$(INTDIR)\\rdjpgcom.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\n\n!ENDIF \n\n"
  },
  {
    "path": "makervcx.v10",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{C81513DB-78DC-46BC-BC98-82E745203976}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>rdjpgcom</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n    <OutDir>$(ProjectName)\\$(Configuration)\\</OutDir>\n    <IntDir>$(ProjectName)\\$(Configuration)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <Optimization>Full</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>false</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>\n      <OmitFramePointers>true</OmitFramePointers>\n      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClInclude Include=\"jconfig.h\" />\n    <ClInclude Include=\"jinclude.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"rdjpgcom.c\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "maketdep.vc6",
    "content": "# Microsoft Developer Studio erstellte Abhngigkeitsdatei, einbezogen von jpegtran.mak\n\n.\\cdjpeg.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\jpegtran.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\".\\jversion.h\"\\\n\t\".\\transupp.h\"\\\n\t\n\n.\\rdswitch.c : \\\n\t\".\\cderror.h\"\\\n\t\".\\cdjpeg.h\"\\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\n\n.\\transupp.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jerror.h\"\\\n\t\".\\jinclude.h\"\\\n\t\".\\jmorecfg.h\"\\\n\t\".\\jpegint.h\"\\\n\t\".\\jpeglib.h\"\\\n\t\".\\transupp.h\"\\\n\t\n"
  },
  {
    "path": "maketdsp.vc6",
    "content": "# Microsoft Developer Studio Project File - Name=\"jpegtran\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** NICHT BEARBEITEN **\n\n# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\n\nCFG=jpegtran - Win32\n!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE\n!MESSAGE verwenden Sie den Befehl \"Makefile exportieren\" und fhren Sie den Befehl\n!MESSAGE \n!MESSAGE NMAKE /f \"jpegtran.mak\".\n!MESSAGE \n!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben\n!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:\n!MESSAGE \n!MESSAGE NMAKE /f \"jpegtran.mak\" CFG=\"jpegtran - Win32\"\n!MESSAGE \n!MESSAGE Fr die Konfiguration stehen zur Auswahl:\n!MESSAGE \n!MESSAGE \"jpegtran - Win32\" (basierend auf  \"Win32 (x86) Console Application\")\n!MESSAGE \n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \".\\jpegtran\\Release\"\n# PROP BASE Intermediate_Dir \".\\jpegtran\\Release\"\n# PROP BASE Target_Dir \".\\jpegtran\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \".\\jpegtran\\Release\"\n# PROP Intermediate_Dir \".\\jpegtran\\Release\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \".\\jpegtran\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /YX /c\n# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /YX /FD /c\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# ADD LINK32 Release\\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# Begin Target\n\n# Name \"jpegtran - Win32\"\n# Begin Group \"Quellcodedateien\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90\"\n# Begin Source File\n\nSOURCE=.\\cdjpeg.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jpegtran.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\rdswitch.c\n# End Source File\n# Begin Source File\n\nSOURCE=.\\transupp.c\n# End Source File\n# End Group\n# Begin Group \"Header-Dateien\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl;fi;fd\"\n# Begin Source File\n\nSOURCE=.\\cderror.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\cdjpeg.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jconfig.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jerror.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jinclude.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jmorecfg.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jpegint.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jpeglib.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jversion.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\transupp.h\n# End Source File\n# End Group\n# Begin Group \"Ressourcendateien\"\n\n# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe\"\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "maketfil.v10",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"cderror.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"cdjpeg.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jconfig.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jerror.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jinclude.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jmorecfg.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jpegint.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jpeglib.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jversion.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"transupp.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"cdjpeg.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jpegtran.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"rdswitch.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"transupp.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "maketmak.vc6",
    "content": "# Microsoft Developer Studio Generated NMAKE File, Based on jpegtran.dsp\n!IF \"$(CFG)\" == \"\"\nCFG=jpegtran - Win32\n!MESSAGE Keine Konfiguration angegeben. jpegtran - Win32 wird als Standard verwendet.\n!ENDIF \n\n!IF \"$(CFG)\" != \"jpegtran - Win32\"\n!MESSAGE Ungltige Konfiguration \"$(CFG)\" angegeben.\n!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben\n!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:\n!MESSAGE \n!MESSAGE NMAKE /f \"jpegtran.mak\" CFG=\"jpegtran - Win32\"\n!MESSAGE \n!MESSAGE Fr die Konfiguration stehen zur Auswahl:\n!MESSAGE \n!MESSAGE \"jpegtran - Win32\" (basierend auf  \"Win32 (x86) Console Application\")\n!MESSAGE \n!ERROR Eine ungltige Konfiguration wurde angegeben.\n!ENDIF \n\n!IF \"$(OS)\" == \"Windows_NT\"\nNULL=\n!ELSE \nNULL=nul\n!ENDIF \n\nCPP=cl.exe\nRSC=rc.exe\nOUTDIR=.\\jpegtran\\Release\nINTDIR=.\\jpegtran\\Release\n# Begin Custom Macros\nOutDir=.\\jpegtran\\Release\n# End Custom Macros\n\nALL : \"$(OUTDIR)\\jpegtran.exe\"\n\n\nCLEAN :\n\t-@erase \"$(INTDIR)\\cdjpeg.obj\"\n\t-@erase \"$(INTDIR)\\jpegtran.obj\"\n\t-@erase \"$(INTDIR)\\rdswitch.obj\"\n\t-@erase \"$(INTDIR)\\transupp.obj\"\n\t-@erase \"$(INTDIR)\\vc60.idb\"\n\t-@erase \"$(OUTDIR)\\jpegtran.exe\"\n\n\"$(OUTDIR)\" :\n    if not exist \"$(OUTDIR)/$(NULL)\" mkdir \"$(OUTDIR)\"\n\nBSC32=bscmake.exe\nBSC32_FLAGS=/nologo /o\"$(OUTDIR)\\jpegtran.bsc\" \nBSC32_SBRS= \\\n\t\nLINK32=link.exe\nLINK32_FLAGS=Release\\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:\"$(OUTDIR)\\jpegtran.pdb\" /machine:I386 /out:\"$(OUTDIR)\\jpegtran.exe\" \nLINK32_OBJS= \\\n\t\"$(INTDIR)\\cdjpeg.obj\" \\\n\t\"$(INTDIR)\\jpegtran.obj\" \\\n\t\"$(INTDIR)\\rdswitch.obj\" \\\n\t\"$(INTDIR)\\transupp.obj\"\n\n\"$(OUTDIR)\\jpegtran.exe\" : \"$(OUTDIR)\" $(DEF_FILE) $(LINK32_OBJS)\n    $(LINK32) @<<\n  $(LINK32_FLAGS) $(LINK32_OBJS)\n<<\n\nCPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /Fp\"$(INTDIR)\\jpegtran.pch\" /YX /Fo\"$(INTDIR)\\\\\" /Fd\"$(INTDIR)\\\\\" /FD /c \n\n.c{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cpp{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cxx{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.c{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cpp{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cxx{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n\n!IF \"$(NO_EXTERNAL_DEPS)\" != \"1\"\n!IF EXISTS(\"jpegtran.dep\")\n!INCLUDE \"jpegtran.dep\"\n!ELSE \n!MESSAGE Warning: cannot find \"jpegtran.dep\"\n!ENDIF \n!ENDIF \n\n\n!IF \"$(CFG)\" == \"jpegtran - Win32\"\nSOURCE=.\\cdjpeg.c\n\n\"$(INTDIR)\\cdjpeg.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\jpegtran.c\n\n\"$(INTDIR)\\jpegtran.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\rdswitch.c\n\n\"$(INTDIR)\\rdswitch.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\nSOURCE=.\\transupp.c\n\n\"$(INTDIR)\\transupp.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\n\n!ENDIF \n\n"
  },
  {
    "path": "maketvcx.v10",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{025BAC50-51B5-4FFE-BC47-3F920BB4047E}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>jpegtran</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n    <OutDir>$(ProjectName)\\$(Configuration)\\</OutDir>\n    <IntDir>$(ProjectName)\\$(Configuration)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <Optimization>Full</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>false</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>\n      <OmitFramePointers>true</OmitFramePointers>\n      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <AdditionalDependencies>Release\\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClInclude Include=\"cderror.h\" />\n    <ClInclude Include=\"cdjpeg.h\" />\n    <ClInclude Include=\"jconfig.h\" />\n    <ClInclude Include=\"jerror.h\" />\n    <ClInclude Include=\"jinclude.h\" />\n    <ClInclude Include=\"jmorecfg.h\" />\n    <ClInclude Include=\"jpegint.h\" />\n    <ClInclude Include=\"jpeglib.h\" />\n    <ClInclude Include=\"jversion.h\" />\n    <ClInclude Include=\"transupp.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"cdjpeg.c\" />\n    <ClCompile Include=\"jpegtran.c\" />\n    <ClCompile Include=\"rdswitch.c\" />\n    <ClCompile Include=\"transupp.c\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "makewdep.vc6",
    "content": "# Microsoft Developer Studio erstellte Abhngigkeitsdatei, einbezogen von wrjpgcom.mak\n\n.\\wrjpgcom.c : \\\n\t\".\\jconfig.h\"\\\n\t\".\\jinclude.h\"\\\n\t\n"
  },
  {
    "path": "makewdsp.vc6",
    "content": "# Microsoft Developer Studio Project File - Name=\"wrjpgcom\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** NICHT BEARBEITEN **\n\n# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\n\nCFG=wrjpgcom - Win32\n!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE\n!MESSAGE verwenden Sie den Befehl \"Makefile exportieren\" und fhren Sie den Befehl\n!MESSAGE \n!MESSAGE NMAKE /f \"wrjpgcom.mak\".\n!MESSAGE \n!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben\n!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:\n!MESSAGE \n!MESSAGE NMAKE /f \"wrjpgcom.mak\" CFG=\"wrjpgcom - Win32\"\n!MESSAGE \n!MESSAGE Fr die Konfiguration stehen zur Auswahl:\n!MESSAGE \n!MESSAGE \"wrjpgcom - Win32\" (basierend auf  \"Win32 (x86) Console Application\")\n!MESSAGE \n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \".\\wrjpgcom\\Release\"\n# PROP BASE Intermediate_Dir \".\\wrjpgcom\\Release\"\n# PROP BASE Target_Dir \".\\wrjpgcom\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \".\\wrjpgcom\\Release\"\n# PROP Intermediate_Dir \".\\wrjpgcom\\Release\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \".\\wrjpgcom\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /YX /c\n# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /YX /FD /c\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# ADD LINK32 Release\\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# Begin Target\n\n# Name \"wrjpgcom - Win32\"\n# Begin Group \"Quellcodedateien\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90\"\n# Begin Source File\n\nSOURCE=.\\wrjpgcom.c\n# End Source File\n# End Group\n# Begin Group \"Header-Dateien\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl;fi;fd\"\n# Begin Source File\n\nSOURCE=.\\jconfig.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\jinclude.h\n# End Source File\n# End Group\n# Begin Group \"Ressourcendateien\"\n\n# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe\"\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "makewfil.v10",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"jconfig.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jinclude.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"wrjpgcom.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "makewmak.vc6",
    "content": "# Microsoft Developer Studio Generated NMAKE File, Based on wrjpgcom.dsp\n!IF \"$(CFG)\" == \"\"\nCFG=wrjpgcom - Win32\n!MESSAGE Keine Konfiguration angegeben. wrjpgcom - Win32 wird als Standard verwendet.\n!ENDIF \n\n!IF \"$(CFG)\" != \"wrjpgcom - Win32\"\n!MESSAGE Ungltige Konfiguration \"$(CFG)\" angegeben.\n!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben\n!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:\n!MESSAGE \n!MESSAGE NMAKE /f \"wrjpgcom.mak\" CFG=\"wrjpgcom - Win32\"\n!MESSAGE \n!MESSAGE Fr die Konfiguration stehen zur Auswahl:\n!MESSAGE \n!MESSAGE \"wrjpgcom - Win32\" (basierend auf  \"Win32 (x86) Console Application\")\n!MESSAGE \n!ERROR Eine ungltige Konfiguration wurde angegeben.\n!ENDIF \n\n!IF \"$(OS)\" == \"Windows_NT\"\nNULL=\n!ELSE \nNULL=nul\n!ENDIF \n\nCPP=cl.exe\nRSC=rc.exe\nOUTDIR=.\\wrjpgcom\\Release\nINTDIR=.\\wrjpgcom\\Release\n# Begin Custom Macros\nOutDir=.\\wrjpgcom\\Release\n# End Custom Macros\n\nALL : \"$(OUTDIR)\\wrjpgcom.exe\"\n\n\nCLEAN :\n\t-@erase \"$(INTDIR)\\vc60.idb\"\n\t-@erase \"$(INTDIR)\\wrjpgcom.obj\"\n\t-@erase \"$(OUTDIR)\\wrjpgcom.exe\"\n\n\"$(OUTDIR)\" :\n    if not exist \"$(OUTDIR)/$(NULL)\" mkdir \"$(OUTDIR)\"\n\nBSC32=bscmake.exe\nBSC32_FLAGS=/nologo /o\"$(OUTDIR)\\wrjpgcom.bsc\" \nBSC32_SBRS= \\\n\t\nLINK32=link.exe\nLINK32_FLAGS=Release\\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:\"$(OUTDIR)\\wrjpgcom.pdb\" /machine:I386 /out:\"$(OUTDIR)\\wrjpgcom.exe\" \nLINK32_OBJS= \\\n\t\"$(INTDIR)\\wrjpgcom.obj\"\n\n\"$(OUTDIR)\\wrjpgcom.exe\" : \"$(OUTDIR)\" $(DEF_FILE) $(LINK32_OBJS)\n    $(LINK32) @<<\n  $(LINK32_FLAGS) $(LINK32_OBJS)\n<<\n\nCPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /Fp\"$(INTDIR)\\wrjpgcom.pch\" /YX /Fo\"$(INTDIR)\\\\\" /Fd\"$(INTDIR)\\\\\" /FD /c \n\n.c{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cpp{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cxx{$(INTDIR)}.obj::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.c{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cpp{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n.cxx{$(INTDIR)}.sbr::\n   $(CPP) @<<\n   $(CPP_PROJ) $< \n<<\n\n\n!IF \"$(NO_EXTERNAL_DEPS)\" != \"1\"\n!IF EXISTS(\"wrjpgcom.dep\")\n!INCLUDE \"wrjpgcom.dep\"\n!ELSE \n!MESSAGE Warning: cannot find \"wrjpgcom.dep\"\n!ENDIF \n!ENDIF \n\n\n!IF \"$(CFG)\" == \"wrjpgcom - Win32\"\nSOURCE=.\\wrjpgcom.c\n\n\"$(INTDIR)\\wrjpgcom.obj\" : $(SOURCE) \"$(INTDIR)\"\n\n\n\n!ENDIF \n\n"
  },
  {
    "path": "makewvcx.v10",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{B57065D4-DDDA-4668-BAF5-2D49270C973C}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>wrjpgcom</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n    <OutDir>$(ProjectName)\\$(Configuration)\\</OutDir>\n    <IntDir>$(ProjectName)\\$(Configuration)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <Optimization>Full</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>false</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>\n      <OmitFramePointers>true</OmitFramePointers>\n      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClInclude Include=\"jconfig.h\" />\n    <ClInclude Include=\"jinclude.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"wrjpgcom.c\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "makljpeg.st",
    "content": "; Project file for Independent JPEG Group's software\n;\n; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.\n; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding.\n;\n; To use this file, rename it to libjpeg.prj.\n; Read installation instructions before trying to make the program!\n;\n;\n;      * * * Output file * * *\nlibjpeg.lib\n;\n; * * * COMPILER OPTIONS * * *  \n.C[-P]        ; absolute calls\n.C[-M]        ; and no string merging, folks\n.C[-w-cln]    ; no \"constant is long\" warnings\n.C[-w-par]    ; no \"parameter xxxx unused\"\n.C[-w-rch]    ; no \"unreachable code\"\n.C[-wsig]     ; warn if significant digits may be lost\n.L[-J]        ; link new Obj-format (so we get a library)\n=\n; * * * * List of modules * * * * \njaricom.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njcapimin.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njcapistd.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njcarith.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njccoefct.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njccolor.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njcdctmgr.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)\njchuff.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njcinit.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njcmainct.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njcmarker.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njcmaster.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njcomapi.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njcparam.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njcprepct.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njcsample.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njctrans.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdapimin.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdapistd.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdarith.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdatadst.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h)\njdatasrc.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h)\njdcoefct.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdcolor.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njddctmgr.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)\njdhuff.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdinput.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdmainct.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdmarker.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdmaster.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdmerge.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdpostct.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdsample.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njdtrans.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njerror.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jversion.h,jerror.h)\njfdctflt.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)\njfdctfst.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)\njfdctint.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)\njidctflt.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)\njidctfst.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)\njidctint.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)\njquant1.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njquant2.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njutils.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)\njmemmgr.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jmemsys.h)\njmemansi.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jmemsys.h)\n"
  },
  {
    "path": "maktjpeg.st",
    "content": "; Project file for Independent JPEG Group's software\n;\n; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.\n; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding.\n;\n; To use this file, rename it to jpegtran.prj.\n; If you are using Turbo C, change filenames beginning with \"pc...\" to \"tc...\"\n; Read installation instructions before trying to make the program!\n;\n;\n;      * * * Output file * * *\njpegtran.ttp\n;\n; * * * COMPILER OPTIONS * * *  \n.C[-P]        ; absolute calls\n.C[-M]        ; and no string merging, folks\n.C[-w-cln]    ; no \"constant is long\" warnings\n.C[-w-par]    ; no \"parameter xxxx unused\"\n.C[-w-rch]    ; no \"unreachable code\"\n.C[-wsig]     ; warn if significant digits may be lost\n=\n; * * * * List of modules * * * * \npcstart.o\njpegtran.c\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,transupp.h,jversion.h)\ncdjpeg.c\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\nrdswitch.c\t(cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)\ntransupp.c\t(jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,transupp.h)\nlibjpeg.lib        ; built by libjpeg.prj\npcstdlib.lib       ; standard library\npcextlib.lib       ; extended library\n"
  },
  {
    "path": "makvms.opt",
    "content": "! A pointer to the VAX/VMS C Run-Time Shareable Library.\n! This file is needed by makefile.mms and makefile.vms,\n! but only for the older VAX C compiler.  DEC C does not need it.\nSys$Library:VAXCRTL.EXE /Share\n"
  },
  {
    "path": "missing",
    "content": "#! /bin/sh\n# Common wrapper for a few potentially missing GNU programs.\n\nscriptversion=2013-10-28.13; # UTC\n\n# Copyright (C) 1996-2014 Free Software Foundation, Inc.\n# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\nif test $# -eq 0; then\n  echo 1>&2 \"Try '$0 --help' for more information\"\n  exit 1\nfi\n\ncase $1 in\n\n  --is-lightweight)\n    # Used by our autoconf macros to check whether the available missing\n    # script is modern enough.\n    exit 0\n    ;;\n\n  --run)\n    # Back-compat with the calling convention used by older automake.\n    shift\n    ;;\n\n  -h|--h|--he|--hel|--help)\n    echo \"\\\n$0 [OPTION]... PROGRAM [ARGUMENT]...\n\nRun 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due\nto PROGRAM being missing or too old.\n\nOptions:\n  -h, --help      display this help and exit\n  -v, --version   output version information and exit\n\nSupported PROGRAM values:\n  aclocal   autoconf  autoheader   autom4te  automake  makeinfo\n  bison     yacc      flex         lex       help2man\n\nVersion suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and\n'g' are ignored when checking the name.\n\nSend bug reports to <bug-automake@gnu.org>.\"\n    exit $?\n    ;;\n\n  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)\n    echo \"missing $scriptversion (GNU Automake)\"\n    exit $?\n    ;;\n\n  -*)\n    echo 1>&2 \"$0: unknown '$1' option\"\n    echo 1>&2 \"Try '$0 --help' for more information\"\n    exit 1\n    ;;\n\nesac\n\n# Run the given program, remember its exit status.\n\"$@\"; st=$?\n\n# If it succeeded, we are done.\ntest $st -eq 0 && exit 0\n\n# Also exit now if we it failed (or wasn't found), and '--version' was\n# passed; such an option is passed most likely to detect whether the\n# program is present and works.\ncase $2 in --version|--help) exit $st;; esac\n\n# Exit code 63 means version mismatch.  This often happens when the user\n# tries to use an ancient version of a tool on a file that requires a\n# minimum version.\nif test $st -eq 63; then\n  msg=\"probably too old\"\nelif test $st -eq 127; then\n  # Program was missing.\n  msg=\"missing on your system\"\nelse\n  # Program was found and executed, but failed.  Give up.\n  exit $st\nfi\n\nperl_URL=http://www.perl.org/\nflex_URL=http://flex.sourceforge.net/\ngnu_software_URL=http://www.gnu.org/software\n\nprogram_details ()\n{\n  case $1 in\n    aclocal|automake)\n      echo \"The '$1' program is part of the GNU Automake package:\"\n      echo \"<$gnu_software_URL/automake>\"\n      echo \"It also requires GNU Autoconf, GNU m4 and Perl in order to run:\"\n      echo \"<$gnu_software_URL/autoconf>\"\n      echo \"<$gnu_software_URL/m4/>\"\n      echo \"<$perl_URL>\"\n      ;;\n    autoconf|autom4te|autoheader)\n      echo \"The '$1' program is part of the GNU Autoconf package:\"\n      echo \"<$gnu_software_URL/autoconf/>\"\n      echo \"It also requires GNU m4 and Perl in order to run:\"\n      echo \"<$gnu_software_URL/m4/>\"\n      echo \"<$perl_URL>\"\n      ;;\n  esac\n}\n\ngive_advice ()\n{\n  # Normalize program name to check for.\n  normalized_program=`echo \"$1\" | sed '\n    s/^gnu-//; t\n    s/^gnu//; t\n    s/^g//; t'`\n\n  printf '%s\\n' \"'$1' is $msg.\"\n\n  configure_deps=\"'configure.ac' or m4 files included by 'configure.ac'\"\n  case $normalized_program in\n    autoconf*)\n      echo \"You should only need it if you modified 'configure.ac',\"\n      echo \"or m4 files included by it.\"\n      program_details 'autoconf'\n      ;;\n    autoheader*)\n      echo \"You should only need it if you modified 'acconfig.h' or\"\n      echo \"$configure_deps.\"\n      program_details 'autoheader'\n      ;;\n    automake*)\n      echo \"You should only need it if you modified 'Makefile.am' or\"\n      echo \"$configure_deps.\"\n      program_details 'automake'\n      ;;\n    aclocal*)\n      echo \"You should only need it if you modified 'acinclude.m4' or\"\n      echo \"$configure_deps.\"\n      program_details 'aclocal'\n      ;;\n   autom4te*)\n      echo \"You might have modified some maintainer files that require\"\n      echo \"the 'autom4te' program to be rebuilt.\"\n      program_details 'autom4te'\n      ;;\n    bison*|yacc*)\n      echo \"You should only need it if you modified a '.y' file.\"\n      echo \"You may want to install the GNU Bison package:\"\n      echo \"<$gnu_software_URL/bison/>\"\n      ;;\n    lex*|flex*)\n      echo \"You should only need it if you modified a '.l' file.\"\n      echo \"You may want to install the Fast Lexical Analyzer package:\"\n      echo \"<$flex_URL>\"\n      ;;\n    help2man*)\n      echo \"You should only need it if you modified a dependency\" \\\n           \"of a man page.\"\n      echo \"You may want to install the GNU Help2man package:\"\n      echo \"<$gnu_software_URL/help2man/>\"\n    ;;\n    makeinfo*)\n      echo \"You should only need it if you modified a '.texi' file, or\"\n      echo \"any other file indirectly affecting the aspect of the manual.\"\n      echo \"You might want to install the Texinfo package:\"\n      echo \"<$gnu_software_URL/texinfo/>\"\n      echo \"The spurious makeinfo call might also be the consequence of\"\n      echo \"using a buggy 'make' (AIX, DU, IRIX), in which case you might\"\n      echo \"want to install GNU make:\"\n      echo \"<$gnu_software_URL/make/>\"\n      ;;\n    *)\n      echo \"You might have modified some files without having the proper\"\n      echo \"tools for further handling them.  Check the 'README' file, it\"\n      echo \"often tells you about the needed prerequisites for installing\"\n      echo \"this package.  You may also peek at any GNU archive site, in\"\n      echo \"case some other package contains this missing '$1' program.\"\n      ;;\n  esac\n}\n\ngive_advice \"$1\" | sed -e '1s/^/WARNING: /' \\\n                       -e '2,$s/^/         /' >&2\n\n# Propagate the correct exit status (expected to be 127 for a program\n# not found, 63 for a program that failed due to version mismatch).\nexit $st\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"
  },
  {
    "path": "rdbmp.c",
    "content": "/*\n * rdbmp.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2010 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to read input images in Microsoft \"BMP\"\n * format (MS Windows 3.x, OS/2 1.x, and OS/2 2.x flavors).\n * Currently, only 8-bit and 24-bit images are supported, not 1-bit or\n * 4-bit (feeding such low-depth images into JPEG would be silly anyway).\n * Also, we don't support RLE-compressed files.\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume input from\n * an ordinary stdio stream.  They further assume that reading begins\n * at the start of the file; start_input may need work if the\n * user interface has already read some data (e.g., to determine that\n * the file is indeed BMP format).\n *\n * This code contributed by James Arthur Boucher.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef BMP_SUPPORTED\n\n\n/* Macros to deal with unsigned chars as efficiently as compiler allows */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char U_CHAR;\n#define UCH(x)\t((int) (x))\n#else /* !HAVE_UNSIGNED_CHAR */\n#ifdef CHAR_IS_UNSIGNED\ntypedef char U_CHAR;\n#define UCH(x)\t((int) (x))\n#else\ntypedef char U_CHAR;\n#define UCH(x)\t((int) (x) & 0xFF)\n#endif\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n#define\tReadOK(file,buffer,len)\t(JFREAD(file,buffer,len) == ((size_t) (len)))\n\n\n/* Private version of data source object */\n\ntypedef struct _bmp_source_struct * bmp_source_ptr;\n\ntypedef struct _bmp_source_struct {\n  struct cjpeg_source_struct pub; /* public fields */\n\n  j_compress_ptr cinfo;\t\t/* back link saves passing separate parm */\n\n  JSAMPARRAY colormap;\t\t/* BMP colormap (converted to my format) */\n\n  jvirt_sarray_ptr whole_image;\t/* Needed to reverse row order */\n  JDIMENSION source_row;\t/* Current source row number */\n  JDIMENSION row_width;\t\t/* Physical width of scanlines in file */\n\n  int bits_per_pixel;\t\t/* remembers 8- or 24-bit format */\n} bmp_source_struct;\n\n\nLOCAL(int)\nread_byte (bmp_source_ptr sinfo)\n/* Read next byte from BMP file */\n{\n  register FILE *infile = sinfo->pub.input_file;\n  register int c;\n\n  if ((c = getc(infile)) == EOF)\n    ERREXIT(sinfo->cinfo, JERR_INPUT_EOF);\n  return c;\n}\n\n\nLOCAL(void)\nread_colormap (bmp_source_ptr sinfo, int cmaplen, int mapentrysize)\n/* Read the colormap from a BMP file */\n{\n  int i;\n\n  switch (mapentrysize) {\n  case 3:\n    /* BGR format (occurs in OS/2 files) */\n    for (i = 0; i < cmaplen; i++) {\n      sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);\n      sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);\n      sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);\n    }\n    break;\n  case 4:\n    /* BGR0 format (occurs in MS Windows files) */\n    for (i = 0; i < cmaplen; i++) {\n      sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);\n      sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);\n      sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);\n      (void) read_byte(sinfo);\n    }\n    break;\n  default:\n    ERREXIT(sinfo->cinfo, JERR_BMP_BADCMAP);\n    break;\n  }\n}\n\n\n/*\n * Read one row of pixels.\n * The image has been read into the whole_image array, but is otherwise\n * unprocessed.  We must read it out in top-to-bottom row order, and if\n * it is an 8-bit image, we must expand colormapped pixels to 24bit format.\n */\n\nMETHODDEF(JDIMENSION)\nget_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 8-bit colormap indexes */\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  register JSAMPARRAY colormap = source->colormap;\n  JSAMPARRAY image_ptr;\n  register int t;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n\n  /* Fetch next row from virtual array */\n  source->source_row--;\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->whole_image,\n     source->source_row, (JDIMENSION) 1, FALSE);\n\n  /* Expand the colormap indexes to real data */\n  inptr = image_ptr[0];\n  outptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    t = GETJSAMPLE(*inptr++);\n    *outptr++ = colormap[0][t];\t/* can omit GETJSAMPLE() safely */\n    *outptr++ = colormap[1][t];\n    *outptr++ = colormap[2][t];\n  }\n\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 24-bit pixels */\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n\n  /* Fetch next row from virtual array */\n  source->source_row--;\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->whole_image,\n     source->source_row, (JDIMENSION) 1, FALSE);\n\n  /* Transfer data.  Note source values are in BGR order\n   * (even though Microsoft's own documents say the opposite).\n   */\n  inptr = image_ptr[0];\n  outptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    outptr[2] = *inptr++;\t/* can omit GETJSAMPLE() safely */\n    outptr[1] = *inptr++;\n    outptr[0] = *inptr++;\n    outptr += 3;\n  }\n\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_32bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 32-bit pixels */\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n\n  /* Fetch next row from virtual array */\n  source->source_row--;\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->whole_image,\n     source->source_row, (JDIMENSION) 1, FALSE);\n  /* Transfer data.  Note source values are in BGR order\n   * (even though Microsoft's own documents say the opposite).\n   */\n  inptr = image_ptr[0];\n  outptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    outptr[2] = *inptr++;\t/* can omit GETJSAMPLE() safely */\n    outptr[1] = *inptr++;\n    outptr[0] = *inptr++;\n    inptr++;\t\t\t/* skip the 4th byte (Alpha channel) */\n    outptr += 3;\n  }\n\n  return 1;\n}\n\n\n/*\n * This method loads the image into whole_image during the first call on\n * get_pixel_rows.  The get_pixel_rows pointer is then adjusted to call\n * get_8bit_row, get_24bit_row, or get_32bit_row on subsequent calls.\n */\n\nMETHODDEF(JDIMENSION)\npreload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  register FILE *infile = source->pub.input_file;\n  register int c;\n  register JSAMPROW out_ptr;\n  JSAMPARRAY image_ptr;\n  JDIMENSION row, col;\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n\n  /* Read the data into a virtual array in input-file row order. */\n  for (row = 0; row < cinfo->image_height; row++) {\n    if (progress != NULL) {\n      progress->pub.pass_counter = (long) row;\n      progress->pub.pass_limit = (long) cinfo->image_height;\n      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n    }\n    image_ptr = (*cinfo->mem->access_virt_sarray)\n      ((j_common_ptr) cinfo, source->whole_image,\n       row, (JDIMENSION) 1, TRUE);\n    out_ptr = image_ptr[0];\n    for (col = source->row_width; col > 0; col--) {\n      /* inline copy of read_byte() for speed */\n      if ((c = getc(infile)) == EOF)\n\tERREXIT(cinfo, JERR_INPUT_EOF);\n      *out_ptr++ = (JSAMPLE) c;\n    }\n  }\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n\n  /* Set up to read from the virtual array in top-to-bottom order */\n  switch (source->bits_per_pixel) {\n  case 8:\n    source->pub.get_pixel_rows = get_8bit_row;\n    break;\n  case 24:\n    source->pub.get_pixel_rows = get_24bit_row;\n    break;\n  case 32:\n    source->pub.get_pixel_rows = get_32bit_row;\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BMP_BADDEPTH);\n  }\n  source->source_row = cinfo->image_height;\n\n  /* And read the first row */\n  return (*source->pub.get_pixel_rows) (cinfo, sinfo);\n}\n\n\n/*\n * Read the file header; return image size and component count.\n */\n\nMETHODDEF(void)\nstart_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  U_CHAR bmpfileheader[14];\n  U_CHAR bmpinfoheader[64];\n#define GET_2B(array,offset)  ((unsigned int) UCH(array[offset]) + \\\n\t\t\t       (((unsigned int) UCH(array[offset+1])) << 8))\n#define GET_4B(array,offset)  ((INT32) UCH(array[offset]) + \\\n\t\t\t       (((INT32) UCH(array[offset+1])) << 8) + \\\n\t\t\t       (((INT32) UCH(array[offset+2])) << 16) + \\\n\t\t\t       (((INT32) UCH(array[offset+3])) << 24))\n  INT32 bfOffBits;\n  INT32 headerSize;\n  INT32 biWidth;\n  INT32 biHeight;\n  unsigned int biPlanes;\n  INT32 biCompression;\n  INT32 biXPelsPerMeter,biYPelsPerMeter;\n  INT32 biClrUsed = 0;\n  int mapentrysize = 0;\t\t/* 0 indicates no colormap */\n  INT32 bPad;\n  JDIMENSION row_width;\n\n  /* Read and verify the bitmap file header */\n  if (! ReadOK(source->pub.input_file, bmpfileheader, 14))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  if (GET_2B(bmpfileheader,0) != 0x4D42) /* 'BM' */\n    ERREXIT(cinfo, JERR_BMP_NOT);\n  bfOffBits = (INT32) GET_4B(bmpfileheader,10);\n  /* We ignore the remaining fileheader fields */\n\n  /* The infoheader might be 12 bytes (OS/2 1.x), 40 bytes (Windows),\n   * or 64 bytes (OS/2 2.x).  Check the first 4 bytes to find out which.\n   */\n  if (! ReadOK(source->pub.input_file, bmpinfoheader, 4))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  headerSize = (INT32) GET_4B(bmpinfoheader,0);\n  if (headerSize < 12 || headerSize > 64)\n    ERREXIT(cinfo, JERR_BMP_BADHEADER);\n  if (! ReadOK(source->pub.input_file, bmpinfoheader+4, headerSize-4))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n\n  switch ((int) headerSize) {\n  case 12:\n    /* Decode OS/2 1.x header (Microsoft calls this a BITMAPCOREHEADER) */\n    biWidth = (INT32) GET_2B(bmpinfoheader,4);\n    biHeight = (INT32) GET_2B(bmpinfoheader,6);\n    biPlanes = GET_2B(bmpinfoheader,8);\n    source->bits_per_pixel = (int) GET_2B(bmpinfoheader,10);\n\n    switch (source->bits_per_pixel) {\n    case 8:\t\t\t/* colormapped image */\n      mapentrysize = 3;\t\t/* OS/2 uses RGBTRIPLE colormap */\n      TRACEMS2(cinfo, 1, JTRC_BMP_OS2_MAPPED, (int) biWidth, (int) biHeight);\n      break;\n    case 24:\t\t\t/* RGB image */\n      TRACEMS2(cinfo, 1, JTRC_BMP_OS2, (int) biWidth, (int) biHeight);\n      break;\n    default:\n      ERREXIT(cinfo, JERR_BMP_BADDEPTH);\n      break;\n    }\n    break;\n  case 40:\n  case 64:\n    /* Decode Windows 3.x header (Microsoft calls this a BITMAPINFOHEADER) */\n    /* or OS/2 2.x header, which has additional fields that we ignore */\n    biWidth = GET_4B(bmpinfoheader,4);\n    biHeight = GET_4B(bmpinfoheader,8);\n    biPlanes = GET_2B(bmpinfoheader,12);\n    source->bits_per_pixel = (int) GET_2B(bmpinfoheader,14);\n    biCompression = GET_4B(bmpinfoheader,16);\n    biXPelsPerMeter = GET_4B(bmpinfoheader,24);\n    biYPelsPerMeter = GET_4B(bmpinfoheader,28);\n    biClrUsed = GET_4B(bmpinfoheader,32);\n    /* biSizeImage, biClrImportant fields are ignored */\n\n    switch (source->bits_per_pixel) {\n    case 8:\t\t\t/* colormapped image */\n      mapentrysize = 4;\t\t/* Windows uses RGBQUAD colormap */\n      TRACEMS2(cinfo, 1, JTRC_BMP_MAPPED, (int) biWidth, (int) biHeight);\n      break;\n    case 24:\t\t\t/* RGB image */\n      TRACEMS2(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight);\n      break;\n    case 32:\t\t\t/* RGB image + Alpha channel */\n      TRACEMS2(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight);\n      break;\n    default:\n      ERREXIT(cinfo, JERR_BMP_BADDEPTH);\n      break;\n    }\n    if (biCompression != 0)\n      ERREXIT(cinfo, JERR_BMP_COMPRESSED);\n\n    if (biXPelsPerMeter > 0 && biYPelsPerMeter > 0) {\n      /* Set JFIF density parameters from the BMP data */\n      cinfo->X_density = (UINT16) (biXPelsPerMeter/100); /* 100 cm per meter */\n      cinfo->Y_density = (UINT16) (biYPelsPerMeter/100);\n      cinfo->density_unit = 2;\t/* dots/cm */\n    }\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BMP_BADHEADER);\n    return;\n  }\n\n  if (biWidth <= 0 || biHeight <= 0)\n    ERREXIT(cinfo, JERR_BMP_EMPTY);\n  if (biPlanes != 1)\n    ERREXIT(cinfo, JERR_BMP_BADPLANES);\n\n  /* Compute distance to bitmap data --- will adjust for colormap below */\n  bPad = bfOffBits - (headerSize + 14);\n\n  /* Read the colormap, if any */\n  if (mapentrysize > 0) {\n    if (biClrUsed <= 0)\n      biClrUsed = 256;\t\t/* assume it's 256 */\n    else if (biClrUsed > 256)\n      ERREXIT(cinfo, JERR_BMP_BADCMAP);\n    /* Allocate space to store the colormap */\n    source->colormap = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) biClrUsed, (JDIMENSION) 3);\n    /* and read it from the file */\n    read_colormap(source, (int) biClrUsed, mapentrysize);\n    /* account for size of colormap */\n    bPad -= biClrUsed * mapentrysize;\n  }\n\n  /* Skip any remaining pad bytes */\n  if (bPad < 0)\t\t\t/* incorrect bfOffBits value? */\n    ERREXIT(cinfo, JERR_BMP_BADHEADER);\n  while (--bPad >= 0) {\n    (void) read_byte(source);\n  }\n\n  /* Compute row width in file, including padding to 4-byte boundary */\n  if (source->bits_per_pixel == 24)\n    row_width = (JDIMENSION) (biWidth * 3);\n  else if (source->bits_per_pixel == 32)\n    row_width = (JDIMENSION) (biWidth * 4);\n  else\n    row_width = (JDIMENSION) biWidth;\n  while ((row_width & 3) != 0) row_width++;\n  source->row_width = row_width;\n\n  /* Allocate space for inversion array, prepare for preload pass */\n  source->whole_image = (*cinfo->mem->request_virt_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n     row_width, (JDIMENSION) biHeight, (JDIMENSION) 1);\n  source->pub.get_pixel_rows = preload_image;\n  if (cinfo->progress != NULL) {\n    cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n    progress->total_extra_passes++; /* count file input as separate pass */\n  }\n\n  /* Allocate one-row buffer for returned data */\n  source->pub.buffer = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     (JDIMENSION) (biWidth * 3), (JDIMENSION) 1);\n  source->pub.buffer_height = 1;\n\n  cinfo->in_color_space = JCS_RGB;\n  cinfo->input_components = 3;\n  cinfo->data_precision = 8;\n  cinfo->image_width = (JDIMENSION) biWidth;\n  cinfo->image_height = (JDIMENSION) biHeight;\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  /* no work */\n}\n\n\n/*\n * The module selection routine for BMP format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_bmp (j_compress_ptr cinfo)\n{\n  bmp_source_ptr source;\n\n  /* Create module interface object */\n  source = (bmp_source_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(bmp_source_struct));\n  source->cinfo = cinfo;\t/* make back link for subroutines */\n  /* Fill in method ptrs, except get_pixel_rows which start_input sets */\n  source->pub.start_input = start_input_bmp;\n  source->pub.finish_input = finish_input_bmp;\n\n  return (cjpeg_source_ptr) source;\n}\n\n#endif /* BMP_SUPPORTED */\n"
  },
  {
    "path": "rdcolmap.c",
    "content": "/*\n * rdcolmap.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file implements djpeg's \"-map file\" switch.  It reads a source image\n * and constructs a colormap to be supplied to the JPEG decompressor.\n *\n * Currently, these file formats are supported for the map file:\n *   GIF: the contents of the GIF's global colormap are used.\n *   PPM (either text or raw flavor): the entire file is read and\n *      each unique pixel value is entered in the map.\n * Note that reading a large PPM file will be horrendously slow.\n * Typically, a PPM-format map file should contain just one pixel\n * of each desired color.  Such a file can be extracted from an\n * ordinary image PPM file with ppmtomap(1).\n *\n * Rescaling a PPM that has a maxval unequal to MAXJSAMPLE is not\n * currently implemented.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef QUANT_2PASS_SUPPORTED\t/* otherwise can't quantize to supplied map */\n\n/* Portions of this code are based on the PBMPLUS library, which is:\n**\n** Copyright (C) 1988 by Jef Poskanzer.\n**\n** Permission to use, copy, modify, and distribute this software and its\n** documentation for any purpose and without fee is hereby granted, provided\n** that the above copyright notice appear in all copies and that both that\n** copyright notice and this permission notice appear in supporting\n** documentation.  This software is provided \"as is\" without express or\n** implied warranty.\n*/\n\n\n/*\n * Add a (potentially) new color to the color map.\n */\n\nLOCAL(void)\nadd_map_entry (j_decompress_ptr cinfo, int R, int G, int B)\n{\n  JSAMPROW colormap0 = cinfo->colormap[0];\n  JSAMPROW colormap1 = cinfo->colormap[1];\n  JSAMPROW colormap2 = cinfo->colormap[2];\n  int ncolors = cinfo->actual_number_of_colors;\n  int index;\n\n  /* Check for duplicate color. */\n  for (index = 0; index < ncolors; index++) {\n    if (GETJSAMPLE(colormap0[index]) == R &&\n\tGETJSAMPLE(colormap1[index]) == G &&\n\tGETJSAMPLE(colormap2[index]) == B)\n      return;\t\t\t/* color is already in map */\n  }\n\n  /* Check for map overflow. */\n  if (ncolors >= (MAXJSAMPLE+1))\n    ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, (MAXJSAMPLE+1));\n\n  /* OK, add color to map. */\n  colormap0[ncolors] = (JSAMPLE) R;\n  colormap1[ncolors] = (JSAMPLE) G;\n  colormap2[ncolors] = (JSAMPLE) B;\n  cinfo->actual_number_of_colors++;\n}\n\n\n/*\n * Extract color map from a GIF file.\n */\n\nLOCAL(void)\nread_gif_map (j_decompress_ptr cinfo, FILE * infile)\n{\n  int header[13];\n  int i, colormaplen;\n  int R, G, B;\n\n  /* Initial 'G' has already been read by read_color_map */\n  /* Read the rest of the GIF header and logical screen descriptor */\n  for (i = 1; i < 13; i++) {\n    if ((header[i] = getc(infile)) == EOF)\n      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n  }\n\n  /* Verify GIF Header */\n  if (header[1] != 'I' || header[2] != 'F')\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  /* There must be a global color map. */\n  if ((header[10] & 0x80) == 0)\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  /* OK, fetch it. */\n  colormaplen = 2 << (header[10] & 0x07);\n\n  for (i = 0; i < colormaplen; i++) {\n    R = getc(infile);\n    G = getc(infile);\n    B = getc(infile);\n    if (R == EOF || G == EOF || B == EOF)\n      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n    add_map_entry(cinfo,\n\t\t  R << (BITS_IN_JSAMPLE-8),\n\t\t  G << (BITS_IN_JSAMPLE-8),\n\t\t  B << (BITS_IN_JSAMPLE-8));\n  }\n}\n\n\n/* Support routines for reading PPM */\n\n\nLOCAL(int)\npbm_getc (FILE * infile)\n/* Read next char, skipping over any comments */\n/* A comment/newline sequence is returned as a newline */\n{\n  register int ch;\n  \n  ch = getc(infile);\n  if (ch == '#') {\n    do {\n      ch = getc(infile);\n    } while (ch != '\\n' && ch != EOF);\n  }\n  return ch;\n}\n\n\nLOCAL(unsigned int)\nread_pbm_integer (j_decompress_ptr cinfo, FILE * infile)\n/* Read an unsigned decimal integer from the PPM file */\n/* Swallows one trailing character after the integer */\n/* Note that on a 16-bit-int machine, only values up to 64k can be read. */\n/* This should not be a problem in practice. */\n{\n  register int ch;\n  register unsigned int val;\n  \n  /* Skip any leading whitespace */\n  do {\n    ch = pbm_getc(infile);\n    if (ch == EOF)\n      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n  } while (ch == ' ' || ch == '\\t' || ch == '\\n' || ch == '\\r');\n  \n  if (ch < '0' || ch > '9')\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n  \n  val = ch - '0';\n  while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') {\n    val *= 10;\n    val += ch - '0';\n  }\n  return val;\n}\n\n\n/*\n * Extract color map from a PPM file.\n */\n\nLOCAL(void)\nread_ppm_map (j_decompress_ptr cinfo, FILE * infile)\n{\n  int c;\n  unsigned int w, h, maxval, row, col;\n  int R, G, B;\n\n  /* Initial 'P' has already been read by read_color_map */\n  c = getc(infile);\t\t/* save format discriminator for a sec */\n\n  /* while we fetch the remaining header info */\n  w = read_pbm_integer(cinfo, infile);\n  h = read_pbm_integer(cinfo, infile);\n  maxval = read_pbm_integer(cinfo, infile);\n\n  if (w <= 0 || h <= 0 || maxval <= 0) /* error check */\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  /* For now, we don't support rescaling from an unusual maxval. */\n  if (maxval != (unsigned int) MAXJSAMPLE)\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  switch (c) {\n  case '3':\t\t\t/* it's a text-format PPM file */\n    for (row = 0; row < h; row++) {\n      for (col = 0; col < w; col++) {\n\tR = read_pbm_integer(cinfo, infile);\n\tG = read_pbm_integer(cinfo, infile);\n\tB = read_pbm_integer(cinfo, infile);\n\tadd_map_entry(cinfo, R, G, B);\n      }\n    }\n    break;\n\n  case '6':\t\t\t/* it's a raw-format PPM file */\n    for (row = 0; row < h; row++) {\n      for (col = 0; col < w; col++) {\n\tR = getc(infile);\n\tG = getc(infile);\n\tB = getc(infile);\n\tif (R == EOF || G == EOF || B == EOF)\n\t  ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\tadd_map_entry(cinfo, R, G, B);\n      }\n    }\n    break;\n\n  default:\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n    break;\n  }\n}\n\n\n/*\n * Main entry point from djpeg.c.\n *  Input: opened input file (from file name argument on command line).\n *  Output: colormap and actual_number_of_colors fields are set in cinfo.\n */\n\nGLOBAL(void)\nread_color_map (j_decompress_ptr cinfo, FILE * infile)\n{\n  /* Allocate space for a color map of maximum supported size. */\n  cinfo->colormap = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     (JDIMENSION) (MAXJSAMPLE+1), (JDIMENSION) 3);\n  cinfo->actual_number_of_colors = 0; /* initialize map to empty */\n\n  /* Read first byte to determine file format */\n  switch (getc(infile)) {\n  case 'G':\n    read_gif_map(cinfo, infile);\n    break;\n  case 'P':\n    read_ppm_map(cinfo, infile);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n    break;\n  }\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n"
  },
  {
    "path": "rdgif.c",
    "content": "/*\n * rdgif.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to read input images in GIF format.\n *\n *****************************************************************************\n * NOTE: to avoid entanglements with Unisys' patent on LZW compression,      *\n * the ability to read GIF files has been removed from the IJG distribution. *\n * Sorry about that.                                                         *\n *****************************************************************************\n *\n * We are required to state that\n *    \"The Graphics Interchange Format(c) is the Copyright property of\n *    CompuServe Incorporated. GIF(sm) is a Service Mark property of\n *    CompuServe Incorporated.\"\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef GIF_SUPPORTED\n\n/*\n * The module selection routine for GIF format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_gif (j_compress_ptr cinfo)\n{\n  fprintf(stderr, \"GIF input is unsupported for legal reasons.  Sorry.\\n\");\n  exit(EXIT_FAILURE);\n  return NULL;\t\t\t/* keep compiler happy */\n}\n\n#endif /* GIF_SUPPORTED */\n"
  },
  {
    "path": "rdjpgcom.1",
    "content": ".TH RDJPGCOM 1 \"13 September 2013\"\n.SH NAME\nrdjpgcom \\- display text comments from a JPEG file\n.SH SYNOPSIS\n.B rdjpgcom\n[\n.B \\-raw\n]\n[\n.B \\-verbose\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B rdjpgcom\nreads the named JPEG/JFIF file, or the standard input if no file is named,\nand prints any text comments found in the file on the standard output.\n.PP\nThe JPEG standard allows \"comment\" (COM) blocks to occur within a JPEG file.\nAlthough the standard doesn't actually define what COM blocks are for, they\nare widely used to hold user-supplied text strings.  This lets you add\nannotations, titles, index terms, etc to your JPEG files, and later retrieve\nthem as text.  COM blocks do not interfere with the image stored in the JPEG\nfile.  The maximum size of a COM block is 64K, but you can have as many of\nthem as you like in one JPEG file.\n.SH OPTIONS\n.TP\n.B \\-raw\nNormally\n.B rdjpgcom\nescapes non-printable characters in comments, for security reasons.\nThis option avoids that.\n.PP\n.B \\-verbose\nCauses\n.B rdjpgcom\nto also display the JPEG image dimensions.\n.PP\nSwitch names may be abbreviated, and are not case sensitive.\n.SH HINTS\n.B rdjpgcom\ndoes not depend on the IJG JPEG library.  Its source code is intended as an\nillustration of the minimum amount of code required to parse a JPEG file\nheader correctly.\n.PP\nIn\n.B \\-verbose\nmode,\n.B rdjpgcom\nwill also attempt to print the contents of any \"APP12\" markers as text.\nSome digital cameras produce APP12 markers containing useful textual\ninformation.  If you like, you can modify the source code to print\nother APPn marker types as well.\n.SH SEE ALSO\n.BR cjpeg (1),\n.BR djpeg (1),\n.BR jpegtran (1),\n.BR wrjpgcom (1)\n.SH AUTHOR\nIndependent JPEG Group\n"
  },
  {
    "path": "rdjpgcom.c",
    "content": "/*\n * rdjpgcom.c\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * Modified 2009 by Bill Allombert, Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a very simple stand-alone application that displays\n * the text in COM (comment) markers in a JFIF file.\n * This may be useful as an example of the minimum logic needed to parse\n * JPEG markers.\n */\n\n#define JPEG_CJPEG_DJPEG\t/* to get the command-line config symbols */\n#include \"jinclude.h\"\t\t/* get auto-config symbols, <stdio.h> */\n\n#ifdef HAVE_LOCALE_H\n#include <locale.h>\t\t/* Bill Allombert: use locale for isprint */\n#endif\n#include <ctype.h>\t\t/* to declare isupper(), tolower() */\n#ifdef USE_SETMODE\n#include <fcntl.h>\t\t/* to declare setmode()'s parameter macros */\n/* If you have setmode() but not <io.h>, just delete this line: */\n#include <io.h>\t\t\t/* to declare setmode() */\n#endif\n\n#ifdef USE_CCOMMAND\t\t/* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>\t\t/* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>\t\t/* Think declares it here */\n#endif\n#endif\n\n#ifdef DONT_USE_B_MODE\t\t/* define mode parameters for fopen() */\n#define READ_BINARY\t\"r\"\n#else\n#ifdef VMS\t\t\t/* VMS is very nonstandard */\n#define READ_BINARY\t\"rb\", \"ctx=stm\"\n#else\t\t\t\t/* standard ANSI-compliant case */\n#define READ_BINARY\t\"rb\"\n#endif\n#endif\n\n#ifndef EXIT_FAILURE\t\t/* define exit() codes if not provided */\n#define EXIT_FAILURE  1\n#endif\n#ifndef EXIT_SUCCESS\n#ifdef VMS\n#define EXIT_SUCCESS  1\t\t/* VMS is very nonstandard */\n#else\n#define EXIT_SUCCESS  0\n#endif\n#endif\n\n\n/*\n * These macros are used to read the input file.\n * To reuse this code in another application, you might need to change these.\n */\n\nstatic FILE * infile;\t\t/* input JPEG file */\n\n/* Return next input byte, or EOF if no more */\n#define NEXTBYTE()  getc(infile)\n\n\n/* Error exit handler */\n#define ERREXIT(msg)  (fprintf(stderr, \"%s\\n\", msg), exit(EXIT_FAILURE))\n\n\n/* Read one byte, testing for EOF */\nstatic int\nread_1_byte (void)\n{\n  int c;\n\n  c = NEXTBYTE();\n  if (c == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  return c;\n}\n\n/* Read 2 bytes, convert to unsigned int */\n/* All 2-byte quantities in JPEG markers are MSB first */\nstatic unsigned int\nread_2_bytes (void)\n{\n  int c1, c2;\n\n  c1 = NEXTBYTE();\n  if (c1 == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  c2 = NEXTBYTE();\n  if (c2 == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  return (((unsigned int) c1) << 8) + ((unsigned int) c2);\n}\n\n\n/*\n * JPEG markers consist of one or more 0xFF bytes, followed by a marker\n * code byte (which is not an FF).  Here are the marker codes of interest\n * in this program.  (See jdmarker.c for a more complete list.)\n */\n\n#define M_SOF0  0xC0\t\t/* Start Of Frame N */\n#define M_SOF1  0xC1\t\t/* N indicates which compression process */\n#define M_SOF2  0xC2\t\t/* Only SOF0-SOF2 are now in common use */\n#define M_SOF3  0xC3\n#define M_SOF5  0xC5\t\t/* NB: codes C4 and CC are NOT SOF markers */\n#define M_SOF6  0xC6\n#define M_SOF7  0xC7\n#define M_SOF9  0xC9\n#define M_SOF10 0xCA\n#define M_SOF11 0xCB\n#define M_SOF13 0xCD\n#define M_SOF14 0xCE\n#define M_SOF15 0xCF\n#define M_SOI   0xD8\t\t/* Start Of Image (beginning of datastream) */\n#define M_EOI   0xD9\t\t/* End Of Image (end of datastream) */\n#define M_SOS   0xDA\t\t/* Start Of Scan (begins compressed data) */\n#define M_APP0\t0xE0\t\t/* Application-specific marker, type N */\n#define M_APP12\t0xEC\t\t/* (we don't bother to list all 16 APPn's) */\n#define M_COM   0xFE\t\t/* COMment */\n\n\n/*\n * Find the next JPEG marker and return its marker code.\n * We expect at least one FF byte, possibly more if the compressor used FFs\n * to pad the file.\n * There could also be non-FF garbage between markers.  The treatment of such\n * garbage is unspecified; we choose to skip over it but emit a warning msg.\n * NB: this routine must not be used after seeing SOS marker, since it will\n * not deal correctly with FF/00 sequences in the compressed image data...\n */\n\nstatic int\nnext_marker (void)\n{\n  int c;\n  int discarded_bytes = 0;\n\n  /* Find 0xFF byte; count and skip any non-FFs. */\n  c = read_1_byte();\n  while (c != 0xFF) {\n    discarded_bytes++;\n    c = read_1_byte();\n  }\n  /* Get marker code byte, swallowing any duplicate FF bytes.  Extra FFs\n   * are legal as pad bytes, so don't count them in discarded_bytes.\n   */\n  do {\n    c = read_1_byte();\n  } while (c == 0xFF);\n\n  if (discarded_bytes != 0) {\n    fprintf(stderr, \"Warning: garbage data found in JPEG file\\n\");\n  }\n\n  return c;\n}\n\n\n/*\n * Read the initial marker, which should be SOI.\n * For a JFIF file, the first two bytes of the file should be literally\n * 0xFF M_SOI.  To be more general, we could use next_marker, but if the\n * input file weren't actually JPEG at all, next_marker might read the whole\n * file and then return a misleading error message...\n */\n\nstatic int\nfirst_marker (void)\n{\n  int c1, c2;\n\n  c1 = NEXTBYTE();\n  c2 = NEXTBYTE();\n  if (c1 != 0xFF || c2 != M_SOI)\n    ERREXIT(\"Not a JPEG file\");\n  return c2;\n}\n\n\n/*\n * Most types of marker are followed by a variable-length parameter segment.\n * This routine skips over the parameters for any marker we don't otherwise\n * want to process.\n * Note that we MUST skip the parameter segment explicitly in order not to\n * be fooled by 0xFF bytes that might appear within the parameter segment;\n * such bytes do NOT introduce new markers.\n */\n\nstatic void\nskip_variable (void)\n/* Skip over an unknown or uninteresting variable-length marker */\n{\n  unsigned int length;\n\n  /* Get the marker parameter length count */\n  length = read_2_bytes();\n  /* Length includes itself, so must be at least 2 */\n  if (length < 2)\n    ERREXIT(\"Erroneous JPEG marker length\");\n  length -= 2;\n  /* Skip over the remaining bytes */\n  while (length > 0) {\n    (void) read_1_byte();\n    length--;\n  }\n}\n\n\n/*\n * Process a COM marker.\n * We want to print out the marker contents as legible text;\n * we must guard against non-text junk and varying newline representations.\n */\n\nstatic void\nprocess_COM (int raw)\n{\n  unsigned int length;\n  int ch;\n  int lastch = 0;\n\n  /* Bill Allombert: set locale properly for isprint */\n#ifdef HAVE_LOCALE_H\n  setlocale(LC_CTYPE, \"\");\n#endif\n\n  /* Get the marker parameter length count */\n  length = read_2_bytes();\n  /* Length includes itself, so must be at least 2 */\n  if (length < 2)\n    ERREXIT(\"Erroneous JPEG marker length\");\n  length -= 2;\n\n  while (length > 0) {\n    ch = read_1_byte();\n    if (raw) {\n      putc(ch, stdout);\n    /* Emit the character in a readable form.\n     * Nonprintables are converted to \\nnn form,\n     * while \\ is converted to \\\\.\n     * Newlines in CR, CR/LF, or LF form will be printed as one newline.\n     */\n    } else if (ch == '\\r') {\n      printf(\"\\n\");\n    } else if (ch == '\\n') {\n      if (lastch != '\\r')\n\tprintf(\"\\n\");\n    } else if (ch == '\\\\') {\n      printf(\"\\\\\\\\\");\n    } else if (isprint(ch)) {\n      putc(ch, stdout);\n    } else {\n      printf(\"\\\\%03o\", ch);\n    }\n    lastch = ch;\n    length--;\n  }\n  printf(\"\\n\");\n\n  /* Bill Allombert: revert to C locale */\n#ifdef HAVE_LOCALE_H\n  setlocale(LC_CTYPE, \"C\");\n#endif\n}\n\n\n/*\n * Process a SOFn marker.\n * This code is only needed if you want to know the image dimensions...\n */\n\nstatic void\nprocess_SOFn (int marker)\n{\n  unsigned int length;\n  unsigned int image_height, image_width;\n  int data_precision, num_components;\n  const char * process;\n  int ci;\n\n  length = read_2_bytes();\t/* usual parameter length count */\n\n  data_precision = read_1_byte();\n  image_height = read_2_bytes();\n  image_width = read_2_bytes();\n  num_components = read_1_byte();\n\n  switch (marker) {\n  case M_SOF0:\tprocess = \"Baseline\";  break;\n  case M_SOF1:\tprocess = \"Extended sequential\";  break;\n  case M_SOF2:\tprocess = \"Progressive\";  break;\n  case M_SOF3:\tprocess = \"Lossless\";  break;\n  case M_SOF5:\tprocess = \"Differential sequential\";  break;\n  case M_SOF6:\tprocess = \"Differential progressive\";  break;\n  case M_SOF7:\tprocess = \"Differential lossless\";  break;\n  case M_SOF9:\tprocess = \"Extended sequential, arithmetic coding\";  break;\n  case M_SOF10:\tprocess = \"Progressive, arithmetic coding\";  break;\n  case M_SOF11:\tprocess = \"Lossless, arithmetic coding\";  break;\n  case M_SOF13:\tprocess = \"Differential sequential, arithmetic coding\";  break;\n  case M_SOF14:\tprocess = \"Differential progressive, arithmetic coding\"; break;\n  case M_SOF15:\tprocess = \"Differential lossless, arithmetic coding\";  break;\n  default:\tprocess = \"Unknown\";  break;\n  }\n\n  printf(\"JPEG image is %uw * %uh, %d color components, %d bits per sample\\n\",\n\t image_width, image_height, num_components, data_precision);\n  printf(\"JPEG process: %s\\n\", process);\n\n  if (length != (unsigned int) (8 + num_components * 3))\n    ERREXIT(\"Bogus SOF marker length\");\n\n  for (ci = 0; ci < num_components; ci++) {\n    (void) read_1_byte();\t/* Component ID code */\n    (void) read_1_byte();\t/* H, V sampling factors */\n    (void) read_1_byte();\t/* Quantization table number */\n  }\n}\n\n\n/*\n * Parse the marker stream until SOS or EOI is seen;\n * display any COM markers.\n * While the companion program wrjpgcom will always insert COM markers before\n * SOFn, other implementations might not, so we scan to SOS before stopping.\n * If we were only interested in the image dimensions, we would stop at SOFn.\n * (Conversely, if we only cared about COM markers, there would be no need\n * for special code to handle SOFn; we could treat it like other markers.)\n */\n\nstatic int\nscan_JPEG_header (int verbose, int raw)\n{\n  int marker;\n\n  /* Expect SOI at start of file */\n  if (first_marker() != M_SOI)\n    ERREXIT(\"Expected SOI marker first\");\n\n  /* Scan miscellaneous markers until we reach SOS. */\n  for (;;) {\n    marker = next_marker();\n    switch (marker) {\n      /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be,\n       * treated as SOFn.  C4 in particular is actually DHT.\n       */\n    case M_SOF0:\t\t/* Baseline */\n    case M_SOF1:\t\t/* Extended sequential, Huffman */\n    case M_SOF2:\t\t/* Progressive, Huffman */\n    case M_SOF3:\t\t/* Lossless, Huffman */\n    case M_SOF5:\t\t/* Differential sequential, Huffman */\n    case M_SOF6:\t\t/* Differential progressive, Huffman */\n    case M_SOF7:\t\t/* Differential lossless, Huffman */\n    case M_SOF9:\t\t/* Extended sequential, arithmetic */\n    case M_SOF10:\t\t/* Progressive, arithmetic */\n    case M_SOF11:\t\t/* Lossless, arithmetic */\n    case M_SOF13:\t\t/* Differential sequential, arithmetic */\n    case M_SOF14:\t\t/* Differential progressive, arithmetic */\n    case M_SOF15:\t\t/* Differential lossless, arithmetic */\n      if (verbose)\n\tprocess_SOFn(marker);\n      else\n\tskip_variable();\n      break;\n\n    case M_SOS:\t\t\t/* stop before hitting compressed data */\n      return marker;\n\n    case M_EOI:\t\t\t/* in case it's a tables-only JPEG stream */\n      return marker;\n\n    case M_COM:\n      process_COM(raw);\n      break;\n\n    case M_APP12:\n      /* Some digital camera makers put useful textual information into\n       * APP12 markers, so we print those out too when in -verbose mode.\n       */\n      if (verbose) {\n\tprintf(\"APP12 contains:\\n\");\n\tprocess_COM(raw);\n      } else\n\tskip_variable();\n      break;\n\n    default:\t\t\t/* Anything else just gets skipped */\n      skip_variable();\t\t/* we assume it has a parameter count... */\n      break;\n    }\n  } /* end loop */\n}\n\n\n/* Command line parsing code */\n\nstatic const char * progname;\t/* program name for error messages */\n\n\nstatic void\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"rdjpgcom displays any textual comments in a JPEG file.\\n\");\n\n  fprintf(stderr, \"Usage: %s [switches] [inputfile]\\n\", progname);\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -raw        Display non-printable characters in comments (unsafe)\\n\");\n  fprintf(stderr, \"  -verbose    Also display dimensions of JPEG image\\n\");\n\n  exit(EXIT_FAILURE);\n}\n\n\nstatic int\nkeymatch (char * arg, const char * keyword, int minchars)\n/* Case-insensitive matching of (possibly abbreviated) keyword switches. */\n/* keyword is the constant keyword (must be lower case already), */\n/* minchars is length of minimum legal abbreviation. */\n{\n  register int ca, ck;\n  register int nmatched = 0;\n\n  while ((ca = *arg++) != '\\0') {\n    if ((ck = *keyword++) == '\\0')\n      return 0;\t\t\t/* arg longer than keyword, no good */\n    if (isupper(ca))\t\t/* force arg to lcase (assume ck is already) */\n      ca = tolower(ca);\n    if (ca != ck)\n      return 0;\t\t\t/* no good */\n    nmatched++;\t\t\t/* count matched characters */\n  }\n  /* reached end of argument; fail if it's too short for unique abbrev */\n  if (nmatched < minchars)\n    return 0;\n  return 1;\t\t\t/* A-OK */\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  int argn;\n  char * arg;\n  int verbose = 0, raw = 0;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"rdjpgcom\";\t/* in case C library doesn't provide it */\n\n  /* Parse switches, if any */\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (arg[0] != '-')\n      break;\t\t\t/* not switch, must be file name */\n    arg++;\t\t\t/* advance over '-' */\n    if (keymatch(arg, \"verbose\", 1)) {\n      verbose++;\n    } else if (keymatch(arg, \"raw\", 1)) {\n      raw = 1;\n    } else\n      usage();\n  }\n\n  /* Open the input file. */\n  /* Unix style: expect zero or one file name */\n  if (argn < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n  if (argn < argc) {\n    if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n#ifdef USE_SETMODE\t\t/* need to hack file mode? */\n    setmode(fileno(stdin), O_BINARY);\n#endif\n#ifdef USE_FDOPEN\t\t/* need to re-open in binary mode? */\n    if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open stdin\\n\", progname);\n      exit(EXIT_FAILURE);\n    }\n#else\n    infile = stdin;\n#endif\n  }\n\n  /* Scan the JPEG headers. */\n  (void) scan_JPEG_header(verbose, raw);\n\n  /* All done. */\n  exit(EXIT_SUCCESS);\n  return 0;\t\t\t/* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "rdppm.c",
    "content": "/*\n * rdppm.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2009 by Bill Allombert, Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to read input images in PPM/PGM format.\n * The extended 2-byte-per-sample raw PPM/PGM formats are supported.\n * The PBMPLUS library is NOT required to compile this software\n * (but it is highly useful as a set of PPM image manipulation programs).\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume input from\n * an ordinary stdio stream.  They further assume that reading begins\n * at the start of the file; start_input may need work if the\n * user interface has already read some data (e.g., to determine that\n * the file is indeed PPM format).\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef PPM_SUPPORTED\n\n\n/* Portions of this code are based on the PBMPLUS library, which is:\n**\n** Copyright (C) 1988 by Jef Poskanzer.\n**\n** Permission to use, copy, modify, and distribute this software and its\n** documentation for any purpose and without fee is hereby granted, provided\n** that the above copyright notice appear in all copies and that both that\n** copyright notice and this permission notice appear in supporting\n** documentation.  This software is provided \"as is\" without express or\n** implied warranty.\n*/\n\n\n/* Macros to deal with unsigned chars as efficiently as compiler allows */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char U_CHAR;\n#define UCH(x)\t((int) (x))\n#else /* !HAVE_UNSIGNED_CHAR */\n#ifdef CHAR_IS_UNSIGNED\ntypedef char U_CHAR;\n#define UCH(x)\t((int) (x))\n#else\ntypedef char U_CHAR;\n#define UCH(x)\t((int) (x) & 0xFF)\n#endif\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n#define\tReadOK(file,buffer,len)\t(JFREAD(file,buffer,len) == ((size_t) (len)))\n\n\n/*\n * On most systems, reading individual bytes with getc() is drastically less\n * efficient than buffering a row at a time with fread().  On PCs, we must\n * allocate the buffer in near data space, because we are assuming small-data\n * memory model, wherein fread() can't reach far memory.  If you need to\n * process very wide images on a PC, you might have to compile in large-memory\n * model, or else replace fread() with a getc() loop --- which will be much\n * slower.\n */\n\n\n/* Private version of data source object */\n\ntypedef struct {\n  struct cjpeg_source_struct pub; /* public fields */\n\n  U_CHAR *iobuffer;\t\t/* non-FAR pointer to I/O buffer */\n  JSAMPROW pixrow;\t\t/* FAR pointer to same */\n  size_t buffer_width;\t\t/* width of I/O buffer */\n  JSAMPLE *rescale;\t\t/* => maxval-remapping array, or NULL */\n} ppm_source_struct;\n\ntypedef ppm_source_struct * ppm_source_ptr;\n\n\nLOCAL(int)\npbm_getc (FILE * infile)\n/* Read next char, skipping over any comments */\n/* A comment/newline sequence is returned as a newline */\n{\n  register int ch;\n\n  ch = getc(infile);\n  if (ch == '#') {\n    do {\n      ch = getc(infile);\n    } while (ch != '\\n' && ch != EOF);\n  }\n  return ch;\n}\n\n\nLOCAL(unsigned int)\nread_pbm_integer (j_compress_ptr cinfo, FILE * infile)\n/* Read an unsigned decimal integer from the PPM file */\n/* Swallows one trailing character after the integer */\n/* Note that on a 16-bit-int machine, only values up to 64k can be read. */\n/* This should not be a problem in practice. */\n{\n  register int ch;\n  register unsigned int val;\n\n  /* Skip any leading whitespace */\n  do {\n    ch = pbm_getc(infile);\n    if (ch == EOF)\n      ERREXIT(cinfo, JERR_INPUT_EOF);\n  } while (ch == ' ' || ch == '\\t' || ch == '\\n' || ch == '\\r');\n\n  if (ch < '0' || ch > '9')\n    ERREXIT(cinfo, JERR_PPM_NONNUMERIC);\n\n  val = ch - '0';\n  while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') {\n    val *= 10;\n    val += ch - '0';\n  }\n  return val;\n}\n\n\n/*\n * Read one row of pixels.\n *\n * We provide several different versions depending on input file format.\n * In all cases, input is scaled to the size of JSAMPLE.\n *\n * A really fast path is provided for reading byte/sample raw files with\n * maxval = MAXJSAMPLE, which is the normal case for 8-bit data.\n */\n\n\nMETHODDEF(JDIMENSION)\nget_text_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading text-format PGM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  FILE * infile = source->pub.input_file;\n  register JSAMPROW ptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_text_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading text-format PPM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  FILE * infile = source->pub.input_file;\n  register JSAMPROW ptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];\n    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];\n    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_scaled_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-byte-format PGM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register U_CHAR * bufferptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  ptr = source->pub.buffer[0];\n  bufferptr = source->iobuffer;\n  for (col = cinfo->image_width; col > 0; col--) {\n    *ptr++ = rescale[UCH(*bufferptr++)];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_scaled_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-byte-format PPM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register U_CHAR * bufferptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  ptr = source->pub.buffer[0];\n  bufferptr = source->iobuffer;\n  for (col = cinfo->image_width; col > 0; col--) {\n    *ptr++ = rescale[UCH(*bufferptr++)];\n    *ptr++ = rescale[UCH(*bufferptr++)];\n    *ptr++ = rescale[UCH(*bufferptr++)];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_raw_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-byte-format files with maxval = MAXJSAMPLE.\n * In this case we just read right into the JSAMPLE buffer!\n * Note that same code works for PPM and PGM files.\n */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_word_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-word-format PGM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register U_CHAR * bufferptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  ptr = source->pub.buffer[0];\n  bufferptr = source->iobuffer;\n  for (col = cinfo->image_width; col > 0; col--) {\n    register int temp;\n    temp  = UCH(*bufferptr++) << 8;\n    temp |= UCH(*bufferptr++);\n    *ptr++ = rescale[temp];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_word_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-word-format PPM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register U_CHAR * bufferptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  ptr = source->pub.buffer[0];\n  bufferptr = source->iobuffer;\n  for (col = cinfo->image_width; col > 0; col--) {\n    register int temp;\n    temp  = UCH(*bufferptr++) << 8;\n    temp |= UCH(*bufferptr++);\n    *ptr++ = rescale[temp];\n    temp  = UCH(*bufferptr++) << 8;\n    temp |= UCH(*bufferptr++);\n    *ptr++ = rescale[temp];\n    temp  = UCH(*bufferptr++) << 8;\n    temp |= UCH(*bufferptr++);\n    *ptr++ = rescale[temp];\n  }\n  return 1;\n}\n\n\n/*\n * Read the file header; return image size and component count.\n */\n\nMETHODDEF(void)\nstart_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  int c;\n  unsigned int w, h, maxval;\n  boolean need_iobuffer, use_raw_buffer, need_rescale;\n\n  if (getc(source->pub.input_file) != 'P')\n    ERREXIT(cinfo, JERR_PPM_NOT);\n\n  c = getc(source->pub.input_file); /* subformat discriminator character */\n\n  /* detect unsupported variants (ie, PBM) before trying to read header */\n  switch (c) {\n  case '2':\t\t\t/* it's a text-format PGM file */\n  case '3':\t\t\t/* it's a text-format PPM file */\n  case '5':\t\t\t/* it's a raw-format PGM file */\n  case '6':\t\t\t/* it's a raw-format PPM file */\n    break;\n  default:\n    ERREXIT(cinfo, JERR_PPM_NOT);\n    break;\n  }\n\n  /* fetch the remaining header info */\n  w = read_pbm_integer(cinfo, source->pub.input_file);\n  h = read_pbm_integer(cinfo, source->pub.input_file);\n  maxval = read_pbm_integer(cinfo, source->pub.input_file);\n\n  if (w <= 0 || h <= 0 || maxval <= 0) /* error check */\n    ERREXIT(cinfo, JERR_PPM_NOT);\n\n  cinfo->data_precision = BITS_IN_JSAMPLE; /* we always rescale data to this */\n  cinfo->image_width = (JDIMENSION) w;\n  cinfo->image_height = (JDIMENSION) h;\n\n  /* initialize flags to most common settings */\n  need_iobuffer = TRUE;\t\t/* do we need an I/O buffer? */\n  use_raw_buffer = FALSE;\t/* do we map input buffer onto I/O buffer? */\n  need_rescale = TRUE;\t\t/* do we need a rescale array? */\n\n  switch (c) {\n  case '2':\t\t\t/* it's a text-format PGM file */\n    cinfo->input_components = 1;\n    cinfo->in_color_space = JCS_GRAYSCALE;\n    TRACEMS2(cinfo, 1, JTRC_PGM_TEXT, w, h);\n    source->pub.get_pixel_rows = get_text_gray_row;\n    need_iobuffer = FALSE;\n    break;\n\n  case '3':\t\t\t/* it's a text-format PPM file */\n    cinfo->input_components = 3;\n    cinfo->in_color_space = JCS_RGB;\n    TRACEMS2(cinfo, 1, JTRC_PPM_TEXT, w, h);\n    source->pub.get_pixel_rows = get_text_rgb_row;\n    need_iobuffer = FALSE;\n    break;\n\n  case '5':\t\t\t/* it's a raw-format PGM file */\n    cinfo->input_components = 1;\n    cinfo->in_color_space = JCS_GRAYSCALE;\n    TRACEMS2(cinfo, 1, JTRC_PGM, w, h);\n    if (maxval > 255) {\n      source->pub.get_pixel_rows = get_word_gray_row;\n    } else if (maxval == MAXJSAMPLE && SIZEOF(JSAMPLE) == SIZEOF(U_CHAR)) {\n      source->pub.get_pixel_rows = get_raw_row;\n      use_raw_buffer = TRUE;\n      need_rescale = FALSE;\n    } else {\n      source->pub.get_pixel_rows = get_scaled_gray_row;\n    }\n    break;\n\n  case '6':\t\t\t/* it's a raw-format PPM file */\n    cinfo->input_components = 3;\n    cinfo->in_color_space = JCS_RGB;\n    TRACEMS2(cinfo, 1, JTRC_PPM, w, h);\n    if (maxval > 255) {\n      source->pub.get_pixel_rows = get_word_rgb_row;\n    } else if (maxval == MAXJSAMPLE && SIZEOF(JSAMPLE) == SIZEOF(U_CHAR)) {\n      source->pub.get_pixel_rows = get_raw_row;\n      use_raw_buffer = TRUE;\n      need_rescale = FALSE;\n    } else {\n      source->pub.get_pixel_rows = get_scaled_rgb_row;\n    }\n    break;\n  }\n\n  /* Allocate space for I/O buffer: 1 or 3 bytes or words/pixel. */\n  if (need_iobuffer) {\n    source->buffer_width = (size_t) w * cinfo->input_components *\n      ((maxval<=255) ? SIZEOF(U_CHAR) : (2*SIZEOF(U_CHAR)));\n    source->iobuffer = (U_CHAR *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  source->buffer_width);\n  }\n\n  /* Create compressor input buffer. */\n  if (use_raw_buffer) {\n    /* For unscaled raw-input case, we can just map it onto the I/O buffer. */\n    /* Synthesize a JSAMPARRAY pointer structure */\n    /* Cast here implies near->far pointer conversion on PCs */\n    source->pixrow = (JSAMPROW) source->iobuffer;\n    source->pub.buffer = & source->pixrow;\n    source->pub.buffer_height = 1;\n  } else {\n    /* Need to translate anyway, so make a separate sample buffer. */\n    source->pub.buffer = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) w * cinfo->input_components, (JDIMENSION) 1);\n    source->pub.buffer_height = 1;\n  }\n\n  /* Compute the rescaling array if required. */\n  if (need_rescale) {\n    INT32 val, half_maxval;\n\n    /* On 16-bit-int machines we have to be careful of maxval = 65535 */\n    source->rescale = (JSAMPLE *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  (size_t) (((long) maxval + 1L) * SIZEOF(JSAMPLE)));\n    half_maxval = maxval / 2;\n    for (val = 0; val <= (INT32) maxval; val++) {\n      /* The multiplication here must be done in 32 bits to avoid overflow */\n      source->rescale[val] = (JSAMPLE) ((val*MAXJSAMPLE + half_maxval)/maxval);\n    }\n  }\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  /* no work */\n}\n\n\n/*\n * The module selection routine for PPM format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_ppm (j_compress_ptr cinfo)\n{\n  ppm_source_ptr source;\n\n  /* Create module interface object */\n  source = (ppm_source_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(ppm_source_struct));\n  /* Fill in method ptrs, except get_pixel_rows which start_input sets */\n  source->pub.start_input = start_input_ppm;\n  source->pub.finish_input = finish_input_ppm;\n\n  return (cjpeg_source_ptr) source;\n}\n\n#endif /* PPM_SUPPORTED */\n"
  },
  {
    "path": "rdrle.c",
    "content": "/*\n * rdrle.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to read input images in Utah RLE format.\n * The Utah Raster Toolkit library is required (version 3.1 or later).\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume input from\n * an ordinary stdio stream.  They further assume that reading begins\n * at the start of the file; start_input may need work if the\n * user interface has already read some data (e.g., to determine that\n * the file is indeed RLE format).\n *\n * Based on code contributed by Mike Lijewski,\n * with updates from Robert Hutchinson.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef RLE_SUPPORTED\n\n/* rle.h is provided by the Utah Raster Toolkit. */\n\n#include <rle.h>\n\n/*\n * We assume that JSAMPLE has the same representation as rle_pixel,\n * to wit, \"unsigned char\".  Hence we can't cope with 12- or 16-bit samples.\n */\n\n#if BITS_IN_JSAMPLE != 8\n  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */\n#endif\n\n/*\n * We support the following types of RLE files:\n *   \n *   GRAYSCALE   - 8 bits, no colormap\n *   MAPPEDGRAY  - 8 bits, 1 channel colomap\n *   PSEUDOCOLOR - 8 bits, 3 channel colormap\n *   TRUECOLOR   - 24 bits, 3 channel colormap\n *   DIRECTCOLOR - 24 bits, no colormap\n *\n * For now, we ignore any alpha channel in the image.\n */\n\ntypedef enum\n  { GRAYSCALE, MAPPEDGRAY, PSEUDOCOLOR, TRUECOLOR, DIRECTCOLOR } rle_kind;\n\n\n/*\n * Since RLE stores scanlines bottom-to-top, we have to invert the image\n * to conform to JPEG's top-to-bottom order.  To do this, we read the\n * incoming image into a virtual array on the first get_pixel_rows call,\n * then fetch the required row from the virtual array on subsequent calls.\n */\n\ntypedef struct _rle_source_struct * rle_source_ptr;\n\ntypedef struct _rle_source_struct {\n  struct cjpeg_source_struct pub; /* public fields */\n\n  rle_kind visual;              /* actual type of input file */\n  jvirt_sarray_ptr image;       /* virtual array to hold the image */\n  JDIMENSION row;\t\t/* current row # in the virtual array */\n  rle_hdr header;               /* Input file information */\n  rle_pixel** rle_row;          /* holds a row returned by rle_getrow() */\n\n} rle_source_struct;\n\n\n/*\n * Read the file header; return image size and component count.\n */\n\nMETHODDEF(void)\nstart_input_rle (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  rle_source_ptr source = (rle_source_ptr) sinfo;\n  JDIMENSION width, height;\n#ifdef PROGRESS_REPORT\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n#endif\n\n  /* Use RLE library routine to get the header info */\n  source->header = *rle_hdr_init(NULL);\n  source->header.rle_file = source->pub.input_file;\n  switch (rle_get_setup(&(source->header))) {\n  case RLE_SUCCESS:\n    /* A-OK */\n    break;\n  case RLE_NOT_RLE:\n    ERREXIT(cinfo, JERR_RLE_NOT);\n    break;\n  case RLE_NO_SPACE:\n    ERREXIT(cinfo, JERR_RLE_MEM);\n    break;\n  case RLE_EMPTY:\n    ERREXIT(cinfo, JERR_RLE_EMPTY);\n    break;\n  case RLE_EOF:\n    ERREXIT(cinfo, JERR_RLE_EOF);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_RLE_BADERROR);\n    break;\n  }\n\n  /* Figure out what we have, set private vars and return values accordingly */\n  \n  width  = source->header.xmax - source->header.xmin + 1;\n  height = source->header.ymax - source->header.ymin + 1;\n  source->header.xmin = 0;\t\t/* realign horizontally */\n  source->header.xmax = width-1;\n\n  cinfo->image_width      = width;\n  cinfo->image_height     = height;\n  cinfo->data_precision   = 8;  /* we can only handle 8 bit data */\n\n  if (source->header.ncolors == 1 && source->header.ncmap == 0) {\n    source->visual     = GRAYSCALE;\n    TRACEMS2(cinfo, 1, JTRC_RLE_GRAY, width, height);\n  } else if (source->header.ncolors == 1 && source->header.ncmap == 1) {\n    source->visual     = MAPPEDGRAY;\n    TRACEMS3(cinfo, 1, JTRC_RLE_MAPGRAY, width, height,\n             1 << source->header.cmaplen);\n  } else if (source->header.ncolors == 1 && source->header.ncmap == 3) {\n    source->visual     = PSEUDOCOLOR;\n    TRACEMS3(cinfo, 1, JTRC_RLE_MAPPED, width, height,\n\t     1 << source->header.cmaplen);\n  } else if (source->header.ncolors == 3 && source->header.ncmap == 3) {\n    source->visual     = TRUECOLOR;\n    TRACEMS3(cinfo, 1, JTRC_RLE_FULLMAP, width, height,\n\t     1 << source->header.cmaplen);\n  } else if (source->header.ncolors == 3 && source->header.ncmap == 0) {\n    source->visual     = DIRECTCOLOR;\n    TRACEMS2(cinfo, 1, JTRC_RLE, width, height);\n  } else\n    ERREXIT(cinfo, JERR_RLE_UNSUPPORTED);\n  \n  if (source->visual == GRAYSCALE || source->visual == MAPPEDGRAY) {\n    cinfo->in_color_space   = JCS_GRAYSCALE;\n    cinfo->input_components = 1;\n  } else {\n    cinfo->in_color_space   = JCS_RGB;\n    cinfo->input_components = 3;\n  }\n\n  /*\n   * A place to hold each scanline while it's converted.\n   * (GRAYSCALE scanlines don't need converting)\n   */\n  if (source->visual != GRAYSCALE) {\n    source->rle_row = (rle_pixel**) (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) width, (JDIMENSION) cinfo->input_components);\n  }\n\n  /* request a virtual array to hold the image */\n  source->image = (*cinfo->mem->request_virt_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n     (JDIMENSION) (width * source->header.ncolors),\n     (JDIMENSION) height, (JDIMENSION) 1);\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL) {\n    /* count file input as separate pass */\n    progress->total_extra_passes++;\n  }\n#endif\n\n  source->pub.buffer_height = 1;\n}\n\n\n/*\n * Read one row of pixels.\n * Called only after load_image has read the image into the virtual array.\n * Used for GRAYSCALE, MAPPEDGRAY, TRUECOLOR, and DIRECTCOLOR images.\n */\n\nMETHODDEF(JDIMENSION)\nget_rle_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  rle_source_ptr source = (rle_source_ptr) sinfo;\n\n  source->row--;\n  source->pub.buffer = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE);\n\n  return 1;\n}\n\n/*\n * Read one row of pixels.\n * Called only after load_image has read the image into the virtual array.\n * Used for PSEUDOCOLOR images.\n */\n\nMETHODDEF(JDIMENSION)\nget_pseudocolor_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  rle_source_ptr source = (rle_source_ptr) sinfo;\n  JSAMPROW src_row, dest_row;\n  JDIMENSION col;\n  rle_map *colormap;\n  int val;\n\n  colormap = source->header.cmap;\n  dest_row = source->pub.buffer[0];\n  source->row--;\n  src_row = * (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE);\n\n  for (col = cinfo->image_width; col > 0; col--) {\n    val = GETJSAMPLE(*src_row++);\n    *dest_row++ = (JSAMPLE) (colormap[val      ] >> 8);\n    *dest_row++ = (JSAMPLE) (colormap[val + 256] >> 8);\n    *dest_row++ = (JSAMPLE) (colormap[val + 512] >> 8);\n  }\n\n  return 1;\n}\n\n\n/*\n * Load the image into a virtual array.  We have to do this because RLE\n * files start at the lower left while the JPEG standard has them starting\n * in the upper left.  This is called the first time we want to get a row\n * of input.  What we do is load the RLE data into the array and then call\n * the appropriate routine to read one row from the array.  Before returning,\n * we set source->pub.get_pixel_rows so that subsequent calls go straight to\n * the appropriate row-reading routine.\n */\n\nMETHODDEF(JDIMENSION)\nload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  rle_source_ptr source = (rle_source_ptr) sinfo;\n  JDIMENSION row, col;\n  JSAMPROW  scanline, red_ptr, green_ptr, blue_ptr;\n  rle_pixel **rle_row;\n  rle_map *colormap;\n  char channel;\n#ifdef PROGRESS_REPORT\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n#endif\n\n  colormap = source->header.cmap;\n  rle_row = source->rle_row;\n\n  /* Read the RLE data into our virtual array.\n   * We assume here that (a) rle_pixel is represented the same as JSAMPLE,\n   * and (b) we are not on a machine where FAR pointers differ from regular.\n   */\n  RLE_CLR_BIT(source->header, RLE_ALPHA); /* don't read the alpha channel */\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL) {\n    progress->pub.pass_limit = cinfo->image_height;\n    progress->pub.pass_counter = 0;\n    (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n  }\n#endif\n\n  switch (source->visual) {\n\n  case GRAYSCALE:\n  case PSEUDOCOLOR:\n    for (row = 0; row < cinfo->image_height; row++) {\n      rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)\n         ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);\n      rle_getrow(&source->header, rle_row);\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n    break;\n\n  case MAPPEDGRAY:\n  case TRUECOLOR:\n    for (row = 0; row < cinfo->image_height; row++) {\n      scanline = * (*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);\n      rle_row = source->rle_row;\n      rle_getrow(&source->header, rle_row);\n\n      for (col = 0; col < cinfo->image_width; col++) {\n        for (channel = 0; channel < source->header.ncolors; channel++) {\n          *scanline++ = (JSAMPLE)\n            (colormap[GETJSAMPLE(rle_row[channel][col]) + 256 * channel] >> 8);\n        }\n      }\n\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n    break;\n\n  case DIRECTCOLOR:\n    for (row = 0; row < cinfo->image_height; row++) {\n      scanline = * (*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);\n      rle_getrow(&source->header, rle_row);\n\n      red_ptr   = rle_row[0];\n      green_ptr = rle_row[1];\n      blue_ptr  = rle_row[2];\n\n      for (col = cinfo->image_width; col > 0; col--) {\n        *scanline++ = *red_ptr++;\n        *scanline++ = *green_ptr++;\n        *scanline++ = *blue_ptr++;\n      }\n\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n  }\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n#endif\n\n  /* Set up to call proper row-extraction routine in future */\n  if (source->visual == PSEUDOCOLOR) {\n    source->pub.buffer = source->rle_row;\n    source->pub.get_pixel_rows = get_pseudocolor_row;\n  } else {\n    source->pub.get_pixel_rows = get_rle_row;\n  }\n  source->row = cinfo->image_height;\n\n  /* And fetch the topmost (bottommost) row */\n  return (*source->pub.get_pixel_rows) (cinfo, sinfo);   \n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_input_rle (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  /* no work */\n}\n\n\n/*\n * The module selection routine for RLE format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_rle (j_compress_ptr cinfo)\n{\n  rle_source_ptr source;\n\n  /* Create module interface object */\n  source = (rle_source_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  SIZEOF(rle_source_struct));\n  /* Fill in method ptrs */\n  source->pub.start_input = start_input_rle;\n  source->pub.finish_input = finish_input_rle;\n  source->pub.get_pixel_rows = load_image;\n\n  return (cjpeg_source_ptr) source;\n}\n\n#endif /* RLE_SUPPORTED */\n"
  },
  {
    "path": "rdswitch.c",
    "content": "/*\n * rdswitch.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to process some of cjpeg's more complicated\n * command-line switches.  Switches processed here are:\n *\t-qtables file\t\tRead quantization tables from text file\n *\t-scans file\t\tRead scan script from text file\n *\t-quality N[,N,...]\tSet quality ratings\n *\t-qslots N[,N,...]\tSet component quantization table selectors\n *\t-sample HxV[,HxV,...]\tSet component sampling factors\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n#include <ctype.h>\t\t/* to declare isdigit(), isspace() */\n\n\nLOCAL(int)\ntext_getc (FILE * file)\n/* Read next char, skipping over any comments (# to end of line) */\n/* A comment/newline sequence is returned as a newline */\n{\n  register int ch;\n  \n  ch = getc(file);\n  if (ch == '#') {\n    do {\n      ch = getc(file);\n    } while (ch != '\\n' && ch != EOF);\n  }\n  return ch;\n}\n\n\nLOCAL(boolean)\nread_text_integer (FILE * file, long * result, int * termchar)\n/* Read an unsigned decimal integer from a file, store it in result */\n/* Reads one trailing character after the integer; returns it in termchar */\n{\n  register int ch;\n  register long val;\n  \n  /* Skip any leading whitespace, detect EOF */\n  do {\n    ch = text_getc(file);\n    if (ch == EOF) {\n      *termchar = ch;\n      return FALSE;\n    }\n  } while (isspace(ch));\n  \n  if (! isdigit(ch)) {\n    *termchar = ch;\n    return FALSE;\n  }\n\n  val = ch - '0';\n  while ((ch = text_getc(file)) != EOF) {\n    if (! isdigit(ch))\n      break;\n    val *= 10;\n    val += ch - '0';\n  }\n  *result = val;\n  *termchar = ch;\n  return TRUE;\n}\n\n\nGLOBAL(boolean)\nread_quant_tables (j_compress_ptr cinfo, char * filename, boolean force_baseline)\n/* Read a set of quantization tables from the specified file.\n * The file is plain ASCII text: decimal numbers with whitespace between.\n * Comments preceded by '#' may be included in the file.\n * There may be one to NUM_QUANT_TBLS tables in the file, each of 64 values.\n * The tables are implicitly numbered 0,1,etc.\n * NOTE: does not affect the qslots mapping, which will default to selecting\n * table 0 for luminance (or primary) components, 1 for chrominance components.\n * You must use -qslots if you want a different component->table mapping.\n */\n{\n  FILE * fp;\n  int tblno, i, termchar;\n  long val;\n  unsigned int table[DCTSIZE2];\n\n  if ((fp = fopen(filename, \"r\")) == NULL) {\n    fprintf(stderr, \"Can't open table file %s\\n\", filename);\n    return FALSE;\n  }\n  tblno = 0;\n\n  while (read_text_integer(fp, &val, &termchar)) { /* read 1st element of table */\n    if (tblno >= NUM_QUANT_TBLS) {\n      fprintf(stderr, \"Too many tables in file %s\\n\", filename);\n      fclose(fp);\n      return FALSE;\n    }\n    table[0] = (unsigned int) val;\n    for (i = 1; i < DCTSIZE2; i++) {\n      if (! read_text_integer(fp, &val, &termchar)) {\n\tfprintf(stderr, \"Invalid table data in file %s\\n\", filename);\n\tfclose(fp);\n\treturn FALSE;\n      }\n      table[i] = (unsigned int) val;\n    }\n    jpeg_add_quant_table(cinfo, tblno, table, cinfo->q_scale_factor[tblno],\n\t\t\t force_baseline);\n    tblno++;\n  }\n\n  if (termchar != EOF) {\n    fprintf(stderr, \"Non-numeric data in file %s\\n\", filename);\n    fclose(fp);\n    return FALSE;\n  }\n\n  fclose(fp);\n  return TRUE;\n}\n\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n\nLOCAL(boolean)\nread_scan_integer (FILE * file, long * result, int * termchar)\n/* Variant of read_text_integer that always looks for a non-space termchar;\n * this simplifies parsing of punctuation in scan scripts.\n */\n{\n  register int ch;\n\n  if (! read_text_integer(file, result, termchar))\n    return FALSE;\n  ch = *termchar;\n  while (ch != EOF && isspace(ch))\n    ch = text_getc(file);\n  if (isdigit(ch)) {\t\t/* oops, put it back */\n    if (ungetc(ch, file) == EOF)\n      return FALSE;\n    ch = ' ';\n  } else {\n    /* Any separators other than ';' and ':' are ignored;\n     * this allows user to insert commas, etc, if desired.\n     */\n    if (ch != EOF && ch != ';' && ch != ':')\n      ch = ' ';\n  }\n  *termchar = ch;\n  return TRUE;\n}\n\n\nGLOBAL(boolean)\nread_scan_script (j_compress_ptr cinfo, char * filename)\n/* Read a scan script from the specified text file.\n * Each entry in the file defines one scan to be emitted.\n * Entries are separated by semicolons ';'.\n * An entry contains one to four component indexes,\n * optionally followed by a colon ':' and four progressive-JPEG parameters.\n * The component indexes denote which component(s) are to be transmitted\n * in the current scan.  The first component has index 0.\n * Sequential JPEG is used if the progressive-JPEG parameters are omitted.\n * The file is free format text: any whitespace may appear between numbers\n * and the ':' and ';' punctuation marks.  Also, other punctuation (such\n * as commas or dashes) can be placed between numbers if desired.\n * Comments preceded by '#' may be included in the file.\n * Note: we do very little validity checking here;\n * jcmaster.c will validate the script parameters.\n */\n{\n  FILE * fp;\n  int scanno, ncomps, termchar;\n  long val;\n  jpeg_scan_info * scanptr;\n#define MAX_SCANS  100\t\t/* quite arbitrary limit */\n  jpeg_scan_info scans[MAX_SCANS];\n\n  if ((fp = fopen(filename, \"r\")) == NULL) {\n    fprintf(stderr, \"Can't open scan definition file %s\\n\", filename);\n    return FALSE;\n  }\n  scanptr = scans;\n  scanno = 0;\n\n  while (read_scan_integer(fp, &val, &termchar)) {\n    if (scanno >= MAX_SCANS) {\n      fprintf(stderr, \"Too many scans defined in file %s\\n\", filename);\n      fclose(fp);\n      return FALSE;\n    }\n    scanptr->component_index[0] = (int) val;\n    ncomps = 1;\n    while (termchar == ' ') {\n      if (ncomps >= MAX_COMPS_IN_SCAN) {\n\tfprintf(stderr, \"Too many components in one scan in file %s\\n\",\n\t\tfilename);\n\tfclose(fp);\n\treturn FALSE;\n      }\n      if (! read_scan_integer(fp, &val, &termchar))\n\tgoto bogus;\n      scanptr->component_index[ncomps] = (int) val;\n      ncomps++;\n    }\n    scanptr->comps_in_scan = ncomps;\n    if (termchar == ':') {\n      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')\n\tgoto bogus;\n      scanptr->Ss = (int) val;\n      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')\n\tgoto bogus;\n      scanptr->Se = (int) val;\n      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')\n\tgoto bogus;\n      scanptr->Ah = (int) val;\n      if (! read_scan_integer(fp, &val, &termchar))\n\tgoto bogus;\n      scanptr->Al = (int) val;\n    } else {\n      /* set non-progressive parameters */\n      scanptr->Ss = 0;\n      scanptr->Se = DCTSIZE2-1;\n      scanptr->Ah = 0;\n      scanptr->Al = 0;\n    }\n    if (termchar != ';' && termchar != EOF) {\nbogus:\n      fprintf(stderr, \"Invalid scan entry format in file %s\\n\", filename);\n      fclose(fp);\n      return FALSE;\n    }\n    scanptr++, scanno++;\n  }\n\n  if (termchar != EOF) {\n    fprintf(stderr, \"Non-numeric data in file %s\\n\", filename);\n    fclose(fp);\n    return FALSE;\n  }\n\n  if (scanno > 0) {\n    /* Stash completed scan list in cinfo structure.\n     * NOTE: for cjpeg's use, JPOOL_IMAGE is the right lifetime for this data,\n     * but if you want to compress multiple images you'd want JPOOL_PERMANENT.\n     */\n    scanptr = (jpeg_scan_info *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  scanno * SIZEOF(jpeg_scan_info));\n    MEMCOPY(scanptr, scans, scanno * SIZEOF(jpeg_scan_info));\n    cinfo->scan_info = scanptr;\n    cinfo->num_scans = scanno;\n  }\n\n  fclose(fp);\n  return TRUE;\n}\n\n#endif /* C_MULTISCAN_FILES_SUPPORTED */\n\n\nGLOBAL(boolean)\nset_quality_ratings (j_compress_ptr cinfo, char *arg, boolean force_baseline)\n/* Process a quality-ratings parameter string, of the form\n *     N[,N,...]\n * If there are more q-table slots than parameters, the last value is replicated.\n */\n{\n  int val = 75;\t\t\t/* default value */\n  int tblno;\n  char ch;\n\n  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {\n    if (*arg) {\n      ch = ',';\t\t\t/* if not set by sscanf, will be ',' */\n      if (sscanf(arg, \"%d%c\", &val, &ch) < 1)\n\treturn FALSE;\n      if (ch != ',')\t\t/* syntax check */\n\treturn FALSE;\n      /* Convert user 0-100 rating to percentage scaling */\n      cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val);\n      while (*arg && *arg++ != ',') /* advance to next segment of arg string */\n\t;\n    } else {\n      /* reached end of parameter, set remaining factors to last value */\n      cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val);\n    }\n  }\n  jpeg_default_qtables(cinfo, force_baseline);\n  return TRUE;\n}\n\n\nGLOBAL(boolean)\nset_quant_slots (j_compress_ptr cinfo, char *arg)\n/* Process a quantization-table-selectors parameter string, of the form\n *     N[,N,...]\n * If there are more components than parameters, the last value is replicated.\n */\n{\n  int val = 0;\t\t\t/* default table # */\n  int ci;\n  char ch;\n\n  for (ci = 0; ci < MAX_COMPONENTS; ci++) {\n    if (*arg) {\n      ch = ',';\t\t\t/* if not set by sscanf, will be ',' */\n      if (sscanf(arg, \"%d%c\", &val, &ch) < 1)\n\treturn FALSE;\n      if (ch != ',')\t\t/* syntax check */\n\treturn FALSE;\n      if (val < 0 || val >= NUM_QUANT_TBLS) {\n\tfprintf(stderr, \"JPEG quantization tables are numbered 0..%d\\n\",\n\t\tNUM_QUANT_TBLS-1);\n\treturn FALSE;\n      }\n      cinfo->comp_info[ci].quant_tbl_no = val;\n      while (*arg && *arg++ != ',') /* advance to next segment of arg string */\n\t;\n    } else {\n      /* reached end of parameter, set remaining components to last table */\n      cinfo->comp_info[ci].quant_tbl_no = val;\n    }\n  }\n  return TRUE;\n}\n\n\nGLOBAL(boolean)\nset_sample_factors (j_compress_ptr cinfo, char *arg)\n/* Process a sample-factors parameter string, of the form\n *     HxV[,HxV,...]\n * If there are more components than parameters, \"1x1\" is assumed for the rest.\n */\n{\n  int ci, val1, val2;\n  char ch1, ch2;\n\n  for (ci = 0; ci < MAX_COMPONENTS; ci++) {\n    if (*arg) {\n      ch2 = ',';\t\t/* if not set by sscanf, will be ',' */\n      if (sscanf(arg, \"%d%c%d%c\", &val1, &ch1, &val2, &ch2) < 3)\n\treturn FALSE;\n      if ((ch1 != 'x' && ch1 != 'X') || ch2 != ',') /* syntax check */\n\treturn FALSE;\n      if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) {\n\tfprintf(stderr, \"JPEG sampling factors must be 1..4\\n\");\n\treturn FALSE;\n      }\n      cinfo->comp_info[ci].h_samp_factor = val1;\n      cinfo->comp_info[ci].v_samp_factor = val2;\n      while (*arg && *arg++ != ',') /* advance to next segment of arg string */\n\t;\n    } else {\n      /* reached end of parameter, set remaining components to 1x1 sampling */\n      cinfo->comp_info[ci].h_samp_factor = 1;\n      cinfo->comp_info[ci].v_samp_factor = 1;\n    }\n  }\n  return TRUE;\n}\n"
  },
  {
    "path": "rdtarga.c",
    "content": "/*\n * rdtarga.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to read input images in Targa format.\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume input from\n * an ordinary stdio stream.  They further assume that reading begins\n * at the start of the file; start_input may need work if the\n * user interface has already read some data (e.g., to determine that\n * the file is indeed Targa format).\n *\n * Based on code contributed by Lee Daniel Crocker.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef TARGA_SUPPORTED\n\n\n/* Macros to deal with unsigned chars as efficiently as compiler allows */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char U_CHAR;\n#define UCH(x)\t((int) (x))\n#else /* !HAVE_UNSIGNED_CHAR */\n#ifdef CHAR_IS_UNSIGNED\ntypedef char U_CHAR;\n#define UCH(x)\t((int) (x))\n#else\ntypedef char U_CHAR;\n#define UCH(x)\t((int) (x) & 0xFF)\n#endif\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n#define\tReadOK(file,buffer,len)\t(JFREAD(file,buffer,len) == ((size_t) (len)))\n\n\n/* Private version of data source object */\n\ntypedef struct _tga_source_struct * tga_source_ptr;\n\ntypedef struct _tga_source_struct {\n  struct cjpeg_source_struct pub; /* public fields */\n\n  j_compress_ptr cinfo;\t\t/* back link saves passing separate parm */\n\n  JSAMPARRAY colormap;\t\t/* Targa colormap (converted to my format) */\n\n  jvirt_sarray_ptr whole_image;\t/* Needed if funny input row order */\n  JDIMENSION current_row;\t/* Current logical row number to read */\n\n  /* Pointer to routine to extract next Targa pixel from input file */\n  JMETHOD(void, read_pixel, (tga_source_ptr sinfo));\n\n  /* Result of read_pixel is delivered here: */\n  U_CHAR tga_pixel[4];\n\n  int pixel_size;\t\t/* Bytes per Targa pixel (1 to 4) */\n\n  /* State info for reading RLE-coded pixels; both counts must be init to 0 */\n  int block_count;\t\t/* # of pixels remaining in RLE block */\n  int dup_pixel_count;\t\t/* # of times to duplicate previous pixel */\n\n  /* This saves the correct pixel-row-expansion method for preload_image */\n  JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,\n\t\t\t\t       cjpeg_source_ptr sinfo));\n} tga_source_struct;\n\n\n/* For expanding 5-bit pixel values to 8-bit with best rounding */\n\nstatic const UINT8 c5to8bits[32] = {\n    0,   8,  16,  25,  33,  41,  49,  58,\n   66,  74,  82,  90,  99, 107, 115, 123,\n  132, 140, 148, 156, 165, 173, 181, 189,\n  197, 206, 214, 222, 230, 239, 247, 255\n};\n\n\n\nLOCAL(int)\nread_byte (tga_source_ptr sinfo)\n/* Read next byte from Targa file */\n{\n  register FILE *infile = sinfo->pub.input_file;\n  register int c;\n\n  if ((c = getc(infile)) == EOF)\n    ERREXIT(sinfo->cinfo, JERR_INPUT_EOF);\n  return c;\n}\n\n\nLOCAL(void)\nread_colormap (tga_source_ptr sinfo, int cmaplen, int mapentrysize)\n/* Read the colormap from a Targa file */\n{\n  int i;\n\n  /* Presently only handles 24-bit BGR format */\n  if (mapentrysize != 24)\n    ERREXIT(sinfo->cinfo, JERR_TGA_BADCMAP);\n\n  for (i = 0; i < cmaplen; i++) {\n    sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);\n    sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);\n    sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);\n  }\n}\n\n\n/*\n * read_pixel methods: get a single pixel from Targa file into tga_pixel[]\n */\n\nMETHODDEF(void)\nread_non_rle_pixel (tga_source_ptr sinfo)\n/* Read one Targa pixel from the input file; no RLE expansion */\n{\n  register FILE *infile = sinfo->pub.input_file;\n  register int i;\n\n  for (i = 0; i < sinfo->pixel_size; i++) {\n    sinfo->tga_pixel[i] = (U_CHAR) getc(infile);\n  }\n}\n\n\nMETHODDEF(void)\nread_rle_pixel (tga_source_ptr sinfo)\n/* Read one Targa pixel from the input file, expanding RLE data as needed */\n{\n  register FILE *infile = sinfo->pub.input_file;\n  register int i;\n\n  /* Duplicate previously read pixel? */\n  if (sinfo->dup_pixel_count > 0) {\n    sinfo->dup_pixel_count--;\n    return;\n  }\n\n  /* Time to read RLE block header? */\n  if (--sinfo->block_count < 0) { /* decrement pixels remaining in block */\n    i = read_byte(sinfo);\n    if (i & 0x80) {\t\t/* Start of duplicate-pixel block? */\n      sinfo->dup_pixel_count = i & 0x7F; /* number of dups after this one */\n      sinfo->block_count = 0;\t/* then read new block header */\n    } else {\n      sinfo->block_count = i & 0x7F; /* number of pixels after this one */\n    }\n  }\n\n  /* Read next pixel */\n  for (i = 0; i < sinfo->pixel_size; i++) {\n    sinfo->tga_pixel[i] = (U_CHAR) getc(infile);\n  }\n}\n\n\n/*\n * Read one row of pixels.\n *\n * We provide several different versions depending on input file format.\n */\n\n\nMETHODDEF(JDIMENSION)\nget_8bit_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 8-bit grayscale pixels */\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n  \n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */\n    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]);\n  }\n  return 1;\n}\n\nMETHODDEF(JDIMENSION)\nget_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 8-bit colormap indexes */\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  register int t;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n  register JSAMPARRAY colormap = source->colormap;\n\n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */\n    t = UCH(source->tga_pixel[0]);\n    *ptr++ = colormap[0][t];\n    *ptr++ = colormap[1][t];\n    *ptr++ = colormap[2][t];\n  }\n  return 1;\n}\n\nMETHODDEF(JDIMENSION)\nget_16bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 16-bit pixels */\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  register int t;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n  \n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */\n    t = UCH(source->tga_pixel[0]);\n    t += UCH(source->tga_pixel[1]) << 8;\n    /* We expand 5 bit data to 8 bit sample width.\n     * The format of the 16-bit (LSB first) input word is\n     *     xRRRRRGGGGGBBBBB\n     */\n    ptr[2] = (JSAMPLE) c5to8bits[t & 0x1F];\n    t >>= 5;\n    ptr[1] = (JSAMPLE) c5to8bits[t & 0x1F];\n    t >>= 5;\n    ptr[0] = (JSAMPLE) c5to8bits[t & 0x1F];\n    ptr += 3;\n  }\n  return 1;\n}\n\nMETHODDEF(JDIMENSION)\nget_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 24-bit pixels */\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n  \n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */\n    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[2]); /* change BGR to RGB order */\n    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[1]);\n    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]);\n  }\n  return 1;\n}\n\n/*\n * Targa also defines a 32-bit pixel format with order B,G,R,A.\n * We presently ignore the attribute byte, so the code for reading\n * these pixels is identical to the 24-bit routine above.\n * This works because the actual pixel length is only known to read_pixel.\n */\n\n#define get_32bit_row  get_24bit_row\n\n\n/*\n * This method is for re-reading the input data in standard top-down\n * row order.  The entire image has already been read into whole_image\n * with proper conversion of pixel format, but it's in a funny row order.\n */\n\nMETHODDEF(JDIMENSION)\nget_memory_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  JDIMENSION source_row;\n\n  /* Compute row of source that maps to current_row of normal order */\n  /* For now, assume image is bottom-up and not interlaced. */\n  /* NEEDS WORK to support interlaced images! */\n  source_row = cinfo->image_height - source->current_row - 1;\n\n  /* Fetch that row from virtual array */\n  source->pub.buffer = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->whole_image,\n     source_row, (JDIMENSION) 1, FALSE);\n\n  source->current_row++;\n  return 1;\n}\n\n\n/*\n * This method loads the image into whole_image during the first call on\n * get_pixel_rows.  The get_pixel_rows pointer is then adjusted to call\n * get_memory_row on subsequent calls.\n */\n\nMETHODDEF(JDIMENSION)\npreload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  JDIMENSION row;\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n\n  /* Read the data into a virtual array in input-file row order. */\n  for (row = 0; row < cinfo->image_height; row++) {\n    if (progress != NULL) {\n      progress->pub.pass_counter = (long) row;\n      progress->pub.pass_limit = (long) cinfo->image_height;\n      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n    }\n    source->pub.buffer = (*cinfo->mem->access_virt_sarray)\n      ((j_common_ptr) cinfo, source->whole_image, row, (JDIMENSION) 1, TRUE);\n    (*source->get_pixel_rows) (cinfo, sinfo);\n  }\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n\n  /* Set up to read from the virtual array in unscrambled order */\n  source->pub.get_pixel_rows = get_memory_row;\n  source->current_row = 0;\n  /* And read the first row */\n  return get_memory_row(cinfo, sinfo);\n}\n\n\n/*\n * Read the file header; return image size and component count.\n */\n\nMETHODDEF(void)\nstart_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  U_CHAR targaheader[18];\n  int idlen, cmaptype, subtype, flags, interlace_type, components;\n  unsigned int width, height, maplen;\n  boolean is_bottom_up;\n\n#define GET_2B(offset)\t((unsigned int) UCH(targaheader[offset]) + \\\n\t\t\t (((unsigned int) UCH(targaheader[offset+1])) << 8))\n\n  if (! ReadOK(source->pub.input_file, targaheader, 18))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n\n  /* Pretend \"15-bit\" pixels are 16-bit --- we ignore attribute bit anyway */\n  if (targaheader[16] == 15)\n    targaheader[16] = 16;\n\n  idlen = UCH(targaheader[0]);\n  cmaptype = UCH(targaheader[1]);\n  subtype = UCH(targaheader[2]);\n  maplen = GET_2B(5);\n  width = GET_2B(12);\n  height = GET_2B(14);\n  source->pixel_size = UCH(targaheader[16]) >> 3;\n  flags = UCH(targaheader[17]);\t/* Image Descriptor byte */\n\n  is_bottom_up = ((flags & 0x20) == 0);\t/* bit 5 set => top-down */\n  interlace_type = flags >> 6;\t/* bits 6/7 are interlace code */\n\n  if (cmaptype > 1 ||\t\t/* cmaptype must be 0 or 1 */\n      source->pixel_size < 1 || source->pixel_size > 4 ||\n      (UCH(targaheader[16]) & 7) != 0 || /* bits/pixel must be multiple of 8 */\n      interlace_type != 0)\t/* currently don't allow interlaced image */\n    ERREXIT(cinfo, JERR_TGA_BADPARMS);\n  \n  if (subtype > 8) {\n    /* It's an RLE-coded file */\n    source->read_pixel = read_rle_pixel;\n    source->block_count = source->dup_pixel_count = 0;\n    subtype -= 8;\n  } else {\n    /* Non-RLE file */\n    source->read_pixel = read_non_rle_pixel;\n  }\n\n  /* Now should have subtype 1, 2, or 3 */\n  components = 3;\t\t/* until proven different */\n  cinfo->in_color_space = JCS_RGB;\n\n  switch (subtype) {\n  case 1:\t\t\t/* Colormapped image */\n    if (source->pixel_size == 1 && cmaptype == 1)\n      source->get_pixel_rows = get_8bit_row;\n    else\n      ERREXIT(cinfo, JERR_TGA_BADPARMS);\n    TRACEMS2(cinfo, 1, JTRC_TGA_MAPPED, width, height);\n    break;\n  case 2:\t\t\t/* RGB image */\n    switch (source->pixel_size) {\n    case 2:\n      source->get_pixel_rows = get_16bit_row;\n      break;\n    case 3:\n      source->get_pixel_rows = get_24bit_row;\n      break;\n    case 4:\n      source->get_pixel_rows = get_32bit_row;\n      break;\n    default:\n      ERREXIT(cinfo, JERR_TGA_BADPARMS);\n      break;\n    }\n    TRACEMS2(cinfo, 1, JTRC_TGA, width, height);\n    break;\n  case 3:\t\t\t/* Grayscale image */\n    components = 1;\n    cinfo->in_color_space = JCS_GRAYSCALE;\n    if (source->pixel_size == 1)\n      source->get_pixel_rows = get_8bit_gray_row;\n    else\n      ERREXIT(cinfo, JERR_TGA_BADPARMS);\n    TRACEMS2(cinfo, 1, JTRC_TGA_GRAY, width, height);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_TGA_BADPARMS);\n    break;\n  }\n\n  if (is_bottom_up) {\n    /* Create a virtual array to buffer the upside-down image. */\n    source->whole_image = (*cinfo->mem->request_virt_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n       (JDIMENSION) width * components, (JDIMENSION) height, (JDIMENSION) 1);\n    if (cinfo->progress != NULL) {\n      cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n      progress->total_extra_passes++; /* count file input as separate pass */\n    }\n    /* source->pub.buffer will point to the virtual array. */\n    source->pub.buffer_height = 1; /* in case anyone looks at it */\n    source->pub.get_pixel_rows = preload_image;\n  } else {\n    /* Don't need a virtual array, but do need a one-row input buffer. */\n    source->whole_image = NULL;\n    source->pub.buffer = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) width * components, (JDIMENSION) 1);\n    source->pub.buffer_height = 1;\n    source->pub.get_pixel_rows = source->get_pixel_rows;\n  }\n  \n  while (idlen--)\t\t/* Throw away ID field */\n    (void) read_byte(source);\n\n  if (maplen > 0) {\n    if (maplen > 256 || GET_2B(3) != 0)\n      ERREXIT(cinfo, JERR_TGA_BADCMAP);\n    /* Allocate space to store the colormap */\n    source->colormap = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) maplen, (JDIMENSION) 3);\n    /* and read it from the file */\n    read_colormap(source, (int) maplen, UCH(targaheader[7]));\n  } else {\n    if (cmaptype)\t\t/* but you promised a cmap! */\n      ERREXIT(cinfo, JERR_TGA_BADPARMS);\n    source->colormap = NULL;\n  }\n\n  cinfo->input_components = components;\n  cinfo->data_precision = 8;\n  cinfo->image_width = width;\n  cinfo->image_height = height;\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  /* no work */\n}\n\n\n/*\n * The module selection routine for Targa format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_targa (j_compress_ptr cinfo)\n{\n  tga_source_ptr source;\n\n  /* Create module interface object */\n  source = (tga_source_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(tga_source_struct));\n  source->cinfo = cinfo;\t/* make back link for subroutines */\n  /* Fill in method ptrs, except get_pixel_rows which start_input sets */\n  source->pub.start_input = start_input_tga;\n  source->pub.finish_input = finish_input_tga;\n\n  return (cjpeg_source_ptr) source;\n}\n\n#endif /* TARGA_SUPPORTED */\n"
  },
  {
    "path": "structure.txt",
    "content": "IJG JPEG LIBRARY:  SYSTEM ARCHITECTURE\n\nCopyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding.\nThis file is part of the Independent JPEG Group's software.\nFor conditions of distribution and use, see the accompanying README file.\n\n\nThis file provides an overview of the architecture of the IJG JPEG software;\nthat is, the functions of the various modules in the system and the interfaces\nbetween modules.  For more precise details about any data structure or calling\nconvention, see the include files and comments in the source code.\n\nWe assume that the reader is already somewhat familiar with the JPEG standard.\nThe README file includes references for learning about JPEG.  The file\nlibjpeg.txt describes the library from the viewpoint of an application\nprogrammer using the library; it's best to read that file before this one.\nAlso, the file coderules.txt describes the coding style conventions we use.\n\nIn this document, JPEG-specific terminology follows the JPEG standard:\n  A \"component\" means a color channel, e.g., Red or Luminance.\n  A \"sample\" is a single component value (i.e., one number in the image data).\n  A \"coefficient\" is a frequency coefficient (a DCT transform output number).\n  A \"block\" is an array of samples or coefficients.\n  An \"MCU\" (minimum coded unit) is an interleaved set of blocks of size\n\tdetermined by the sampling factors, or a single block in a\n\tnoninterleaved scan.\nWe do not use the terms \"pixel\" and \"sample\" interchangeably.  When we say\npixel, we mean an element of the full-size image, while a sample is an element\nof the downsampled image.  Thus the number of samples may vary across\ncomponents while the number of pixels does not.  (This terminology is not used\nrigorously throughout the code, but it is used in places where confusion would\notherwise result.)\n\n\n*** System features ***\n\nThe IJG distribution contains two parts:\n  * A subroutine library for JPEG compression and decompression.\n  * cjpeg/djpeg, two sample applications that use the library to transform\n    JFIF JPEG files to and from several other image formats.\ncjpeg/djpeg are of no great intellectual complexity: they merely add a simple\ncommand-line user interface and I/O routines for several uncompressed image\nformats.  This document concentrates on the library itself.\n\nWe desire the library to be capable of supporting all JPEG baseline, extended\nsequential, and progressive DCT processes.  The library does not support the\nhierarchical or lossless processes defined in the standard.\n\nWithin these limits, any set of compression parameters allowed by the JPEG\nspec should be readable for decompression.  (We can be more restrictive about\nwhat formats we can generate.)  Although the system design allows for all\nparameter values, some uncommon settings are not yet implemented and may\nnever be; nonintegral sampling ratios are the prime example.  Furthermore,\nwe treat 8-bit vs. 12-bit data precision as a compile-time switch, not a\nrun-time option, because most machines can store 8-bit pixels much more\ncompactly than 12-bit.\n\nBy itself, the library handles only interchange JPEG datastreams --- in\nparticular the widely used JFIF file format.  The library can be used by\nsurrounding code to process interchange or abbreviated JPEG datastreams that\nare embedded in more complex file formats.  (For example, libtiff uses this\nlibrary to implement JPEG compression within the TIFF file format.)\n\nThe library includes a substantial amount of code that is not covered by the\nJPEG standard but is necessary for typical applications of JPEG.  These\nfunctions preprocess the image before JPEG compression or postprocess it after\ndecompression.  They include colorspace conversion, downsampling/upsampling,\nand color quantization.  This code can be omitted if not needed.\n\nA wide range of quality vs. speed tradeoffs are possible in JPEG processing,\nand even more so in decompression postprocessing.  The decompression library\nprovides multiple implementations that cover most of the useful tradeoffs,\nranging from very-high-quality down to fast-preview operation.  On the\ncompression side we have generally not provided low-quality choices, since\ncompression is normally less time-critical.  It should be understood that the\nlow-quality modes may not meet the JPEG standard's accuracy requirements;\nnonetheless, they are useful for viewers.\n\n\n*** Portability issues ***\n\nPortability is an essential requirement for the library.  The key portability\nissues that show up at the level of system architecture are:\n\n1.  Memory usage.  We want the code to be able to run on PC-class machines\nwith limited memory.  Images should therefore be processed sequentially (in\nstrips), to avoid holding the whole image in memory at once.  Where a\nfull-image buffer is necessary, we should be able to use either virtual memory\nor temporary files.\n\n2.  Near/far pointer distinction.  To run efficiently on 80x86 machines, the\ncode should distinguish \"small\" objects (kept in near data space) from\n\"large\" ones (kept in far data space).  This is an annoying restriction, but\nfortunately it does not impact code quality for less brain-damaged machines,\nand the source code clutter turns out to be minimal with sufficient use of\npointer typedefs.\n\n3. Data precision.  We assume that \"char\" is at least 8 bits, \"short\" and\n\"int\" at least 16, \"long\" at least 32.  The code will work fine with larger\ndata sizes, although memory may be used inefficiently in some cases.  However,\nthe JPEG compressed datastream must ultimately appear on external storage as a\nsequence of 8-bit bytes if it is to conform to the standard.  This may pose a\nproblem on machines where char is wider than 8 bits.  The library represents\ncompressed data as an array of values of typedef JOCTET.  If no data type\nexactly 8 bits wide is available, custom data source and data destination\nmodules must be written to unpack and pack the chosen JOCTET datatype into\n8-bit external representation.\n\n\n*** System overview ***\n\nThe compressor and decompressor are each divided into two main sections:\nthe JPEG compressor or decompressor proper, and the preprocessing or\npostprocessing functions.  The interface between these two sections is the\nimage data that the official JPEG spec regards as its input or output: this\ndata is in the colorspace to be used for compression, and it is downsampled\nto the sampling factors to be used.  The preprocessing and postprocessing\nsteps are responsible for converting a normal image representation to or from\nthis form.  (Those few applications that want to deal with YCbCr downsampled\ndata can skip the preprocessing or postprocessing step.)\n\nLooking more closely, the compressor library contains the following main\nelements:\n\n  Preprocessing:\n    * Color space conversion (e.g., RGB to YCbCr).\n    * Edge expansion and downsampling.  Optionally, this step can do simple\n      smoothing --- this is often helpful for low-quality source data.\n  JPEG proper:\n    * MCU assembly, DCT, quantization.\n    * Entropy coding (sequential or progressive, Huffman or arithmetic).\n\nIn addition to these modules we need overall control, marker generation,\nand support code (memory management & error handling).  There is also a\nmodule responsible for physically writing the output data --- typically\nthis is just an interface to fwrite(), but some applications may need to\ndo something else with the data.\n\nThe decompressor library contains the following main elements:\n\n  JPEG proper:\n    * Entropy decoding (sequential or progressive, Huffman or arithmetic).\n    * Dequantization, inverse DCT, MCU disassembly.\n  Postprocessing:\n    * Upsampling.  Optionally, this step may be able to do more general\n      rescaling of the image.\n    * Color space conversion (e.g., YCbCr to RGB).  This step may also\n      provide gamma adjustment [ currently it does not ].\n    * Optional color quantization (e.g., reduction to 256 colors).\n    * Optional color precision reduction (e.g., 24-bit to 15-bit color).\n      [This feature is not currently implemented.]\n\nWe also need overall control, marker parsing, and a data source module.\nThe support code (memory management & error handling) can be shared with\nthe compression half of the library.\n\nThere may be several implementations of each of these elements, particularly\nin the decompressor, where a wide range of speed/quality tradeoffs is very\nuseful.  It must be understood that some of the best speedups involve\nmerging adjacent steps in the pipeline.  For example, upsampling, color space\nconversion, and color quantization might all be done at once when using a\nlow-quality ordered-dither technique.  The system architecture is designed to\nallow such merging where appropriate.\n\n\nNote: it is convenient to regard edge expansion (padding to block boundaries)\nas a preprocessing/postprocessing function, even though the JPEG spec includes\nit in compression/decompression.  We do this because downsampling/upsampling\ncan be simplified a little if they work on padded data: it's not necessary to\nhave special cases at the right and bottom edges.  Therefore the interface\nbuffer is always an integral number of blocks wide and high, and we expect\ncompression preprocessing to pad the source data properly.  Padding will occur\nonly to the next block (block_size-sample) boundary.  In an interleaved-scan\nsituation, additional dummy blocks may be used to fill out MCUs, but the MCU\nassembly and disassembly logic will create or discard these blocks internally.\n(This is advantageous for speed reasons, since we avoid DCTing the dummy\nblocks.  It also permits a small reduction in file size, because the\ncompressor can choose dummy block contents so as to minimize their size\nin compressed form.  Finally, it makes the interface buffer specification\nindependent of whether the file is actually interleaved or not.)\nApplications that wish to deal directly with the downsampled data must\nprovide similar buffering and padding for odd-sized images.\n\n\n*** Poor man's object-oriented programming ***\n\nIt should be clear by now that we have a lot of quasi-independent processing\nsteps, many of which have several possible behaviors.  To avoid cluttering the\ncode with lots of switch statements, we use a simple form of object-style\nprogramming to separate out the different possibilities.\n\nFor example, two different color quantization algorithms could be implemented\nas two separate modules that present the same external interface; at runtime,\nthe calling code will access the proper module indirectly through an \"object\".\n\nWe can get the limited features we need while staying within portable C.\nThe basic tool is a function pointer.  An \"object\" is just a struct\ncontaining one or more function pointer fields, each of which corresponds to\na method name in real object-oriented languages.  During initialization we\nfill in the function pointers with references to whichever module we have\ndetermined we need to use in this run.  Then invocation of the module is done\nby indirecting through a function pointer; on most machines this is no more\nexpensive than a switch statement, which would be the only other way of\nmaking the required run-time choice.  The really significant benefit, of\ncourse, is keeping the source code clean and well structured.\n\nWe can also arrange to have private storage that varies between different\nimplementations of the same kind of object.  We do this by making all the\nmodule-specific object structs be separately allocated entities, which will\nbe accessed via pointers in the master compression or decompression struct.\nThe \"public\" fields or methods for a given kind of object are specified by\na commonly known struct.  But a module's initialization code can allocate\na larger struct that contains the common struct as its first member, plus\nadditional private fields.  With appropriate pointer casting, the module's\ninternal functions can access these private fields.  (For a simple example,\nsee jdatadst.c, which implements the external interface specified by struct\njpeg_destination_mgr, but adds extra fields.)\n\n(Of course this would all be a lot easier if we were using C++, but we are\nnot yet prepared to assume that everyone has a C++ compiler.)\n\nAn important benefit of this scheme is that it is easy to provide multiple\nversions of any method, each tuned to a particular case.  While a lot of\nprecalculation might be done to select an optimal implementation of a method,\nthe cost per invocation is constant.  For example, the upsampling step might\nhave a \"generic\" method, plus one or more \"hardwired\" methods for the most\npopular sampling factors; the hardwired methods would be faster because they'd\nuse straight-line code instead of for-loops.  The cost to determine which\nmethod to use is paid only once, at startup, and the selection criteria are\nhidden from the callers of the method.\n\nThis plan differs a little bit from usual object-oriented structures, in that\nonly one instance of each object class will exist during execution.  The\nreason for having the class structure is that on different runs we may create\ndifferent instances (choose to execute different modules).  You can think of\nthe term \"method\" as denoting the common interface presented by a particular\nset of interchangeable functions, and \"object\" as denoting a group of related\nmethods, or the total shared interface behavior of a group of modules.\n\n\n*** Overall control structure ***\n\nWe previously mentioned the need for overall control logic in the compression\nand decompression libraries.  In IJG implementations prior to v5, overall\ncontrol was mostly provided by \"pipeline control\" modules, which proved to be\nlarge, unwieldy, and hard to understand.  To improve the situation, the\ncontrol logic has been subdivided into multiple modules.  The control modules\nconsist of:\n\n1. Master control for module selection and initialization.  This has two\nresponsibilities:\n\n   1A.  Startup initialization at the beginning of image processing.\n        The individual processing modules to be used in this run are selected\n        and given initialization calls.\n\n   1B.  Per-pass control.  This determines how many passes will be performed\n        and calls each active processing module to configure itself\n        appropriately at the beginning of each pass.  End-of-pass processing,\n\twhere necessary, is also invoked from the master control module.\n\n   Method selection is partially distributed, in that a particular processing\n   module may contain several possible implementations of a particular method,\n   which it will select among when given its initialization call.  The master\n   control code need only be concerned with decisions that affect more than\n   one module.\n \n2. Data buffering control.  A separate control module exists for each\n   inter-processing-step data buffer.  This module is responsible for\n   invoking the processing steps that write or read that data buffer.\n\nEach buffer controller sees the world as follows:\n\ninput data => processing step A => buffer => processing step B => output data\n                      |              |               |\n              ------------------ controller ------------------\n\nThe controller knows the dataflow requirements of steps A and B: how much data\nthey want to accept in one chunk and how much they output in one chunk.  Its\nfunction is to manage its buffer and call A and B at the proper times.\n\nA data buffer control module may itself be viewed as a processing step by a\nhigher-level control module; thus the control modules form a binary tree with\nelementary processing steps at the leaves of the tree.\n\nThe control modules are objects.  A considerable amount of flexibility can\nbe had by replacing implementations of a control module.  For example:\n* Merging of adjacent steps in the pipeline is done by replacing a control\n  module and its pair of processing-step modules with a single processing-\n  step module.  (Hence the possible merges are determined by the tree of\n  control modules.)\n* In some processing modes, a given interstep buffer need only be a \"strip\"\n  buffer large enough to accommodate the desired data chunk sizes.  In other\n  modes, a full-image buffer is needed and several passes are required.\n  The control module determines which kind of buffer is used and manipulates\n  virtual array buffers as needed.  One or both processing steps may be\n  unaware of the multi-pass behavior.\n\nIn theory, we might be able to make all of the data buffer controllers\ninterchangeable and provide just one set of implementations for all.  In\npractice, each one contains considerable special-case processing for its\nparticular job.  The buffer controller concept should be regarded as an\noverall system structuring principle, not as a complete description of the\ntask performed by any one controller.\n\n\n*** Compression object structure ***\n\nHere is a sketch of the logical structure of the JPEG compression library:\n\n                                                 |-- Colorspace conversion\n                  |-- Preprocessing controller --|\n                  |                              |-- Downsampling\nMain controller --|\n                  |                            |-- Forward DCT, quantize\n                  |-- Coefficient controller --|\n                                               |-- Entropy encoding\n\nThis sketch also describes the flow of control (subroutine calls) during\ntypical image data processing.  Each of the components shown in the diagram is\nan \"object\" which may have several different implementations available.  One\nor more source code files contain the actual implementation(s) of each object.\n\nThe objects shown above are:\n\n* Main controller: buffer controller for the subsampled-data buffer, which\n  holds the preprocessed input data.  This controller invokes preprocessing to\n  fill the subsampled-data buffer, and JPEG compression to empty it.  There is\n  usually no need for a full-image buffer here; a strip buffer is adequate.\n\n* Preprocessing controller: buffer controller for the downsampling input data\n  buffer, which lies between colorspace conversion and downsampling.  Note\n  that a unified conversion/downsampling module would probably replace this\n  controller entirely.\n\n* Colorspace conversion: converts application image data into the desired\n  JPEG color space; also changes the data from pixel-interleaved layout to\n  separate component planes.  Processes one pixel row at a time.\n\n* Downsampling: performs reduction of chroma components as required.\n  Optionally may perform pixel-level smoothing as well.  Processes a \"row\n  group\" at a time, where a row group is defined as Vmax pixel rows of each\n  component before downsampling, and Vk sample rows afterwards (remember Vk\n  differs across components).  Some downsampling or smoothing algorithms may\n  require context rows above and below the current row group; the\n  preprocessing controller is responsible for supplying these rows via proper\n  buffering.  The downsampler is responsible for edge expansion at the right\n  edge (i.e., extending each sample row to a multiple of block_size samples);\n  but the preprocessing controller is responsible for vertical edge expansion\n  (i.e., duplicating the bottom sample row as needed to make a multiple of\n  block_size rows).\n\n* Coefficient controller: buffer controller for the DCT-coefficient data.\n  This controller handles MCU assembly, including insertion of dummy DCT\n  blocks when needed at the right or bottom edge.  When performing\n  Huffman-code optimization or emitting a multiscan JPEG file, this\n  controller is responsible for buffering the full image.  The equivalent of\n  one fully interleaved MCU row of subsampled data is processed per call,\n  even when the JPEG file is noninterleaved.\n\n* Forward DCT and quantization: Perform DCT, quantize, and emit coefficients.\n  Works on one or more DCT blocks at a time.  (Note: the coefficients are now\n  emitted in normal array order, which the entropy encoder is expected to\n  convert to zigzag order as necessary.  Prior versions of the IJG code did\n  the conversion to zigzag order within the quantization step.)\n\n* Entropy encoding: Perform Huffman or arithmetic entropy coding and emit the\n  coded data to the data destination module.  Works on one MCU per call.\n  For progressive JPEG, the same DCT blocks are fed to the entropy coder\n  during each pass, and the coder must emit the appropriate subset of\n  coefficients.\n\nIn addition to the above objects, the compression library includes these\nobjects:\n\n* Master control: determines the number of passes required, controls overall\n  and per-pass initialization of the other modules.\n\n* Marker writing: generates JPEG markers (except for RSTn, which is emitted\n  by the entropy encoder when needed).\n\n* Data destination manager: writes the output JPEG datastream to its final\n  destination (e.g., a file).  The destination manager supplied with the\n  library knows how to write to a stdio stream or to a memory buffer;\n  for other behaviors, the surrounding application may provide its own\n  destination manager.\n\n* Memory manager: allocates and releases memory, controls virtual arrays\n  (with backing store management, where required).\n\n* Error handler: performs formatting and output of error and trace messages;\n  determines handling of nonfatal errors.  The surrounding application may\n  override some or all of this object's methods to change error handling.\n\n* Progress monitor: supports output of \"percent-done\" progress reports.\n  This object represents an optional callback to the surrounding application:\n  if wanted, it must be supplied by the application.\n\nThe error handler, destination manager, and progress monitor objects are\ndefined as separate objects in order to simplify application-specific\ncustomization of the JPEG library.  A surrounding application may override\nindividual methods or supply its own all-new implementation of one of these\nobjects.  The object interfaces for these objects are therefore treated as\npart of the application interface of the library, whereas the other objects\nare internal to the library.\n\nThe error handler and memory manager are shared by JPEG compression and\ndecompression; the progress monitor, if used, may be shared as well.\n\n\n*** Decompression object structure ***\n\nHere is a sketch of the logical structure of the JPEG decompression library:\n\n                                               |-- Entropy decoding\n                  |-- Coefficient controller --|\n                  |                            |-- Dequantize, Inverse DCT\nMain controller --|\n                  |                               |-- Upsampling\n                  |-- Postprocessing controller --|   |-- Colorspace conversion\n                                                  |-- Color quantization\n                                                  |-- Color precision reduction\n\nAs before, this diagram also represents typical control flow.  The objects\nshown are:\n\n* Main controller: buffer controller for the subsampled-data buffer, which\n  holds the output of JPEG decompression proper.  This controller's primary\n  task is to feed the postprocessing procedure.  Some upsampling algorithms\n  may require context rows above and below the current row group; when this\n  is true, the main controller is responsible for managing its buffer so as\n  to make context rows available.  In the current design, the main buffer is\n  always a strip buffer; a full-image buffer is never required.\n\n* Coefficient controller: buffer controller for the DCT-coefficient data.\n  This controller handles MCU disassembly, including deletion of any dummy\n  DCT blocks at the right or bottom edge.  When reading a multiscan JPEG\n  file, this controller is responsible for buffering the full image.\n  (Buffering DCT coefficients, rather than samples, is necessary to support\n  progressive JPEG.)  The equivalent of one fully interleaved MCU row of\n  subsampled data is processed per call, even when the source JPEG file is\n  noninterleaved.\n\n* Entropy decoding: Read coded data from the data source module and perform\n  Huffman or arithmetic entropy decoding.  Works on one MCU per call.\n  For progressive JPEG decoding, the coefficient controller supplies the prior\n  coefficients of each MCU (initially all zeroes), which the entropy decoder\n  modifies in each scan.\n\n* Dequantization and inverse DCT: like it says.  Note that the coefficients\n  buffered by the coefficient controller have NOT been dequantized; we\n  merge dequantization and inverse DCT into a single step for speed reasons.\n  When scaled-down output is asked for, simplified DCT algorithms may be used\n  that need fewer coefficients and emit fewer samples per DCT block, not the\n  full 8x8.  Works on one DCT block at a time.\n\n* Postprocessing controller: buffer controller for the color quantization\n  input buffer, when quantization is in use.  (Without quantization, this\n  controller just calls the upsampler.)  For two-pass quantization, this\n  controller is responsible for buffering the full-image data.\n\n* Upsampling: restores chroma components to full size.  (May support more\n  general output rescaling, too.  Note that if undersized DCT outputs have\n  been emitted by the DCT module, this module must adjust so that properly\n  sized outputs are created.)  Works on one row group at a time.  This module\n  also calls the color conversion module, so its top level is effectively a\n  buffer controller for the upsampling->color conversion buffer.  However, in\n  all but the highest-quality operating modes, upsampling and color\n  conversion are likely to be merged into a single step.\n\n* Colorspace conversion: convert from JPEG color space to output color space,\n  and change data layout from separate component planes to pixel-interleaved.\n  Works on one pixel row at a time.\n\n* Color quantization: reduce the data to colormapped form, using either an\n  externally specified colormap or an internally generated one.  This module\n  is not used for full-color output.  Works on one pixel row at a time; may\n  require two passes to generate a color map.  Note that the output will\n  always be a single component representing colormap indexes.  In the current\n  design, the output values are JSAMPLEs, so an 8-bit compilation cannot\n  quantize to more than 256 colors.  This is unlikely to be a problem in\n  practice.\n\n* Color reduction: this module handles color precision reduction, e.g.,\n  generating 15-bit color (5 bits/primary) from JPEG's 24-bit output.\n  Not quite clear yet how this should be handled... should we merge it with\n  colorspace conversion???\n\nNote that some high-speed operating modes might condense the entire\npostprocessing sequence to a single module (upsample, color convert, and\nquantize in one step).\n\nIn addition to the above objects, the decompression library includes these\nobjects:\n\n* Master control: determines the number of passes required, controls overall\n  and per-pass initialization of the other modules.  This is subdivided into\n  input and output control: jdinput.c controls only input-side processing,\n  while jdmaster.c handles overall initialization and output-side control.\n\n* Marker reading: decodes JPEG markers (except for RSTn).\n\n* Data source manager: supplies the input JPEG datastream.  The source\n  manager supplied with the library knows how to read from a stdio stream\n  or from a memory buffer;  for other behaviors, the surrounding application\n  may provide its own source manager.\n\n* Memory manager: same as for compression library.\n\n* Error handler: same as for compression library.\n\n* Progress monitor: same as for compression library.\n\nAs with compression, the data source manager, error handler, and progress\nmonitor are candidates for replacement by a surrounding application.\n\n\n*** Decompression input and output separation ***\n\nTo support efficient incremental display of progressive JPEG files, the\ndecompressor is divided into two sections that can run independently:\n\n1. Data input includes marker parsing, entropy decoding, and input into the\n   coefficient controller's DCT coefficient buffer.  Note that this\n   processing is relatively cheap and fast.\n\n2. Data output reads from the DCT coefficient buffer and performs the IDCT\n   and all postprocessing steps.\n\nFor a progressive JPEG file, the data input processing is allowed to get\narbitrarily far ahead of the data output processing.  (This occurs only\nif the application calls jpeg_consume_input(); otherwise input and output\nrun in lockstep, since the input section is called only when the output\nsection needs more data.)  In this way the application can avoid making\nextra display passes when data is arriving faster than the display pass\ncan run.  Furthermore, it is possible to abort an output pass without\nlosing anything, since the coefficient buffer is read-only as far as the\noutput section is concerned.  See libjpeg.txt for more detail.\n\nA full-image coefficient array is only created if the JPEG file has multiple\nscans (or if the application specifies buffered-image mode anyway).  When\nreading a single-scan file, the coefficient controller normally creates only\na one-MCU buffer, so input and output processing must run in lockstep in this\ncase.  jpeg_consume_input() is effectively a no-op in this situation.\n\nThe main impact of dividing the decompressor in this fashion is that we must\nbe very careful with shared variables in the cinfo data structure.  Each\nvariable that can change during the course of decompression must be\nclassified as belonging to data input or data output, and each section must\nlook only at its own variables.  For example, the data output section may not\ndepend on any of the variables that describe the current scan in the JPEG\nfile, because these may change as the data input section advances into a new\nscan.\n\nThe progress monitor is (somewhat arbitrarily) defined to treat input of the\nfile as one pass when buffered-image mode is not used, and to ignore data\ninput work completely when buffered-image mode is used.  Note that the\nlibrary has no reliable way to predict the number of passes when dealing\nwith a progressive JPEG file, nor can it predict the number of output passes\nin buffered-image mode.  So the work estimate is inherently bogus anyway.\n\nNo comparable division is currently made in the compression library, because\nthere isn't any real need for it.\n\n\n*** Data formats ***\n\nArrays of pixel sample values use the following data structure:\n\n    typedef something JSAMPLE;\t\ta pixel component value, 0..MAXJSAMPLE\n    typedef JSAMPLE *JSAMPROW;\t\tptr to a row of samples\n    typedef JSAMPROW *JSAMPARRAY;\tptr to a list of rows\n    typedef JSAMPARRAY *JSAMPIMAGE;\tptr to a list of color-component arrays\n\nThe basic element type JSAMPLE will typically be one of unsigned char,\n(signed) char, or short.  Short will be used if samples wider than 8 bits are\nto be supported (this is a compile-time option).  Otherwise, unsigned char is\nused if possible.  If the compiler only supports signed chars, then it is\nnecessary to mask off the value when reading.  Thus, all reads of JSAMPLE\nvalues must be coded as \"GETJSAMPLE(value)\", where the macro will be defined\nas \"((value) & 0xFF)\" on signed-char machines and \"((int) (value))\" elsewhere.\n\nWith these conventions, JSAMPLE values can be assumed to be >= 0.  This helps\nsimplify correct rounding during downsampling, etc.  The JPEG standard's\nspecification that sample values run from -128..127 is accommodated by\nsubtracting 128 from the sample value in the DCT step.  Similarly, during\ndecompression the output of the IDCT step will be immediately shifted back to\n0..255.  (NB: different values are required when 12-bit samples are in use.\nThe code is written in terms of MAXJSAMPLE and CENTERJSAMPLE, which will be\ndefined as 255 and 128 respectively in an 8-bit implementation, and as 4095\nand 2048 in a 12-bit implementation.)\n\nWe use a pointer per row, rather than a two-dimensional JSAMPLE array.  This\nchoice costs only a small amount of memory and has several benefits:\n* Code using the data structure doesn't need to know the allocated width of\n  the rows.  This simplifies edge expansion/compression, since we can work\n  in an array that's wider than the logical picture width.\n* Indexing doesn't require multiplication; this is a performance win on many\n  machines.\n* Arrays with more than 64K total elements can be supported even on machines\n  where malloc() cannot allocate chunks larger than 64K.\n* The rows forming a component array may be allocated at different times\n  without extra copying.  This trick allows some speedups in smoothing steps\n  that need access to the previous and next rows.\n\nNote that each color component is stored in a separate array; we don't use the\ntraditional layout in which the components of a pixel are stored together.\nThis simplifies coding of modules that work on each component independently,\nbecause they don't need to know how many components there are.  Furthermore,\nwe can read or write each component to a temporary file independently, which\nis helpful when dealing with noninterleaved JPEG files.\n\nIn general, a specific sample value is accessed by code such as\n\tGETJSAMPLE(image[colorcomponent][row][col])\nwhere col is measured from the image left edge, but row is measured from the\nfirst sample row currently in memory.  Either of the first two indexings can\nbe precomputed by copying the relevant pointer.\n\n\nSince most image-processing applications prefer to work on images in which\nthe components of a pixel are stored together, the data passed to or from the\nsurrounding application uses the traditional convention: a single pixel is\nrepresented by N consecutive JSAMPLE values, and an image row is an array of\n(# of color components)*(image width) JSAMPLEs.  One or more rows of data can\nbe represented by a pointer of type JSAMPARRAY in this scheme.  This scheme is\nconverted to component-wise storage inside the JPEG library.  (Applications\nthat want to skip JPEG preprocessing or postprocessing will have to contend\nwith component-wise storage.)\n\n\nArrays of DCT-coefficient values use the following data structure:\n\n    typedef short JCOEF;\t\ta 16-bit signed integer\n    typedef JCOEF JBLOCK[DCTSIZE2];\tan 8x8 block of coefficients\n    typedef JBLOCK *JBLOCKROW;\t\tptr to one horizontal row of 8x8 blocks\n    typedef JBLOCKROW *JBLOCKARRAY;\tptr to a list of such rows\n    typedef JBLOCKARRAY *JBLOCKIMAGE;\tptr to a list of color component arrays\n\nThe underlying type is at least a 16-bit signed integer; while \"short\" is big\nenough on all machines of interest, on some machines it is preferable to use\n\"int\" for speed reasons, despite the storage cost.  Coefficients are grouped\ninto 8x8 blocks (but we always use #defines DCTSIZE and DCTSIZE2 rather than\n\"8\" and \"64\").\n\nThe contents of a coefficient block may be in either \"natural\" or zigzagged\norder, and may be true values or divided by the quantization coefficients,\ndepending on where the block is in the processing pipeline.  In the current\nlibrary, coefficient blocks are kept in natural order everywhere; the entropy\ncodecs zigzag or dezigzag the data as it is written or read.  The blocks\ncontain quantized coefficients everywhere outside the DCT/IDCT subsystems.\n(This latter decision may need to be revisited to support variable\nquantization a la JPEG Part 3.)\n\nNotice that the allocation unit is now a row of 8x8 coefficient blocks,\ncorresponding to block_size rows of samples.  Otherwise the structure\nis much the same as for samples, and for the same reasons.\n\nOn machines where malloc() can't handle a request bigger than 64Kb, this data\nstructure limits us to rows of less than 512 JBLOCKs, or a picture width of\n4000+ pixels.  This seems an acceptable restriction.\n\n\nOn 80x86 machines, the bottom-level pointer types (JSAMPROW and JBLOCKROW)\nmust be declared as \"far\" pointers, but the upper levels can be \"near\"\n(implying that the pointer lists are allocated in the DS segment).\nWe use a #define symbol FAR, which expands to the \"far\" keyword when\ncompiling on 80x86 machines and to nothing elsewhere.\n\n\n*** Suspendable processing ***\n\nIn some applications it is desirable to use the JPEG library as an\nincremental, memory-to-memory filter.  In this situation the data source or\ndestination may be a limited-size buffer, and we can't rely on being able to\nempty or refill the buffer at arbitrary times.  Instead the application would\nlike to have control return from the library at buffer overflow/underrun, and\nthen resume compression or decompression at a later time.\n\nThis scenario is supported for simple cases.  (For anything more complex, we\nrecommend that the application \"bite the bullet\" and develop real multitasking\ncapability.)  The libjpeg.txt file goes into more detail about the usage and\nlimitations of this capability; here we address the implications for library\nstructure.\n\nThe essence of the problem is that the entropy codec (coder or decoder) must\nbe prepared to stop at arbitrary times.  In turn, the controllers that call\nthe entropy codec must be able to stop before having produced or consumed all\nthe data that they normally would handle in one call.  That part is reasonably\nstraightforward: we make the controller call interfaces include \"progress\ncounters\" which indicate the number of data chunks successfully processed, and\nwe require callers to test the counter rather than just assume all of the data\nwas processed.\n\nRather than trying to restart at an arbitrary point, the current Huffman\ncodecs are designed to restart at the beginning of the current MCU after a\nsuspension due to buffer overflow/underrun.  At the start of each call, the\ncodec's internal state is loaded from permanent storage (in the JPEG object\nstructures) into local variables.  On successful completion of the MCU, the\npermanent state is updated.  (This copying is not very expensive, and may even\nlead to *improved* performance if the local variables can be registerized.)\nIf a suspension occurs, the codec simply returns without updating the state,\nthus effectively reverting to the start of the MCU.  Note that this implies\nleaving some data unprocessed in the source/destination buffer (ie, the\ncompressed partial MCU).  The data source/destination module interfaces are\nspecified so as to make this possible.  This also implies that the data buffer\nmust be large enough to hold a worst-case compressed MCU; a couple thousand\nbytes should be enough.\n\nIn a successive-approximation AC refinement scan, the progressive Huffman\ndecoder has to be able to undo assignments of newly nonzero coefficients if it\nsuspends before the MCU is complete, since decoding requires distinguishing\npreviously-zero and previously-nonzero coefficients.  This is a bit tedious\nbut probably won't have much effect on performance.  Other variants of Huffman\ndecoding need not worry about this, since they will just store the same values\nagain if forced to repeat the MCU.\n\nThis approach would probably not work for an arithmetic codec, since its\nmodifiable state is quite large and couldn't be copied cheaply.  Instead it\nwould have to suspend and resume exactly at the point of the buffer end.\n\nThe JPEG marker reader is designed to cope with suspension at an arbitrary\npoint.  It does so by backing up to the start of the marker parameter segment,\nso the data buffer must be big enough to hold the largest marker of interest.\nAgain, a couple KB should be adequate.  (A special \"skip\" convention is used\nto bypass COM and APPn markers, so these can be larger than the buffer size\nwithout causing problems; otherwise a 64K buffer would be needed in the worst\ncase.)\n\nThe JPEG marker writer currently does *not* cope with suspension.\nWe feel that this is not necessary; it is much easier simply to require\nthe application to ensure there is enough buffer space before starting.  (An\nempty 2K buffer is more than sufficient for the header markers; and ensuring\nthere are a dozen or two bytes available before calling jpeg_finish_compress()\nwill suffice for the trailer.)  This would not work for writing multi-scan\nJPEG files, but we simply do not intend to support that capability with\nsuspension.\n\n\n*** Memory manager services ***\n\nThe JPEG library's memory manager controls allocation and deallocation of\nmemory, and it manages large \"virtual\" data arrays on machines where the\noperating system does not provide virtual memory.  Note that the same\nmemory manager serves both compression and decompression operations.\n\nIn all cases, allocated objects are tied to a particular compression or\ndecompression master record, and they will be released when that master\nrecord is destroyed.\n\nThe memory manager does not provide explicit deallocation of objects.\nInstead, objects are created in \"pools\" of free storage, and a whole pool\ncan be freed at once.  This approach helps prevent storage-leak bugs, and\nit speeds up operations whenever malloc/free are slow (as they often are).\nThe pools can be regarded as lifetime identifiers for objects.  Two\npools/lifetimes are defined:\n  * JPOOL_PERMANENT\tlasts until master record is destroyed\n  * JPOOL_IMAGE\t\tlasts until done with image (JPEG datastream)\nPermanent lifetime is used for parameters and tables that should be carried\nacross from one datastream to another; this includes all application-visible\nparameters.  Image lifetime is used for everything else.  (A third lifetime,\nJPOOL_PASS = one processing pass, was originally planned.  However it was\ndropped as not being worthwhile.  The actual usage patterns are such that the\npeak memory usage would be about the same anyway; and having per-pass storage\nsubstantially complicates the virtual memory allocation rules --- see below.)\n\nThe memory manager deals with three kinds of object:\n1. \"Small\" objects.  Typically these require no more than 10K-20K total.\n2. \"Large\" objects.  These may require tens to hundreds of K depending on\n   image size.  Semantically they behave the same as small objects, but we\n   distinguish them for two reasons:\n     * On MS-DOS machines, large objects are referenced by FAR pointers,\n       small objects by NEAR pointers.\n     * Pool allocation heuristics may differ for large and small objects.\n   Note that individual \"large\" objects cannot exceed the size allowed by\n   type size_t, which may be 64K or less on some machines.\n3. \"Virtual\" objects.  These are large 2-D arrays of JSAMPLEs or JBLOCKs\n   (typically large enough for the entire image being processed).  The\n   memory manager provides stripwise access to these arrays.  On machines\n   without virtual memory, the rest of the array may be swapped out to a\n   temporary file.\n\n(Note: JSAMPARRAY and JBLOCKARRAY data structures are a combination of large\nobjects for the data proper and small objects for the row pointers.  For\nconvenience and speed, the memory manager provides single routines to create\nthese structures.  Similarly, virtual arrays include a small control block\nand a JSAMPARRAY or JBLOCKARRAY working buffer, all created with one call.)\n\nIn the present implementation, virtual arrays are only permitted to have image\nlifespan.  (Permanent lifespan would not be reasonable, and pass lifespan is\nnot very useful since a virtual array's raison d'etre is to store data for\nmultiple passes through the image.)  We also expect that only \"small\" objects\nwill be given permanent lifespan, though this restriction is not required by\nthe memory manager.\n\nIn a non-virtual-memory machine, some performance benefit can be gained by\nmaking the in-memory buffers for virtual arrays be as large as possible.\n(For small images, the buffers might fit entirely in memory, so blind\nswapping would be very wasteful.)  The memory manager will adjust the height\nof the buffers to fit within a prespecified maximum memory usage.  In order\nto do this in a reasonably optimal fashion, the manager needs to allocate all\nof the virtual arrays at once.  Therefore, there isn't a one-step allocation\nroutine for virtual arrays; instead, there is a \"request\" routine that simply\nallocates the control block, and a \"realize\" routine (called just once) that\ndetermines space allocation and creates all of the actual buffers.  The\nrealize routine must allow for space occupied by non-virtual large objects.\n(We don't bother to factor in the space needed for small objects, on the\ngrounds that it isn't worth the trouble.)\n\nTo support all this, we establish the following protocol for doing business\nwith the memory manager:\n  1. Modules must request virtual arrays (which may have only image lifespan)\n     during the initial setup phase, i.e., in their jinit_xxx routines.\n  2. All \"large\" objects (including JSAMPARRAYs and JBLOCKARRAYs) must also be\n     allocated during initial setup.\n  3. realize_virt_arrays will be called at the completion of initial setup.\n     The above conventions ensure that sufficient information is available\n     for it to choose a good size for virtual array buffers.\nSmall objects of any lifespan may be allocated at any time.  We expect that\nthe total space used for small objects will be small enough to be negligible\nin the realize_virt_arrays computation.\n\nIn a virtual-memory machine, we simply pretend that the available space is\ninfinite, thus causing realize_virt_arrays to decide that it can allocate all\nthe virtual arrays as full-size in-memory buffers.  The overhead of the\nvirtual-array access protocol is very small when no swapping occurs.\n\nA virtual array can be specified to be \"pre-zeroed\"; when this flag is set,\nnever-yet-written sections of the array are set to zero before being made\navailable to the caller.  If this flag is not set, never-written sections\nof the array contain garbage.  (This feature exists primarily because the\nequivalent logic would otherwise be needed in jdcoefct.c for progressive\nJPEG mode; we may as well make it available for possible other uses.)\n\nThe first write pass on a virtual array is required to occur in top-to-bottom\norder; read passes, as well as any write passes after the first one, may\naccess the array in any order.  This restriction exists partly to simplify\nthe virtual array control logic, and partly because some file systems may not\nsupport seeking beyond the current end-of-file in a temporary file.  The main\nimplication of this restriction is that rearrangement of rows (such as\nconverting top-to-bottom data order to bottom-to-top) must be handled while\nreading data out of the virtual array, not while putting it in.\n\n\n*** Memory manager internal structure ***\n\nTo isolate system dependencies as much as possible, we have broken the\nmemory manager into two parts.  There is a reasonably system-independent\n\"front end\" (jmemmgr.c) and a \"back end\" that contains only the code\nlikely to change across systems.  All of the memory management methods\noutlined above are implemented by the front end.  The back end provides\nthe following routines for use by the front end (none of these routines\nare known to the rest of the JPEG code):\n\njpeg_mem_init, jpeg_mem_term\tsystem-dependent initialization/shutdown\n\njpeg_get_small, jpeg_free_small\tinterface to malloc and free library routines\n\t\t\t\t(or their equivalents)\n\njpeg_get_large, jpeg_free_large\tinterface to FAR malloc/free in MSDOS machines;\n\t\t\t\telse usually the same as\n\t\t\t\tjpeg_get_small/jpeg_free_small\n\njpeg_mem_available\t\testimate available memory\n\njpeg_open_backing_store\t\tcreate a backing-store object\n\nread_backing_store,\t\tmanipulate a backing-store object\nwrite_backing_store,\nclose_backing_store\n\nOn some systems there will be more than one type of backing-store object\n(specifically, in MS-DOS a backing store file might be an area of extended\nmemory as well as a disk file).  jpeg_open_backing_store is responsible for\nchoosing how to implement a given object.  The read/write/close routines\nare method pointers in the structure that describes a given object; this\nlets them be different for different object types.\n\nIt may be necessary to ensure that backing store objects are explicitly\nreleased upon abnormal program termination.  For example, MS-DOS won't free\nextended memory by itself.  To support this, we will expect the main program\nor surrounding application to arrange to call self_destruct (typically via\njpeg_destroy) upon abnormal termination.  This may require a SIGINT signal\nhandler or equivalent.  We don't want to have the back end module install its\nown signal handler, because that would pre-empt the surrounding application's\nability to control signal handling.\n\nThe IJG distribution includes several memory manager back end implementations.\nUsually the same back end should be suitable for all applications on a given\nsystem, but it is possible for an application to supply its own back end at\nneed.\n\n\n*** Implications of DNL marker ***\n\nSome JPEG files may use a DNL marker to postpone definition of the image\nheight (this would be useful for a fax-like scanner's output, for instance).\nIn these files the SOF marker claims the image height is 0, and you only\nfind out the true image height at the end of the first scan.\n\nWe could read these files as follows:\n1. Upon seeing zero image height, replace it by 65535 (the maximum allowed).\n2. When the DNL is found, update the image height in the global image\n   descriptor.\nThis implies that control modules must avoid making copies of the image\nheight, and must re-test for termination after each MCU row.  This would\nbe easy enough to do.\n\nIn cases where image-size data structures are allocated, this approach will\nresult in very inefficient use of virtual memory or much-larger-than-necessary\ntemporary files.  This seems acceptable for something that probably won't be a\nmainstream usage.  People might have to forgo use of memory-hogging options\n(such as two-pass color quantization or noninterleaved JPEG files) if they\nwant efficient conversion of such files.  (One could improve efficiency by\ndemanding a user-supplied upper bound for the height, less than 65536; in most\ncases it could be much less.)\n\nThe standard also permits the SOF marker to overestimate the image height,\nwith a DNL to give the true, smaller height at the end of the first scan.\nThis would solve the space problems if the overestimate wasn't too great.\nHowever, it implies that you don't even know whether DNL will be used.\n\nThis leads to a couple of very serious objections:\n1. Testing for a DNL marker must occur in the inner loop of the decompressor's\n   Huffman decoder; this implies a speed penalty whether the feature is used\n   or not.\n2. There is no way to hide the last-minute change in image height from an\n   application using the decoder.  Thus *every* application using the IJG\n   library would suffer a complexity penalty whether it cared about DNL or\n   not.\nWe currently do not support DNL because of these problems.\n\nA different approach is to insist that DNL-using files be preprocessed by a\nseparate program that reads ahead to the DNL, then goes back and fixes the SOF\nmarker.  This is a much simpler solution and is probably far more efficient.\nEven if one wants piped input, buffering the first scan of the JPEG file needs\na lot smaller temp file than is implied by the maximum-height method.  For\nthis approach we'd simply treat DNL as a no-op in the decompressor (at most,\ncheck that it matches the SOF image height).\n\nWe will not worry about making the compressor capable of outputting DNL.\nSomething similar to the first scheme above could be applied if anyone ever\nwants to make that work.\n"
  },
  {
    "path": "testimg.ppm",
    "content": "P6\n227 149\n255\n0/-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}E6G8G9E7F9F9E8F;F>F?G@G@CNCLCLDKDIBF>B<A;A9@9?;@>@?@?<=;@.@.@.?-?-@-?-?-@,A.A-B,A*A)@*A*?/?/?/>,>,<+<+<+?+?+=*=*=*>+?+@,?:>7=4?1B3D3D3D4?/@2E8H;H9mB2T8*D3#:659549547326216005//50-72/72/72/61-61-50,50,50,.0-.0-.0-//-//-0/-2.-3--5,-4+,4*+4(*7(+=.1E69L<?n@B|HJMNNOVZclns|}|pz`aTLuRCjSKcOG_MH\\TR`fdo|}{|jhgUXWERO>UPdUPdUPd0/-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^A3jC4xD6D4D5B3B3@2@4B7C:E<F=G>AKAICIDHDGBD@D>C;A9@9?<??@@@@<=8@.@.?-?-?-?,?-@-@,@-A-A+A*@+@*A*?/?/>.>.>,=+<+<+>->*>*=*=*>+?,@-@8>5>3?1A3D4D3C4A2B6E8I;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<;vDCJILJST`hk{r{|ylv[\\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|C2A2@0<+:+;,>0@4C8F=G>?E@FBGCFDFCEAD?D;@:?:@=@@@A=@;>7@-@-@-?,?,?->,?,?-@-@,A+A,@*A*@)?/>.>.>.=+=+=+<+=,=,<+=)>*>*?+@,B7?5>3>2A4C5D5C4D6F9I=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@IBNKZ^ftnw~zsdmUUNEtO?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)<-@3E8I<J>@CACCEDECDAC@C>A;@:?:>=@A?B=A7>5@,@,@,?->,>,?,>-?-?,@-@,@+@*@)@(>.>.>.=-=-=-<*<*=+=+<*<*=+=,>->-B6?5?2@2B4C6B5B5F: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}D9H@RQ_iis|zu~my^gRQMDyM?rN@dPEgQFfLC^GBVNLZ^^fjnquzvx}vzvwzokoa`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/|?,;):';(=,B2G7K<M>DBDCDBEBC@@@>>:>:=9<;>?>B>C:A5?0@-?,?,?,>+>+>-?-?,?-?,?+?*?+?*>)?.?.>->->-=,=,=,=,=,=,=,<,=->.>.B4A4@1@3B5C7A8@7B;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|KGYcg~pxxs{js]eTTOGLAyPAjPAhMAeJA`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?-{<*;);*=,A1F5J:M=E@FAFAE@C?@>==9<:<9;;=?=B=D8A2>,@,@,?+>->->,>,>.>-?,?,>,?+>*>)?)>->->->-=,=,=,<+=,<+<+<+<+=.>/?0C2A2@2A5B9C:@:@9@9H@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>2nGBzYblu{|u|mubi[[SLLBQAnN?jI=cH>`HB^FCX@BO<?HBGJFLJJQJJQIIQFKQGOUISYMaXSaXSaXS++++++,,,---/.,/.,0/-0/-1-*1-*1-*2-)2-)2-)2-)2-)2-*2-*1,)1,)1,)1,)2-*2-*1,)1,)1,)1,)1,)1,)1,)1,)2-*2-*2-*1,)1,)1,)0+(0+(3.+3.+3.+3.+3.+3.+3.+3.+41,41,41,30+30+30+30+30+41,41,52-63.74/74/850850:3+;4,<5-=6.?6-?6-?6-?6-B8.B8.C9/E9-G;/H<0J>2K?3DG6EF6KE5PD4VC2^C2e@.m>,v=,|;):);*=.B2F7I:D<F>G>F>E>C?@><>9:9:;<@<B;D6A/=)@-@-@-?,?,>.=->->,?.?-?,>,>*?*>)>->->-=,=,=,<-<-<-<-<,<,=-=0=0>1D2C1A3B6C:A<B=B=EAPJXPZOqSIVI@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]hs|szkqedVSJCN>kK<gG;cG=`FB]DBX?AP;?H:BE?HGDMHGQIGQHJRGNVKRZOaYNaYNaYN++++++,,,,,,---/.,0/-0/-/.,1-*1-*1-*2-)2-)2-)2-)1-,0,+0,+/+*/+*0,+0,+1-,/+*/+*/+*/+*/+*/+*/+*/+*1-,1-,1-,0,+0,+/+*/+*/+*1-,1-,1-,1-,1-,1-,1-,1-,3/,3/,3/,3/,3/,3/,3/,3/,40-40-51.62/62/73084184192,:3-;4,<5->5.>5.>5.>5,B8/B8/C9/E8/G:1I<3J=4K?3EC6FB6IC5NB4TA3\\@2b>0h=-q<.w9*}8)7*:,=/B2D5E9F;G<H=H>F@C?@@:9:9=;A;D:E4A-?(A-A-@.@.?.>-?->/>.@.?.?->+?*>)>+>->->-=,=.=-=-=-</<.<.<.<.=0>1?2D2C1B4B6C;C>C>D?PJ[Te\\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^IHtbnzʂyrwikXVGDI<gG<fD<aC>^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@3B5D8E:G=F>D?B>?=A?D?E>C8C1B.B,A.@-?,?,=-=->.?.<,=,=+>-=,=+=*>*<+<+<+<,<,<,;-;-=/</</=0?1@4A5B6F3E4F7H>F@C>DAKGXRf]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Ӑ݂tzjn_bYZPHmHBdA>]>>X?AVBHVLU^U`bbqnn}xv|pulyoguh_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@3A5B5E8E:F<E=C=C?D@F@F>F8C2B/C-B0A/@.?-?->->.>.=,=.=-=,=+>-=,>,=+=+<,<,<,;-;-<-</=/=1=1>4@6A7B8H7F7G:I@HBFAJFTMdZre~op~|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ΐׄxpykten__yXZsSUjRWjU]j\\gmguvrv}vypsfteXfW_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@3A3C6C8D:C<F>G@HBH?E:C3B0B.B/A.@->->->->-?0<-=-=,=.>-=,=+=+<*<,<,;+;+<-;,;-<0<0<2>3?4A8C:D;K<H;H>JDIFKGSM_Vrgqz{wrocqbVdWPQCMN@HI;DD8@@4::055+/0(01)01+/0*/0+./*./*//-//-//-//-//-//-//-//-//-//-00.00.00.00.00.00.00.00.6*>6+;8.6;63HE>_^Yyz|Î˄}{||yq~o|n}oy|{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@1A2C5D7D:F<G>IAH>F:C4B0B.A.A.?->,>,=.=.=.<,<.=.=-<.=-=-<,;);+;+;+;,;,;-:,;/<1<1>5@7C:E<F=M>I<H>ICLGPL\\Tj^oyzym{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?3A3C5D6E8E;F=G>F=D8B5@0@/A-A-?,>+<,<,=-=/<.<-=-<.<-<,<,<,;+:*:*:*:+:+:,:.;0<1=4?6B9D;G@HALAH?HAKGOLWQf]whw|}tqlte\\eRV_LMVCEL<?F6<@27;-68-01)00(.-(/+(/+(/+*2,,3--1-,1-,1-,1-,1-,1-,1-,1-,0/-0/-0/-0/-0/-0/-0/-0/-9*?5)73*-66*GL6_iPxn{xgzdQcMTS5VU7XW9,03,03,03,03./1./1./1///..........-+.-+.-+-,*-,*-+,-+,-+,,*++)**()*()*()+)*+)*+)*+)*+)*+)*+)*+)*,*+,*++)*+)*+)**()*()*(),*+,*+,*+-+,.,-.,-/-./-./+*/+*0,+0,+/+*/+*.*)-)(0,+0,+/+*0,+1-,2.-3/.40/:12:12;23<42=32<21<21;1/=20<1/<1->0-?1.@2/A30A30?61@72@93A96A96B94E74G51O61W6/a6/j8/u9.</=0>0>7>5?5@4B4C4C4D4B5C8E:E;C7@4?1?2A,?-=,=,<+<+<.<.;-</<.;-;,<,;-<-:*:*9):):+9+:+9-<1<3?5A8C<F?JBJEJAG@HCNJVR_Yper{~~zuszjcqZ]iSR^JHT@BK:>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ƤШɯʰ˯ɪ{wrdx]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@4A4B3B2@0?1@4B7B9@6?5=2?2@-?->,<+;*;,;-;-;,<.;-<-;.;-;,;,9)9)9)9*9*9+~8,}9,=1=4@7B9E>HCKFMHIAGAJFSO\\Xh`{ny~w{nixacr[ZhQP]IIUACL;>D6<?467/44,30+0+(1)'1()3)*5+,2)*2)*2)*2)*2)*0**0**0**1++1++0,+0,+0,+0,+0,+0,+;&57(/4-%46\u001e?I$Ue8pTk}ɓҔҰҮѭ̥{{tqk_sWJ^CMM1LL0KK/,03,03,03,03./1./1./1./10000000000/-0/-0/-/.,/.,0.//-./-..,--+,,*++)*+)*+)*+)*+)*+)*+)*+)*+)*+)*+)*+)*+)**()*())'()'((&'*()+)*,*+,*+-+,.,-/-./-./+*/+*/+*/+*.*)-)(,(',('1-,1-,1-,1-,2.-3/.40/510;23;23<34<34=34<21;10;10<1/<1/;0.=/.=/,>0-?1.?1.96/:729839839:4:94;83>71A2+I2*S2)^4(j6)s8*|:*~;+84:5=4@3B3A1@/>-<-=0@4A7@7>4=4=3@-?,=+<*;*;,;,<-;.<.;-;,:-;-;,;,9)9)9(9*9*8*~8,}9,>2?5@7C<G?IDMGOIICHDMJUTa^ngs||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\u001c=H\u001eRb1l~Jbr|~{ƅ΅ɢɟȞ×~~vumldZnRG[?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+;->.B1D0D0B.?,<*6383:2<1@1B0|A/|A/C2A1>1=0;/:.9-9-v:/|@5u=0n9)s@/s@/t<+{@0{<-?4D9H?LANBQCRCHKTRd]ue{lwsz|yk{awhea]\\zV[sS]mR[cLVTEPH=J;6G53B,/=&,:#+:#-9#/8\".#/-#-,$-,&*+))+-(.1'/2'/4'06&14'14'13'32(32(30(3.)-0,-0,)//'=>0WZErx\\gspqrrs{{z{~}|zvroi{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.<->.A0B1B/A/@/93:3;2=1?0@0@/?/A1>0=0;/;.:-:,:,w9.x<1s9-n9)r?.s>.q9*u:,}=1@5E:H?K@MBPCQCDJQRd]vfp}w~w}oxag\\`VZU}XWyXWpSPbJKVECI;@A998340-0,+/+,.)--(,*,+)+***,+),-(,/)-2(03(03(02(02(10)1/*1-*1,+3,+32-12./0,)--%9:,TWBox[iolnpppw{xwy||{xuqnh{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;594:4;2=2>2@1A2A3B5C6=2=1>1>0>/=.=.=.<.;.:-9,;,;+~=+z=*}=3z<1v:/u;-x@1x@1v<.v;-?3B6F=H?JAKANCPDDHQQc^ugnt~}{ak[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[~ik~hjnn~mqx|zwvtuwyy}}ywspmh{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?9B9C9B9B9A9@7B/B/@.@.>-<,:+9+8*8*9*9)<)z=(w?(t@(=3{7,x8,z</v;-w=/{A5{?4B7D:G=I@I@LBNFPHOLYSf[sbg}mzv{|~zmmiiegdefgce]~_Zw[PhPI_J@Q?8D60:/-5**/(),%7$(7$(5%(4%(1&*1(+/+,.,-*+-(,-'--%-/%-/$./$./$./1(+1+-0+(.+$88,PUAiqYve{hyf{in}mykzmrsq}o}p}s~t~v}w|x}zzwuqnjg{bWkRK]GGE9?=1:8,45/45/45/560560560761761872:72;83<94<94=84<73<73<41<41;30;3083072/61.61.5106216213122011/00.//-.4+.4+.4+.4+.2,.2,,2,,2,,3/,3/,3/,10,21,21,32-32-22222032032032.51.61-61-;4.<5-=4-@6-A7.B8/E8/E8/C:1C:1E;2D:1C90B71@5/@5/>3/>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>8A:C;C<B<@9?8E/D/C.@-=,<,9+9+6)7)9);)~=)w?(sA(qB(6/|/'8/?4w5)s5*}A6}C7E9G<I>J?K@LDOGSJycL~hSoYu]}biu|~|~|}{yn}lylwkwmtjogl~dbqZ[hTSZHIK=B@4=6,8/&5+\":&(8%'6&'2&&0(&-)(++)).*'+*&,*&,*'+*'+,)*,**,**,-#$2*(50,85,BC5UZFfpWn}^tcqbtexiwkshsiwmzmxlwkvlyq{u{w|wxuzwwtqomhd{_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}77897978}75{:6|=8{?7@9@:@;?;|E0}D0C0A/=.;-:-9,8+9+:+<+{>+x?+uA+tB+2,2,LEXQA8|90F;J>yH:zJ<{M@|NA~NBPEUJYN_uNgwRtzX{^|bis|z||x~tyqvponpp}pxmskk~bgu\\_iQWZGPM<H@3B6*>0%:,+7,*5+)1,(-,'+.').((/().(+-*,,*/+*3)*6',7&,9&,2)$<3,E>4JF:QR@]bLgqVizXm]j\\j]pbqeodoerhukrhqitlxrzvyvyvvtwturokjfc|^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/x7398;;<<>;A>A<?6}=4~;3;5=8>:~C3B3A2?2=1<0;/;/;.|=.{=.|>/|>/|>/}>/}>/.*;8kf~yZTC<LAN@tJ:qM=pQ?qR@tSB{VD[J_OUOeUz~[y_raofrkxovz~~}yyvrrrrt|svpspligeby\\\\lQU_GMP;ED0A<)>3-<3,92*41(01).1(+1'+0)/0*2/*6,*:*+@'+D%+G$+H#+A7+LC4WP@[XE`bLgmQiwVj{Wl[gWfWj^nananbrfrkohniqnwsyvxuutssutspnlicb{[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@:DAHDJGLHQJMDD;;28-7-91;4?7?7=6<5=5=4|>3y?3vA3uA3uA3y?3}=3:38373%$<;{zhcG@K@wI:mN<gR=dU>fW@jX@r\\E}aLeQj{O{{Uw\\l`^_R\\M[O^muxx΅~}xurruuus{sxrqlphiadtW]gLVX@LJ3GB.L40H3.D3,?2*:1(70&40'40'81):/+?-+C++H(+M%-O$-Q#-PE1[P:d^FgfJilOnuTm{Wl~VkZgVgVm]papbrdvhrlokmipmwtyxwwtustutsqokicb{[TmMGa>SJCKB;F=69:49:49:49:49:4:;5=<7=<7=<7?<7@=8@=8A>9C>:D?;D?;E@<E@<E@<D?;D?9C>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@1gB2I;G;I?LAF>>7=6D;NDQEVHYKPB@5:0=49;9:675496@:{@8o?3oC6lB4m?2u:27435-3(1EEbaEDWUyvVOF<WGlS=f\\CedFgfHgbEm_DyeLnVdKp]phW]8K(D&H+L<WG\\Xenr|zف}ֆ؉wwxxxyyxmm~itagY{YMtLBpE<r;>d02b22\\31L)'D'#I2,J70F5.E2,E0+H0.I-,I)*O+-V24VK/`W:f_BgdEkoLu}Xu]oWjWlXn]q`sbubudveqksmsoqosrwxzzyzxyqrmjjghdazZTnKIc@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{;;ECD?H@I?G>JANHPLMKE3C2B4B6>36-7+<0C5@.@.E3F6E5H9N@KRGN@F9=8:?<A:r@5k?2uK=NC@:,-(08FK\\JIMM>=>?_\\XQ@5UDvbJa]@Z_?ekIonOshJ{fKkP]V][SZ<N'E\u001eD\u001fH!K(N.N9RF[M^O]O]S`akclgnkpnrstvuww{zwzuxotircn^k\\i`nRaJWGQDKFIk79F\u001d\u001bS2-L0,F2+I6/J91I;2M>7SD=]P.dY9ga?ifCnrMz[zbt^r]o]o^q^ubwcwcwcrmwrzvyw~}z|qqljhc`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<P40g35AGJWS`[f^cB>I?MAOBRJSRNSENE2B0@0?1:-7*8+=/E4>+7$:%>+@/B2C5/89BDLKRNRLLB>}:1u;/q9,s5*2-47<GEWLaFC41:921MKb]J?\\JzdLebCbfEpqOysS~iLiNrZW`NZ@Q3I-H-N*M&H-M,K.J2L1K.K.L1O=Z?[B]FaJcMfQhSkPhOiLgKiKjLoOsQuh_|ZtUkYldrR[r-0]''X1,T<2N@5?<-7:)<C1GP=[N,aW4e_=heBstRd~hwdxgsercrctcwfzgze~xzynmg~b^wYTmMKfCXUFXUFYVG7827828939:4;<6=>8@?:A@;BA<DA<DA<DA<DA<E@<E@<E@<GB<GB<GB<FA;FA;HA9HA9HA9LC:KB9JA8I@7H>4G=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`OeOfPcGO20:/?.C3F=FG>H2BH6F5B3@3?1>1B4D6G5B/<);&<(:(5&3$7<8>7>6=<BJMTSZT@76+.%62HKNX@Q0E:4-(7464D@\\UWKXFtX@rgIysS|qQhJdKoY~kGVAP9J8I=N@Q:N5H@S:M4K3K0J-I-L1S1T1T3W3W6Z9\\;^<a@f=f<e<g<i?mBpEsLuNuRvPqRn`xdvWb|15h0/U3*L:,BA/:C.5G/5L2VH+_T6i`CokN||`rv}qzq|s|szozm}msxsqh|c]tWSlLLgDVWEWXFYZH671671782893:;5<=7?>9@?:BA<DA<DA<DA<DA<FA=FA=FA=FC<GB<GB<HC=HC=JC;JC;JC9LC:KB9KA7J@6H>4G=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;0D</G=1I=/K?/M@0M@/P@0O?/O?/O>4N=3N=3J<1I;0G;/F90D:0D<1D;2B;1@<1A=2A>5B?6C@7_4-t42KSYiH_:Q2C#+/)9(;&=)@3A=:?0;D4B3?2>2?5C7G;J<>/?-=+:)9':*;-</EBCB=?6:7<AFLNRPD>LDTLTNKJ>C3>.<5+7.0+9482@9[PUDxO9~dIlPbF]FeTqdsj<I9D8A<DCHHKJLIMLSDM:I5H1G-F0J5P7V7X7X8Z:[<_>b?eAiBkBmAm@o@o@qAqBn=hEmJpGhMiZrbsYc@D]($M-\"PC2PR=CO76H.WH1eYCujT{gy~þþyvh{e\\sWTmONiHTYBUZCW\\E560560671782893:;5=<7>=8@?:B?:C@;DA<EB=FA=GB>GB>GD=GD=HC=ID>IE<KD<KD<MD;LC:KC8LB8KA5L@4K?3J>0I=/G>/G>/F<0F<0E;/E;1D<1C:1B90A:2@91@91?82<71;60;60;7.;7.;7,<8-?8.A;/D</F<0H?0J>0K?/M@0NA0P@0O?/O@-P>2N>1M<2L;1I;0H:/F90C9/C;0B<0B;1@<1A=2A?3B@4C@7t50FEY_Ub@Q5F0;*+1%9#;!: =&=.902-:,:-9-6,91A9E;E:?2@0<,6'6)=0D9G=9*@4D=A@<?7<05-.63H@TJNE=70..0273$</,\"7/2,6/g\\m^XC\\CW?R=\\LjafbUTAI>D<@?>C>JBRMZWPREL;G6F2D/B1G6L:T:T:T:W=\\?aBeDi<e>h?jAm@n?o>m=mFn:a>dInJlMmSoXnp_jILt:6\\6-O9+OD2SN:`PArdW|p̿m~k^u[VoQSlNU_DV`EWaF560560560560671893:94;:5=<7@=8A>9C@;DA<GB>HC?HC?GD=HE>ID>ID>JF=LE=MF<NE<ME:MC9MC7OC7NB6MA3MA3N@3JA2JA2I@1H>2G=1F<0D<1D<1C:1B;1A:2@91?82?82<71<71<8/<8-<8->7-@:.B:/D</F<0H?0K?/M@0NA0NA0P@0O@-O@-O=1O=1M=0L;1I;0G9.E9-C9/B:/A;/A:0?;0?=1@>2B@4@@4+)JKSV=B/6.3./0)1 9!=!=\u001f= =#;#6\"6-8/5.3,71@:B<@6B7A5</8+:0B:C=@;@(?+5))$ #\")'/-2((.)2*4*4*1*0+.+6#5&2$6,6.>7`UqeSWCN:XGe[a_PTBIDK@D@?B<B8B9IAPLKP@K9H7H5H3E7G=K9R9R7R7U7X9]<a=g@k@nBqDtCuCuCvBuFgAaEeJlJkUt^z\\vi~o~nw]aCAh6/hB7vTHwf_}vŽ˻tqexb[tWXqS\\iK\\iK[hJ560560560560560671872983<;6?<7@=8B?:DA<GB>HC?ID@HE>HE>ID>JE?JF=MF>MF<OF=NF;OE;ND8PD8PD6PD6QC6QC6OC5MD5KB3JA2H>2G=1E=2D<1C:1C:1A:2A:2@93?82<71<71<8-<8-<8-?8.@:.B:/D</F<0I@1K?/M@0NA0P@0PA.O@-O@-O=1O=1M=0L;1H:/G9.E9-C9/A9.@:.@9/?;0?=1@>2??3@@467]_Z[78,,/,,#0#8$B(G*G'F$F$C!? 81;29250:6B>D=>7<3<2</<1F<KDE>72:\u001d<$:*.($&\u001f'\u001d'\u001d%%(,)2*5*3(2'/&-%=(2\u001f>05)7/?7C9qdm]YFVEi\\lfSS@H?L<B:=<:@9>46,4.44BH8G2F3H5I7G<JBN>Y=X:W6W5Y5\\6_7e;k:m;o<r<r=t>t>vEbNkTqIf?\\Rqff^wbvkys{rvfeZVTN~ĻþĪyvi|f`w[\\uWbqRapQ`oP201312423653875984984983;:5<<4==5??5AA7CC9EE9EE9HH@HH>HH<HI9KJ6LK6MM5MM5LK7IG8EE;HGELIPKIWFCVA=TQF4NC1JA0KB1MD5LB6F>3B90E<5C:5@85?74@86?67>56:44F85E76B87@78>:;<:=<<>==????A@<DA:HB6JA2M@-P?+O?(CB0F?/K:2O62Q35Q28N5;F:<??=-=3)A1.J4/G-,?#5B&GP3`SJ<7)7':'9%;&@);$='?+?+:)6&4%2$8'8':(>,B0D2D0B/?,>*<*=-C4F7>03&6+8,:-=/=.</905//,--.,0,4,9)=)>(9%4\u001e4 9%8&6&@4QEIAMIUUVXJP9A4?9DCHCFAA?;=3=/?/@0Q@QCLCC=??@E>G8CGMENEQESAR=S>XCbGiBh<f;g=kDsIyK}MyNwRtTqQkQl[xdY?lMxX{Ypyca}sŹʻ|zt|qpzo~synv}k0./1/0320542653762873872:94;;3==5??5AA7CC9DD8EE9HH@HH>HH<JH9KJ6LK6MM5NM8KJ6KI<KJEQORWU`ZWhVTjQNiSI@ND;H?6F=6G>7H?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)^B4sRCK=;-2#6&:'8$9%?(;%=(@,@-=,9*6(5(;+:*9);+?.B/B/@.?.:(<+E6H9?18+7+5+7,:.;/=/;/8/4/0----+/+4)8(;'=&:'7\"8%=*;*5&;/G<G?JFPOPQGK;@:A?GDGDCB?>8;1;-<->.F5M?NEGC?@>B>F>HDJCLDPFTBS=S>XBaFhCi?i@lBpGvJzL|IxHtKpRs]z`{XwMqCkAlCjJg^ppugNIv̲Ų}/.,0/-10.21/43/540762761:94::2<<4>>4@@6BB8CC9DD8IF=IG;JH;KJ8MJ7NL7NL7OL9KI:NKBTSQ_^dihxmmlkihcYd[QZQGPJ@IH>FG>CC=A@:<A;;?:7<73<73=82>: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-.:=EJ9+2$1\"9'<)7$8$<&;&=)A-A/>.<-:-:.>0<.9+:+<+>->-=,?-9(>/L=H:6*2&;05*6+8,:.;/9.7/2,/-.+.+0)2'6&8$:#7$5#8'>-=.7)8.A7<5?8EAKIIJCC?A@CDCC?B;=4:.9*;*<+9)E8NEIE?@<AAIFPAG@ICOGTEU@U>X@_DfCiDmFpIwK{L|K{CvGwJtNtZ|aUvCdHkRv=\\H`z}~\\F;rճξ/.,/.,0/-10,21-32.54/650872991;;3==3??5AA7BB8CC9IE<JF;KG;OI9PK8QL8QL8OL;LJ=SPK^]bmlzzz~|urke^}YSoRMdMEZG@PB<HD?F@;?<87;62;7.<8-=9-<8,880991;;1><0?=1@<0?<-A;+F?/H?.K?/M@/O?/P?/Q>/P=.<@)=?*?>,?<-?;0=:3;:5:94<94D95N43[*-o&--83C7H7)7&9(?-?,9&9#;&:&<)>,@/>/<0=/=0@5=2:,8*9+:,:,:*;,;-B4E9?31'2(:13+4*7,8-8.7,3,1,0,.+.)0(1&4$6 8\u001f/\u001e0\u001f4$;,</9.<2C;6/70;5E@MILGC?;8A9@8>4</:+8*:+<-4&?3HBHEAB@DELLU?E?GBKHUHWBW?W@\\BbCfFmIsMyO|L{Jy@tL~Q}JrLoUwUuLjEcKf>Vet͑]=2aP@wlѥº10,10,0/+0/+10,21,43.54/77/880991;;1==3??5AA7BB8KD:LF:OG:QJ:RK9SL9RM:QK=OKBVTUfdowxÎƏ{wrlid_[~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;D9E2A<+<+@.A/@-<'<'>*8%:'<+=.;/;.<0<1A6>3:/7,7,8+8+8+7+A5C88.1&3)7-6-2+3)5+6,5,4-2*/*/,.*/)0'1#4!6\u001f7\u001e/\u001e/\u001e2\"5)9-:0?6E=F>@9<5@9KDNGF<;1=1<0</;,9*:+=-?29-=4@:C?BDDHIOOV>C>EBJJTJYFXCYB]@_BdFjJsOxOzLyIxGwRQ}IqImStVtNiD^F]YkKFd2)jc͖ɿ˾Ⱦȿ84163.52-30+30+41,52-63,85.96/:70<90>;2@=4B?6B?6KC8ME:PF:SJ9TK:UL;SL<RL@QLHZW^kj|~Θڙޙޓ֋̆~xvmlfe]ZwVTiMKXDAH><=;:6;8396/267465672880<:-A<)D>(G?(I?&J?)IA,JA0IA4IA6HA9G@:R9<N8;I68A57:65384.93+;12?517+=3'X:0{D=GC>?46<*=+?-?->,>*?+@-8%9(:+:+9,9.:0;2>7;4818.8.9/8.6,7-C9?50&,#7/<44,1*1*2)3*3+2+/*.(.*-)/)2&3$5\"7 7\u001f5#3#2$2&5)7,;3?8YRRJHAD;F<J?G;?3;(;(;*:):(:+>0A3A6<5<6A?EEGIJMMQAD?ECIJTN[JZF\\F]A]BaEiJpNwOzMxKxR{R{OvOtVw]{SoD^UjQddt`cKLkeώ<94;8385052-41*41*52+63,74-85.96/;8/=:1?<3A>5B?6KA7MC7RF8UI9WK;WK;UL=SJASJK[Xcnlǚޞ졩홛敘ߔ֐̈zzrqfd|XWiPN\\IGRFCJDBG=?K==G;:?;:8<92A;-D=*F@*F@(GA)GB.ED2CC7BC=AC@>BAG9HH<JG?LGDODGN@JL;II:ID?KA<@2F=.bH9QBK<@2;-=+>,>,?+@,@-?-=*8'8)9*9,8-8.91;3;4:3818192:2706/<3>5912*3*;2<35,0(1)1*1+0+/)-(,(-).)0)2(5%6#7!8 8%8%5%4%4(6+7.7/NGXPZQRIH>E9B5?1<&<&<(;'9(;*>0@4D;?9@:FCIHHGIHJMCFADDIKSQZN]L]J`D^DaFfIlNuOxOxNyYzWvVuYx]{ZuQkI`WkUgN\\^kKZSaSaQ_jfɂ~窧@=6=:3:7074-52+52+52+63,74-74-96/;8/=:1?<3@=4A>5M@7OC7RF8WJ:XK:YL<WK=TICSJM^Xfpm͜磬Ꝡ㙛ؕΒĉyyji`]|XUpSOhPLcMJeKG^FBS@=H?;<?:4B<0A>-C@-CB.BC3AE7>E=<EB;EF9DF:D]@JcHTjR]oXdt\\fp]dj`ac`[W]LDgI>UEYFL7A+A+@,A-A-A-A.A/=+7&7(8)8+8-6-7/8/;2736161729494816/A:8/3*7/=5=58/6-0'0'0(/).)-)+(+(-)/)1)4)5'8&8$8#8$9%7$6&7)8,7+4*3+NGd\\`YOFB9<2:/?&>&=&;%9&9*;/>3C9A9E?KHLIGDFEJIFGCDDHMSRZR\\N^OaG^GbGdIiNrRvRyRy[u\\x`}_|UpMgPgYn[mbsL]SdM_RgI_E]d`tqښA>5@=4?<3=:1;8/96-74+63*52)52)63*74-:70=:3@=6B?8J@6OC7RF8VI9WJ9XK;ZL?[NHTIMXR`gd|}̗瞩꟡ܙҍurhe]ZXR~YP{YQxVOpOG_E?M?:@?;8@@6>>2@B5@F:>E=:C>9CB<GI?MP:YvKh[udunx|zq|`n]eX[XUWMM?A,:\";#<(>*?,@.@.?-=,;,6'5(6*7-7-8/91818495:685616183:3C<=670@7[Rlc]T@71'2)1*/)*&'%(&*(-)0*2)1%0#1\"5$:(=&=&=)<*;,9+8,6-@871GAc^XQB<@93.<#<$<&<&:(:)<.=2>4C;PJXTOJ@;@:KEFEFEJKPTQWNVKVL\\RdOfKeJfMnRsRvPt[wZuZu[w]xZsWnVictVg\\mYlDXBXMeIbnhhcˎ赲C?4B>3A=2?;0=90;7.:6-95,73*73*73*83-:5/=82@;5B=7I?5LB6QE7UH8VI8YI9YK>ZMEUKLXP_ebyzɔ䚧䘘،ɀ~uqieb^cVbU]TWOtNHdFCTBAIAAA;=8@C<DG@BD??A@BCGMNSWW_Vlgyw}q_wXkTaOUFD=49(:$<#8%7%8&:(8'9(7(5&3%4(7-;0<3=5;5;5>9<7<7=9A=C=B<A;@:A9@78/1'6+I>\\Q?46,+#)#,)./,-((0.4/7/6,4)2&3%5&='<'<(;(:(7)6(4(8/5-<6PJSOLHA?/,=%>&='<'9(8(9,:/>4B:OFWPQKD=B<KDIFIFMLSRTVPVNVOZVfUhSiRkRmSqStRsNoTv\\|^{[vUoQgReUfQbZhZjM^RcWiI\\ha\\W{٩EA5EA6C?4A=2?;0=9.<8-;7.84+84+73*83-:5/=82?:4A<6G>5JB7ND8RF6TG6WG7YI:YKBWKKXP[b^wsuޗ뙗Ղxtqml`i]dY^VVQyNKhEDV@@J76;?=>HBBKABN?BYFJmX_}fnt}}wpcRpE^I\\EP9<3,7(;%; <*<*;);*<,<-<-<.6*8.<1>5@8>7<3:273403/93A;E?A<<5<44,4*7-2', 6*H<I>@64--)+*+,+,*,))/+3,5.4+2(2'2':&;'<(;);*:,8+8,4+;4:5<7ONXYEE02=(<(<(:'9)8*7*7,>2A6JAUKRIH>E:H@IDHCLGSPSSPQMQNWXdZh[pZrUoQlPnRpFmOvZ}[{VqSkVk[mYhYh`m`k\\fenfmT[cY}NDlfØ߹IE9HD8FB6D@4B>2@<1?;0>:/:6-95,95,94.:5/<71>93@;5E>6HA7LD7QE5RE4UF3WG7WI<XMIXNW_Zppp֔횪엖䌋ق{zxlpfh__ZYWQQwGGc@?Q<6DF9BS>C_@EmDJOU]fjreklf]TyFg8U0H>PBM:<7/@.B*<!5$5$5$6&7(8);-</@6@5@6?6<5:16.4,/(-'.(3-:4;4814-5,+\")\u001f7,B4?04%.\u001fF7I<H?<9,,\"%&)/2-./-2.3,2*0(/'/)8*9+;-=->/?0@3@36*KBJE50FFZ\\HK?B=-;+:*:*:*9,9+8,<0>2F9OBPDH<C7D7F?F?JCPKROMLKMKPX`[haqauWoOgMgPkJuOySwRqSm[pcuixguaobmelgljjjhc_dVeH:_TͫLI:KH9JG8HD8FB6D@4B>3A=2=9.<8/;7.;60;60<71>93?:4B?8EA8JD8NE4PE1TE0VG4XH9ZMEVMR[Whkl~В噧铕⊌لӅ{umkdd_aX[QQsNHbUFY_CRlBLEOLVU][d]fJuNxPuLnFc?Y5J+?5EAMFK><>6H8J6B)>-=-<->/?2B4D7E:E9B7>5:26-5,3+2*1*4-6090807/6.5,/&5+6)2#1\"9)>-<+=-D7KAD?56)-)-.26755301,/,/,0-/-80:1:1<0<0=0?0>17+WL`X;6;:OQEHOT=2:/8,8,:-;.;-:.:-<.B3H9I:D6@2>0E<E<I@PIRMNKKKLOZ`^hfrhx]qOgMeQjPzQxQpSm\\qhxjwepfr_k_kkrsulhf\\l^ujXVI8kXJ{tQK=PJ<OI;MG9KE9IC7GA5G@6B;1A:2@91?82?82?82A:4B:7@?:EB;IE9MF6PE1RF0UF1WG7YLCUKLZTbii|ɓޗ먫횞蕙⑕ޒډ|rxnulphhj_x`xWjO_OZR\\R[OVHP:P=QAPCLCI?B9:45IJHH@A7693B8E8@1E6E6F7E8G8G:H<G;>3;18/4*3*4+4,5-9/<2=4<3905-5,6-.$;.<.1\".\u001d8$=);&:'9+:1=9@@;?27+1,.+,+)+(/.4488:;5564736/7-5*5(5&5'PEmcHA42CC>BUYB;=6706-9/<1=1=.9)<+@.B0B0?.=,<+C8D9H=PGSLOIOJOP_caiitm|duUjRgWoSxUtWp_poyy~msXaam`maos{숊ɂ|wjyhhpYMO:^WGqgݿSM=RL<QK=OI;MG9KE9JD8IB8E>4D=5B;3A:4@93A:4A96B:7@A;CC;IE:NG7QF2RF.UF/WH5XJ=RHFXR\\jh}ƒږ奦띤蛢晞⒚ۊ҅ʂymczWiP]KWGP?H9A;6<5B6H7J5G1D.@/UGG?;76488:;9866=.<.;.;,8+6*3)1&5*3*3(2)3*5,6.7/>3<2;18/7.6,4*3)3&3%4%6&=)>*9$2\u001c;(5%3'60;<=@7=27-1..--0.449:;=;>.4/3011/1*2(1%3$2#>/j_TL95@@:=RUJEB=935.8.;0<0=-<*?-@.?-;(;(<)=*>2>2D8LBPFNFMGNLbcbfhqo{hxYmUj[pXs\\tbqkt퉇yy_dhrl|cskw餟z\\pWFR<UVFtg^ܾUO?TN>RL<PJ<NH:LF:KE9JC9G@6F?7D=5B;5A:4A:4B:7C;8@A<DD<IG;MG7OG2RF.VG0WH3VH;RGCWRYjh~~Œؖ㡞뢪룫좪롩蘡䖡ᔟݓِѐǒmc{WjM\\BN;E6>4:B*D)H)N+O(L%H%D&WBF8;5>>BH>F5>08F8E7D7A3=08,3)0%0&1(2(3*5,5,4,4,C8=27-7-:/9/5+1'7*0\"0!9&9%5 9#E.:&:)7+3.//055;;BIMGJDD@@>>9:28.4'/(/*.-.0+2*5)7(0!/\u001feY]TA<ED;=NRPMFC:65/8.:/</<+>,A/B0=)8%9&;)>,8+8+>1G<K@IAICJG`a^bdllxixZkTiZo^tcugqqr݅锍ꋇruq{x`sXg֫TnSAS;PTCkaWݿXO@XO@WN?VM>TK<SJ;RI:QH9MD5LC4KB3I@1H?0H?0H?0H?0FC<GE9JG8NI6RJ5UJ4UJ4VK9XNDULMXTbii{~Ƒڗ妢ꧨ뫨ﲧ珣֢˴bnEP:G5B4>8>=@D@HB;D;BCG99B@D@/-HIHKAG;D8A:?<><;<9A=>9C=LCK@>27+;-9,8-7-3,0,/-1134A19)1 1\"8(;*6%2\u001e2\u001c4\u001d5\u001f4 3\"3%3(3).(2+6+8*8(7&7%6'3'2,3101+2*2+4-6+1*/+,.-4.8,7(5#.\u001a3 XHZL<2OG5/IFQRLKDB<8807,9+;+;):'9%:&<)=+=+=,9.;.=1?1?1@1@2A4k_qed[mirocbjituk|ivdm_hafgjnkqk|w}Yj[wZpaz]sMIZ6LR6snX˷YPAXO@XO@VM>UL=TK<SJ;RI:NE6MD5LC4KB3JA2JA2JA2JA2FC<GE9JG8OH6RJ5UJ4VK5VK9XNDUMKYUcii{}ԓߠퟧ梦榣誢瞧垞ҬºrUbCM;D7?6=8==?AADA:C8?@D;;C@A=41OPDF>D:B7?7;89:8;7F?<5<4G>LAC7;,9+7*7+7-4-2.3/5366?0<-6)4&6%6%4\"4\u001f:\":\":#;&<*;,8,5*3.5-7-8*6&4\"4!3\"2$1(/+.,,-,1-3.4*,,-0.2.3*5'7'9'@,*\u0017E5?1F>WPC?BAWVRRKJC>=59.9+8(;);(:';'>+?-@/>-9.;0=0=1?0?1B3C6i\\mdb[kfolbakluvpo|ir^fY^adqn|vyux~RdUrXnXn[tLN_;QZ;us\\úZQBYPAYPAWN?VM>UL=TK<TK<QH9PG8OF7MD5MD5MD5MD5MD5GD;JF;MG9PI7SK6VK5VK5VK9WMCVNL\\Vbkiy{͏ؙ䘙障蜤✢៙㞗䐝㖛ݠҮ¼rZqCQAJ>C<?;=<?=A>C>C;C7=?AA@D?=896WWBC=B:A7<586696;6HA:35+A5K>H:=/8)7)7+8,7.606387;;5)6*6*6*5(7):*?,5\u001f5\u001f6 7\"9)8+4(0&=;>8=5</9)8$7\"7#7%2&.&-'-*.-////*)/+4.5,3&5#9&>*B/1 TE<0A;C?JITSVVSSOMIEC;<28+6&7&7%7$:'<*>-=,=,:.;/<.=/=.?0B4E7\\Og]aYlgpoabfgkoP`^khqem`edgqqzwvsnuJ]MjUm񜡟PcVoEOd=Va?ww]\\PB\\PB[OAZN@YM?YM?XL>XL>UI;TH:SG9RF8RF8RF8RF8RF8JF=KG<OI;RK9TL7WL6WL6WL:VL@UMJ\\V`jh~yyĎДҔՕۖ㘛ꘞ욢훣뜥昢ߖؓՓՓג֐ց~reTzDa:K@HBCC?C?AA?C=F;F?F:>>@FCA<71>:[WAB?C=@:=8997=8A:E;9/2(</E7E6>/9(8)8+:,:/8083;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%<(>*<(=,^PF<3/.-?BUXvurojg^YPIA75(.\u001e8'9&8&:)=,=->,<-<.<.=/<-;->0B3E9MA`Wa[pltr`a]a^dFVYegpgodljpstxvssenCXEbRk뒘N\\Ql?Ri?ZhDy|_\\PB\\PB[OA[OAZN@YM?YM?YM?WK=VJ<UI;UI;TH:UI;UI;UI;LH=OI=QI<TK:WL8XM7YM7XM;UK?UKI\\U]hexut|~ĎƐ͒ԒܓᕚޕܒԌ̇ƃÁ}z|vqh[Kv>c7U8IAEFAIAIAFCAG;J8JDI>A@?JE?83,D<TPDCAC>@>?>=@<E;H<=27,5'9*=-=-<+<);*;,<-;/8/708395:764223142502+1)2'9-<0905/52<;DC5766615,5&6\"9#;#>'9&5$5'9,;0:/8-?1;-8'7&:'<)=';&>-:*>2B:.+::142673;7C>JEQISHTHUG?0>.<,<->.@.?/?.=0=.<.<.<,=.A3D6LAbZc]nlrr`c`e`gixozlt`h^fkqw{{|pq^h@W>]Oh懍XaXuE\\vIgwPfŻ㾺޺޼[OA[OA[OAZN@ZN@YM?YM?YM?XL>XL>WK=VJ<VJ<WK=WK=XL>PI?QI>SK>UL;XM9YM7YM7XM;WK=ULGYSWc_nmktt|~ȍώԏՍӐӋʂ{u|ovgpckn~eyZvMo?c2V0L6G@CGBLBMCIGCJ<N8NFHCCA>ID<45*I@LFCA>=:;;;?=E=H<I;7*7*8(9(9'9&:(;(;)=,<-;.8.6.6/5.24.1+0/237694521/,316342/3/55?=G,2.22/3,5(8';&>(9$8$8&:,?1A5B5A6I8B1<*:&<)?*<)9&;*6)0'B<1/>A.2'-3-4.71928.5*2&1#E5A2=.:+9):+:,:,</=.>/=.<+=,?/A4SGg^d_kinochjqoxp}t~mwcjdlqzw|sukpXfAY:[Kf}lojXoZx`rū٫ӦѥԩԮֱںZN>ZN>ZN>ZN>YM=YM=YM=YM=XL<XL<WK;WK;WK;XL<XL<YM=RJ?TJ@UL=XL<YN:ZN8ZN8ZM:YM?VKEXOP^Xbd_sifqpyy|~ĈˉΉ̈ȃ{~uxorjmegacacX^O\\H\\=V1K/D7B>@E@JBKCHGBL<N8PDDEDA=IB:/7,PFB<=8641051>8E;F9E68(:*:*:'8%:&:':&9&:);*9+7+5+3+4-)-)/,3.4071828587;8<9?9A9D6G6H5J)1,2024/7-9*<+=,7&9*</>2?4>4?6?6N<H7B1=,:':'9(9)3%9/@8D>0/-.38384-6.80:1;1;0:.:/L?F:?29*7)7*8*8*<->/?0=/<+<+<,>0KAc[c^kioshnrzveroyr{jslvvu}ioflRbA[6YFat{~zf{fhu˭շˮŨÒēș˝ˡΧҮٻǾ[N>ZM=ZM=ZM=ZM=ZM=YL<YL<ZM=YL<YL<XK;XK;YL<ZM=ZM=TJ@TJ>XL>YN<ZM:ZN8ZN8ZM:[O?WMDWMKZSZ^Xfb]sjfspvwxx|{~ǈʉɂ}~zzuvqvoslogldPHJEFFEO@L7D3@8><=A=E?GBDHAK=M:OBAGDA<H=;.</VK>583.,)&.*:3C9D6@0:(<)<):';(=(;'8%6\"7%8)7*5(3(3)3*03587<38,2&-'-)1,3'0%/'6+=(A\u001e:\u00152\".&0+10/1,4+5)6*6+90>5>7:4615061L?K<F7>/6(3%6)9-5*6-C<7421  89352(3)4)5)5+5*5+7+YNRFH;@4</;0=1=1:-</=0=.<,:*:*;-<2YQb]ppvyltrzr}yziqeop|t}nt`jNa@^3WA^nt~i}ghq̭ܽٻԴ̩ß~~ÏÑŗɟΪҵºνȷZM=ZM=ZM=ZM=ZM=ZM=ZM=ZM=XK;XK;XK;YL<YL<ZM=ZM=ZM=YMAYM?ZM=[N=[N;\\O<\\P:\\O<ZM=YMAWLHXNOXQX]Ub`Yka\\pifokspvq{u}ÊˊɈ~zrrulz^G9C7A:C@?=89:<BC<<=<>=@ABICMAN>NA<@9?6?3=/=0E8MD61;61.2.C<?36'?.6#:'<);'9%:&:':&:'9(7(3$.\"/%7.=57230.-)(%&#%\"'\"'$* )!,%7'<\u001f;\u00164\u00113)7\".\"+*---+(-)416254645512-.+,++<491:1TK\"\u001a+#F>.&/(<7E@:7/,.*41:7?3;.5)3&5*:.;08.bWZOD86,:/9-3)6,1%2&2&4'7':,<.=/:.C;\\Wppsvv~yq|{xu}s{r~q}lxisbmI\\=\\8[:Vek}~i|d}cju|vxqwo|rtwuy§̹־ʻZM<ZM<ZM<ZM<ZM<ZM<ZM<ZM<XK:XK:XK:YL;YL;ZM<ZM<ZM<ZL?ZL?ZM=]M=]N;^O<^O<\\O<]P?[OA[NFYNJZPQ\\SX_U^_Wbb\\xibngqjvpyƊŏÐ~tnquiY;.7)6)>1B6?6?8A==;:<:@<D?IAI@K?H>7=4<1</:,;+B5JAG@A=6341@9C8:+6%8%;(=*=*;(;(:(:&9(5&2%2%5*8.80912&0%.#,$+%+',+-,)-%+#.&5$9\u001b5\u00121\r0 .-92<*1(,.002*.9>6;3:06-2.314364/:572DADA/+2.\"\u001e41?<E@=83-2,6091<-9*5'4&8+;0<29/cYXN@83+:1;27.:14+4*4*5*6(6(7(6);0B9YTllqtw~|v|yv~uso}iweqanI]<\\9\\=Ydhysu`t\\w]ckppmp_l_f\\g^j_qeyi}lrtz}ƷǿҺŷ\\L<\\L<\\L<\\L<\\L<\\L<\\L<\\L<ZJ:ZJ:ZJ:[K;[K;\\L<\\L<\\L<\\L?\\L=\\L=]M=]N;^O<^O<^O<_RA^QA\\PD[NFZOK[PN]QS]ST_RlcXvh]jbsk}w}}ÙvotviU925-5)>/E5G7C8?9=<9>9A:E>GAH@E@B<4908-:*9(:*?3F<D>9665:7C=OEI<4%9&:'<)=+>,=*:)9)8'2#/#4*=3?6912+7&6&3#/\"-\"+%,&+(++(+'-(5%8\u001d5\u00152\u00133(5.;4?8C;D<E5>+61</9-8+5,3-1.1011.<964;9ljBA.-.,97?<A=<67.6+6+5*8&6%6%8);.<1<2;1aWTM<30(;3?6;3>6=8<7=4<2;/:.7*6);/@8TMgeorz~{{zxwsl}ftbn]kG^:Z9\\AZ_cgk^eOhOlRtX{\\}^x\\qX`yO_P`UeYm`ug{jmptvyyz~ǹ˸̴[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^ohzu|{yxucOyAF@@A=F;J;J;F9B:@?;A:D<G@HAFAA?<?6<19+;*:)9*?0D:<721:9A?D?TLVH;+9)6&8%;)=,=,9*8)3&2&3'9/>7>850-&:)8)5(2'/'.',(,*+*(,)1+7';\";\u001f=\"A8G(6/;P\\`lP\\<I9G)8)8,90:1701*(&#2-641/BArpTU==FF=:<9:5807-7*4&1#7#6\"8&;,</9.:/<4XQMG70/*<7A:;5=5<9=9?9?8?5<0;.9-9,<3OGc_no|~xyzxtl}dt_nXhE\\6V7ZC\\YZmRWxIXv@\\yCdzIl}PtVwXrXoWlZl^obuh{loqrqruvvvwz|z|ȷ˶[K;[K;[K;[K;[K;[K;[K;[K;ZJ:ZJ:ZJ:[K;[K;\\L<\\L<\\L<^K=^K<]L<^M=^M;_N<^O<^O<^O<^N>^N>^N?^N?_OB`PC`OEbM\\cPdcUodZlevr~wv~ЁwkXuFf=MDPJNJHG>G<G<D>BB>C>G@HCIDDB=?9A5=/:+;*:)9*<.?6FB<;ABAA:8JBXLL>@08(3#8(<-:*7)8+0%3)8/;4:3500++'4,4-2.314345586;/4.60=1C.F*G,L1T<H3?@M_llzWfCS>P3D2A3>5<89733*/$2*-(61XT\\ZXV@AHHB@<7706-8-9+7'3!:%9$;(=-;-6)8.>5NGEA501->9?:8171/011427392:/9.:.6*7-IB_Ynl}v}x~zxsj{dt_nUeF]6V7ZF_TRvaBJo<Us?[vCdzIn~QtVyZy_waygvhyl|oprpmrrttrrtw{xxüƪZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9\\M:\\M:\\M:^K<^K<^K<_L=^M;_N<^O<^O<]N;]N;^O<_P=_P=aP@bQAbQAeKTdN[aPc`Usgarpxv|rv݂̋rbsOb>R-H:QCTDK@AA>DAEBEFAF@EBFDEEAC:?4@3;-8(9(:)9(:-;3IE??;>682/A:ZPg[QCA34'6)9+8+6+8,0&5-;4:440/,-+-,4;3;3<2=1>0=0?0@1A2D5K5O0P-Q1X:d7BO\\an`nXfQbEX8J@S:G2;/23-9-=+>(9/2(JBkcLGPM<9;9LJ@<7/7-</<+:'9&>(;%=)?-9)4':1C=HAC?722.;7:62.2-)++,.-3/61:1<1>26)4)B:XRjh|}v}y{xqh{bt^oSeI`9X9[I_QNmZ:Em8ZvCa|InSvY|]bgll{m|o}p~onllqqrronptvtwï̾ŽӫZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9\\M:\\M:\\M:`J<`J<^K<_L=^M;_N<_N<^O<^O<_P;_P;aP<aP<aP<aP<bP<fLOdMUaO]_Vkgbsryx}tvΆ}owbjOX>H$H0Q;U<M<GAEEDBCCEBCADABDBC>A6>1?19+7':)=*=,>1>7=:79/3/03294NElaj[QC</:-:.7*6+8/4,7/93621/.,1/320E/E-D*B%@\"=\u001f:\u001f:'A+G/M0R+R)V1b=nHS`miuVeKZL]CU1DAR7C,3)(0$9&A&D'=.;,ZM\\SG>D>61;7UQF@918-:,9(:&;%B)<&<&=*8(3(=4MFGCEB96307341/+2-)/*/--0/4/7/;1>2:,4(;2NHb^yzz}}xn~dw^p[lN`Ha8W7YH]JGcS1Al6ZtDf~NuZcfjnsttr}p}nmlknpoolknpsrwƱοŷҤZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9\\M:\\M:\\M:`J<`J<^K<_L=^M=_N<_N<^O<`Q>aR=bQ=bQ=bR;bP:aO9`N8jNMgNRbQ[cWkjfuv}}y{˃{|qsgjTXAG#M.T7W9P>NEMEH?BBDAC@AA?C?B9?4=0?19+8(=,A.B1C7D=6457,002880+5-UKzn^RD7=0<06,6+90708271401/105387\u001f=\u001f>\u001e>\u001d>\u001c=\u001a=\u0019<\u001b=\u0018:\u001d@$I&N$Q%U0e=sgralXeR_Q`M]?R1B:J4?-0-(5'>&C%E\"7&9(WH<0A87/3/C@XSHA916*6&5$6\"9#B*<%:%<*7&3'A7SLIEGE:82.411-.)4.'-',)+*)-(1*5,9->13(7.HB\\Xwu~xl|`sZlXiHZE^4S3RCXE@\\L*?j4Uo?d|Lw\\hlptx{xt|mzi}ghhkmmlj}ilostx«ǶȻӞ]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@pKEjKIfOUgZknlv|}̃{~uml]fRN[DQ>LANCQ>K:G<F:B;?;;<:?7>4;/8+:$C0=,6(?5D=;56183716-7)9(=';\"7\u001e74PLXOD98(?.C3;-4+GD.14;4?+9@Q(9&+*-*-\u001f\"#$()((\u001d\u001f\u001f\"+1 )&1.<$5Yn+@`j^iYcT[PTHI@;:1A2F2D.;$5\u001f7#;)=+8183EC;9234544CAKFKED;:04+4*3+2*?19,.#'\u001e,\"7/C:G=PFE;801*/-01/3.4141201/00.1+4+8-=/2#?0>3`Wtqwe}[wXuSoJgDc7Y9]>[]kC=PI/F`;Xw<eKu[zcze|hlol~k~j}g}feee}p~onk~geegjpszĤŧz]K7]K7]K7]K7]K7]K7]K7]K7^L8^L8^L8^L8^L8^L8^L8^L8\\J<^L>^N?^N?[N>ZO=\\Q?^SA_TB]QA]P@_OB`NBbPFcOFcOFkLGjMOgS\\h_rnow~~̢wx|xuhjYZgN\\FRHUJVER?J;E9A:>::=:?7>4</;,>+?-9(:,A6<47/<7404-4*4(7&:&;%;\"52A;MDI>>/8(8);.<2JF/15<6A.<?P'8$'%(),+,*+'(((*,$'%(%,:D\u001a'4CAT#6lublZcW]OSBC;8>68,E4H6?,1\u001f)\u001a(\u0019)\u001b-':6TRHG5445<=WUGBGAB99/4+6,7/5.?5:15.3+4.83?9E=JBA86/1*0-1103.3141201/00.1+4+8->03$=.=2^Uvsue|[vWtQoIhAa8Z=_F`Q\\{?7NH.Ga>Yx=eKsYxawbzf|i}j|i|i|h{e{d}c}cd{l}n}l}i}e}cccfkpu|zdoqR]_]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]kmisvz͉ٟ֗ʪ}烅~tve`kS\\GQFQHREQ@K=G6=7:99<7@7A4?0=-@-=+;*B4I?;20)926/5.7,7*7(7$:%<'3/4.A9OCH:6%3#@2>5HD134;6@4@ES3A),\"&#&03--''%%12(*7:+1)13?R^=KYiafV\\OTMREI:;74?96,?2C5>18-3),%' % 0*FC::,,44AB^]>:C;A9=39/=4@8@9A>=;>=A??>;9?=IDA;=45,2+2-3112/2040201/0/.0+4+8-?14%9*;0[Rzw~rcyZtTqMmFg=_:^BbQg?Fn<1OK2KcA[z?hLrZu^t_wc{gzgyfyfycxbyb{a|b}byj{j{h{e{az^|^`hnstwvypngVb`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]hlbclemolrtx~τߊ狇ޝ٬ɳy{߁yvnrbgU\\LUFPBM>G;D5;7:97=7A6B4B1?.;,=/>0G:RGH?6.1)9181;0<0;-6%6&9'402-=4OCK=;,8*B67.>:/0164<8BNZKW>C38$&/1,,22+*0.::\u001a\u001c37-29BENYcLY?AADCF>C9=8988:58391:2A:NHVSNNAB82:5KGNLQRYZRQYX51>6C9@7?5A9C<A;<B7=8?>C:?58=?LJ93704+3,5.302101040201.0/.0+3+8-@26'6'9.WM}y{ocwXqNmFh?c8\\=`IdYh25d<0SQ8TgG`}EjPsYt\\u^wbyeyfwdvawav`x`z`{a|byhzg|fzbz_z]|]~_emrsustii_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}tfnnzorrwv|y~׃刋쒍뛌ߞƞtkmqvj{illklfi]`QWEM;B5=596898>7A7C5C0A-8+@3;.;1RH]SNC;2907,9/>1=16*4'7(2-60=5E9F9C3A2?20&620/-1-47?OYZd[_OS.103--EE66,,-.>@2537ch=C*2-4();=AE7:378;89..43<9HESS`chndk[eB<E@^[igopjjKK=;4.>7E<C;?5<4937/0=,9+6-8*5+38<JK3/4.4+4+5.404/3//4/2/1-0..0+3+7-?29*3$8-NE}y}wl|atUmHg>b8_4\\@aMcWap/+\\A0XX>]lMbIlSt\\u_v_xcyexbu`u`u_v_w_z`{a|byd{f|dz`y^yZ{Z}\\_gmpst{nrffvi[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{tyrzpyoovpyt}wz~Ճዋ唏㗊ҙ~yl[X>H?PIVRVURRJM=C387<9;;9=8A8C4B0@-9.A65+.$J?h\\eZVI=26)4):0;05,3)6+/+61;2:/?0F7C39+1&3-31-.*.17EJS[_d\\a9<9<+.JK89//55()(+YZ?B9=7: %))=>BE49,217/5(,37KNaehncl_k_m_nNIOJ]ZVTMMGH3231A<KDPHKAA8:3502+,;+:(7%4'4/:=CIL1.3,4,5,4-4-5/4//4/2.1-0../+3+7-=0;-1#7,D;yvyqhx`sTlCc7^3_3\\DcM^JMb6+TE0W[@^kMc~KkTt[w_x`{dzcv`s]s\\s\\t]v^w_{a|bybzb|b{_x[xYzY{Z~]eimsus|mvunmfwe_P=_P=_P=_P=_P=_P=_P=_P=^O<^O<^O<^O<^O<^O<^O<^O<cP2cO4aO7^O<[OA[RK^UV_Zakgvso}z~|}w{u{tpzs}w{~Ǆ͋ӓԘ͠«ǮŦlmJ?/A2@4A9GBMLHK?A;?:=;;=:A:A5?1=.;2?84,1'J>cWh[fYPB?25)7,:05,2+6.0,4/7/8.>1C4?04'4*1)2/..-.1468?COTY^FKRW47FJ8<BE7:.015IK8;8:#%<>89;>=A6<-4)219<DLS^eksis`lYhXhXkgaZVWT@?104441C@JDRKSLJA?7938171)8/>/>)7-:9CAHAB1/4-5,5,4-3,5/50.4.2.1-0../+3+7-:.>02$7,<3tqrj}bt]pRjBb6`5a8_KfN[z;6Y?.LH/TZ@]cIbzJjTr[v^yc{dxas\\pYpYqZqZt\\u]y_z`x_y^z^y\\xWvUwV{X~]dhlormxgrlk}ecu]_O?_O?_O?_O?_O?_O?_O?_O?^N>^N>^N>^N>^N>^N>^N>^N>eQ6cR8aP<]P@ZPG\\TR_Zab^otryx~~yxwvxwt}w}Ƃƅȸп¡ϼǲkS\\FG5=0H=VQVTNO?A=?<<<;=:=5;18.82<5:3>5PDYM]PgXdWM@:-8.913-2,50402-5-<3C7C4:-3%5*-&0+.,2144.,00EIY]W\\puDJHN=C[aou>C~mqQT>@02<>EI9>7==F6@-8>J\\hmwitdl]g^kap]nWh_YOKJG740.54/.95D?JDJA@86/5-7194$0/<1=*6/:>E>C443.5.6-5,3*3,4/5/.4.2.1-0...+2+6-9-@21$6,7/pokcx]pZnPiAd7a8d=bPiQW^2'RG3DH/PV<X\\C_vHiRq[v_zb|dx_rZnUnUnUoVrXt\\u]y_v[x[y[wXvUvSwTyVzX~_cd~f{fr_kV`uVZoPRgH\\L<^N>`P@`P@_O?_O?_O?aQAbRB_O?]M=]M=aQAcSCbRB`P@eS;aP<_O?^QH[QOZSZeapsqxxz|~}xyrsnoqwv{̋ȖäŲͭЩУѠѡ̚Ɣզg_FzgteG?QMbaIL>A799;997561949550B;=5I?XKPAeVdVYKG;:/6-6/5/3//-2,70=4<08)5(8*/$/(.)0-204051408<JNY]OS7?6>X`~~owgoipfj\\_Y[^`RYCK8B7A1>+9/>=IS_`kgpepbobp`o[lTOFA853110/.2186D=B:?7<4908183845=4;3;4<5;49331/3,6-7.5+3+2,1,2./503/2.1///,3,7.@49,7+/&<5XW~he|]rRhHeAe9b5`JlRd==K. >>&?I.IO5]]EWlAcxMqZxby`t\\rXqWlSmRnSoVrXt\\u]u]tVtWvXwWvUvUuTtS{[{\\z\\uZnUc}MXrCSj>AW1?U/<R,[K;^N>`P@`P@`P@_O?`P@aQAbRB`P@_O?`P@bRBcSCbRB`P@fVF_QD\\OF_TRcZ_f`nmkwvwy{}}x|qtlolnoqsu|}ىԘШƹƵϩףܞߞޝܞ٠ҜʖѼ~dċw}mVJ`YqnZZJL>@<>>@:;5634=:73?86.>3L@I;^Op`aSH<5)0&5-4-/)4395<7<38.5)5(5*6.4-1+0+0,2,4.5.9;>AIMW[\\d\\d]e`kR]MXQ[_gjqfl[`RU07+5+5-9&5\u001f/'67DP\\[dclemepdo[hP^FB<9646353202/62>9>7<2:1918295969;7:7:797957313,4,7-7.6,2+1*0,1.0503/2.1///,3,6.=2>28-2*82Z[w{a{^vWqOkFf=b:c=cLhJVw<8F5#7=#9C(DH/UP<Tf>`rJnXw_v]tZpVnTkOkPlQmRoVrZs[s[tVuWuWuUtTrQqPqQnPlNhLbFXu?Nh8F]/@W+@W-@W-AX.YL<[N>^QA^QA^QA^QA_RB`SCaTD`SC_RB`SCaTDaTD`SC^QAbUM^QK[QPcYakesqmvuy{y{y~w}nseibfjnrv}zᇃᖔߩټظۤϠĘkpp`RG]Umius^_HL@D@D=@7:36>;;6A:707.?3=/G8j\\j[\\MB62(4+6-1*44A>GC=62)1'2'0%3*1).)/)2,7/=4A7-,43CEVX^bYaS]P[FQHSNY\\fmvmtY_AG*2,41<1>*9&66EJXISOYW__fdkaiQ[BJ956375<8<9855160:3;290908183:6:8;9:999988884403+6,8-8,6,3)/)/,0.151302.1//0,3,6.9/D99/4.0,`bnu_zWsPmLlDf8_9_GfReDJi=4K@,7@%8@(ED/LE2N^9YkEg|Qr[tZqUmRkMiKhKiLkPmToUpXqZuWuWtUrTpRmMkKjLdGaE\\~AUt;Li3E_/AX*>U'B\\/E_2Ic6WJ:ZM=\\O?^QA]P@^QA_RBaTD`SC`SC`SCaTDaTD`SC_RB]P@YNR[PVbXcjcsqmvuxzz|w|symrbi]caglrv|ȋ攑褡淴޿ܨҧßvqsecWi`rmut[[KNCG?D;?8=:8;8D?C;:0;/7)2#J;bRk]SG9.3)5+4+33ML[XKF803*4+2(-&,%,%,'0)6-<0?20(4,:6CBFHEKGPLVQ]VbXd[ggpmuY_=C.2-4-4*4%2(6<KS_?IBIGMQV[`X]GM5<5173;8?>@?<;857292:1908071738687<9;9:7;8:8845.4+7,8-8,7*3)/)/)/+252312/1//0,3,6.8.G<903.-*fjyjr`{TqKkFj=c3[<^PhXeDBbE7WP=DH1@D-JH3JB/IW4Sc?btLmUpXoRkNiKgIgIhKjMkPmToWpYtVsUqSnQjLgIeHdG`D]AWy=Rq8Mi6Lf6Ne7Pe:Lf6Oi9Sm=UH8WJ:[N>\\O?]P@]P@_RBaTD_RB`SCaTDaTD`SC_RB_RB_RBTLY`Xgnf{tpxtxwxzy{syjq`g\\b`fkqv|~Ε䞞譭齼߳سѴůy}qwkskngoi扄~sredVYLNCE>A95:7B=E?<3=3B51%1\"I;YKN@=/8*6*3'34UUkh]XE>;3;2804-1,1+0)/'0$/$0#9,4'3):5CAEGBG@HDOOZVaVa^igoYaDI885526183;9CHSVa6?4;7;AFKOIM;@056195;8;9;9:77370;2;1;2:282736465<8;8;8:9;7956/4,8-9,9-7*3)0'/)0+453322010/1,3,6.7.D:7/1-21jprzhr]vPmCf<d7c6^Db[mW[uF>_L;_ZFQP;KI4PI6MB0DR1M[8[kFf|NmSmPlMhHfGgHgIiLjOlSnVoXtVqUnPjLfIcFaF_DZ@X|?St;Pn8Pj:Tk=XmB[pEUp=Vq>Wr?RE5UH8XK;ZM=[N>\\O?^QA`SC`SCaTDaTDaTD`SC`SCbUEdWG]Ulje|yu}yzywyvxswlqcj[c]ehpw}ǁІՙܡ௲廿Źxzuwvqulg~mfoib[a[smzu{|yrpccSTHHB=>:<6A;:1D:TJ>26):,=.?/A3C5?18*23LM_]XSD?;48170929292929/9.9+8))\u00163\"@2I>E>;:7;9@8AHTUaYb^g`iU[CI?:?;AAGJMRQYT]V^4:/5037:=A:?48/2619595411/20404.<4=4=3;293734333:898888987754/4+7-9,9-7*2(0&0(0*454332111/1,3,5.90<3700-AAnukucoSkIf;c1`3b<dMg]iIFeH:YN<\\WCXQ>RJ7QF4MB0AL.GU4Sc>`rHgMjMjKhGeFfGfHgJiNkRlUmVqSoQjNgKcH`E_F_G\\E[~DWxAVr?Uo?YpB]rG_tKYtAYtAXs@NB2QE5UI9WK;XL<ZN>\\P@^RBaUEbVFbVFaUE_SCaUEfZJj^Nkgup|x{ywxvwptjoah^f_gempx~͉؏ܙϠ֪۴ߺ߾̼ƻŴqqstpqogevhenj`Ye_[Tg`tn{v{wwshf[ZQKGB=6C=;4G=\\R;0<07+6(>.D3C2A1A08:>@DCC@=8917/7/:393:3;3>5A5E6G8.\u0017;%K8L==30+108>BJKVU`Ze]eYaLR?D4+8/<7@@DFEJBI?F5;26368<7914-2.44095640.,*/,2.2-=5=4>4<3:58565555757575656422.1*7.:-:+8*3(1&1(1*555342111/1,3,5.;24+;420UVpxcn[gKbEf7b+]1b@hKeRYd8/ZI7SN:UN;[P>VI8M@0MA1=H*CN.K[6Xj@ayGfHhIgFeDcBcEeHgLhOiRjTnPlNhLdJbH_F_H`H_H_H]~I]yH]wH`wKcxOdyP[vA[vAZu@MA1PD4SG7VJ:WK;YM=[O?]QAcWGdXHdXHbVFaUEcWGj^NpdTvqyuxvtsrrsulpbgZa^femltu}ƁЍڕ⚤ȟͦԬٰ۱ڲڵ۳ֲѮ˫Ī¦{|ydbgidhbY\\g[[xeauXRe]OHVOaYjcvp}zwuljZUPJD>MGB9F>WO,\"2'5'=0E6>-2!8%F4DF9;3262;6<7<6<6;4825.4+5+8+<.>/U;I/=';+=2;56537KRLVOYS]WaU\\LSCG5)8-816455584:288<6;9=<?6:,0)..44.94860.,*/-405.;4=4=4=4;49676563615052435310-/(7.9-:+8*4&1&1(2*655342211/1,3,5.=4/&>853cepy\\hR_HaGh:e*]/a@hE]AFQ-!UJ8PN9OH5\\O>YH8L<-NB2:D)?J*GU2Rd:]sBcEfGeDcBa@aCcFeJfMgPhRlPkOfLcIaG_H_H`I\\G]H]~I`|Ka{Ld{Of{Rg|S]xC^yD_zEAC8CE:IF=OH@RGAWI@]M>`O=aQ:aS9`T>_VGaZTfaeljwrowozt~wzurohfa`^^bahgqo|xυڏ㗐흖٣ڥܦݧݦۥڦ٥֣ҢС͞ɗymrvghlc_`e[ZlYUtUPULVKRGZNZP\\Smd|t~xyyyabPQEEYV611(5(7&6%8%9':+<.?18+=/?1;-5'4&:.?590907.7+7);)@+C,;3?7D<F>C;<42*,$>5G>QHXO[RYPPGE<<!<$:(4,--'0%2$6(@'@'B&B%B$B!A!A\u001e:\"<'>)<*6.648;;94:5<4;5:593736225445464717.6,6)9*:(:&9&8%8%7#7#414/4.3.4,5)6(8*:.7/96>BlyasRlGdIj5Y5];e=cPjLVT)\":1 9<)EF4RL>PH;BC39E15K4FG\u001fHJ#MQ,U\\:\\jGcuOf}QeNcHbBa>c@eDjIlNmQjIiFgFfFfHfIcIcGdJdIc~Gc~GdFfFe~Dc|BX}8[;^><?4?A6FC<JE?OF?TG>[K>^M;`O;`Q:^S?^WGa\\Vhcinlyrqtnvptppmgfaa]^\\\\edkjtr}{φَ蘒웗Ҝӝ֞ם֝՜ҝўќ͜ʛǙēwtmtkdkf]`e[YiZSoWMzVJVIUK\\RYRXRf_qjvowuufdTSYU2+/%7)7&7%8%9&:*;-=/8,9,:,:,9+9+8+8,;1908.8,8*:(;&;%4-80=5@8A9?7<4915->6H@OGQINFC;7/8\u001f9\"8)4,./*3(7(:+B*B)A&A$@ >\u001e=\u001c<\u001d8\u001f9$;);-9297;;;94:5;6;5:593736225365464717.5,6)9*:(:&9&9%8%7#7#4-3-4,4*4*5(6)7*</5,52TYes[pGbKh@d:`1[7aImJb8?O,&=7'3:(:=,C@1F@0@?-;C.:H1@C\u0018KP'\\b<eoLhvRezSd~QdLaFa@a>c@eDiHkMlPlIjGhGfFfHfIdJdHeKdIcHdHeGeGfEd}C\\<_?bB69.:<1??7E@:KB=OE<VH=[K<^O<\\O<\\TA_WLc^[helol}sqsmqkjgc`\\[ZZ\\]\\_hjnowxʁ҆؋ܐⓒΓΓЕДѓГϒΕ͓ǓĔz{rdpt_fiZ]c\\Vc\\ReYKqWHTFZQ_Y[YXWcblipkwq|ymh`Z4+2&8):':%9%9&:):+:,9-5)5'8*>/>/6(/\":.7-7,8,9+:)9&8#4*6,8.:0=3@6A7B8;1@6E;F<H>G=@68.6!7&7,3/03,5*9*<'='=%=#;!:\u001d8\u001c7\u001b7\u001d6\u001f6#8*;1<6=9;;:86:5;6;5:585736226475565616/5,5(9)9)9'8%8%7$7$7$4+4)4*5(6(7&7'8)=12+98lt]nPi=[Jl5\\=e4[<`Tq?Oa#(H1+79+-8'18&:;)B=*A<(@>)@B*?G\u0018Y`4s~Tfwbi~Ub|MaI`C`?a>c@hEjJkMlPnKkHhGgGgIhKfKfJeKeJcHeGfHfGeFcDbBeEhH06*58-;<4A>9G@:KB;RE<VJ<XL<YN<YRB^WOc_`igrompppmjg`^WWTUWY\\_adkoqt{|̂Ոيیڍۏ͎̏Ύ΍юЍύ΍ʎƎxxq[i}WbmWYa]T\\`Q\\^IhYF}SCULZYW[V\\bekkplys}v{u~{ka<29);(:'<&;%:&:'9)9*9.6*4'8)>.?.8(/!6)5)4(6)9+<+=*;(9/9/9/9/:0;1<2=3E;E;B8=3=3A7A7=34#6)5.31/5+6(7)<&9&;&;'<&<%<$:#:!7\"7%7-95>:?9:8786:5;6;59585655427376665726/5,5(8*8(9&8&7$7$6#6#6'7(8'9(9(:(:':+;/3.IKo{VjDa=_Ci/[7`=cLlOe0=G\u001f >3--3'+8'2=,=B.B@+C;$G=\"MA'R_*q}Mp|mjW_{J]~E_Ca@b?fCkHlLmQmSoLlIiHhHhJiLhMiMfLdJdGeHfHhIfEeDfFiIlL-3'17-7:3<;6B=9G?<MD=QG=SI=SK>UOCZUQa_dhgukklljgbaXVPPQQXY`cfjorux|Ѓֆ׉؊׌،̋ˊ͉ЉшъӉЌϋȍ}xvpScQ\\qUT`^RVcOTbH_]DvUBLBRRPWPY\\dejljwqvlph~v{~ka?28(;(='='=';':'8(8)8/7.8,9+;+;*:)7(9+7+8,7+7*8*<,>-=0<0<0;/:.8,7+5*@5@5=28.8.;1:06,.$0)2.23/8-9+;+>-?.?0@/@/A.?-?->)9)8*70:6=9=775386:5;6:79585655438485676746/6,5*9*9*9(9&9&8&7$7$9%:&<'=(=(=(>*=.8-;8^eaqPi;\\Ai6a/].WIjYq>NX'-?+,730*1)-9-5@/:B+<<\"B;\u001eVG(iV6vPlwo[aK^F`BcBeBjGoLpPoSoUoLlKiHgGiJiLiNhNfJeIdHfIgIhHgGfFgIiKlN*2%.4*470894<;7B=:HA;KD<NH<NH<OKBUTR_^ffewggfgba[YQQNORS[^eilosxx}փ؆ن׈ՉԇȆȅ˅΄Ѕԅԇҍӌˍ{vrnN\\NTqTPa_PWgMReI\\`EsXCOCTRSXPZYc`ghjqq{rrh}tsjxm\\Q:-5#<'>(>(=(;(;)9)8*3+6-:.:,:)9';)=,>.@2A4=17*4&8)<,:,:,;-;-;-9+6)5(6*;/>2>3?4>37,.#)%-*02290;/>/?0A0@1@2@0=/:-9,8*7/</;0:2:6;68554286:5:6:78777675449496976746/6-6*7+8)8)9'8'8%8%8%:$<%>&?'A(A*@,=.71IKgrOdHf7]Am/_1^1XOjWfh39@*,?994443524925>-2<#29\u0018EC\u001dl`8}RuΗȕ}vbeQ_F`Bc@gDoJrOrRqUpVoLlKhGfFhIiLiNiOgKfJeIfIhIjJiGgEhJkMnP(0#*2'/4-350664<87@<9C>8IE<HE<KHCQQQ[[eabvab~`a_]ZXTTTT\\]gipsty{~ہބ݃؃օ҆ӃǄȃ˂̓ӄՆ؈ՍՋʋ|uqlirOVNQpUNc`OYgMVfI]dEo]ETF[TXYSZYa\\daekn|rsjxoYP[QD85':):'<(='=*<*:*8*7+/'2)8,;,<*;(;(<);*C4K=G:</4&5';,9)9)9)9)8)8)7)7)7);.?2?3@4A5;/3'..12495>3>0>0@/?.</</907.5,2+2)/1;3<5;59475565758697:6:7877767465:5:7:8774726-6+8*8*9(9(9(8&8&8&:\";\">$?%A(@*>-;1:6U\\_oGc>b8c6g0c4\\CbMaBIL44:97<<>948>58<7379+3=\"8D\u001eS[,PoȈˎ̒Í}{ggQ^E^@c@iDoJsPsSqUoUnMkJgGeEgHhKiNiNfLdIdIgHiJjIiFhEiKlNoQ&.!(0%-2+130333756:97>;6GD=DD<GFAOOQZZd_`t^_{\\]|`^\\ZYX\\\\ggqrz|}܁ゅ䃆ㄅႄہՁ҃ЄȃɄ̃΅Ն׈؋؍ҌƋxsntjfgSPuRLjWIe`MafO\\gI`cFn`FxR?[MZSRRUZV\\X``itkofqhD;A91%4&C29%:&;'=);+:,8,7,,#/%6)<,@->*<'8$5#B2OAN@B47)7)>/;+:*8(6'6'6(8*8+;.;/9-5*7,;1<29/7:8=:A8B4A.>,;,:/;19385857483645496;9<69453386;986979899896967465:5:7:7985827/7+8+9+:*;*:*:*:(9(: : =$?%@(@+=.81<?[hQhHh7]<j,]7i;XYpLUX00?<5<E@99;B3:G08F21?9+<E(DW*at=_|̌ɋĉzygfPZ|@]?a>hCoJrOrRpTnToMkIgFeFfGhKiNiNfKeJdGeHgHhGhGfDjLmOpR(0!'/\"(-&+-*.0/333775:94==5?@8DE?JLKQQYVWiZ\\s]^|YW[Y^]eennwxڄ䊌솇䂂܀ԂӃҀāǃɄΆ҈Ջ֌ҊǊ~xwpxkeec^XpZMm[Mi\\Kf^Kd_IcaHfbGl`FlR;UA^OaYYXPTQ[XbkcYRD<707/;/</;+9(:(:(:)8)7,5,4,/'2)8,>/@/@-=*9'9)0\"VJJ?.#=1</8*;*:)9(8'6&6&5&4&7);.>2<07,7->4E;AF8?3:4?2>-;,:2=7@5;687899:98665==<<:<8977767575979899::9;9<9<8<6;5:7:9::9;5907,7+9):):):):);*;)9!>%;#5\u001c:$E3@60.^eVgHc;\\0X/[5c<j\\mEOo33G6.9C8:E==9:B+3P-4N00D7'CJ)Wo=}_v~ˌ~~nfRXvBY{?]>c?iDnImLlNkQjRjHfDcBcDfGhKgLdJgMhNgKfHeEfEjImJpSrUtW*0\")/#).'+-(-/.222553782;<4>@5BC;HJGOPTSUaXYm[[s\\Z^]dakjus}Їዋ퍌텄 ڀ~ҀσυƆȇˉ΋ьЍΎɊ{x{stknkd^e\\SbaLb`Ke^Kh]Ii\\Ij^Hk_Gm_EraG{]C[F[LWPQSPXS`WQKF>9505/908,8*8&8&8&8)7)5,3,2,1'4)9+=-A/@-=*9(9)<.QEH<4(:-:,5&=+=+;*;*:)8)7)6(7*8,7,3)1'1(7.=4BH7>07/:0;.;1<6?6<3632:8EBJFEA?<:9:89796858598988788999:9;9<8=7<5:596888:8:5917-8*:*:*;*;*<+<+<+9\"?);$5\u001f;'</:2<=]iOd@[6Y5[:`=f@gEJ>>];2@>/3A05?4E=:X;?T-0X51ZI7bjEu[p||}yr`YuESq?\\{B_>b>iCmFlKkMhMhQhFeDcBcDgHiLhNgMiOiMiKgGgGfGjImLnQoRrU-1\"-1#,/&,.).0-11/34/45-9;0<>1@B5EH?KMLQRWUTbXWi\\Yx^]fcpmzxύᐏ퐎釃~|}ȁ}ǅĈƊʌˌˌǌ|v{pujpod`i_Ue\\MXeK]bKa_Jh[HmZIp[Hq\\Go]EtcItZ?V=WDYMTSNTIU@<<984616/6.6+7(6&8&8&8'6)5,3,1,5(6(9)<+@-@-=+8(5'J=E:A5</6(;+7&:):):):*8)7)5(3'8-6,3*3*2+6/:3=6;?4:070:2<3>7@=C7;AANKZUZURLB>62727474748596;8::7788898;9<8<7<7<38475777:7:48/7,8+:+;+<+<+<+<+<+9$@*9$7$;+2%40OTZiH`8U6V>]FfHfEat?9e?6QA2@C04?.29)>5,O61K*#W:,j\\B_t{yv|m\\uKHa7Nh9[xB_}?c?hBlEjGhJgLeMeCdCcBeFhIjNkOjNkOkOiMhJgHiHlIpMsVtWvY25$13&02'01+12-23.34.46+9;-;>-?B1DF9IJBNNNRQWTR]XVd\\Zoda~nlzwČؑ唑쓏펋扅ڂ{}}Ë}{vzm~sfmoa`k^Vi[NgZJVdJZbJa_JjZJpYIsYJtZIs]FqY?tU9T;ZF\\PRNEG:A3/4151505.4+6)8)7$8$8&9'6)5*3,2,8+7)7(:*=->/;-8+3)TK;38.A64'<->-7&8'9(:)8)7)6(3'5*3)2)4,:3>7?9>847596;5;2:397=<@UVc`njidVQA<613/71717182859697::78898;9<8<8<8<8<48686787;7<49/8.9,;,;+<+<+<+;*;*:'@,8&9';-+\"54_gSdE];U<XG_OdP_KZcPAVI8JE2CF1AF0<?*<7#>1\u001eB2\u001bSE*okHfttqt}l\\K_:BV1Lc7Yq?_{@d@iAkDiFgIdJbLcBcBdCgHjMkOmQnRjPjNjLiJgGiGmKqMuYvZx\\78(78*66,56056156167/68+;>-=@+@C.DG4IK=NNFQPNSQTVUSYY[a_lkius}Ȍ֕㔐䐍ދӄƁ}|{~zxsznzrfjm_\\j[Tk[NjZKjYI^bK_aKe^Kk[KpZLtZKw\\Kz[G{WAS=U?XFSFF?76012-3/5/4.2*2'5(9(7$9$:$:'8)7*5,3,>-:)6%8';+=.;.6,80\\T=54+A53$:(@-9):*:+:,;-:-8-7-3*1)1+71;7>:;77477;<<?69156:BFNOxwqna[KC832.73?<939382727275767868798;8<8<8>7=7=69797:::=:=7;2;/9*;*<*<)=)<(<(<(:(=*9':*9-0)AAgrL^E[BYF[N^T]VWSQSU@LN9JG4JE1FD-AA'>C#@G%MU.^g<xTfmnrzudRcC?O2BS3Oa;Vl=b{Be@iCjEiFeFbH`IeBdCgFiJkNlPnRoSjPkOjMiKiIkInKrOuYvZw[?>,?=.==1==5=<7;<6;=2;=/?B-@D+CG,GI1KM8NOASPITQLYXDZ[M_^Zgepqo{yƏӏՍъǃ~zzw{uzw|y|~~y|tzrvkqrffm`Zl[QlZNl[KmZKmZIg^Mi]Mi]Mj]Mn]Ms^My^M[I`OWGN@I=@56.0)0*515/4/4-2)3'6&;(9$;$<$<':)9*7,5,A.;(6#5#:)=.;/6->7ZTHA90@36&4 >)7'7'7'7(7)7*7,8-<3:293<7>:=9854196<9::8:>@ORccqpheUP=82+5.;7<::9<3:2:4837365556869697;8<8>7=7=6<8:8;8:;:>:>7<2</9);*;);(<(;':&:&<):(<):*7*?8TXdpK\\H]I\\L[RXWV\\R^OAP9FN9NI5K>+>4\u001b67\u0015>O#Jh4gTt\\cdfltxpn}\\Q`C=J09F,BO3O_;Xi=czDgBkDkDhFeF`G`GfCiFjKlMlOkOmQlRmQmQmPlLkJmJrOuQy]y]x\\CB0DB3DB6EB9CC;CC;BB8AD3CG0EH-GJ-JM0OO7RQ?TREURI[\\:\\\\@\\]Kaa_ihvrq{z~È{ystpqmolrntqwrwrtoskxrilmb^l_Vj\\OlZLn[Lo\\Kq\\Kq\\KrZNq[Nn\\Nl_Ol`PqaQy_N[K_SOEA8:25-1(1(5*706/4-3*4(5(6%9#;\"<$>$>'<';*9,8,D/<(5!4!9(<.9/5-83NISMB9B5@.2\u001d?(;,9+8*6)7+9.;1;3D=A<?;>;=;;:8877939584;:JJ\\[dcca=9824.81B=E@=;42;3;3928484667777696;6;8<8>7=7=6<686989;9>9>6<1<.8););(;';&;%:'9&?-7%=,:)3'QKkm\\fN^I\\HWJUSS]RfQjP=S<CL7JB/L7$F5\u001bFH!Tq;cTxoof~YXcd|YXeGGT89E-8A,:C.?I0JX7Wh>g{FhClEkDiGcFaG^GiFlImNnOlOjNkOkQpTpSpRoPoNqNvRwUz^z^y]GD3HE6HF9HE<GG?GG?FF:FG5GI1HK.JM.LO0QQ7SR=VSDWSG[\\4Z\\7[[C\\\\Rcbhmkuszx~{||zwsomjkfgbhdlflhlhleuibij`^g]Th\\NjZJl[Io\\Ks^Ms^Ms\\LzWQvYQp\\Ql`PkbQpcR{aP\\OULD>613/5/5+7*8)6/4-3,4*6*7'7%7 <\">\">$?'>'<*:,9,E/='3\u001f3 8';.9/5./*?;YTI@D7I75\u001fD,F7D5A3?2?3B7F<G?B;>9;77464657799>7:473<:IHML=;(%-(5/@9C=A;=8>;?>:2:292849596999:7:6;7<8<8>7=6<7<595878:8<7<4<0:-8(:(;';&:':&:&9%?,4\">,:*1&\\Xy|T_TbI[DRGOSPbSlS{rSC[C?H3B7%O6\"_K0prJiǀyt{qu]oHy}JXy|O\\d5:D)3=$4>&<E2=D2:B+EP2Ve<g{HiDlEmEiGdGaG^GkHnKoPoPlOiMjNjPsWsVsUrSrQuRwU{YtXsWqUSJ;SJ;SJ;SJ;SJ;SJ;SJ;SJ;VM>WN?XO@YPAZQB\\SD]TE]TEcZKbYJbXNcXRg\\Zmacsfmwjs|n{~p}ss~p}wjtobli\\fcb]a`[a^W_\\U_[R^ZOa[ObZMe\\Kg\\Ji\\Ii]Gk\\El]Fm]Dm]D_gOkiTqZH{M@RIWLTIWHN:G2?*;(:.7223,17.7.7.8.8.7-6+6+7+7+7+7+8+8+8+8+=.=.8(2!2!;*>/:,6+6-:2B8I>G9;,1!OGIAE=E;H?G@C><:54678:9:7772:3>5KAE;=07)5&8)>.A2;/<2>5=8;97967687>7>7<8:9997:5:35.6/818497989:9:;>9;99<<A=C;B6@3;+=+>,<*;(:'9&8%F2>//%-(IKkolqWZOPTQVOYP[P]R^V`XMb!:O\u000e3J\u0006Of xIhrtpakN\\lEWdHS\\GHN@=C9;<,AB4=?2:=2<B6:C2AN4Rc?\\tBgHpKoIlGjIjKgJlUmToUlPkLkHlHmFpJoIpJrNsPvUyYzZ{jo^dSWN?WN?WN?WN?WN?WN?WN?WN?XO@YPAYPA[RC\\SD]TE^UF_VGd[JcZIcYMcYOf[Uj_]nbdpcjrentgpvirvirsfom`ggZacW[\\\\T\\YRYVOWTKXTIXTI\\VJ^VIb[Ic[Hf[Gh[Hi]Gj^Fm^Gm^G]eNmhTt]MRFVMVMQHQEH9C2>,:)9,7042226-7.8.8.7-8-7,7+7+7+7+8+8+8+8+9+>/=.9(2 3 :)=.;,:-4*3+;0E:PBRCQAE@@;<6;5>7=89633696879687797=9?:C9?2:,6'5&8)=-@1A4A4@7=8976756686<6<7:89879795:392:3:3;6:8:899999;:=<=?=@;?6<2;-;+<,=+<);(:&8&7%z;)8)5*;5QPce]aMMNLSOYP\\R^S^U_V^VSg*Sg(^r3zOlzn`jFau@Sf9IY5FP7?H59?358/;<,AB4=?2:=2;A5:C2@M3Rc?]uCgHqLpJmHkJkLhKmTnToSmQkLjHlHmHpJnJpLsOuTxXxXxZm\\bQYH]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_PXN[TVQHEE>@7>3<-9*8+9.:/;17-7-7-8.8-7,8,7+7+7+7+8+8+8+9+9+@1>.9(2 3\u001f:&=,=.?07+2(3(<0F9M?QB87432052:7>;=<;<8<5:27245697<8=8;-9+6'4%5%8(<+=.D7C6B8=7966455675:6:69797795:3:3:3;4<6<6;8:999889:;<@>A=>7:17+7(;,=+=*<(;(9&8%7$u8%y6%9,E=ROVTOOHHLHSLZO^SbUaW_V]UgxB{UnzzYYp:?R$AS)AQ-?L0:C.6<.690581:;+@A3=?29<1;A59B1@M3Qb>_wEiJsNrLoJmLmNkNpVqUoSnPlKkIlHmIpJpJpLuSxXy[uWqU_NVEOx>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[Qb\\YXDD9:;8:6808-8):*@.C17*7*8+8+8+8*8*8)8)8)8)8)8)9)9)9)A2>.9'4 2\u001e8\"=)@.>/9+6*4*7+;.</>02614023488;<=?;?6<38/505477764307(6'6&7&7&9':):*A3A4A7?8:78576676:6:68768694:4;492:2:4;7:8989789<:@<B?A;;26+5'7(;*<)<)<(:&8$7#6%z@,v5#6'E;OHMILGPLPHVLZO_RbTaVaW`W~]ztsYN`8/A\u001b->\u001c3B%:F.=F3;A3:=2;<4<=79:*?@2<>19<1:@49B1?L2Pa=`xFjKtOsMqLoNoPmPpTqUpRoPmLlJnJoKqMrNtSyX|]w[mSdJ[LS|DNw?cZKcZKcZKcZKcZKcZKcZKcZKcZKcZKd[Ld[Le\\Mf]Nf]Nf]Nf_Eg`Fh`IiaLiaNi`Oh_Ng^OjaRi`Qi`Qh_Nh`Mh`Mh`KiaLb_P^[LYVGTQBPM>NK<NK:NK:PM<RO>TQ>VS@YVC\\YF^[H^]I`aSf^QmWJ[Rhcb`LM@C:<7974709+>)D+H-7)7)8*9+9+9*9*8)8)8)8)9)9)9)9)9)A2>.:(7\"5\u001e7 >&B-<*;*:,8-8.:.<0>25<3:2736464646155:39385:8:662/,(9(:(:(:(:(:(9&7&:+<-?3?7=8:68687566666748493:3;3:2;2=5=9=:><=;==A<B<A:<37-5(7(;);)<)=(;(9&8%7$6#}C/s4\"y4$G:RGNFNEWNULXL[N\\N^R`UaWbYd|j]kJDS42@&$2\u001b-:&0;*5=.9?3<?6=>6:;3::29:*>?1;=08;09?38A0>K1Pa=ayGkLuPtNrMqPqRoRrSrSrQpOmKmIpLrOtQvSxY{^z_qVdJY?]NVGQzBe\\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]WKcQEzXNhaeaUUOR=C8>6762:.@+E*I*7(7(8)9*9*9*9*8)8)9)9)9)9)9)9):)@4=/<+:$7\u001f6\u001d<#B*C.@/;,7*2(4+:2@81<2<5=8>:>;>:=9<485:8<;>;<861--'<+=,>*>*=)<(:'8%6%7);.=3<5;7;8;77575758494;4;4=4>5?7A:A;A>A?????B:@8<38-5(5'8(<*;*<)<(:&9'7%6$5#y<)r3!}:*OAYLRGOEVJZN[M[M[O\\Q^T`Ya[s}Xy`r|ZU`B9F,/;'0;+1;03=44;35<4:?8?B9?A6<<277+89)>?1:</7:/8>27@/=J0O`<ayGkLuPuOsNqPrSpSrOrPqOoMnJpLsOuRyX{Z|]x]qWgO]EV@`PYISzCg^Og^Og^Og^Og^Og^Og^Og^Og^Og^Og^Oh_Ph_Ph_Ph_Pi`QjbOjbOjbOjbOiaNiaNiaNiaNiaLh`Kh`Ih`IhaGhaEhaEhaEf_Le^Kb[H\\WDWR?PM:LI6IH6GH6GH8GJ9GK:HL;IM>HO?HO?PPDVRGYOChREYMULRLXWGJ<B7954:1@-D*D$6'7(8):*:*:*:*:*9)9)9):):):):):)?3</=,<)9 6\u001b: B)C-A/=/6)/%/'6.=60;5>:A?CBCAC@A>?1256::<;;7734.3+>+>+>+?,>+>(<';'7$7'8+8.8.92<7?;85858494:4;4=4>4A7C9C<B;A=?<=;<9>3:/8+6(7'8):);(=)=*<):'9&7&6%~5$v4$x5%B2UEXKQCPDZLZM[N]O\\Q\\R\\U[V\\W`hCX_=JS4>G,6?*2=-4>35?74=88>:=B<CF?EG<CC7@>/;9*78(=>0:</7:/8>26?.=J0N_;`xFkLuPuOsNrQrSpSqMrNqMpLoKrNuRyX`~az]qUfL_G[E\\HbRYISzCh_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<bM:qF6I>YSQOCE8:55:3>/>)<$8'8'9(;*;*;*;*;*:):):):):):):):)=2:.<,>+9#5\u001a9\u001e@':$<)?0;18.7/<5A;;B>FBGCE@?;7501.0,51:5<6:29.9,9,>+>+?,@-@-A+>*=*<(:(7(5)4*80?8D>:5:5;4;4<4=4?4@5C9D:C;A9?:;685739-7*5'6':)<*:)9&=*=+=*<)~:'|7'{6&{6&y1#8*G8REPBK?SE_SXKZN\\R]T\\V[VYTXSV^7EM(6@\u001e8A&>G2<D53=2-7/1737>7@E>GJ?GI;BC1?>);;#78(=>09;.69.8>26?.<I/N_;`xFjKuPtNsNrQrSpSqJqLpLoKoLrOwV{\\edx^jP]EYC^HeOcUZLSzEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qj_Yj_Yj`Wj`Wj`Vj`Vj`TjaRjaPjaPjbOjbOjbOjbMjbMjbMg_Jg_Jf^Ie_Ib]I\\WCSP=ML:HI7EH7AE6>E5>F7?G8=H8<G7HJ=HL>AE4HK6YS;_F0K9j]f`SSDE@@?==5=0>/3$5&6'7(7(8);,=.<-<-<-<-;,;,;,;,3,7.;-;)8\"7\u001f8\u001e:\"B-<+7)4*6/<7C?HCBGDHCC:661808.5+:/9.8.8-9,:+<+>-=*=*>+?,@-A.B-@-<*:(7(6)6+8-;1=4:4<6?6@7A7A6@4@5G=E;A6;26.3-1,1+;-:,:+:*:);)<+=+~:'|9(|9({:({:(z9'x6&w4$z, A4NCMAL>REVHRG\\R\\RUMTLZUXSWR`^R[0IQ(AK&BK,>H/7@-2=-4>34;3HPEX^RW[LLO<DF.AA'==!:;+>?1;=0:=29?34=,;H.Pa=bzHlMuPsMqLpOrSqTpJqKrLrNsPvU{\\bfx^iO_G]G`JfOhRdU[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?ON<IJ8EH7AE6>E5?E7>F7>F7=E6BF8>E5=F1DN5HK0PB'yS<ubdX_YUTFG>>@=>982:+<-=.<.;-:,9+9+:,:,:,:,:,:,:,:,?9A:A7=/6#2\u001d2\u001d3\u001d5#7(;0A8E?IDJFJGBCEDC@;59/>1A1?.@1@0>0?/?-?.A.B.;*;*<+=,?+?+?,>+@.=-:,9*8+8-:0:190;2>5A7C7D7D9E8B6A4=1:08-5.5,5.=,=,;,;+:*;*<,=,~;*|;)y:)y:)x9(w8'u6't5&1)C9NCK?J>PDTIRGSJWQUOUR\\XWTSO\\XT]0Zc8_j@[eBIT66C)4@*<G6MXGYbQ_fTW\\FJN5BE*?@!<=\u001d9:*=>0:</9<1:@45>-;H.Pa=c{IlMuPtNqLqPrSqTqKpLpJqMtQxW|_c{aoUcJ]FaJeNeNcLdU[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']Eu`WHbZebRSEFFHBD799+:,:,:,:,8+6)6)8+7+7+7+7+8,8,7,3/5/5-3(0\"0\u001e1 4$A2C7G?KFLGJFFBC?CCDA@:;1=/C1F4G3E3E2C2B0B0B/{B.xD.8*9+:);*<+<+=,<*?.=-;+9*8+9-:/;/7.90;0>3?3@4@3A4:,:,9+7+7+7,8.91=-<,<+;,:+;+<+<,};+z;*z;,w9*v8)u7(t6's5&91F<MBJ?H<ODSHQINGSOSOVS]XYUZTf_wS~\\`lxPJX46D#=J.MZ@eqYeoW\\fMNW<DJ.?D&=@!:=\u001e89);<.8:-9<1;A56?.<I/Pa=c{ImNvQtNrMqPrSpSsMpLnLpOuV{\\}`|boUfM\\E\\EdMhQeN_GcUZLSxEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QjaRjaRjaRjaRjaRjaRjaRjaRk_ak__k__k`^k`\\kaXkaWkaWkaUkaUkaUkaWkaWkaWkaXkaXncQmbPjbOjbOhaNe^L_ZGYVERO>MK<GH8DF8CE7AE6@D5>B3;I27C-EJ3IG0K<%mN9dO`NA5SLc_^^RUJMDH>C;/9-7+7+9-:/;0;0>4>4>4>4?5?5?5?5?=B>D>F=G<I>N@PDSJOGLGIEFCC?A=@<FDC??7<1>.D2H3J6G4F3D3C1B0zA.wC.uB/8+9+9+:,:,;-;+;+:+:)8)8*9,<-=/>09/8.9/:.:.:,9+8*7)7*7(6*7+8-9/;0=.<-;,9*:+~9*}:*};-|:,z;,y;,w9,s8*q6(q7)q7)B8G=K?H<I<ODUJTLPLSPQORO\\X_Xh^znkfuVYh=CR)?O(P`<crQetS\\iKNY;CL/?E)>B'=A&;>#78(:;-79,9<1;A57@/<I/O`<ayGlMvQuOsNrQrSpSqMoKoMsRz]|az^u[bJ^G[D_HgMjPfL`FbTY~KRwDi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QjaRjaRjaRjaRjaRjaRjaRjaRk`^k`^k`\\k`ZkaXkaWkaUkbSkbSkbSkbSkaUkaWkaWkaXkaXocSnbRmaQkbQkbQhaOd]M`ZJVSBRO>MK<IG8EF6DE5BC3@A19K1>H/JH1Q?+e>-ZL`S>64+@9XUigdeRUINKQJ@F<@6>4@6D:G=G>JAJAJBJBKCJCKDKDRTSTTPSMSLSLTNUNLHHFEBB@B@B@EBEBJHD@>7>2A2C1F3I6F3D3C3@0@1}?0y@/x@19.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=RFWMWOQMTQRPVQ`YbWh[whivKZi>JY.AR&IZ0Wi?dvLj|TXjDL\\8?M,:D)<D,>C-=@-:=*89):;-68+8;0<B67@/;H.L]9^vDiJtOtNsNrQsTqTmJmLpPxY|_z`rXiQYC\\E`IeKgMgKfJdHcSY{IRtBi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QkbSkbSkbSkbSkbSkbSkbSkbSla[lbYlbYlbXlcTlcRldQldQldQldQlcRlcTlbVlbXlbXlbYocSnbRmaQlcTlcTkbSg`Pd]M]WGYSCSM=MJ9KH7HE6DB3B@16J.>H-NC-b=-D:VPMJ++:9=;TPpnwvehY^]cVOOHG@C<D=G@GAGAHCIDIDIEJFJFKGKGGJGIGHGGHDHDGDEBBAAB@CBBBBB@A>A=JIB@<6>3@3A2B0D3A2@2>1=1<2<1=1}=1:3;3;1;1<1<1=/=/=/</=-;,;,9+9+8):/9.9/;/;.=.=/>.9)9*:*;+;,;+;,;+:,9+7)~6*{5){5)z6)z6+x6*x8,w9.s7,o5)o5)r:-u=0L>K>J<M=QCVHXMWNMIRQTR[We\\y_PcXFb]IBP,?M)?O(K\\2_qGk~QcyKVk@M_7@R,6E&7D*=F1=D4:=27:19:*:;-68+8;0<B67@/9F,IZ6Zr@eFrMsMrMrQsTqTlKoOsUx\\z_s[iQ`JXB^GdMgMfJeIgGhHaQXzHQsAi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QkbSkbSkbSkbSkbSkbSkbSkbSlbXlbVlcTlcRldQldOldMldMldMldMldOldQlcRlcTlbVlbXocUmaSkbSlcTmdUlcTi`Qf_Ob[K^WGWQARL<OI9LF6IC3F@02K+>G*SA+{E9NLEH5<19@E?@JIb`rpopbeZ^RJLDD=B;D=E>C<?9C=B=C>C?C?D@EAEA?D@DDFFHIHJIIIFHACADAEACAA@>>:=8EG=<73;4@4?1>0A1=/<0;1928193: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@4PBN?N=R@VFXIUJRINIRPSO\\VfZl\\LML7BL3@O.KZ9WgC`rJezOdzLVl=G]/AV+7I#0A!5C*=F5<D98=7796:;+;<.68+9<1=C77@/7D*FW3Um;a}BoJqKrMrQtUrUnNqQuWv\\sYjR`J[E^G`IbKeKfJhHfEeD`PWyGPr@i`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcRldQldOldMleKleIleIleKldMldOlcRlcTlbVlbVnbTmaSkbSkbSmdUlcTjaRh_Pd]M`YIZSCUN>QJ:MG7IC3GA13M*>G*[B.PGVV7?'3BN:C9>;:HG][gf[]ILJDF@C=C>GBGBB>=9C?B?C@DADBECECFD>C?DBEEGGGFFBC=AAD>C;A<>>>A?D@FA@C7830:4?4>1=/?2;.9.8061717384: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;0xB6TEQ@P>UBYHYISGNGSNRPPKVObUeZHFK4;K0IX;[jKgxVewQYnCSi;Me5I`28M\"-B\u001b*;\u001b2@):E7;B;8<;7;<<=-<=/79,9<1=C77@/6C)DU1Rj8_{@mHpJqLrQtUrUqQtVuYsYmSdN\\HZDdNaJ`HcIfJiIeDa>`PWyGPr@i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTo\\Nq_QtdUrdWnbTj`Th`ShbTgaSebQa^K[VBVQ;TN6NH.GA'RD)N=#cI2iVzmng[WPQBE@E@GBFDGEIGIGIBEBEBDEEDBC;D:H;F7H9H:G?EBBD?F=EBDBDBDDEDEEDEDEDDAC@B?@>?=?=?=@>E??8:280:0>4@3?2A4|@5}?4<3:3837372<-<-<-;,;-:,:,:,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=ULTLQKPJNJNLNMPLSMUK\\NdOkaFTW8JX5N_;gT`zMWpFTkARg@O`<IX7DQ39C*5=&49%7:)=>0CA4B@4@<12:/2:/4:.5;-9=.<?.>A,>D*T^<bqHqTtVtUrSsSrQv^ggqYcK_G_G^F`HbJdLfNeMcK`H^F_OTvDKm;i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTsaSr`RrbUqcVrfZpfZmeZjdXgdUkhYmjYlgThcOd^H[U=RL4PJ0F?%P@)kP;WGNBD=C?VTSRPQNOLMLKKHJHRTFG<<;:A@E?B9>4E9F9G=G>GDCEAE?GCDCDCDDEDEFDFDFDEAC@B?A>A=A=@=A>FAB<=6:090;/=0=0A4|@5}?4<3:3917172<-<-;,;,;-:,:,:,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<SKTJQJPJPLOMPNROOGSH[K{ePsiPhkLdrOgxT\\uKXoEPf?Ka:K_:K\\:GV7CP4<F-8@)6;'7:)<=/?@2@>2><03;03;05;/6<09=/<?.>A,>D*Q[9^mDmPpRrSqRsSsRxa|exakT`I]F]F\\E`IaJcLeNdMbK`I^G]MRtBIk9i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTtbTo_Pm]Pm_ToeYog\\keYhbVfbVpl`{xi~{jzgzuapiVf`JPV<DF.A?(MB.S@/U8(^6*m=3p7.x71:3@9HBOHWP\\R[WROFEA?CBFCD@?:A9C:E>G@GCFFEFDGCDCDCDCDDEECECECDBE@D?C>C=C=B=B=F@E=C:>5:/8-9,<-A2~@3}?2=1:1918180<-;,;,;,:,:,:,:.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;QIPIQJQLRMRNTPUPVO[P^OtbNoiQnrWjwYfwWPf@K_:EY6BV3EV6GV7FU8ER8?I1<D-9>*7;*:<.<>0<=/:;-5<45<46<26<09=/<>0=@-=C)MV7Zi@h|KlNpOqRuStSzcw`nWcL\\E\\E\\EZC_HaJbKdMcLaJ_H]F[}KPr@Gi7i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTtdWqaTm_Rk_SkaWlcZle[jf]jf]wuiy|rygZfNLV>AI2CF1ED0D?,I=-TD5M:+O8*R6*T7)X8+];/a?3eA5KASLUQNKEDABCCEF?>@=B>D@EAFDEDEDCDCDDDDDDDEDEBGCFBE?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:OGPHQIRMSNUPWPYQ]RaUy_PiZGd_IciOZgKN]@EU8AQ4=M0<K.?M3CQ7FR:GS;BK6>G2:A/7>,9=,9=.8<-7;,6=66=66;46<29<1;=/<?,<A*JS4Ve>dxGjLpOsTwUwT{dr[eN\\EZC\\E\\EZC_H`IaJbKaJ`I^G]FY{INp>Ef7i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTseXugZsg[mcYjaXle]snhzwp~wv~i`hSLSADK9AJ7>G4>G4BI7GN<FJ9CF5?@0=;,<:+<9*<9*U5(lD8PHPLHIEIDIAE>B?@AAC@EAEAEAEADFDFDFDDEDEDEDEAFBFAF>E=F=F=F=G>@9B;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;MGNHPJSLUOWPZPZQ{YMv\\OkZJ]UBYXDY^HOYA>L3;G18D.5A+5A+8D.=I3AM7EN;BK8?H5<E29B/7@/7>.5<,4;+5;75<56;56;48;2:</;>-;@)GP1Ra:buGiKqPuVyWxUzcnW`IZ}C[~D^G^G]F`IaJbKbKaJ`I_H^GW{KLp@Bf6haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTmaUndXpf\\lcZkd\\rmg|ľtfcTPQAEI8=F38E18G45F35F44E36D58D6;E:?G<@H=<6(L</b@7EAOOW[OVBIDJDFDFEBEBE@D?C?DFDFDFDFDCDCDCECEAFAF@F=F<F<G=G==8@9B:C9A7>0=/=.>/?/>.=-<-;,;,;-:,:,:,:,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*xD9KEMFPJTLVOXNYO|\\Os\\Nk[L_XFUTBPS@JQ?@I64@,3<+2;*09(09(2;*5>-9B1<E4?H7=H7<G6:E48C25A-3?+1=)3973954954937:19;0;>-;@*CL/O^7_rDiMrSwXyWvUs\\fOZ}CX{A\\E]F]F^G`I`I`I`I`I_H^G]FVzLJn@Ae7haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTiaVjbWkdZmf^upjҺzym__YIKL:>F19E1<K8;J79G68D68@57<57947836A3>>2J91`94HH\\__dVZOSMOLKJJHEFBDAA?DFDFDFCECEBBCBCBDCD@E?F?F<F<G=H=>8?:B9C:C8A4<-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)uC8JELHPJTLWNYOx[Mp]Nj^N]WGPQAKN=CJ:9B12:+08)36-17-06,/5+/5)17+2:-4<-9D4;F6=H7<I7:G56C/3@,1>*0640641622716929;0:<.:?)?H+KY5]pChLsTwYwWrQiT^IUx@WzB[~F[~F[~F]H_J_J_J_J^I^I]H]HUvKJk@@a6haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcToh^ng_lh_tqjũsbaZGML7CH2AI4AH6BF7BD7C@9D<9C98C772?5;@9@93H/+c76QRgimm[\\YWUSQNKKGFBB@ACGDFDFBEBEADBBBBDCCBC?C>E>E>F<G=@;@9@9C9D: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(uC8JGNIQJTMXOzZMq[Mh\\LXUDHK:=D4=E69A208+/7*5=056157257247005.06,08-19,6A3:E5=J9>K9;J77F12A,0?*.42.420511605818:/:<.:?+<E*IW4[nAgMrUvZuWoPbMX{CSv>WzB[~FY|DY|D\\G_J_J^I^I^I]H]H]HSsJHh?>^5icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUfc\\gd]vsnȷɴicbFGG-EG/DF0GD3IC5H;3F42G34M797@;;@:@;8G85cGFkjŔ譩ҋtn]XSNNNIKEICGFHHKCF:>>@FIDG:;@@@@A@B>C>B<B;B;A<@9?8A7B8@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@6LJOKQJQJ}YMv_QfYIRO>CF5=F58C35@02=/3;04:04:077577566446135016/05..6+.9+2=/6C29H5:I68G42D./A+,20,2.-2..3-36/780:</:?+6>&DR1YkChRu[w_rWjN\\}HXyDTu@Tu@WxCZ{F[|GZ{F^JbNbN^J\\}H_K`L^JTrNFd@:X4icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUed_onjͱcgkJMP1II/EC,HA/J>2L93M85Q99;;9BA?MHE\\RQyjg̳ǿ괪̃|c\\VTPSFM=DEEEEGHIKEG<><>@C>???@@A@B>B=A<A;@:@;?8A:C9A6;/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?5IEQLWRWOrVKdRDQJ:>?/:A16A14A02>02<14<15;17:388677577557446116005./7,.8-1<.4A07E49H58G44E22D.062.40.3--2,14-45-8:-9=,7?'DQ3YkEhSv`wbpYfNZzHWwETtBTtBVvDYyGYyGYyG[{I_M_M\\|J[{I^~L^~L\\|JTmOF_A9R4icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUneVneVneVddby{xشĝj`hCRW7DG,EC.KD4MC9N?8L=8C:;SJKi`axv画ecACBINVVRLIDABAFEEFCDBD=?>>??@?A@A=B=A<?:@:A:D<D<B7<29.=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:OKUPXQqSK^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[lHkZyfwflX^KWwEUuCRr@Rr@TtBVvDWwEWwEXxF[{I]}K[{I[{I]}K\\|JXxFPfOAW@3I2icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUneVneVneVneVofWgkl۲}cdnKLS4EI0HJ5KI:GE9D@7QEEk__莎bd>CPITMOJF@FBMJJI??>>>??>@?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_pPrd}nwifXT}EUrBTqASp@Sp@TqAUrBVsCVsCWtD[xH]zJ\\yI^{K_|L\\yIVsCK\\J<M;.?-gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUneVneVofWofWpgXmruҭ|bX_@GL5DL7DK;AG9>D8f\\Z|z즤ifK=QDYN[QQHD=A<D@@=?>@?B>C?C?C?C?>9@<D@E@D<@9>5<4<3=2=1=0=/~<.=/</~:/~:/~:/}9.}9.{8/{8/{8/~;2|<3|<3{;2z;4y:3y:3y:3m80m80l7/l7/k6.h6-h6-h6-h8.h8.h8.h8.g8.g8.g8.g8.k92h6/f4-g5.i70h70e4-b1*b3+b3+_0(_0(]1(V*!b6-SJn[U`OHN?8A7.=6,;9-9;.7=12:-3;.4</6<06<07:167/56.49249238139/39/2:/19.19,.9+.9+/:,0;+2?.6C29F5;H7=E6:B35;-06(/3%/1$13&15&29'GS;dtWwm~rqg\\QIq?Qn>Qn>Qn>Qn>Qn>Qn>Sp@Sp@WtD[xH]zJ]zJ_|L_|LZwGQn>ESF6D7(6)gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVneVofWpgXpgXpgXinrz׹ĥregOMP;EL:EM>EODGSG~zqƽߑ}fSK:UFWKF;@8KEC>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>.6A17B2<E4:C28?/5<,37)24'13%04%07%HT>gw]umvnf_RwKAh;Mj:Nk;Pm=Pm=Nk;Nk;Ol<Qn>VsCZwG]zJ^{K_|L_|LVsCLi9=H@/:2#.&gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVneVofWpgXqhYqhYcjpmtzƯ}vn[ZWFOQCQWKYcZbmeq[WDSCQBMAJAG@E?E@E@E>D=C<C<C?D@EAC==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;.4</9B/:C0;B0:A19=.68*24&/3$29'IU?eu[mghbWyTInE>e9Jg9Li;Nk=Nk=Li;Li;Mj<Ol>UrDYvH[xJ]zL^{M\\yKQn@Eb47@;+4/!*%gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVofWpgXpgXqhYriZhowmt|ʹƯsce]P[YM_bYovo|Ȱ}gO=Q@RDC8IAH@F@F@E=D<C;C;D@E@E@A=;77493<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;2SJaXTKpE<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=MEKBC:A7D:H>JAI>G>J2K4L5K4H2F2E3E5D5C6@4>3;29/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\\|jqOL;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>Je<Je<Lg>OjAUpGYtK\\vO]wR]wTWpPHaC8Q3).2&+/$)-heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\\kd\\md]meZmfVjcPlgQmkVlj[gg_lll~~ЯvkrSYaI_kUto}uJ@K@J<K>J>D9=2?6D;H3J7M9J7G5C4D6F7C7C8A7>5<4:19181}: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?ufSvdsrML: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@66B66B66B45B16C1CP<P]IR`IIW>AO6BP7FT:Ic@Jd?Ke@Ke>Ic<Hc:Id;Je<SnEXrK\\vQ]wT[tTTmOC\\>3L/).2',0$)-heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\\kd\\md]meZmfVmhTmhRmkVjk[jkcvxwۿʫyuy^kpZt{iٞL=Q@K;>1G9XMTJ?6D6H9J=I=B7?5A7E=A9A9@:>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ؼǫ}ſınQ>P=XHL?D7G<>4D;H?F>?9;6=8A>?;@<@<}@;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\\GskVnzor_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<I58E12@)2@)8F/?M4DX<G\\=K`ALa@K`?I_;H^:H^:SiEZoN`uV`tXZnSNbI9M4(;%',/%*-$),heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVjcYkd\\kd\\md]meZmfVlgSkiRnmXop`svmؿʱ½ÝcPK8L:O@M>=7A;D?C?<;989:====>>@?|A=xA<sB=rC=pC=s>6s>6s>6r=5p>5p>5p>5n>4n>4m=3l<2j;1j;1i:0i:0i:0p62p62p62o51m61m61k60i70l;4k:3h91e90e90e90e:1f;2dB6cA5cC4dD5fG5eH6cH3_I2^L6eV?jbKrmWnr[`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θͺƶø̧lXZGVCM;A8B<D>D??>;;99:;<<>??=}@=wB<pC=mE=lF=q?8q?8q?8q?8p?8o>7o>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<JZ?M]@O_BUeJ^nSdtZbqZXgRIXE4B1$2!&+.$),\"'*heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTjdVjcYkd\\lc\\md]meZlfVljUllTkmWjn]lrhy}оλvaP:^HI>H=H>G@F@C@=:97<;=;>;A<wB:sD<nF<lH<q?8q?8q?8q?8p?8p?8p?8p?8qB:pA9n?7j>5i=4j>5j>5k?6s63r73q62p62n72l71j81i81d8/d90c;1d>3d@4cA5cA5bB5VG4^O<gVBhWCbS<^O8[O5\\R7]V<]Y>mmSsw^zjcmU2>(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׭sYSAQ?N>O?OBJ@C:<4<7>8?6@7{B7tD6qE8nG8s>:s>:s>:q>:q>:q>:q>:p?:sB=rA<p?:m>8l=7l=7m>8n?9r73r73q73n72m82j81i81f:1f;2d>3d@4bB5`C5]A3\\@2[?1QI4[S>f^Gg_H`Y?ZS9ZS7\\W:ZV;WW;knSrx^u}eUaI%3\u001c7E.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<J3@N7FT=JXAR`I[iRanZ\\iWQ^MBN@/;/!-!+1/(.,&,*heVheVheVheVheVheVheVheVifWifWifWifWifWifWifWifWkeUkeWkdZle]md]ne^mg[mgWqoZkmUkoXkr`jrgozvecIO7T=YFQ?I:L?;0=0=0=/x=/t?/rC3sE5s<9s<9t=:s>:u@<u@<t?;q>:s@<r?;q@;q@;p?:o>9o>9o>9n72n72n93m;4l;4j;3g<3d<2c?3^>1dG9cG9T=-O8(M8'D/\u001eTR;PN7KI0MK2]Y>ieJeaDVU7XX<]`CosXzfcmT=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:?G<AI>7B25@03>-1<+2>*9E/BN8IU?O[EVbN]hWYdTLWI<F;/90)3*)/-(.,'-+heVheVheVheVheVheVheVheVifWifWifWifWifWifWifWifWkeUkeWkdZmd]md]mf^mg[khWonYjlTjoXkr`jtiq|x߲uZ[AZBYCUAQ>F5F4D4D2}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_KXeSVcRKWI<H<0<2*6,+1-*0,)/+heVheVheVheVheVheVheVheVifWifWifWifWifWifWifWifWkeUkeWlcZmd]md]mf^mg[khWmlWimTjoXktaiuiq}yjYAQ;[D]GR=F2w=)t=)t@+vC.xE2s>8p;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<5<C<AHA?L;>K:<I78E34A-2?+3A*5C,DQ=KXDQ^LQ^MHTF<H<2>4-9/-3/-3/,2.gdUgdUheVheVheVheVifWifWifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWmlWimThpXht`hthm|wڻּҽzyS<tJ2uH1wI2{M6~O;zK7o@.e8%{LBsD:qB8sD:qB8g;0d8-h<1j>3i?3i?3i?3f>2f>2f>2f>2aA4`C5`C5_C5^D5[D4ZE4VE3XI6OB/\\T?oiSc^HMK4IG0LJ3;E*?H->G*<B&<A#FI,VY:deFmmQxx\\tw\\[_F@D-6;%8@+<D/9?59?59?58>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<A=?L;@M<@M;=J88E13@,1?(0>'<I5BO;HUCIVEDPB;G;2>4.:0.5..5.-4-gdUgdUgdUheVheVifWifWifWifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWkmWjnUiqYgs_drejytܽչѷѾӾϴu`yVBlI5mH6rM;uP>mF7iB3gB2jE5nI9oJ:pK;oK;eA1eA1cB1cB1cB1cB1cB1bC1\\G6\\G6\\G6ZG6YH6WH5TG4RG3PH3MH2fdM~~fprZVX@IM4HL3;E*<F+?H+AG+AF(DG*MN/TU6xw[{z^nnTUU=AC-?A,>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:<K67F/4C,2A*6E.:I4@O<BP??M>8F91?2,9/.5.-4-,3,fcTfcTgdUheVheVifWjgXjgXifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWkmWioUiqYgs_bpcgxrڻѵ˴˺ӿһurd|]I}^JrVAaE0W;&Y=(Z?*X=(`E0`E0_F0_F0`G1`G1^H1^H1[L9ZM:ZM:XM9XM9UM8RL6QL6NL5QQ9ikS|glrXSY?DM2>G,:G+<F+?H+DJ.EJ,DG*HI*ML.yx\\tsWfdKTR;LJ5KJ6FE3<=+:@69?59?59?58>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:L6<M::K95F6/?2*:--4,-4,,3+fcTfcTgdUheVheVifWjgXjgXifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[jiWjlVhnThrYfs_aqdhysչ̳ŰĴ˴xt^GdP8aM5\\H0\\J2\\J2\\J2]K3\\L3]M4]M4]M4WO:WO:VP:VP:TO9QO8PN7NN6MO7PT;`fLfoTU^CEO4AK0:G+=J.?I.CL/HN2HM/FI,OP1YX:qmRjfKa]D[V@YT@TQ>MJ9EB1;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<N4:L2:L25G-7I1:L6<M::K96G70@3+;..5--4,,3+fcTfcTgdUheVheVifWjgXjgXifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^kg[jiWikUhnThrYgt`brej{uҶȯſļtaP6RB(XH.XH.[M2[M2\\N3\\N3[P4[P4\\Q5\\Q5TO9TO9TO9QO8PN7NN6KM5IM4JN5LR8S\\AOY>?I.9F*?L0=J.AN2DN3HQ4LR6IN0JM0ZY;miLhdIc]C_YA_ZD`[GZUBQN=LI8=C9=C9=C9<B8<B8<B8;A7;A79?59?59?5:@6:@6;A7;A7;A7;@:;@:;@::?9:?99>89>89>8;@:;@:;@:;@::?9:?9:?9:?99>:8=95:6384162/40.3/.21.21.21-10-12,01,01-12-12$5\"*<&3E/9K3<N6;M3;M3;M38J09K3;M7<M:<M;7H81B2,<//6..5--4,ZgM[hN\\hP_iQakSckTfkWhkXfgUhgUheVheVjdVldWldYmeZjgVkhYkg[kg^kg^jf]hfZgeVfiVfkUenYbo^dqhsҿͼ̿·ƍnTO2UN1RL,SJ+WN/UO/UN1TO1SO2QP4QP4PP6QM2PO3QO6PP6MO7KO6HM6EM5HQ6FO4AJ-?F'@G&EK)GM)FL(ST2RS3MN.JK,TT8bbHccIZZB[YB\\ZC][B][B[Z>XW9UT6SR3KE/JD.FA-D?,A>/@>1??3>@5<=5;>59?59A67B48C57C57D3:B79A69A68@58@59A69A6:B7:B7:B79A6:B7;C8<D9=E:>F;7B:7C97A66A16?.4<-39-270.5./51-7/-9+-<%.B\u001f3J\u001e7O\u001f7Z 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[[?VV<UU=VV>VV>XV=YW>XW;XW9WV8VU7QK5OI3LG3ID1DA2B@3??3>@5<=5;>59?59A67B48C57C57D3:B79A69A68@58@59A69A6:B7:B7:B7:B7:B7;C8<D9=E:>F;<G?<H><F;;F6<E4:B39?38=67>76<83=51=/3B+9M*BY-Ia1Nq7Mn9Ji=Fa>AY?<Q>:L<:K9=O9DV<K^@LaBLaBF]A:Q7/E.-4,+2*)0(ZgM[hN\\hP`jRakSdlUglXilYijXkjXkhYkhYlfXmgYnf[og\\khWkhYkg[jf]jf]ie\\hfZhfWgjWejTdmXgtco|s˸öƉjPK.RK.QJ-SJ+VM.UO/UN1UP2TP3QP4QP4OO3QM2ON2PN5OO5MO7KO6IN7FN6HQ6FO4CL/EL-FM,KQ/OU1SY5QY0W_8jpLy]qvVY^@LO4MO7QQ9QQ9QQ9SQ8TR9UT8WV:ZV;XR<VP:RM9NI6HE6DB5AA5?A6<=5;>5:@69A67B47B47C57D3:B7:B79A69A69A69A6:B7:B7:B7:B7:B7:B7;C8<D9>F;>F;>IA>J@?I>>I9?H7>F7>D8=B;>E>;A=6@85A39H1BV3Pg;ZrB]F\\}HVuIMhEBZ@9N;5G74E3<N8EW=NaCRgHShILcG@W=4J3180/6.-4,YgM[hN\\hP^jRblTemVhmYjmZklZklZlj[liZnhZnhZog\\ph]liXkhYjfZjf]ie\\ie\\hfZhfWehUbgQajUerao|s~Ѿ˸ƳþķǺǊmPJ0SL0SL/UL-VM.UO/VO2UP2TP3QP4PO3NN2PL1NM1OM4NN4LN6KO6JO8HP8JS8GP5GP3KR3MT3PV4V\\8]c?fsGtUislnuTZaBRV;LN6NN6MM5NL5OM6TP7WS:YU<ZT>XR<TO;QL9KH9GE8CC7@B7=>6<?6:@69A67B47B46B46C2;C8:B79A69A69A69A6:B7;C8;C8:B7:B7;C8;C8=E:>F;?G<<G?<H>>H=>I9?H7>F7>D8=B;=D=;A=6@85A39H1DX5Ri=]uEY|BXyDRqEIdA<T:2G4.@0->,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?gmIasxpr|Z\\bFLP7KM7LK6KI4NI5PK7TM:VP:WQ;VP:SN:QL9LI:IG:EE9CE:=>6<?6:@69A67B47B46B46C2;C8;C8:B79A69A6:B7;C8;C8;C8;C8;C8;C8<D9=E:>F;?G<<G?<H>=G<=H8>G6=E6=C7=B;:A:9?;5?75A39H1BV3Ne9Wo?Sv<St?NmAE`=8P6-B/*<,+<*1C-<N4H[=OdERgHLcG@W=3I2.5-+2*'.&"
  },
  {
    "path": "transupp.c",
    "content": "/*\n * transupp.c\n *\n * Copyright (C) 1997-2013, Thomas G. Lane, Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains image transformation routines and other utility code\n * used by the jpegtran sample application.  These are NOT part of the core\n * JPEG library.  But we keep these routines separate from jpegtran.c to\n * ease the task of maintaining jpegtran-like programs that have other user\n * interfaces.\n */\n\n/* Although this file really shouldn't have access to the library internals,\n * it's helpful to let it call jround_up() and jcopy_block_row().\n */\n#define JPEG_INTERNALS\n\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"transupp.h\"\t\t/* My own external interface */\n#include <ctype.h>\t\t/* to declare isdigit() */\n\n\n#if TRANSFORMS_SUPPORTED\n\n/*\n * Lossless image transformation routines.  These routines work on DCT\n * coefficient arrays and thus do not require any lossy decompression\n * or recompression of the image.\n * Thanks to Guido Vollbeding for the initial design and code of this feature,\n * and to Ben Jackson for introducing the cropping feature.\n *\n * Horizontal flipping is done in-place, using a single top-to-bottom\n * pass through the virtual source array.  It will thus be much the\n * fastest option for images larger than main memory.\n *\n * The other routines require a set of destination virtual arrays, so they\n * need twice as much memory as jpegtran normally does.  The destination\n * arrays are always written in normal scan order (top to bottom) because\n * the virtual array manager expects this.  The source arrays will be scanned\n * in the corresponding order, which means multiple passes through the source\n * arrays for most of the transforms.  That could result in much thrashing\n * if the image is larger than main memory.\n *\n * If cropping or trimming is involved, the destination arrays may be smaller\n * than the source arrays.  Note it is not possible to do horizontal flip\n * in-place when a nonzero Y crop offset is specified, since we'd have to move\n * data from one block row to another but the virtual array manager doesn't\n * guarantee we can touch more than one row at a time.  So in that case,\n * we have to use a separate destination array.\n *\n * Some notes about the operating environment of the individual transform\n * routines:\n * 1. Both the source and destination virtual arrays are allocated from the\n *    source JPEG object, and therefore should be manipulated by calling the\n *    source's memory manager.\n * 2. The destination's component count should be used.  It may be smaller\n *    than the source's when forcing to grayscale.\n * 3. Likewise the destination's sampling factors should be used.  When\n *    forcing to grayscale the destination's sampling factors will be all 1,\n *    and we may as well take that as the effective iMCU size.\n * 4. When \"trim\" is in effect, the destination's dimensions will be the\n *    trimmed values but the source's will be untrimmed.\n * 5. When \"crop\" is in effect, the destination's dimensions will be the\n *    cropped values but the source's will be uncropped.  Each transform\n *    routine is responsible for picking up source data starting at the\n *    correct X and Y offset for the crop region.  (The X and Y offsets\n *    passed to the transform routines are measured in iMCU blocks of the\n *    destination.)\n * 6. All the routines assume that the source and destination buffers are\n *    padded out to a full iMCU boundary.  This is true, although for the\n *    source buffer it is an undocumented property of jdcoefct.c.\n */\n\n\nLOCAL(void)\ndo_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t jvirt_barray_ptr *src_coef_arrays,\n\t jvirt_barray_ptr *dst_coef_arrays)\n/* Crop.  This is only used when no rotate/flip is requested with the crop. */\n{\n  JDIMENSION dst_blk_y, x_crop_blocks, y_crop_blocks;\n  int ci, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  jpeg_component_info *compptr;\n\n  /* We simply have to copy the right amount of data (the destination's\n   * image size) starting at the given X and Y offsets in the source.\n   */\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      src_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t dst_blk_y + y_crop_blocks,\n\t (JDIMENSION) compptr->v_samp_factor, FALSE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tjcopy_block_row(src_buffer[offset_y] + x_crop_blocks,\n\t\t\tdst_buffer[offset_y],\n\t\t\tcompptr->width_in_blocks);\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_crop_ext (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t     JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t     jvirt_barray_ptr *src_coef_arrays,\n\t     jvirt_barray_ptr *dst_coef_arrays)\n/* Crop.  This is only used when no rotate/flip is requested with the crop.\n * Extension: If the destination size is larger than the source, we fill in\n * the extra area with zero (neutral gray).  Note we also have to zero partial\n * iMCUs at the right and bottom edge of the source image area in this case.\n */\n{\n  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height;\n  JDIMENSION dst_blk_y, x_crop_blocks, y_crop_blocks;\n  int ci, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  jpeg_component_info *compptr;\n\n  MCU_cols = srcinfo->output_width /\n    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);\n  MCU_rows = srcinfo->output_height /\n    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      if (dstinfo->jpeg_height > srcinfo->output_height) {\n\tif (dst_blk_y < y_crop_blocks ||\n\t    dst_blk_y >= comp_height + y_crop_blocks) {\n\t  for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\t    FMEMZERO(dst_buffer[offset_y],\n\t\t     compptr->width_in_blocks * SIZEOF(JBLOCK));\n\t  }\n\t  continue;\n\t}\n\tsrc_buffer = (*srcinfo->mem->access_virt_barray)\n\t  ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t   dst_blk_y - y_crop_blocks,\n\t   (JDIMENSION) compptr->v_samp_factor, FALSE);\n      } else {\n\tsrc_buffer = (*srcinfo->mem->access_virt_barray)\n\t  ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t   dst_blk_y + y_crop_blocks,\n\t   (JDIMENSION) compptr->v_samp_factor, FALSE);\n      }\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tif (dstinfo->jpeg_width > srcinfo->output_width) {\n\t  if (x_crop_blocks > 0) {\n\t    FMEMZERO(dst_buffer[offset_y],\n\t\t     x_crop_blocks * SIZEOF(JBLOCK));\n\t  }\n\t  jcopy_block_row(src_buffer[offset_y],\n\t\t\t  dst_buffer[offset_y] + x_crop_blocks,\n\t\t\t  comp_width);\n\t  if (compptr->width_in_blocks > comp_width + x_crop_blocks) {\n\t    FMEMZERO(dst_buffer[offset_y] +\n\t\t       comp_width + x_crop_blocks,\n\t\t     (compptr->width_in_blocks -\n\t\t       comp_width - x_crop_blocks) * SIZEOF(JBLOCK));\n\t  }\n\t} else {\n\t  jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,\n\t\t\t  dst_buffer[offset_y],\n\t\t\t  compptr->width_in_blocks);\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_wipe (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t jvirt_barray_ptr *src_coef_arrays,\n\t JDIMENSION drop_width, JDIMENSION drop_height)\n/* Wipe - drop content of specified area, fill with zero (neutral gray) */\n{\n  JDIMENSION comp_width, comp_height;\n  JDIMENSION blk_y, x_wipe_blocks, y_wipe_blocks;\n  int ci, offset_y;\n  JBLOCKARRAY buffer;\n  jpeg_component_info *compptr;\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = drop_width * compptr->h_samp_factor;\n    comp_height = drop_height * compptr->v_samp_factor;\n    x_wipe_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_wipe_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (blk_y = 0; blk_y < comp_height; blk_y += compptr->v_samp_factor) {\n      buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y + y_wipe_blocks,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tFMEMZERO(buffer[offset_y] + x_wipe_blocks,\n\t\t comp_width * SIZEOF(JBLOCK));\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_flip_h_no_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t\t   JDIMENSION x_crop_offset,\n\t\t   jvirt_barray_ptr *src_coef_arrays)\n/* Horizontal flip; done in-place, so no separate dest array is required.\n * NB: this only works when y_crop_offset is zero.\n */\n{\n  JDIMENSION MCU_cols, comp_width, blk_x, blk_y, x_crop_blocks;\n  int ci, k, offset_y;\n  JBLOCKARRAY buffer;\n  JCOEFPTR ptr1, ptr2;\n  JCOEF temp1, temp2;\n  jpeg_component_info *compptr;\n\n  /* Horizontal mirroring of DCT blocks is accomplished by swapping\n   * pairs of blocks in-place.  Within a DCT block, we perform horizontal\n   * mirroring by changing the signs of odd-numbered columns.\n   * Partial iMCUs at the right edge are left untouched.\n   */\n  MCU_cols = srcinfo->output_width /\n    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    for (blk_y = 0; blk_y < compptr->height_in_blocks;\n\t blk_y += compptr->v_samp_factor) {\n      buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\t/* Do the mirroring */\n\tfor (blk_x = 0; blk_x * 2 < comp_width; blk_x++) {\n\t  ptr1 = buffer[offset_y][blk_x];\n\t  ptr2 = buffer[offset_y][comp_width - blk_x - 1];\n\t  /* this unrolled loop doesn't need to know which row it's on... */\n\t  for (k = 0; k < DCTSIZE2; k += 2) {\n\t    temp1 = *ptr1;\t/* swap even column */\n\t    temp2 = *ptr2;\n\t    *ptr1++ = temp2;\n\t    *ptr2++ = temp1;\n\t    temp1 = *ptr1;\t/* swap odd column with sign change */\n\t    temp2 = *ptr2;\n\t    *ptr1++ = -temp2;\n\t    *ptr2++ = -temp1;\n\t  }\n\t}\n\tif (x_crop_blocks > 0) {\n\t  /* Now left-justify the portion of the data to be kept.\n\t   * We can't use a single jcopy_block_row() call because that routine\n\t   * depends on memcpy(), whose behavior is unspecified for overlapping\n\t   * source and destination areas.  Sigh.\n\t   */\n\t  for (blk_x = 0; blk_x < compptr->width_in_blocks; blk_x++) {\n\t    jcopy_block_row(buffer[offset_y] + blk_x + x_crop_blocks,\n\t\t\t    buffer[offset_y] + blk_x,\n\t\t\t    (JDIMENSION) 1);\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t   JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t   jvirt_barray_ptr *src_coef_arrays,\n\t   jvirt_barray_ptr *dst_coef_arrays)\n/* Horizontal flip in general cropping case */\n{\n  JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, k, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JBLOCKROW src_row_ptr, dst_row_ptr;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* Here we must output into a separate array because we can't touch\n   * different rows of a single virtual array simultaneously.  Otherwise,\n   * this is essentially the same as the routine above.\n   */\n  MCU_cols = srcinfo->output_width /\n    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      src_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t dst_blk_y + y_crop_blocks,\n\t (JDIMENSION) compptr->v_samp_factor, FALSE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tdst_row_ptr = dst_buffer[offset_y];\n\tsrc_row_ptr = src_buffer[offset_y];\n\tfor (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {\n\t  if (x_crop_blocks + dst_blk_x < comp_width) {\n\t    /* Do the mirrorable blocks */\n\t    dst_ptr = dst_row_ptr[dst_blk_x];\n\t    src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];\n\t    /* this unrolled loop doesn't need to know which row it's on... */\n\t    for (k = 0; k < DCTSIZE2; k += 2) {\n\t      *dst_ptr++ = *src_ptr++;\t /* copy even column */\n\t      *dst_ptr++ = - *src_ptr++; /* copy odd column with sign change */\n\t    }\n\t  } else {\n\t    /* Copy last partial block(s) verbatim */\n\t    jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,\n\t\t\t    dst_row_ptr + dst_blk_x,\n\t\t\t    (JDIMENSION) 1);\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_flip_v (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t   JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t   jvirt_barray_ptr *src_coef_arrays,\n\t   jvirt_barray_ptr *dst_coef_arrays)\n/* Vertical flip */\n{\n  JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JBLOCKROW src_row_ptr, dst_row_ptr;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* We output into a separate array because we can't touch different\n   * rows of the source virtual array simultaneously.  Otherwise, this\n   * is a pretty straightforward analog of horizontal flip.\n   * Within a DCT block, vertical mirroring is done by changing the signs\n   * of odd-numbered rows.\n   * Partial iMCUs at the bottom edge are copied verbatim.\n   */\n  MCU_rows = srcinfo->output_height /\n    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      if (y_crop_blocks + dst_blk_y < comp_height) {\n\t/* Row is within the mirrorable area. */\n\tsrc_buffer = (*srcinfo->mem->access_virt_barray)\n\t  ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t   comp_height - y_crop_blocks - dst_blk_y -\n\t   (JDIMENSION) compptr->v_samp_factor,\n\t   (JDIMENSION) compptr->v_samp_factor, FALSE);\n      } else {\n\t/* Bottom-edge blocks will be copied verbatim. */\n\tsrc_buffer = (*srcinfo->mem->access_virt_barray)\n\t  ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t   dst_blk_y + y_crop_blocks,\n\t   (JDIMENSION) compptr->v_samp_factor, FALSE);\n      }\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tif (y_crop_blocks + dst_blk_y < comp_height) {\n\t  /* Row is within the mirrorable area. */\n\t  dst_row_ptr = dst_buffer[offset_y];\n\t  src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];\n\t  src_row_ptr += x_crop_blocks;\n\t  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n\t       dst_blk_x++) {\n\t    dst_ptr = dst_row_ptr[dst_blk_x];\n\t    src_ptr = src_row_ptr[dst_blk_x];\n\t    for (i = 0; i < DCTSIZE; i += 2) {\n\t      /* copy even row */\n\t      for (j = 0; j < DCTSIZE; j++)\n\t\t*dst_ptr++ = *src_ptr++;\n\t      /* copy odd row with sign change */\n\t      for (j = 0; j < DCTSIZE; j++)\n\t\t*dst_ptr++ = - *src_ptr++;\n\t    }\n\t  }\n\t} else {\n\t  /* Just copy row verbatim. */\n\t  jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,\n\t\t\t  dst_buffer[offset_y],\n\t\t\t  compptr->width_in_blocks);\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_transpose (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t      JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t      jvirt_barray_ptr *src_coef_arrays,\n\t      jvirt_barray_ptr *dst_coef_arrays)\n/* Transpose source into destination */\n{\n  JDIMENSION dst_blk_x, dst_blk_y, x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_x, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* Transposing pixels within a block just requires transposing the\n   * DCT coefficients.\n   * Partial iMCUs at the edges require no special treatment; we simply\n   * process all the available DCT blocks for every component.\n   */\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tfor (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n\t     dst_blk_x += compptr->h_samp_factor) {\n\t  src_buffer = (*srcinfo->mem->access_virt_barray)\n\t    ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t     dst_blk_x + x_crop_blocks,\n\t     (JDIMENSION) compptr->h_samp_factor, FALSE);\n\t  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {\n\t    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];\n\t    src_ptr = src_buffer[offset_x][dst_blk_y + offset_y + y_crop_blocks];\n\t    for (i = 0; i < DCTSIZE; i++)\n\t      for (j = 0; j < DCTSIZE; j++)\n\t\tdst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_rot_90 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t   JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t   jvirt_barray_ptr *src_coef_arrays,\n\t   jvirt_barray_ptr *dst_coef_arrays)\n/* 90 degree rotation is equivalent to\n *   1. Transposing the image;\n *   2. Horizontal mirroring.\n * These two steps are merged into a single processing routine.\n */\n{\n  JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_x, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* Because of the horizontal mirror step, we can't process partial iMCUs\n   * at the (output) right edge properly.  They just get transposed and\n   * not mirrored.\n   */\n  MCU_cols = srcinfo->output_height /\n    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tfor (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n\t     dst_blk_x += compptr->h_samp_factor) {\n\t  if (x_crop_blocks + dst_blk_x < comp_width) {\n\t    /* Block is within the mirrorable area. */\n\t    src_buffer = (*srcinfo->mem->access_virt_barray)\n\t      ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t       comp_width - x_crop_blocks - dst_blk_x -\n\t       (JDIMENSION) compptr->h_samp_factor,\n\t       (JDIMENSION) compptr->h_samp_factor, FALSE);\n\t  } else {\n\t    /* Edge blocks are transposed but not mirrored. */\n\t    src_buffer = (*srcinfo->mem->access_virt_barray)\n\t      ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t       dst_blk_x + x_crop_blocks,\n\t       (JDIMENSION) compptr->h_samp_factor, FALSE);\n\t  }\n\t  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {\n\t    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];\n\t    if (x_crop_blocks + dst_blk_x < comp_width) {\n\t      /* Block is within the mirrorable area. */\n\t      src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]\n\t\t[dst_blk_y + offset_y + y_crop_blocks];\n\t      for (i = 0; i < DCTSIZE; i++) {\n\t\tfor (j = 0; j < DCTSIZE; j++)\n\t\t  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t\ti++;\n\t\tfor (j = 0; j < DCTSIZE; j++)\n\t\t  dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n\t      }\n\t    } else {\n\t      /* Edge blocks are transposed but not mirrored. */\n\t      src_ptr = src_buffer[offset_x]\n\t\t[dst_blk_y + offset_y + y_crop_blocks];\n\t      for (i = 0; i < DCTSIZE; i++)\n\t\tfor (j = 0; j < DCTSIZE; j++)\n\t\t  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t    }\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_rot_270 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t    JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t    jvirt_barray_ptr *src_coef_arrays,\n\t    jvirt_barray_ptr *dst_coef_arrays)\n/* 270 degree rotation is equivalent to\n *   1. Horizontal mirroring;\n *   2. Transposing the image.\n * These two steps are merged into a single processing routine.\n */\n{\n  JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_x, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* Because of the horizontal mirror step, we can't process partial iMCUs\n   * at the (output) bottom edge properly.  They just get transposed and\n   * not mirrored.\n   */\n  MCU_rows = srcinfo->output_width /\n    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tfor (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n\t     dst_blk_x += compptr->h_samp_factor) {\n\t  src_buffer = (*srcinfo->mem->access_virt_barray)\n\t    ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t     dst_blk_x + x_crop_blocks,\n\t     (JDIMENSION) compptr->h_samp_factor, FALSE);\n\t  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {\n\t    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];\n\t    if (y_crop_blocks + dst_blk_y < comp_height) {\n\t      /* Block is within the mirrorable area. */\n\t      src_ptr = src_buffer[offset_x]\n\t\t[comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];\n\t      for (i = 0; i < DCTSIZE; i++) {\n\t\tfor (j = 0; j < DCTSIZE; j++) {\n\t\t  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t\t  j++;\n\t\t  dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n\t\t}\n\t      }\n\t    } else {\n\t      /* Edge blocks are transposed but not mirrored. */\n\t      src_ptr = src_buffer[offset_x]\n\t\t[dst_blk_y + offset_y + y_crop_blocks];\n\t      for (i = 0; i < DCTSIZE; i++)\n\t\tfor (j = 0; j < DCTSIZE; j++)\n\t\t  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t    }\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t    JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t    jvirt_barray_ptr *src_coef_arrays,\n\t    jvirt_barray_ptr *dst_coef_arrays)\n/* 180 degree rotation is equivalent to\n *   1. Vertical mirroring;\n *   2. Horizontal mirroring.\n * These two steps are merged into a single processing routine.\n */\n{\n  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JBLOCKROW src_row_ptr, dst_row_ptr;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  MCU_cols = srcinfo->output_width /\n    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);\n  MCU_rows = srcinfo->output_height /\n    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      if (y_crop_blocks + dst_blk_y < comp_height) {\n\t/* Row is within the vertically mirrorable area. */\n\tsrc_buffer = (*srcinfo->mem->access_virt_barray)\n\t  ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t   comp_height - y_crop_blocks - dst_blk_y -\n\t   (JDIMENSION) compptr->v_samp_factor,\n\t   (JDIMENSION) compptr->v_samp_factor, FALSE);\n      } else {\n\t/* Bottom-edge rows are only mirrored horizontally. */\n\tsrc_buffer = (*srcinfo->mem->access_virt_barray)\n\t  ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t   dst_blk_y + y_crop_blocks,\n\t   (JDIMENSION) compptr->v_samp_factor, FALSE);\n      }\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tdst_row_ptr = dst_buffer[offset_y];\n\tif (y_crop_blocks + dst_blk_y < comp_height) {\n\t  /* Row is within the mirrorable area. */\n\t  src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];\n\t  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {\n\t    dst_ptr = dst_row_ptr[dst_blk_x];\n\t    if (x_crop_blocks + dst_blk_x < comp_width) {\n\t      /* Process the blocks that can be mirrored both ways. */\n\t      src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];\n\t      for (i = 0; i < DCTSIZE; i += 2) {\n\t\t/* For even row, negate every odd column. */\n\t\tfor (j = 0; j < DCTSIZE; j += 2) {\n\t\t  *dst_ptr++ = *src_ptr++;\n\t\t  *dst_ptr++ = - *src_ptr++;\n\t\t}\n\t\t/* For odd row, negate every even column. */\n\t\tfor (j = 0; j < DCTSIZE; j += 2) {\n\t\t  *dst_ptr++ = - *src_ptr++;\n\t\t  *dst_ptr++ = *src_ptr++;\n\t\t}\n\t      }\n\t    } else {\n\t      /* Any remaining right-edge blocks are only mirrored vertically. */\n\t      src_ptr = src_row_ptr[x_crop_blocks + dst_blk_x];\n\t      for (i = 0; i < DCTSIZE; i += 2) {\n\t\tfor (j = 0; j < DCTSIZE; j++)\n\t\t  *dst_ptr++ = *src_ptr++;\n\t\tfor (j = 0; j < DCTSIZE; j++)\n\t\t  *dst_ptr++ = - *src_ptr++;\n\t      }\n\t    }\n\t  }\n\t} else {\n\t  /* Remaining rows are just mirrored horizontally. */\n\t  src_row_ptr = src_buffer[offset_y];\n\t  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {\n\t    if (x_crop_blocks + dst_blk_x < comp_width) {\n\t      /* Process the blocks that can be mirrored. */\n\t      dst_ptr = dst_row_ptr[dst_blk_x];\n\t      src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];\n\t      for (i = 0; i < DCTSIZE2; i += 2) {\n\t\t*dst_ptr++ = *src_ptr++;\n\t\t*dst_ptr++ = - *src_ptr++;\n\t      }\n\t    } else {\n\t      /* Any remaining right-edge blocks are only copied. */\n\t      jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,\n\t\t\t      dst_row_ptr + dst_blk_x,\n\t\t\t      (JDIMENSION) 1);\n\t    }\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_transverse (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t       JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t       jvirt_barray_ptr *src_coef_arrays,\n\t       jvirt_barray_ptr *dst_coef_arrays)\n/* Transverse transpose is equivalent to\n *   1. 180 degree rotation;\n *   2. Transposition;\n * or\n *   1. Horizontal mirroring;\n *   2. Transposition;\n *   3. Horizontal mirroring.\n * These steps are merged into a single processing routine.\n */\n{\n  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_x, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  MCU_cols = srcinfo->output_height /\n    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);\n  MCU_rows = srcinfo->output_width /\n    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tfor (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n\t     dst_blk_x += compptr->h_samp_factor) {\n\t  if (x_crop_blocks + dst_blk_x < comp_width) {\n\t    /* Block is within the mirrorable area. */\n\t    src_buffer = (*srcinfo->mem->access_virt_barray)\n\t      ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t       comp_width - x_crop_blocks - dst_blk_x -\n\t       (JDIMENSION) compptr->h_samp_factor,\n\t       (JDIMENSION) compptr->h_samp_factor, FALSE);\n\t  } else {\n\t    src_buffer = (*srcinfo->mem->access_virt_barray)\n\t      ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t       dst_blk_x + x_crop_blocks,\n\t       (JDIMENSION) compptr->h_samp_factor, FALSE);\n\t  }\n\t  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {\n\t    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];\n\t    if (y_crop_blocks + dst_blk_y < comp_height) {\n\t      if (x_crop_blocks + dst_blk_x < comp_width) {\n\t\t/* Block is within the mirrorable area. */\n\t\tsrc_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]\n\t\t  [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];\n\t\tfor (i = 0; i < DCTSIZE; i++) {\n\t\t  for (j = 0; j < DCTSIZE; j++) {\n\t\t    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t\t    j++;\n\t\t    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n\t\t  }\n\t\t  i++;\n\t\t  for (j = 0; j < DCTSIZE; j++) {\n\t\t    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n\t\t    j++;\n\t\t    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t\t  }\n\t\t}\n\t      } else {\n\t\t/* Right-edge blocks are mirrored in y only */\n\t\tsrc_ptr = src_buffer[offset_x]\n\t\t  [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];\n\t\tfor (i = 0; i < DCTSIZE; i++) {\n\t\t  for (j = 0; j < DCTSIZE; j++) {\n\t\t    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t\t    j++;\n\t\t    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n\t\t  }\n\t\t}\n\t      }\n\t    } else {\n\t      if (x_crop_blocks + dst_blk_x < comp_width) {\n\t\t/* Bottom-edge blocks are mirrored in x only */\n\t\tsrc_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]\n\t\t  [dst_blk_y + offset_y + y_crop_blocks];\n\t\tfor (i = 0; i < DCTSIZE; i++) {\n\t\t  for (j = 0; j < DCTSIZE; j++)\n\t\t    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t\t  i++;\n\t\t  for (j = 0; j < DCTSIZE; j++)\n\t\t    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n\t\t}\n\t      } else {\n\t\t/* At lower right corner, just transpose, no mirroring */\n\t\tsrc_ptr = src_buffer[offset_x]\n\t\t  [dst_blk_y + offset_y + y_crop_blocks];\n\t\tfor (i = 0; i < DCTSIZE; i++)\n\t\t  for (j = 0; j < DCTSIZE; j++)\n\t\t    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t      }\n\t    }\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\n/* Parse an unsigned integer: subroutine for jtransform_parse_crop_spec.\n * Returns TRUE if valid integer found, FALSE if not.\n * *strptr is advanced over the digit string, and *result is set to its value.\n */\n\nLOCAL(boolean)\njt_read_integer (const char ** strptr, JDIMENSION * result)\n{\n  const char * ptr = *strptr;\n  JDIMENSION val = 0;\n\n  for (; isdigit(*ptr); ptr++) {\n    val = val * 10 + (JDIMENSION) (*ptr - '0');\n  }\n  *result = val;\n  if (ptr == *strptr)\n    return FALSE;\t\t/* oops, no digits */\n  *strptr = ptr;\n  return TRUE;\n}\n\n\n/* Parse a crop specification (written in X11 geometry style).\n * The routine returns TRUE if the spec string is valid, FALSE if not.\n *\n * The crop spec string should have the format\n *\t<width>[f]x<height>[f]{+-}<xoffset>{+-}<yoffset>\n * where width, height, xoffset, and yoffset are unsigned integers.\n * Each of the elements can be omitted to indicate a default value.\n * (A weakness of this style is that it is not possible to omit xoffset\n * while specifying yoffset, since they look alike.)\n *\n * This code is loosely based on XParseGeometry from the X11 distribution.\n */\n\nGLOBAL(boolean)\njtransform_parse_crop_spec (jpeg_transform_info *info, const char *spec)\n{\n  info->crop = FALSE;\n  info->crop_width_set = JCROP_UNSET;\n  info->crop_height_set = JCROP_UNSET;\n  info->crop_xoffset_set = JCROP_UNSET;\n  info->crop_yoffset_set = JCROP_UNSET;\n\n  if (isdigit(*spec)) {\n    /* fetch width */\n    if (! jt_read_integer(&spec, &info->crop_width))\n      return FALSE;\n    if (*spec == 'f' || *spec == 'F') {\n      spec++;\n      info->crop_width_set = JCROP_FORCE;\n    } else\n      info->crop_width_set = JCROP_POS;\n  }\n  if (*spec == 'x' || *spec == 'X') {\n    /* fetch height */\n    spec++;\n    if (! jt_read_integer(&spec, &info->crop_height))\n      return FALSE;\n    if (*spec == 'f' || *spec == 'F') {\n      spec++;\n      info->crop_height_set = JCROP_FORCE;\n    } else\n      info->crop_height_set = JCROP_POS;\n  }\n  if (*spec == '+' || *spec == '-') {\n    /* fetch xoffset */\n    info->crop_xoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS;\n    spec++;\n    if (! jt_read_integer(&spec, &info->crop_xoffset))\n      return FALSE;\n  }\n  if (*spec == '+' || *spec == '-') {\n    /* fetch yoffset */\n    info->crop_yoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS;\n    spec++;\n    if (! jt_read_integer(&spec, &info->crop_yoffset))\n      return FALSE;\n  }\n  /* We had better have gotten to the end of the string. */\n  if (*spec != '\\0')\n    return FALSE;\n  info->crop = TRUE;\n  return TRUE;\n}\n\n\n/* Trim off any partial iMCUs on the indicated destination edge */\n\nLOCAL(void)\ntrim_right_edge (jpeg_transform_info *info, JDIMENSION full_width)\n{\n  JDIMENSION MCU_cols;\n\n  MCU_cols = info->output_width / info->iMCU_sample_width;\n  if (MCU_cols > 0 && info->x_crop_offset + MCU_cols ==\n      full_width / info->iMCU_sample_width)\n    info->output_width = MCU_cols * info->iMCU_sample_width;\n}\n\nLOCAL(void)\ntrim_bottom_edge (jpeg_transform_info *info, JDIMENSION full_height)\n{\n  JDIMENSION MCU_rows;\n\n  MCU_rows = info->output_height / info->iMCU_sample_height;\n  if (MCU_rows > 0 && info->y_crop_offset + MCU_rows ==\n      full_height / info->iMCU_sample_height)\n    info->output_height = MCU_rows * info->iMCU_sample_height;\n}\n\n\n/* Request any required workspace.\n *\n * This routine figures out the size that the output image will be\n * (which implies that all the transform parameters must be set before\n * it is called).\n *\n * We allocate the workspace virtual arrays from the source decompression\n * object, so that all the arrays (both the original data and the workspace)\n * will be taken into account while making memory management decisions.\n * Hence, this routine must be called after jpeg_read_header (which reads\n * the image dimensions) and before jpeg_read_coefficients (which realizes\n * the source's virtual arrays).\n *\n * This function returns FALSE right away if -perfect is given\n * and transformation is not perfect.  Otherwise returns TRUE.\n */\n\nGLOBAL(boolean)\njtransform_request_workspace (j_decompress_ptr srcinfo,\n\t\t\t      jpeg_transform_info *info)\n{\n  jvirt_barray_ptr *coef_arrays;\n  boolean need_workspace, transpose_it;\n  jpeg_component_info *compptr;\n  JDIMENSION xoffset, yoffset;\n  JDIMENSION width_in_iMCUs, height_in_iMCUs;\n  JDIMENSION width_in_blocks, height_in_blocks;\n  int ci, h_samp_factor, v_samp_factor;\n\n  /* Determine number of components in output image */\n  if (info->force_grayscale &&\n      (srcinfo->jpeg_color_space == JCS_YCbCr ||\n       srcinfo->jpeg_color_space == JCS_BG_YCC) &&\n      srcinfo->num_components == 3)\n    /* We'll only process the first component */\n    info->num_components = 1;\n  else\n    /* Process all the components */\n    info->num_components = srcinfo->num_components;\n\n  /* Compute output image dimensions and related values. */\n  jpeg_core_output_dimensions(srcinfo);\n\n  /* Return right away if -perfect is given and transformation is not perfect.\n   */\n  if (info->perfect) {\n    if (info->num_components == 1) {\n      if (!jtransform_perfect_transform(srcinfo->output_width,\n\t  srcinfo->output_height,\n\t  srcinfo->min_DCT_h_scaled_size,\n\t  srcinfo->min_DCT_v_scaled_size,\n\t  info->transform))\n\treturn FALSE;\n    } else {\n      if (!jtransform_perfect_transform(srcinfo->output_width,\n\t  srcinfo->output_height,\n\t  srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size,\n\t  srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size,\n\t  info->transform))\n\treturn FALSE;\n    }\n  }\n\n  /* If there is only one output component, force the iMCU size to be 1;\n   * else use the source iMCU size.  (This allows us to do the right thing\n   * when reducing color to grayscale, and also provides a handy way of\n   * cleaning up \"funny\" grayscale images whose sampling factors are not 1x1.)\n   */\n  switch (info->transform) {\n  case JXFORM_TRANSPOSE:\n  case JXFORM_TRANSVERSE:\n  case JXFORM_ROT_90:\n  case JXFORM_ROT_270:\n    info->output_width = srcinfo->output_height;\n    info->output_height = srcinfo->output_width;\n    if (info->num_components == 1) {\n      info->iMCU_sample_width = srcinfo->min_DCT_v_scaled_size;\n      info->iMCU_sample_height = srcinfo->min_DCT_h_scaled_size;\n    } else {\n      info->iMCU_sample_width =\n\tsrcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;\n      info->iMCU_sample_height =\n\tsrcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;\n    }\n    break;\n  default:\n    info->output_width = srcinfo->output_width;\n    info->output_height = srcinfo->output_height;\n    if (info->num_components == 1) {\n      info->iMCU_sample_width = srcinfo->min_DCT_h_scaled_size;\n      info->iMCU_sample_height = srcinfo->min_DCT_v_scaled_size;\n    } else {\n      info->iMCU_sample_width =\n\tsrcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;\n      info->iMCU_sample_height =\n\tsrcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;\n    }\n    break;\n  }\n\n  /* If cropping has been requested, compute the crop area's position and\n   * dimensions, ensuring that its upper left corner falls at an iMCU boundary.\n   */\n  if (info->crop) {\n    /* Insert default values for unset crop parameters */\n    if (info->crop_xoffset_set == JCROP_UNSET)\n      info->crop_xoffset = 0;\t/* default to +0 */\n    if (info->crop_yoffset_set == JCROP_UNSET)\n      info->crop_yoffset = 0;\t/* default to +0 */\n    if (info->crop_width_set == JCROP_UNSET) {\n      if (info->crop_xoffset >= info->output_width)\n\tERREXIT(srcinfo, JERR_BAD_CROP_SPEC);\n      info->crop_width = info->output_width - info->crop_xoffset;\n    } else {\n      /* Check for crop extension */\n      if (info->crop_width > info->output_width) {\n\t/* Crop extension does not work when transforming! */\n\tif (info->transform != JXFORM_NONE ||\n\t    info->crop_xoffset >= info->crop_width ||\n\t    info->crop_xoffset > info->crop_width - info->output_width)\n\t  ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);\n      } else {\n\tif (info->crop_xoffset >= info->output_width ||\n\t    info->crop_width <= 0 ||\n\t    info->crop_xoffset > info->output_width - info->crop_width)\n\t  ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);\n      }\n    }\n    if (info->crop_height_set == JCROP_UNSET) {\n      if (info->crop_yoffset >= info->output_height)\n\tERREXIT(srcinfo, JERR_BAD_CROP_SPEC);\n      info->crop_height = info->output_height - info->crop_yoffset;\n    } else {\n      /* Check for crop extension */\n      if (info->crop_height > info->output_height) {\n\t/* Crop extension does not work when transforming! */\n\tif (info->transform != JXFORM_NONE ||\n\t    info->crop_yoffset >= info->crop_height ||\n\t    info->crop_yoffset > info->crop_height - info->output_height)\n\t  ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);\n      } else {\n\tif (info->crop_yoffset >= info->output_height ||\n\t    info->crop_height <= 0 ||\n\t    info->crop_yoffset > info->output_height - info->crop_height)\n\t  ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);\n      }\n    }\n    /* Convert negative crop offsets into regular offsets */\n    if (info->crop_xoffset_set != JCROP_NEG)\n      xoffset = info->crop_xoffset;\n    else if (info->crop_width > info->output_width) /* crop extension */\n      xoffset = info->crop_width - info->output_width - info->crop_xoffset;\n    else\n      xoffset = info->output_width - info->crop_width - info->crop_xoffset;\n    if (info->crop_yoffset_set != JCROP_NEG)\n      yoffset = info->crop_yoffset;\n    else if (info->crop_height > info->output_height) /* crop extension */\n      yoffset = info->crop_height - info->output_height - info->crop_yoffset;\n    else\n      yoffset = info->output_height - info->crop_height - info->crop_yoffset;\n    /* Now adjust so that upper left corner falls at an iMCU boundary */\n    if (info->transform == JXFORM_WIPE) {\n      /* Ensure the effective wipe region will cover the requested */\n      info->drop_width = (JDIMENSION) jdiv_round_up\n\t((long) (info->crop_width + (xoffset % info->iMCU_sample_width)),\n\t (long) info->iMCU_sample_width);\n      info->drop_height = (JDIMENSION) jdiv_round_up\n\t((long) (info->crop_height + (yoffset % info->iMCU_sample_height)),\n\t (long) info->iMCU_sample_height);\n    } else {\n      /* Ensure the effective crop region will cover the requested */\n      if (info->crop_width_set == JCROP_FORCE ||\n\t  info->crop_width > info->output_width)\n\tinfo->output_width = info->crop_width;\n      else\n\tinfo->output_width =\n\t  info->crop_width + (xoffset % info->iMCU_sample_width);\n      if (info->crop_height_set == JCROP_FORCE ||\n\t  info->crop_height > info->output_height)\n\tinfo->output_height = info->crop_height;\n      else\n\tinfo->output_height =\n\t  info->crop_height + (yoffset % info->iMCU_sample_height);\n    }\n    /* Save x/y offsets measured in iMCUs */\n    info->x_crop_offset = xoffset / info->iMCU_sample_width;\n    info->y_crop_offset = yoffset / info->iMCU_sample_height;\n  } else {\n    info->x_crop_offset = 0;\n    info->y_crop_offset = 0;\n  }\n\n  /* Figure out whether we need workspace arrays,\n   * and if so whether they are transposed relative to the source.\n   */\n  need_workspace = FALSE;\n  transpose_it = FALSE;\n  switch (info->transform) {\n  case JXFORM_NONE:\n    if (info->x_crop_offset != 0 || info->y_crop_offset != 0 ||\n\tinfo->output_width > srcinfo->output_width ||\n\tinfo->output_height > srcinfo->output_height)\n      need_workspace = TRUE;\n    /* No workspace needed if neither cropping nor transforming */\n    break;\n  case JXFORM_FLIP_H:\n    if (info->trim)\n      trim_right_edge(info, srcinfo->output_width);\n    if (info->y_crop_offset != 0)\n      need_workspace = TRUE;\n    /* do_flip_h_no_crop doesn't need a workspace array */\n    break;\n  case JXFORM_FLIP_V:\n    if (info->trim)\n      trim_bottom_edge(info, srcinfo->output_height);\n    /* Need workspace arrays having same dimensions as source image. */\n    need_workspace = TRUE;\n    break;\n  case JXFORM_TRANSPOSE:\n    /* transpose does NOT have to trim anything */\n    /* Need workspace arrays having transposed dimensions. */\n    need_workspace = TRUE;\n    transpose_it = TRUE;\n    break;\n  case JXFORM_TRANSVERSE:\n    if (info->trim) {\n      trim_right_edge(info, srcinfo->output_height);\n      trim_bottom_edge(info, srcinfo->output_width);\n    }\n    /* Need workspace arrays having transposed dimensions. */\n    need_workspace = TRUE;\n    transpose_it = TRUE;\n    break;\n  case JXFORM_ROT_90:\n    if (info->trim)\n      trim_right_edge(info, srcinfo->output_height);\n    /* Need workspace arrays having transposed dimensions. */\n    need_workspace = TRUE;\n    transpose_it = TRUE;\n    break;\n  case JXFORM_ROT_180:\n    if (info->trim) {\n      trim_right_edge(info, srcinfo->output_width);\n      trim_bottom_edge(info, srcinfo->output_height);\n    }\n    /* Need workspace arrays having same dimensions as source image. */\n    need_workspace = TRUE;\n    break;\n  case JXFORM_ROT_270:\n    if (info->trim)\n      trim_bottom_edge(info, srcinfo->output_width);\n    /* Need workspace arrays having transposed dimensions. */\n    need_workspace = TRUE;\n    transpose_it = TRUE;\n    break;\n  case JXFORM_WIPE:\n    break;\n  }\n\n  /* Allocate workspace if needed.\n   * Note that we allocate arrays padded out to the next iMCU boundary,\n   * so that transform routines need not worry about missing edge blocks.\n   */\n  if (need_workspace) {\n    coef_arrays = (jvirt_barray_ptr *)\n      (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE,\n\tSIZEOF(jvirt_barray_ptr) * info->num_components);\n    width_in_iMCUs = (JDIMENSION)\n      jdiv_round_up((long) info->output_width,\n\t\t    (long) info->iMCU_sample_width);\n    height_in_iMCUs = (JDIMENSION)\n      jdiv_round_up((long) info->output_height,\n\t\t    (long) info->iMCU_sample_height);\n    for (ci = 0; ci < info->num_components; ci++) {\n      compptr = srcinfo->comp_info + ci;\n      if (info->num_components == 1) {\n\t/* we're going to force samp factors to 1x1 in this case */\n\th_samp_factor = v_samp_factor = 1;\n      } else if (transpose_it) {\n\th_samp_factor = compptr->v_samp_factor;\n\tv_samp_factor = compptr->h_samp_factor;\n      } else {\n\th_samp_factor = compptr->h_samp_factor;\n\tv_samp_factor = compptr->v_samp_factor;\n      }\n      width_in_blocks = width_in_iMCUs * h_samp_factor;\n      height_in_blocks = height_in_iMCUs * v_samp_factor;\n      coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)\n\t((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE,\n\t width_in_blocks, height_in_blocks, (JDIMENSION) v_samp_factor);\n    }\n    info->workspace_coef_arrays = coef_arrays;\n  } else\n    info->workspace_coef_arrays = NULL;\n\n  return TRUE;\n}\n\n\n/* Transpose destination image parameters */\n\nLOCAL(void)\ntranspose_critical_parameters (j_compress_ptr dstinfo)\n{\n  int tblno, i, j, ci, itemp;\n  jpeg_component_info *compptr;\n  JQUANT_TBL *qtblptr;\n  JDIMENSION jtemp;\n  UINT16 qtemp;\n\n  /* Transpose image dimensions */\n  jtemp = dstinfo->image_width;\n  dstinfo->image_width = dstinfo->image_height;\n  dstinfo->image_height = jtemp;\n  itemp = dstinfo->min_DCT_h_scaled_size;\n  dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;\n  dstinfo->min_DCT_v_scaled_size = itemp;\n\n  /* Transpose sampling factors */\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    itemp = compptr->h_samp_factor;\n    compptr->h_samp_factor = compptr->v_samp_factor;\n    compptr->v_samp_factor = itemp;\n  }\n\n  /* Transpose quantization tables */\n  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {\n    qtblptr = dstinfo->quant_tbl_ptrs[tblno];\n    if (qtblptr != NULL) {\n      for (i = 0; i < DCTSIZE; i++) {\n\tfor (j = 0; j < i; j++) {\n\t  qtemp = qtblptr->quantval[i*DCTSIZE+j];\n\t  qtblptr->quantval[i*DCTSIZE+j] = qtblptr->quantval[j*DCTSIZE+i];\n\t  qtblptr->quantval[j*DCTSIZE+i] = qtemp;\n\t}\n      }\n    }\n  }\n}\n\n\n/* Adjust Exif image parameters.\n *\n * We try to adjust the Tags ExifImageWidth and ExifImageHeight if possible.\n */\n\nLOCAL(void)\nadjust_exif_parameters (JOCTET FAR * data, unsigned int length,\n\t\t\tJDIMENSION new_width, JDIMENSION new_height)\n{\n  boolean is_motorola; /* Flag for byte order */\n  unsigned int number_of_tags, tagnum;\n  unsigned int firstoffset, offset;\n  JDIMENSION new_value;\n\n  if (length < 12) return; /* Length of an IFD entry */\n\n  /* Discover byte order */\n  if (GETJOCTET(data[0]) == 0x49 && GETJOCTET(data[1]) == 0x49)\n    is_motorola = FALSE;\n  else if (GETJOCTET(data[0]) == 0x4D && GETJOCTET(data[1]) == 0x4D)\n    is_motorola = TRUE;\n  else\n    return;\n\n  /* Check Tag Mark */\n  if (is_motorola) {\n    if (GETJOCTET(data[2]) != 0) return;\n    if (GETJOCTET(data[3]) != 0x2A) return;\n  } else {\n    if (GETJOCTET(data[3]) != 0) return;\n    if (GETJOCTET(data[2]) != 0x2A) return;\n  }\n\n  /* Get first IFD offset (offset to IFD0) */\n  if (is_motorola) {\n    if (GETJOCTET(data[4]) != 0) return;\n    if (GETJOCTET(data[5]) != 0) return;\n    firstoffset = GETJOCTET(data[6]);\n    firstoffset <<= 8;\n    firstoffset += GETJOCTET(data[7]);\n  } else {\n    if (GETJOCTET(data[7]) != 0) return;\n    if (GETJOCTET(data[6]) != 0) return;\n    firstoffset = GETJOCTET(data[5]);\n    firstoffset <<= 8;\n    firstoffset += GETJOCTET(data[4]);\n  }\n  if (firstoffset > length - 2) return; /* check end of data segment */\n\n  /* Get the number of directory entries contained in this IFD */\n  if (is_motorola) {\n    number_of_tags = GETJOCTET(data[firstoffset]);\n    number_of_tags <<= 8;\n    number_of_tags += GETJOCTET(data[firstoffset+1]);\n  } else {\n    number_of_tags = GETJOCTET(data[firstoffset+1]);\n    number_of_tags <<= 8;\n    number_of_tags += GETJOCTET(data[firstoffset]);\n  }\n  if (number_of_tags == 0) return;\n  firstoffset += 2;\n\n  /* Search for ExifSubIFD offset Tag in IFD0 */\n  for (;;) {\n    if (firstoffset > length - 12) return; /* check end of data segment */\n    /* Get Tag number */\n    if (is_motorola) {\n      tagnum = GETJOCTET(data[firstoffset]);\n      tagnum <<= 8;\n      tagnum += GETJOCTET(data[firstoffset+1]);\n    } else {\n      tagnum = GETJOCTET(data[firstoffset+1]);\n      tagnum <<= 8;\n      tagnum += GETJOCTET(data[firstoffset]);\n    }\n    if (tagnum == 0x8769) break; /* found ExifSubIFD offset Tag */\n    if (--number_of_tags == 0) return;\n    firstoffset += 12;\n  }\n\n  /* Get the ExifSubIFD offset */\n  if (is_motorola) {\n    if (GETJOCTET(data[firstoffset+8]) != 0) return;\n    if (GETJOCTET(data[firstoffset+9]) != 0) return;\n    offset = GETJOCTET(data[firstoffset+10]);\n    offset <<= 8;\n    offset += GETJOCTET(data[firstoffset+11]);\n  } else {\n    if (GETJOCTET(data[firstoffset+11]) != 0) return;\n    if (GETJOCTET(data[firstoffset+10]) != 0) return;\n    offset = GETJOCTET(data[firstoffset+9]);\n    offset <<= 8;\n    offset += GETJOCTET(data[firstoffset+8]);\n  }\n  if (offset > length - 2) return; /* check end of data segment */\n\n  /* Get the number of directory entries contained in this SubIFD */\n  if (is_motorola) {\n    number_of_tags = GETJOCTET(data[offset]);\n    number_of_tags <<= 8;\n    number_of_tags += GETJOCTET(data[offset+1]);\n  } else {\n    number_of_tags = GETJOCTET(data[offset+1]);\n    number_of_tags <<= 8;\n    number_of_tags += GETJOCTET(data[offset]);\n  }\n  if (number_of_tags < 2) return;\n  offset += 2;\n\n  /* Search for ExifImageWidth and ExifImageHeight Tags in this SubIFD */\n  do {\n    if (offset > length - 12) return; /* check end of data segment */\n    /* Get Tag number */\n    if (is_motorola) {\n      tagnum = GETJOCTET(data[offset]);\n      tagnum <<= 8;\n      tagnum += GETJOCTET(data[offset+1]);\n    } else {\n      tagnum = GETJOCTET(data[offset+1]);\n      tagnum <<= 8;\n      tagnum += GETJOCTET(data[offset]);\n    }\n    if (tagnum == 0xA002 || tagnum == 0xA003) {\n      if (tagnum == 0xA002)\n\tnew_value = new_width; /* ExifImageWidth Tag */\n      else\n\tnew_value = new_height; /* ExifImageHeight Tag */\n      if (is_motorola) {\n\tdata[offset+2] = 0; /* Format = unsigned long (4 octets) */\n\tdata[offset+3] = 4;\n\tdata[offset+4] = 0; /* Number Of Components = 1 */\n\tdata[offset+5] = 0;\n\tdata[offset+6] = 0;\n\tdata[offset+7] = 1;\n\tdata[offset+8] = 0;\n\tdata[offset+9] = 0;\n\tdata[offset+10] = (JOCTET)((new_value >> 8) & 0xFF);\n\tdata[offset+11] = (JOCTET)(new_value & 0xFF);\n      } else {\n\tdata[offset+2] = 4; /* Format = unsigned long (4 octets) */\n\tdata[offset+3] = 0;\n\tdata[offset+4] = 1; /* Number Of Components = 1 */\n\tdata[offset+5] = 0;\n\tdata[offset+6] = 0;\n\tdata[offset+7] = 0;\n\tdata[offset+8] = (JOCTET)(new_value & 0xFF);\n\tdata[offset+9] = (JOCTET)((new_value >> 8) & 0xFF);\n\tdata[offset+10] = 0;\n\tdata[offset+11] = 0;\n      }\n    }\n    offset += 12;\n  } while (--number_of_tags);\n}\n\n\n/* Adjust output image parameters as needed.\n *\n * This must be called after jpeg_copy_critical_parameters()\n * and before jpeg_write_coefficients().\n *\n * The return value is the set of virtual coefficient arrays to be written\n * (either the ones allocated by jtransform_request_workspace, or the\n * original source data arrays).  The caller will need to pass this value\n * to jpeg_write_coefficients().\n */\n\nGLOBAL(jvirt_barray_ptr *)\njtransform_adjust_parameters (j_decompress_ptr srcinfo,\n\t\t\t      j_compress_ptr dstinfo,\n\t\t\t      jvirt_barray_ptr *src_coef_arrays,\n\t\t\t      jpeg_transform_info *info)\n{\n  /* If force-to-grayscale is requested, adjust destination parameters */\n  if (info->force_grayscale) {\n    /* First, ensure we have YCC or grayscale data, and that the source's\n     * Y channel is full resolution.  (No reasonable person would make Y\n     * be less than full resolution, so actually coping with that case\n     * isn't worth extra code space.  But we check it to avoid crashing.)\n     */\n    if ((((dstinfo->jpeg_color_space == JCS_YCbCr ||\n\t   dstinfo->jpeg_color_space == JCS_BG_YCC) &&\n\t  dstinfo->num_components == 3) ||\n\t (dstinfo->jpeg_color_space == JCS_GRAYSCALE &&\n\t  dstinfo->num_components == 1)) &&\n\tsrcinfo->comp_info[0].h_samp_factor == srcinfo->max_h_samp_factor &&\n\tsrcinfo->comp_info[0].v_samp_factor == srcinfo->max_v_samp_factor) {\n      /* We use jpeg_set_colorspace to make sure subsidiary settings get fixed\n       * properly.  Among other things, it sets the target h_samp_factor &\n       * v_samp_factor to 1, which typically won't match the source.\n       * We have to preserve the source's quantization table number, however.\n       */\n      int sv_quant_tbl_no = dstinfo->comp_info[0].quant_tbl_no;\n      jpeg_set_colorspace(dstinfo, JCS_GRAYSCALE);\n      dstinfo->comp_info[0].quant_tbl_no = sv_quant_tbl_no;\n    } else {\n      /* Sorry, can't do it */\n      ERREXIT(dstinfo, JERR_CONVERSION_NOTIMPL);\n    }\n  } else if (info->num_components == 1) {\n    /* For a single-component source, we force the destination sampling factors\n     * to 1x1, with or without force_grayscale.  This is useful because some\n     * decoders choke on grayscale images with other sampling factors.\n     */\n    dstinfo->comp_info[0].h_samp_factor = 1;\n    dstinfo->comp_info[0].v_samp_factor = 1;\n  }\n\n  /* Correct the destination's image dimensions as necessary\n   * for rotate/flip, resize, and crop operations.\n   */\n  dstinfo->jpeg_width = info->output_width;\n  dstinfo->jpeg_height = info->output_height;\n\n  /* Transpose destination image parameters */\n  switch (info->transform) {\n  case JXFORM_TRANSPOSE:\n  case JXFORM_TRANSVERSE:\n  case JXFORM_ROT_90:\n  case JXFORM_ROT_270:\n    transpose_critical_parameters(dstinfo);\n    break;\n  default:\n    break;\n  }\n\n  /* Adjust Exif properties */\n  if (srcinfo->marker_list != NULL &&\n      srcinfo->marker_list->marker == JPEG_APP0+1 &&\n      srcinfo->marker_list->data_length >= 6 &&\n      GETJOCTET(srcinfo->marker_list->data[0]) == 0x45 &&\n      GETJOCTET(srcinfo->marker_list->data[1]) == 0x78 &&\n      GETJOCTET(srcinfo->marker_list->data[2]) == 0x69 &&\n      GETJOCTET(srcinfo->marker_list->data[3]) == 0x66 &&\n      GETJOCTET(srcinfo->marker_list->data[4]) == 0 &&\n      GETJOCTET(srcinfo->marker_list->data[5]) == 0) {\n    /* Suppress output of JFIF marker */\n    dstinfo->write_JFIF_header = FALSE;\n    /* Adjust Exif image parameters */\n    if (dstinfo->jpeg_width != srcinfo->image_width ||\n\tdstinfo->jpeg_height != srcinfo->image_height)\n      /* Align data segment to start of TIFF structure for parsing */\n      adjust_exif_parameters(srcinfo->marker_list->data + 6,\n\tsrcinfo->marker_list->data_length - 6,\n\tdstinfo->jpeg_width, dstinfo->jpeg_height);\n  }\n\n  /* Return the appropriate output data set */\n  if (info->workspace_coef_arrays != NULL)\n    return info->workspace_coef_arrays;\n  return src_coef_arrays;\n}\n\n\n/* Execute the actual transformation, if any.\n *\n * This must be called *after* jpeg_write_coefficients, because it depends\n * on jpeg_write_coefficients to have computed subsidiary values such as\n * the per-component width and height fields in the destination object.\n *\n * Note that some transformations will modify the source data arrays!\n */\n\nGLOBAL(void)\njtransform_execute_transform (j_decompress_ptr srcinfo,\n\t\t\t      j_compress_ptr dstinfo,\n\t\t\t      jvirt_barray_ptr *src_coef_arrays,\n\t\t\t      jpeg_transform_info *info)\n{\n  jvirt_barray_ptr *dst_coef_arrays = info->workspace_coef_arrays;\n\n  /* Note: conditions tested here should match those in switch statement\n   * in jtransform_request_workspace()\n   */\n  switch (info->transform) {\n  case JXFORM_NONE:\n    if (info->output_width > srcinfo->output_width ||\n\tinfo->output_height > srcinfo->output_height)\n      do_crop_ext(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t\t  src_coef_arrays, dst_coef_arrays);\n    else if (info->x_crop_offset != 0 || info->y_crop_offset != 0)\n      do_crop(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t      src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_FLIP_H:\n    if (info->y_crop_offset != 0)\n      do_flip_h(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t\tsrc_coef_arrays, dst_coef_arrays);\n    else\n      do_flip_h_no_crop(srcinfo, dstinfo, info->x_crop_offset,\n\t\t\tsrc_coef_arrays);\n    break;\n  case JXFORM_FLIP_V:\n    do_flip_v(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t      src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_TRANSPOSE:\n    do_transpose(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t\t src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_TRANSVERSE:\n    do_transverse(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t\t  src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_ROT_90:\n    do_rot_90(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t      src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_ROT_180:\n    do_rot_180(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t       src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_ROT_270:\n    do_rot_270(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t       src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_WIPE:\n    do_wipe(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t    src_coef_arrays, info->drop_width, info->drop_height);\n    break;\n  }\n}\n\n/* jtransform_perfect_transform\n *\n * Determine whether lossless transformation is perfectly\n * possible for a specified image and transformation.\n *\n * Inputs:\n *   image_width, image_height: source image dimensions.\n *   MCU_width, MCU_height: pixel dimensions of MCU.\n *   transform: transformation identifier.\n * Parameter sources from initialized jpeg_struct\n * (after reading source header):\n *   image_width = cinfo.image_width\n *   image_height = cinfo.image_height\n *   MCU_width = cinfo.max_h_samp_factor * cinfo.block_size\n *   MCU_height = cinfo.max_v_samp_factor * cinfo.block_size\n * Result:\n *   TRUE = perfect transformation possible\n *   FALSE = perfect transformation not possible\n *           (may use custom action then)\n */\n\nGLOBAL(boolean)\njtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,\n\t\t\t     int MCU_width, int MCU_height,\n\t\t\t     JXFORM_CODE transform)\n{\n  boolean result = TRUE; /* initialize TRUE */\n\n  switch (transform) {\n  case JXFORM_FLIP_H:\n  case JXFORM_ROT_270:\n    if (image_width % (JDIMENSION) MCU_width)\n      result = FALSE;\n    break;\n  case JXFORM_FLIP_V:\n  case JXFORM_ROT_90:\n    if (image_height % (JDIMENSION) MCU_height)\n      result = FALSE;\n    break;\n  case JXFORM_TRANSVERSE:\n  case JXFORM_ROT_180:\n    if (image_width % (JDIMENSION) MCU_width)\n      result = FALSE;\n    if (image_height % (JDIMENSION) MCU_height)\n      result = FALSE;\n    break;\n  default:\n    break;\n  }\n\n  return result;\n}\n\n#endif /* TRANSFORMS_SUPPORTED */\n\n\n/* Setup decompression object to save desired markers in memory.\n * This must be called before jpeg_read_header() to have the desired effect.\n */\n\nGLOBAL(void)\njcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option)\n{\n#ifdef SAVE_MARKERS_SUPPORTED\n  int m;\n\n  /* Save comments except under NONE option */\n  if (option != JCOPYOPT_NONE) {\n    jpeg_save_markers(srcinfo, JPEG_COM, 0xFFFF);\n  }\n  /* Save all types of APPn markers iff ALL option */\n  if (option == JCOPYOPT_ALL) {\n    for (m = 0; m < 16; m++)\n      jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF);\n  }\n#endif /* SAVE_MARKERS_SUPPORTED */\n}\n\n/* Copy markers saved in the given source object to the destination object.\n * This should be called just after jpeg_start_compress() or\n * jpeg_write_coefficients().\n * Note that those routines will have written the SOI, and also the\n * JFIF APP0 or Adobe APP14 markers if selected.\n */\n\nGLOBAL(void)\njcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t\t       JCOPY_OPTION option)\n{\n  jpeg_saved_marker_ptr marker;\n\n  /* In the current implementation, we don't actually need to examine the\n   * option flag here; we just copy everything that got saved.\n   * But to avoid confusion, we do not output JFIF and Adobe APP14 markers\n   * if the encoder library already wrote one.\n   */\n  for (marker = srcinfo->marker_list; marker != NULL; marker = marker->next) {\n    if (dstinfo->write_JFIF_header &&\n\tmarker->marker == JPEG_APP0 &&\n\tmarker->data_length >= 5 &&\n\tGETJOCTET(marker->data[0]) == 0x4A &&\n\tGETJOCTET(marker->data[1]) == 0x46 &&\n\tGETJOCTET(marker->data[2]) == 0x49 &&\n\tGETJOCTET(marker->data[3]) == 0x46 &&\n\tGETJOCTET(marker->data[4]) == 0)\n      continue;\t\t\t/* reject duplicate JFIF */\n    if (dstinfo->write_Adobe_marker &&\n\tmarker->marker == JPEG_APP0+14 &&\n\tmarker->data_length >= 5 &&\n\tGETJOCTET(marker->data[0]) == 0x41 &&\n\tGETJOCTET(marker->data[1]) == 0x64 &&\n\tGETJOCTET(marker->data[2]) == 0x6F &&\n\tGETJOCTET(marker->data[3]) == 0x62 &&\n\tGETJOCTET(marker->data[4]) == 0x65)\n      continue;\t\t\t/* reject duplicate Adobe */\n#ifdef NEED_FAR_POINTERS\n    /* We could use jpeg_write_marker if the data weren't FAR... */\n    {\n      unsigned int i;\n      jpeg_write_m_header(dstinfo, marker->marker, marker->data_length);\n      for (i = 0; i < marker->data_length; i++)\n\tjpeg_write_m_byte(dstinfo, marker->data[i]);\n    }\n#else\n    jpeg_write_marker(dstinfo, marker->marker,\n\t\t      marker->data, marker->data_length);\n#endif\n  }\n}\n"
  },
  {
    "path": "transupp.h",
    "content": "/*\n * transupp.h\n *\n * Copyright (C) 1997-2013, Thomas G. Lane, Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains declarations for image transformation routines and\n * other utility code used by the jpegtran sample application.  These are\n * NOT part of the core JPEG library.  But we keep these routines separate\n * from jpegtran.c to ease the task of maintaining jpegtran-like programs\n * that have other user interfaces.\n *\n * NOTE: all the routines declared here have very specific requirements\n * about when they are to be executed during the reading and writing of the\n * source and destination files.  See the comments in transupp.c, or see\n * jpegtran.c for an example of correct usage.\n */\n\n/* If you happen not to want the image transform support, disable it here */\n#ifndef TRANSFORMS_SUPPORTED\n#define TRANSFORMS_SUPPORTED 1\t\t/* 0 disables transform code */\n#endif\n\n/*\n * Although rotating and flipping data expressed as DCT coefficients is not\n * hard, there is an asymmetry in the JPEG format specification for images\n * whose dimensions aren't multiples of the iMCU size.  The right and bottom\n * image edges are padded out to the next iMCU boundary with junk data; but\n * no padding is possible at the top and left edges.  If we were to flip\n * the whole image including the pad data, then pad garbage would become\n * visible at the top and/or left, and real pixels would disappear into the\n * pad margins --- perhaps permanently, since encoders & decoders may not\n * bother to preserve DCT blocks that appear to be completely outside the\n * nominal image area.  So, we have to exclude any partial iMCUs from the\n * basic transformation.\n *\n * Transpose is the only transformation that can handle partial iMCUs at the\n * right and bottom edges completely cleanly.  flip_h can flip partial iMCUs\n * at the bottom, but leaves any partial iMCUs at the right edge untouched.\n * Similarly flip_v leaves any partial iMCUs at the bottom edge untouched.\n * The other transforms are defined as combinations of these basic transforms\n * and process edge blocks in a way that preserves the equivalence.\n *\n * The \"trim\" option causes untransformable partial iMCUs to be dropped;\n * this is not strictly lossless, but it usually gives the best-looking\n * result for odd-size images.  Note that when this option is active,\n * the expected mathematical equivalences between the transforms may not hold.\n * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim\n * followed by -rot 180 -trim trims both edges.)\n *\n * We also offer a lossless-crop option, which discards data outside a given\n * image region but losslessly preserves what is inside.  Like the rotate and\n * flip transforms, lossless crop is restricted by the current JPEG format: the\n * upper left corner of the selected region must fall on an iMCU boundary.  If\n * this does not hold for the given crop parameters, we silently move the upper\n * left corner up and/or left to make it so, simultaneously increasing the\n * region dimensions to keep the lower right crop corner unchanged.  (Thus, the\n * output image covers at least the requested region, but may cover more.)\n * The adjustment of the region dimensions may be optionally disabled.\n *\n * A complementary lossless-wipe option is provided to discard (gray out) data\n * inside a given image region while losslessly preserving what is outside.\n *\n * We also provide a lossless-resize option, which is kind of a lossless-crop\n * operation in the DCT coefficient block domain - it discards higher-order\n * coefficients and losslessly preserves lower-order coefficients of a\n * sub-block.\n *\n * Rotate/flip transform, resize, and crop can be requested together in a\n * single invocation.  The crop is applied last --- that is, the crop region\n * is specified in terms of the destination image after transform/resize.\n *\n * We also offer a \"force to grayscale\" option, which simply discards the\n * chrominance channels of a YCbCr image.  This is lossless in the sense that\n * the luminance channel is preserved exactly.  It's not the same kind of\n * thing as the rotate/flip transformations, but it's convenient to handle it\n * as part of this package, mainly because the transformation routines have to\n * be aware of the option to know how many components to work on.\n */\n\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jtransform_parse_crop_spec\tjTrParCrop\n#define jtransform_request_workspace\tjTrRequest\n#define jtransform_adjust_parameters\tjTrAdjust\n#define jtransform_execute_transform\tjTrExec\n#define jtransform_perfect_transform\tjTrPerfect\n#define jcopy_markers_setup\t\tjCMrkSetup\n#define jcopy_markers_execute\t\tjCMrkExec\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/*\n * Codes for supported types of image transformations.\n */\n\ntypedef enum {\n\tJXFORM_NONE,\t\t/* no transformation */\n\tJXFORM_FLIP_H,\t\t/* horizontal flip */\n\tJXFORM_FLIP_V,\t\t/* vertical flip */\n\tJXFORM_TRANSPOSE,\t/* transpose across UL-to-LR axis */\n\tJXFORM_TRANSVERSE,\t/* transpose across UR-to-LL axis */\n\tJXFORM_ROT_90,\t\t/* 90-degree clockwise rotation */\n\tJXFORM_ROT_180,\t\t/* 180-degree rotation */\n\tJXFORM_ROT_270,\t\t/* 270-degree clockwise (or 90 ccw) */\n\tJXFORM_WIPE\t\t/* wipe */\n} JXFORM_CODE;\n\n/*\n * Codes for crop parameters, which can individually be unspecified,\n * positive or negative for xoffset or yoffset,\n * positive or forced for width or height.\n */\n\ntypedef enum {\n        JCROP_UNSET,\n        JCROP_POS,\n        JCROP_NEG,\n        JCROP_FORCE\n} JCROP_CODE;\n\n/*\n * Transform parameters struct.\n * NB: application must not change any elements of this struct after\n * calling jtransform_request_workspace.\n */\n\ntypedef struct {\n  /* Options: set by caller */\n  JXFORM_CODE transform;\t/* image transform operator */\n  boolean perfect;\t\t/* if TRUE, fail if partial MCUs are requested */\n  boolean trim;\t\t\t/* if TRUE, trim partial MCUs as needed */\n  boolean force_grayscale;\t/* if TRUE, convert color image to grayscale */\n  boolean crop;\t\t\t/* if TRUE, crop or wipe source image */\n\n  /* Crop parameters: application need not set these unless crop is TRUE.\n   * These can be filled in by jtransform_parse_crop_spec().\n   */\n  JDIMENSION crop_width;\t/* Width of selected region */\n  JCROP_CODE crop_width_set;\t/* (forced disables adjustment) */\n  JDIMENSION crop_height;\t/* Height of selected region */\n  JCROP_CODE crop_height_set;\t/* (forced disables adjustment) */\n  JDIMENSION crop_xoffset;\t/* X offset of selected region */\n  JCROP_CODE crop_xoffset_set;\t/* (negative measures from right edge) */\n  JDIMENSION crop_yoffset;\t/* Y offset of selected region */\n  JCROP_CODE crop_yoffset_set;\t/* (negative measures from bottom edge) */\n\n  /* Internal workspace: caller should not touch these */\n  int num_components;\t\t/* # of components in workspace */\n  jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */\n  JDIMENSION output_width;\t/* cropped destination dimensions */\n  JDIMENSION output_height;\n  JDIMENSION x_crop_offset;\t/* destination crop offsets measured in iMCUs */\n  JDIMENSION y_crop_offset;\n  JDIMENSION drop_width;\t/* drop/wipe dimensions measured in iMCUs */\n  JDIMENSION drop_height;\n  int iMCU_sample_width;\t/* destination iMCU size */\n  int iMCU_sample_height;\n} jpeg_transform_info;\n\n\n#if TRANSFORMS_SUPPORTED\n\n/* Parse a crop specification (written in X11 geometry style) */\nEXTERN(boolean) jtransform_parse_crop_spec\n\tJPP((jpeg_transform_info *info, const char *spec));\n/* Request any required workspace */\nEXTERN(boolean) jtransform_request_workspace\n\tJPP((j_decompress_ptr srcinfo, jpeg_transform_info *info));\n/* Adjust output image parameters */\nEXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters\n\tJPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t     jvirt_barray_ptr *src_coef_arrays,\n\t     jpeg_transform_info *info));\n/* Execute the actual transformation, if any */\nEXTERN(void) jtransform_execute_transform\n\tJPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t     jvirt_barray_ptr *src_coef_arrays,\n\t     jpeg_transform_info *info));\n/* Determine whether lossless transformation is perfectly\n * possible for a specified image and transformation.\n */\nEXTERN(boolean) jtransform_perfect_transform\n\tJPP((JDIMENSION image_width, JDIMENSION image_height,\n\t     int MCU_width, int MCU_height,\n\t     JXFORM_CODE transform));\n\n/* jtransform_execute_transform used to be called\n * jtransform_execute_transformation, but some compilers complain about\n * routine names that long.  This macro is here to avoid breaking any\n * old source code that uses the original name...\n */\n#define jtransform_execute_transformation\tjtransform_execute_transform\n\n#endif /* TRANSFORMS_SUPPORTED */\n\n\n/*\n * Support for copying optional markers from source to destination file.\n */\n\ntypedef enum {\n\tJCOPYOPT_NONE,\t\t/* copy no optional markers */\n\tJCOPYOPT_COMMENTS,\t/* copy only comment (COM) markers */\n\tJCOPYOPT_ALL\t\t/* copy all optional markers */\n} JCOPY_OPTION;\n\n#define JCOPYOPT_DEFAULT  JCOPYOPT_COMMENTS\t/* recommended default */\n\n/* Setup decompression object to save desired markers in memory */\nEXTERN(void) jcopy_markers_setup\n\tJPP((j_decompress_ptr srcinfo, JCOPY_OPTION option));\n/* Copy markers saved in the given source object to the destination object */\nEXTERN(void) jcopy_markers_execute\n\tJPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t     JCOPY_OPTION option));\n"
  },
  {
    "path": "usage.txt",
    "content": "USAGE instructions for the Independent JPEG Group's JPEG software\n=================================================================\n\nThis file describes usage of the JPEG conversion programs cjpeg and djpeg,\nas well as the utility programs jpegtran, rdjpgcom and wrjpgcom.  (See\nthe other documentation files if you wish to use the JPEG library within\nyour own programs.)\n\nIf you are on a Unix machine you may prefer to read the Unix-style manual\npages in files cjpeg.1, djpeg.1, jpegtran.1, rdjpgcom.1, wrjpgcom.1.\n\n\nINTRODUCTION\n\nThese programs implement JPEG image encoding, decoding, and transcoding.\nJPEG (pronounced \"jay-peg\") is a standardized compression method for\nfull-color and gray-scale images.\n\n\nGENERAL USAGE\n\nWe provide two programs, cjpeg to compress an image file into JPEG format,\nand djpeg to decompress a JPEG file back into a conventional image format.\n\nOn Unix-like systems, you say:\n\tcjpeg [switches] [imagefile] >jpegfile\nor\n\tdjpeg [switches] [jpegfile]  >imagefile\nThe programs read the specified input file, or standard input if none is\nnamed.  They always write to standard output (with trace/error messages to\nstandard error).  These conventions are handy for piping images between\nprograms.\n\nOn most non-Unix systems, you say:\n\tcjpeg [switches] imagefile jpegfile\nor\n\tdjpeg [switches] jpegfile  imagefile\ni.e., both the input and output files are named on the command line.  This\nstyle is a little more foolproof, and it loses no functionality if you don't\nhave pipes.  (You can get this style on Unix too, if you prefer, by defining\nTWO_FILE_COMMANDLINE when you compile the programs; see install.txt.)\n\nYou can also say:\n\tcjpeg [switches] -outfile jpegfile  imagefile\nor\n\tdjpeg [switches] -outfile imagefile  jpegfile\nThis syntax works on all systems, so it is useful for scripts.\n\nThe currently supported image file formats are: PPM (PBMPLUS color format),\nPGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster Toolkit\nformat).  (RLE is supported only if the URT library is available.)\ncjpeg recognizes the input image format automatically, with the exception\nof some Targa-format files.  You have to tell djpeg which format to generate.\n\nJPEG files are in the defacto standard JFIF file format.  There are other,\nless widely used JPEG-based file formats, but we don't support them.\n\nAll switch names may be abbreviated; for example, -grayscale may be written\n-gray or -gr.  Most of the \"basic\" switches can be abbreviated to as little as\none letter.  Upper and lower case are equivalent (-BMP is the same as -bmp).\nBritish spellings are also accepted (e.g., -greyscale), though for brevity\nthese are not mentioned below.\n\n\nCJPEG DETAILS\n\nThe basic command line switches for cjpeg are:\n\n\t-quality N[,...]  Scale quantization tables to adjust image quality.\n\t\t\tQuality is 0 (worst) to 100 (best); default is 75.\n\t\t\t(See below for more info.)\n\n\t-grayscale\tCreate monochrome JPEG file from color input.\n\t\t\tBe sure to use this switch when compressing a grayscale\n\t\t\tBMP file, because cjpeg isn't bright enough to notice\n\t\t\twhether a BMP file uses only shades of gray.  By\n\t\t\tsaying -grayscale, you'll get a smaller JPEG file that\n\t\t\ttakes less time to process.\n\n\t-rgb\t\tCreate RGB JPEG file.\n\t\t\tUsing this switch suppresses the conversion from RGB\n\t\t\tcolorspace input to the default YCbCr JPEG colorspace.\n\t\t\tYou can use this switch in combination with the\n\t\t\t-block N switch (see below) for lossless JPEG coding.\n\t\t\tSee also the -rgb1 switch below.\n\n\t-optimize\tPerform optimization of entropy encoding parameters.\n\t\t\tWithout this, default encoding parameters are used.\n\t\t\t-optimize usually makes the JPEG file a little smaller,\n\t\t\tbut cjpeg runs somewhat slower and needs much more\n\t\t\tmemory.  Image quality and speed of decompression are\n\t\t\tunaffected by -optimize.\n\n\t-progressive\tCreate progressive JPEG file (see below).\n\n\t-scale M/N\tScale the output image by a factor M/N.  Currently\n\t\t\tsupported scale factors are M/N with all N from 1 to\n\t\t\t16, where M is the destination DCT size, which is 8 by\n\t\t\tdefault (see -block N switch below).\n\n\t-targa\t\tInput file is Targa format.  Targa files that contain\n\t\t\tan \"identification\" field will not be automatically\n\t\t\trecognized by cjpeg; for such files you must specify\n\t\t\t-targa to make cjpeg treat the input as Targa format.\n\t\t\tFor most Targa files, you won't need this switch.\n\nThe -quality switch lets you trade off compressed file size against quality of\nthe reconstructed image: the higher the quality setting, the larger the JPEG\nfile, and the closer the output image will be to the original input.  Normally\nyou want to use the lowest quality setting (smallest file) that decompresses\ninto something visually indistinguishable from the original image.  For this\npurpose the quality setting should be between 50 and 95; the default of 75 is\noften about right.  If you see defects at -quality 75, then go up 5 or 10\ncounts at a time until you are happy with the output image.  (The optimal\nsetting will vary from one image to another.)\n\n-quality 100 will generate a quantization table of all 1's, minimizing loss\nin the quantization step (but there is still information loss in subsampling,\nas well as roundoff error).  This setting is mainly of interest for\nexperimental purposes.  Quality values above about 95 are NOT recommended for\nnormal use; the compressed file size goes up dramatically for hardly any gain\nin output image quality.\n\nIn the other direction, quality values below 50 will produce very small files\nof low image quality.  Settings around 5 to 10 might be useful in preparing an\nindex of a large image library, for example.  Try -quality 2 (or so) for some\namusing Cubist effects.  (Note: quality values below about 25 generate 2-byte\nquantization tables, which are considered optional in the JPEG standard.\ncjpeg emits a warning message when you give such a quality value, because some\nother JPEG programs may be unable to decode the resulting file.  Use -baseline\nif you need to ensure compatibility at low quality values.)\n\nThe -quality option has been extended in IJG version 7 for support of separate\nquality settings for luminance and chrominance (or in general, for every\nprovided quantization table slot).  This feature is useful for high-quality\napplications which cannot accept the damage of color data by coarse\nsubsampling settings.  You can now easily reduce the color data amount more\nsmoothly with finer control without separate subsampling.  The resulting file\nis fully compliant with standard JPEG decoders.\nNote that the -quality ratings refer to the quantization table slots, and that\nthe last value is replicated if there are more q-table slots than parameters.\nThe default q-table slots are 0 for luminance and 1 for chrominance with\ndefault tables as given in the JPEG standard.  This is compatible with the old\nbehaviour in case that only one parameter is given, which is then used for\nboth luminance and chrominance (slots 0 and 1).  More or custom quantization\ntables can be set with -qtables and assigned to components with -qslots\nparameter (see the \"wizard\" switches below).\nCAUTION: You must explicitly add -sample 1x1 for efficient separate color\nquality selection, since the default value used by library is 2x2!\n\nThe -progressive switch creates a \"progressive JPEG\" file.  In this type of\nJPEG file, the data is stored in multiple scans of increasing quality.  If the\nfile is being transmitted over a slow communications link, the decoder can use\nthe first scan to display a low-quality image very quickly, and can then\nimprove the display with each subsequent scan.  The final image is exactly\nequivalent to a standard JPEG file of the same quality setting, and the total\nfile size is about the same --- often a little smaller.\n\nSwitches for advanced users:\n\n\t-arithmetic\tUse arithmetic coding.\n\t\t\tCAUTION: arithmetic coded JPEG is not yet widely\n\t\t\timplemented, so many decoders will be unable to\n\t\t\tview an arithmetic coded JPEG file at all.\n\n\t-block N\tSet DCT block size.  All N from 1 to 16 are possible.\n\t\t\tDefault is 8 (baseline format).\n\t\t\tLarger values produce higher compression,\n\t\t\tsmaller values produce higher quality\n\t\t\t(exact DCT stage possible with 1 or 2; with the\n\t\t\tdefault quality of 75 and default Luminance qtable\n\t\t\tthe DCT+Quantization stage is lossless for N=1).\n\t\t\tCAUTION: An implementation of the JPEG SmartScale\n\t\t\textension is required for this feature.  SmartScale\n\t\t\tenabled JPEG is not yet widely implemented, so many\n\t\t\tdecoders will be unable to view a SmartScale extended\n\t\t\tJPEG file at all.\n\n\t-rgb1\t\tCreate RGB JPEG file with reversible color transform.\n\t\t\tWorks like the -rgb switch (see above) and inserts a\n\t\t\tsimple reversible color transform into the processing\n\t\t\twhich significantly improves the compression.\n\t\t\tUse this switch in combination with the -block N\n\t\t\tswitch (see above) for lossless JPEG coding.\n\t\t\tCAUTION: A decoder with inverse color transform\n\t\t\tsupport is required for this feature.  Reversible\n\t\t\tcolor transform support is not yet widely implemented,\n\t\t\tso many decoders will be unable to view a reversible\n\t\t\tcolor transformed JPEG file at all.\n\n\t-bgycc\t\tCreate big gamut YCC JPEG file.\n\t\t\tIn this type of encoding the color difference\n\t\t\tcomponents are quantized further by a factor of 2\n\t\t\tcompared to the normal Cb/Cr values, thus creating\n\t\t\tspace to allow larger color values with higher\n\t\t\tsaturation than the normal gamut limits to be encoded.\n\t\t\tIn order to compensate for the loss of color fidelity\n\t\t\tcompared to a normal YCC encoded file, the color\n\t\t\tquantization tables can be adjusted accordingly.\n\t\t\tFor example, cjpeg -bgycc -quality 80,90 will give\n\t\t\tsimilar results as cjpeg -quality 80.\n\t\t\tCAUTION: For correct decompression a decoder with big\n\t\t\tgamut YCC support (JFIF version 2) is required.\n\t\t\tAn old decoder may or may not display a big gamut YCC\n\t\t\tencoded JPEG file, depending on JFIF version check\n\t\t\tand corresponding warning/error configuration.\n\t\t\tIn case of a granted decompression the old decoder\n\t\t\twill display the image with half saturated colors.\n\n\t-dct int\tUse integer DCT method (default).\n\t-dct fast\tUse fast integer DCT (less accurate).\n\t-dct float\tUse floating-point DCT method.\n\t\t\tThe float method is very slightly more accurate than\n\t\t\tthe int method, but is much slower unless your machine\n\t\t\thas very fast floating-point hardware.  Also note that\n\t\t\tresults of the floating-point method may vary slightly\n\t\t\tacross machines, while the integer methods should give\n\t\t\tthe same results everywhere.  The fast integer method\n\t\t\tis much less accurate than the other two.\n\n\t-nosmooth\tDon't use high-quality downsampling.\n\n\t-restart N\tEmit a JPEG restart marker every N MCU rows, or every\n\t\t\tN MCU blocks if \"B\" is attached to the number.\n\t\t\t-restart 0 (the default) means no restart markers.\n\n\t-smooth N\tSmooth the input image to eliminate dithering noise.\n\t\t\tN, ranging from 1 to 100, indicates the strength of\n\t\t\tsmoothing.  0 (the default) means no smoothing.\n\n\t-maxmemory N\tSet limit for amount of memory to use in processing\n\t\t\tlarge images.  Value is in thousands of bytes, or\n\t\t\tmillions of bytes if \"M\" is attached to the number.\n\t\t\tFor example, -max 4m selects 4000000 bytes.  If more\n\t\t\tspace is needed, temporary files will be used.\n\n\t-verbose\tEnable debug printout.  More -v's give more printout.\n\tor  -debug\tAlso, version information is printed at startup.\n\nThe -restart option inserts extra markers that allow a JPEG decoder to\nresynchronize after a transmission error.  Without restart markers, any damage\nto a compressed file will usually ruin the image from the point of the error\nto the end of the image; with restart markers, the damage is usually confined\nto the portion of the image up to the next restart marker.  Of course, the\nrestart markers occupy extra space.  We recommend -restart 1 for images that\nwill be transmitted across unreliable networks such as Usenet.\n\nThe -smooth option filters the input to eliminate fine-scale noise.  This is\noften useful when converting dithered images to JPEG: a moderate smoothing\nfactor of 10 to 50 gets rid of dithering patterns in the input file, resulting\nin a smaller JPEG file and a better-looking image.  Too large a smoothing\nfactor will visibly blur the image, however.\n\nSwitches for wizards:\n\n\t-baseline\tForce baseline-compatible quantization tables to be\n\t\t\tgenerated.  This clamps quantization values to 8 bits\n\t\t\teven at low quality settings.  (This switch is poorly\n\t\t\tnamed, since it does not ensure that the output is\n\t\t\tactually baseline JPEG.  For example, you can use\n\t\t\t-baseline and -progressive together.)\n\n\t-qtables file\tUse the quantization tables given in the specified\n\t\t\ttext file.\n\n\t-qslots N[,...] Select which quantization table to use for each color\n\t\t\tcomponent.\n\n\t-sample HxV[,...]  Set JPEG sampling factors for each color component.\n\n\t-scans file\tUse the scan script given in the specified text file.\n\nThe \"wizard\" switches are intended for experimentation with JPEG.  If you\ndon't know what you are doing, DON'T USE THEM.  These switches are documented\nfurther in the file wizard.txt.\n\n\nDJPEG DETAILS\n\nThe basic command line switches for djpeg are:\n\n\t-colors N\tReduce image to at most N colors.  This reduces the\n\tor -quantize N\tnumber of colors used in the output image, so that it\n\t\t\tcan be displayed on a colormapped display or stored in\n\t\t\ta colormapped file format.  For example, if you have\n\t\t\tan 8-bit display, you'd need to reduce to 256 or fewer\n\t\t\tcolors.  (-colors is the recommended name, -quantize\n\t\t\tis provided only for backwards compatibility.)\n\n\t-fast\t\tSelect recommended processing options for fast, low\n\t\t\tquality output.  (The default options are chosen for\n\t\t\thighest quality output.)  Currently, this is equivalent\n\t\t\tto \"-dct fast -nosmooth -onepass -dither ordered\".\n\n\t-grayscale\tForce gray-scale output even if JPEG file is color.\n\t\t\tUseful for viewing on monochrome displays; also,\n\t\t\tdjpeg runs noticeably faster in this mode.\n\n\t-scale M/N\tScale the output image by a factor M/N.  Currently\n\t\t\tsupported scale factors are M/N with all M from 1 to\n\t\t\t16, where N is the source DCT size, which is 8 for\n\t\t\tbaseline JPEG.  If the /N part is omitted, then M\n\t\t\tspecifies the DCT scaled size to be applied on the\n\t\t\tgiven input.  For baseline JPEG this is equivalent to\n\t\t\tM/8 scaling, since the source DCT size for baseline\n\t\t\tJPEG is 8.  Scaling is handy if the image is larger\n\t\t\tthan your screen; also, djpeg runs much faster when\n\t\t\tscaling down the output.\n\n\t-bmp\t\tSelect BMP output format (Windows flavor).  8-bit\n\t\t\tcolormapped format is emitted if -colors or -grayscale\n\t\t\tis specified, or if the JPEG file is gray-scale;\n\t\t\totherwise, 24-bit full-color format is emitted.\n\n\t-gif\t\tSelect GIF output format.  Since GIF does not support\n\t\t\tmore than 256 colors, -colors 256 is assumed (unless\n\t\t\tyou specify a smaller number of colors).  If you\n\t\t\tspecify -fast, the default number of colors is 216.\n\n\t-os2\t\tSelect BMP output format (OS/2 1.x flavor).  8-bit\n\t\t\tcolormapped format is emitted if -colors or -grayscale\n\t\t\tis specified, or if the JPEG file is gray-scale;\n\t\t\totherwise, 24-bit full-color format is emitted.\n\n\t-pnm\t\tSelect PBMPLUS (PPM/PGM) output format (this is the\n\t\t\tdefault format).  PGM is emitted if the JPEG file is\n\t\t\tgray-scale or if -grayscale is specified; otherwise\n\t\t\tPPM is emitted.\n\n\t-rle\t\tSelect RLE output format.  (Requires URT library.)\n\n\t-targa\t\tSelect Targa output format.  Gray-scale format is\n\t\t\temitted if the JPEG file is gray-scale or if\n\t\t\t-grayscale is specified; otherwise, colormapped format\n\t\t\tis emitted if -colors is specified; otherwise, 24-bit\n\t\t\tfull-color format is emitted.\n\nSwitches for advanced users:\n\n\t-dct int\tUse integer DCT method (default).\n\t-dct fast\tUse fast integer DCT (less accurate).\n\t-dct float\tUse floating-point DCT method.\n\t\t\tThe float method is very slightly more accurate than\n\t\t\tthe int method, but is much slower unless your machine\n\t\t\thas very fast floating-point hardware.  Also note that\n\t\t\tresults of the floating-point method may vary slightly\n\t\t\tacross machines, while the integer methods should give\n\t\t\tthe same results everywhere.  The fast integer method\n\t\t\tis much less accurate than the other two.\n\n\t-dither fs\tUse Floyd-Steinberg dithering in color quantization.\n\t-dither ordered\tUse ordered dithering in color quantization.\n\t-dither none\tDo not use dithering in color quantization.\n\t\t\tBy default, Floyd-Steinberg dithering is applied when\n\t\t\tquantizing colors; this is slow but usually produces\n\t\t\tthe best results.  Ordered dither is a compromise\n\t\t\tbetween speed and quality; no dithering is fast but\n\t\t\tusually looks awful.  Note that these switches have\n\t\t\tno effect unless color quantization is being done.\n\t\t\tOrdered dither is only available in -onepass mode.\n\n\t-map FILE\tQuantize to the colors used in the specified image\n\t\t\tfile.  This is useful for producing multiple files\n\t\t\twith identical color maps, or for forcing a predefined\n\t\t\tset of colors to be used.  The FILE must be a GIF\n\t\t\tor PPM file.  This option overrides -colors and\n\t\t\t-onepass.\n\n\t-nosmooth\tDon't use high-quality upsampling.\n\n\t-onepass\tUse one-pass instead of two-pass color quantization.\n\t\t\tThe one-pass method is faster and needs less memory,\n\t\t\tbut it produces a lower-quality image.  -onepass is\n\t\t\tignored unless you also say -colors N.  Also,\n\t\t\tthe one-pass method is always used for gray-scale\n\t\t\toutput (the two-pass method is no improvement then).\n\n\t-maxmemory N\tSet limit for amount of memory to use in processing\n\t\t\tlarge images.  Value is in thousands of bytes, or\n\t\t\tmillions of bytes if \"M\" is attached to the number.\n\t\t\tFor example, -max 4m selects 4000000 bytes.  If more\n\t\t\tspace is needed, temporary files will be used.\n\n\t-verbose\tEnable debug printout.  More -v's give more printout.\n\tor  -debug\tAlso, version information is printed at startup.\n\n\nHINTS FOR CJPEG\n\nColor GIF files are not the ideal input for JPEG; JPEG is really intended for\ncompressing full-color (24-bit) images.  In particular, don't try to convert\ncartoons, line drawings, and other images that have only a few distinct\ncolors.  GIF works great on these, JPEG does not.  If you want to convert a\nGIF to JPEG, you should experiment with cjpeg's -quality and -smooth options\nto get a satisfactory conversion.  -smooth 10 or so is often helpful.\n\nAvoid running an image through a series of JPEG compression/decompression\ncycles.  Image quality loss will accumulate; after ten or so cycles the image\nmay be noticeably worse than it was after one cycle.  It's best to use a\nlossless format while manipulating an image, then convert to JPEG format when\nyou are ready to file the image away.\n\nThe -optimize option to cjpeg is worth using when you are making a \"final\"\nversion for posting or archiving.  It's also a win when you are using low\nquality settings to make very small JPEG files; the percentage improvement\nis often a lot more than it is on larger files.  (At present, -optimize\nmode is always selected when generating progressive JPEG files.)\n\nGIF input files are no longer supported, to avoid the Unisys LZW patent\n(now expired).\n(Conversion of GIF files to JPEG is usually a bad idea anyway.)\n\n\nHINTS FOR DJPEG\n\nTo get a quick preview of an image, use the -grayscale and/or -scale switches.\n\"-grayscale -scale 1/8\" is the fastest case.\n\nSeveral options are available that trade off image quality to gain speed.\n\"-fast\" turns on the recommended settings.\n\n\"-dct fast\" and/or \"-nosmooth\" gain speed at a small sacrifice in quality.\nWhen producing a color-quantized image, \"-onepass -dither ordered\" is fast but\nmuch lower quality than the default behavior.  \"-dither none\" may give\nacceptable results in two-pass mode, but is seldom tolerable in one-pass mode.\n\nIf you are fortunate enough to have very fast floating point hardware,\n\"-dct float\" may be even faster than \"-dct fast\".  But on most machines\n\"-dct float\" is slower than \"-dct int\"; in this case it is not worth using,\nbecause its theoretical accuracy advantage is too small to be significant\nin practice.\n\nTwo-pass color quantization requires a good deal of memory; on MS-DOS machines\nit may run out of memory even with -maxmemory 0.  In that case you can still\ndecompress, with some loss of image quality, by specifying -onepass for\none-pass quantization.\n\nTo avoid the Unisys LZW patent (now expired), djpeg produces uncompressed GIF\nfiles.  These are larger than they should be, but are readable by standard GIF\ndecoders.\n\n\nHINTS FOR BOTH PROGRAMS\n\nIf more space is needed than will fit in the available main memory (as\ndetermined by -maxmemory), temporary files will be used.  (MS-DOS versions\nwill try to get extended or expanded memory first.)  The temporary files are\noften rather large: in typical cases they occupy three bytes per pixel, for\nexample 3*800*600 = 1.44Mb for an 800x600 image.  If you don't have enough\nfree disk space, leave out -progressive and -optimize (for cjpeg) or specify\n-onepass (for djpeg).\n\nOn MS-DOS, the temporary files are created in the directory named by the TMP\nor TEMP environment variable, or in the current directory if neither of those\nexist.  Amiga implementations put the temp files in the directory named by\nJPEGTMP:, so be sure to assign JPEGTMP: to a disk partition with adequate free\nspace.\n\nThe default memory usage limit (-maxmemory) is set when the software is\ncompiled.  If you get an \"insufficient memory\" error, try specifying a smaller\n-maxmemory value, even -maxmemory 0 to use the absolute minimum space.  You\nmay want to recompile with a smaller default value if this happens often.\n\nOn machines that have \"environment\" variables, you can define the environment\nvariable JPEGMEM to set the default memory limit.  The value is specified as\ndescribed for the -maxmemory switch.  JPEGMEM overrides the default value\nspecified when the program was compiled, and itself is overridden by an\nexplicit -maxmemory switch.\n\nOn MS-DOS machines, -maxmemory is the amount of main (conventional) memory to\nuse.  (Extended or expanded memory is also used if available.)  Most\nDOS-specific versions of this software do their own memory space estimation\nand do not need you to specify -maxmemory.\n\n\nJPEGTRAN\n\njpegtran performs various useful transformations of JPEG files.\nIt can translate the coded representation from one variant of JPEG to another,\nfor example from baseline JPEG to progressive JPEG or vice versa.  It can also\nperform some rearrangements of the image data, for example turning an image\nfrom landscape to portrait format by rotation.\n\njpegtran works by rearranging the compressed data (DCT coefficients), without\never fully decoding the image.  Therefore, its transformations are lossless:\nthere is no image degradation at all, which would not be true if you used\ndjpeg followed by cjpeg to accomplish the same conversion.  But by the same\ntoken, jpegtran cannot perform lossy operations such as changing the image\nquality.\n\njpegtran uses a command line syntax similar to cjpeg or djpeg.\nOn Unix-like systems, you say:\n\tjpegtran [switches] [inputfile] >outputfile\nOn most non-Unix systems, you say:\n\tjpegtran [switches] inputfile outputfile\nwhere both the input and output files are JPEG files.\n\nTo specify the coded JPEG representation used in the output file,\njpegtran accepts a subset of the switches recognized by cjpeg:\n\t-optimize\tPerform optimization of entropy encoding parameters.\n\t-progressive\tCreate progressive JPEG file.\n\t-arithmetic\tUse arithmetic coding.\n\t-restart N\tEmit a JPEG restart marker every N MCU rows, or every\n\t\t\tN MCU blocks if \"B\" is attached to the number.\n\t-scans file\tUse the scan script given in the specified text file.\nSee the previous discussion of cjpeg for more details about these switches.\nIf you specify none of these switches, you get a plain baseline-JPEG output\nfile.  The quality setting and so forth are determined by the input file.\n\nThe image can be losslessly transformed by giving one of these switches:\n\t-flip horizontal\tMirror image horizontally (left-right).\n\t-flip vertical\t\tMirror image vertically (top-bottom).\n\t-rotate 90\t\tRotate image 90 degrees clockwise.\n\t-rotate 180\t\tRotate image 180 degrees.\n\t-rotate 270\t\tRotate image 270 degrees clockwise (or 90 ccw).\n\t-transpose\t\tTranspose image (across UL-to-LR axis).\n\t-transverse\t\tTransverse transpose (across UR-to-LL axis).\n\nThe transpose transformation has no restrictions regarding image dimensions.\nThe other transformations operate rather oddly if the image dimensions are not\na multiple of the iMCU size (usually 8 or 16 pixels), because they can only\ntransform complete blocks of DCT coefficient data in the desired way.\n\njpegtran's default behavior when transforming an odd-size image is designed\nto preserve exact reversibility and mathematical consistency of the\ntransformation set.  As stated, transpose is able to flip the entire image\narea.  Horizontal mirroring leaves any partial iMCU column at the right edge\nuntouched, but is able to flip all rows of the image.  Similarly, vertical\nmirroring leaves any partial iMCU row at the bottom edge untouched, but is\nable to flip all columns.  The other transforms can be built up as sequences\nof transpose and flip operations; for consistency, their actions on edge\npixels are defined to be the same as the end result of the corresponding\ntranspose-and-flip sequence.\n\nFor practical use, you may prefer to discard any untransformable edge pixels\nrather than having a strange-looking strip along the right and/or bottom edges\nof a transformed image.  To do this, add the -trim switch:\n\t-trim\t\tDrop non-transformable edge blocks.\nObviously, a transformation with -trim is not reversible, so strictly speaking\njpegtran with this switch is not lossless.  Also, the expected mathematical\nequivalences between the transformations no longer hold.  For example,\n\"-rot 270 -trim\" trims only the bottom edge, but \"-rot 90 -trim\" followed by\n\"-rot 180 -trim\" trims both edges.\n\nIf you are only interested in perfect transformation, add the -perfect switch:\n\t-perfect\tFails with an error if the transformation is not\n\t\t\tperfect.\nFor example you may want to do\n  jpegtran -rot 90 -perfect foo.jpg || djpeg foo.jpg | pnmflip -r90 | cjpeg\nto do a perfect rotation if available or an approximated one if not.\n\nWe also offer a lossless-crop option, which discards data outside a given\nimage region but losslessly preserves what is inside.  Like the rotate and\nflip transforms, lossless crop is restricted by the current JPEG format: the\nupper left corner of the selected region must fall on an iMCU boundary.  If\nthis does not hold for the given crop parameters, we silently move the upper\nleft corner up and/or left to make it so, simultaneously increasing the\nregion dimensions to keep the lower right crop corner unchanged.  (Thus, the\noutput image covers at least the requested region, but may cover more.)\nThe adjustment of the region dimensions may be optionally disabled.\n\nThe image can be losslessly cropped by giving the switch:\n\t-crop WxH+X+Y\tCrop to a rectangular subarea of width W, height H\n\t\t\tstarting at point X,Y.\n\nA complementary lossless-wipe option is provided to discard (gray out) data\ninside a given image region while losslessly preserving what is outside:\n\t-wipe WxH+X+Y\tWipe (gray out) a rectangular subarea of\n\t\t\twidth W, height H starting at point X,Y.\n\nOther not-strictly-lossless transformation switches are:\n\n\t-grayscale\tForce grayscale output.\nThis option discards the chrominance channels if the input image is YCbCr\n(ie, a standard color JPEG), resulting in a grayscale JPEG file.  The\nluminance channel is preserved exactly, so this is a better method of reducing\nto grayscale than decompression, conversion, and recompression.  This switch\nis particularly handy for fixing a monochrome picture that was mistakenly\nencoded as a color JPEG.  (In such a case, the space savings from getting rid\nof the near-empty chroma channels won't be large; but the decoding time for\na grayscale JPEG is substantially less than that for a color JPEG.)\n\n\t-scale M/N\tScale the output image by a factor M/N.\nCurrently supported scale factors are M/N with all M from 1 to 16, where N is\nthe source DCT size, which is 8 for baseline JPEG.  If the /N part is omitted,\nthen M specifies the DCT scaled size to be applied on the given input.  For\nbaseline JPEG this is equivalent to M/8 scaling, since the source DCT size\nfor baseline JPEG is 8.  CAUTION: An implementation of the JPEG SmartScale\nextension is required for this feature.  SmartScale enabled JPEG is not yet\nwidely implemented, so many decoders will be unable to view a SmartScale\nextended JPEG file at all.\n\njpegtran also recognizes these switches that control what to do with \"extra\"\nmarkers, such as comment blocks:\n\t-copy none\tCopy no extra markers from source file.  This setting\n\t\t\tsuppresses all comments and other excess baggage\n\t\t\tpresent in the source file.\n\t-copy comments\tCopy only comment markers.  This setting copies\n\t\t\tcomments from the source file, but discards\n\t\t\tany other inessential (for image display) data.\n\t-copy all\tCopy all extra markers.  This setting preserves\n\t\t\tmiscellaneous markers found in the source file, such\n\t\t\tas JFIF thumbnails, Exif data, and Photoshop settings.\n\t\t\tIn some files these extra markers can be sizable.\nThe default behavior is -copy comments.  (Note: in IJG releases v6 and v6a,\njpegtran always did the equivalent of -copy none.)\n\nAdditional switches recognized by jpegtran are:\n\t-outfile filename\n\t-maxmemory N\n\t-verbose\n\t-debug\nThese work the same as in cjpeg or djpeg.\n\n\nTHE COMMENT UTILITIES\n\nThe JPEG standard allows \"comment\" (COM) blocks to occur within a JPEG file.\nAlthough the standard doesn't actually define what COM blocks are for, they\nare widely used to hold user-supplied text strings.  This lets you add\nannotations, titles, index terms, etc to your JPEG files, and later retrieve\nthem as text.  COM blocks do not interfere with the image stored in the JPEG\nfile.  The maximum size of a COM block is 64K, but you can have as many of\nthem as you like in one JPEG file.\n\nWe provide two utility programs to display COM block contents and add COM\nblocks to a JPEG file.\n\nrdjpgcom searches a JPEG file and prints the contents of any COM blocks on\nstandard output.  The command line syntax is\n\trdjpgcom [-raw] [-verbose] [inputfilename]\nThe switch \"-raw\" (or just \"-r\") causes rdjpgcom to also output non-printable\ncharacters in comments, which are normally escaped for security reasons.\nThe switch \"-verbose\" (or just \"-v\") causes rdjpgcom to also display the JPEG\nimage dimensions.  If you omit the input file name from the command line,\nthe JPEG file is read from standard input.  (This may not work on some\noperating systems, if binary data can't be read from stdin.)\n\nwrjpgcom adds a COM block, containing text you provide, to a JPEG file.\nOrdinarily, the COM block is added after any existing COM blocks, but you\ncan delete the old COM blocks if you wish.  wrjpgcom produces a new JPEG\nfile; it does not modify the input file.  DO NOT try to overwrite the input\nfile by directing wrjpgcom's output back into it; on most systems this will\njust destroy your file.\n\nThe command line syntax for wrjpgcom is similar to cjpeg's.  On Unix-like\nsystems, it is\n\twrjpgcom [switches] [inputfilename]\nThe output file is written to standard output.  The input file comes from\nthe named file, or from standard input if no input file is named.\n\nOn most non-Unix systems, the syntax is\n\twrjpgcom [switches] inputfilename outputfilename\nwhere both input and output file names must be given explicitly.\n\nwrjpgcom understands three switches:\n\t-replace\t\t Delete any existing COM blocks from the file.\n\t-comment \"Comment text\"\t Supply new COM text on command line.\n\t-cfile name\t\t Read text for new COM block from named file.\n(Switch names can be abbreviated.)  If you have only one line of comment text\nto add, you can provide it on the command line with -comment.  The comment\ntext must be surrounded with quotes so that it is treated as a single\nargument.  Longer comments can be read from a text file.\n\nIf you give neither -comment nor -cfile, then wrjpgcom will read the comment\ntext from standard input.  (In this case an input image file name MUST be\nsupplied, so that the source JPEG file comes from somewhere else.)  You can\nenter multiple lines, up to 64KB worth.  Type an end-of-file indicator\n(usually control-D or control-Z) to terminate the comment text entry.\n\nwrjpgcom will not add a COM block if the provided comment string is empty.\nTherefore -replace -comment \"\" can be used to delete all COM blocks from a\nfile.\n\nThese utility programs do not depend on the IJG JPEG library.  In\nparticular, the source code for rdjpgcom is intended as an illustration of\nthe minimum amount of code required to parse a JPEG file header correctly.\n"
  },
  {
    "path": "wizard.txt",
    "content": "Advanced usage instructions for the Independent JPEG Group's JPEG software\n==========================================================================\n\nThis file describes cjpeg's \"switches for wizards\".\n\nThe \"wizard\" switches are intended for experimentation with JPEG by persons\nwho are reasonably knowledgeable about the JPEG standard.  If you don't know\nwhat you are doing, DON'T USE THESE SWITCHES.  You'll likely produce files\nwith worse image quality and/or poorer compression than you'd get from the\ndefault settings.  Furthermore, these switches must be used with caution\nwhen making files intended for general use, because not all JPEG decoders\nwill support unusual JPEG parameter settings.\n\n\nQuantization Table Adjustment\n-----------------------------\n\nOrdinarily, cjpeg starts with a default set of tables (the same ones given\nas examples in the JPEG standard) and scales them up or down according to\nthe -quality setting.  The details of the scaling algorithm can be found in\njcparam.c.  At very low quality settings, some quantization table entries\ncan get scaled up to values exceeding 255.  Although 2-byte quantization\nvalues are supported by the IJG software, this feature is not in baseline\nJPEG and is not supported by all implementations.  If you need to ensure\nwide compatibility of low-quality files, you can constrain the scaled\nquantization values to no more than 255 by giving the -baseline switch.\nNote that use of -baseline will result in poorer quality for the same file\nsize, since more bits than necessary are expended on higher AC coefficients.\n\nYou can substitute a different set of quantization values by using the\n-qtables switch:\n\n\t-qtables file\tUse the quantization tables given in the named file.\n\nThe specified file should be a text file containing decimal quantization\nvalues.  The file should contain one to four tables, each of 64 elements.\nThe tables are implicitly numbered 0,1,etc. in order of appearance.  Table\nentries appear in normal array order (NOT in the zigzag order in which they\nwill be stored in the JPEG file).\n\nQuantization table files are free format, in that arbitrary whitespace can\nappear between numbers.  Also, comments can be included: a comment starts\nwith '#' and extends to the end of the line.  Here is an example file that\nduplicates the default quantization tables:\n\n\t# Quantization tables given in JPEG spec, section K.1\n\n\t# This is table 0 (the luminance table):\n\t  16  11  10  16  24  40  51  61\n\t  12  12  14  19  26  58  60  55\n\t  14  13  16  24  40  57  69  56\n\t  14  17  22  29  51  87  80  62\n\t  18  22  37  56  68 109 103  77\n\t  24  35  55  64  81 104 113  92\n\t  49  64  78  87 103 121 120 101\n\t  72  92  95  98 112 100 103  99\n\n\t# This is table 1 (the chrominance table):\n\t  17  18  24  47  99  99  99  99\n\t  18  21  26  66  99  99  99  99\n\t  24  26  56  99  99  99  99  99\n\t  47  66  99  99  99  99  99  99\n\t  99  99  99  99  99  99  99  99\n\t  99  99  99  99  99  99  99  99\n\t  99  99  99  99  99  99  99  99\n\t  99  99  99  99  99  99  99  99\n\nIf the -qtables switch is used without -quality, then the specified tables\nare used exactly as-is.  If both -qtables and -quality are used, then the\ntables taken from the file are scaled in the same fashion that the default\ntables would be scaled for that quality setting.  If -baseline appears, then\nthe quantization values are constrained to the range 1-255.\n\nBy default, cjpeg will use quantization table 0 for luminance components and\ntable 1 for chrominance components.  To override this choice, use the -qslots\nswitch:\n\n\t-qslots N[,...]\t\tSelect which quantization table to use for\n\t\t\t\teach color component.\n\nThe -qslots switch specifies a quantization table number for each color\ncomponent, in the order in which the components appear in the JPEG SOF marker.\nFor example, to create a separate table for each of Y,Cb,Cr, you could\nprovide a -qtables file that defines three quantization tables and say\n\"-qslots 0,1,2\".  If -qslots gives fewer table numbers than there are color\ncomponents, then the last table number is repeated as necessary.\n\n\nSampling Factor Adjustment\n--------------------------\n\nBy default, cjpeg uses 2:1 horizontal and vertical downsampling when\ncompressing YCbCr data, and no downsampling for all other color spaces.\nYou can override this default with the -sample switch:\n\n\t-sample HxV[,...]\tSet JPEG sampling factors for each color\n\t\t\t\tcomponent.\n\nThe -sample switch specifies the JPEG sampling factors for each color\ncomponent, in the order in which they appear in the JPEG SOF marker.\nIf you specify fewer HxV pairs than there are components, the remaining\ncomponents are set to 1x1 sampling.  For example, the default YCbCr setting\nis equivalent to \"-sample 2x2,1x1,1x1\", which can be abbreviated to\n\"-sample 2x2\".\n\nThere are still some JPEG decoders in existence that support only 2x1\nsampling (also called 4:2:2 sampling).  Compatibility with such decoders can\nbe achieved by specifying \"-sample 2x1\".  This is not recommended unless\nreally necessary, since it increases file size and encoding/decoding time\nwith very little quality gain.\n\n\nMultiple Scan / Progression Control\n-----------------------------------\n\nBy default, cjpeg emits a single-scan sequential JPEG file.  The\n-progressive switch generates a progressive JPEG file using a default series\nof progression parameters.  You can create multiple-scan sequential JPEG\nfiles or progressive JPEG files with custom progression parameters by using\nthe -scans switch:\n\n\t-scans file\tUse the scan sequence given in the named file.\n\nThe specified file should be a text file containing a \"scan script\".\nThe script specifies the contents and ordering of the scans to be emitted.\nEach entry in the script defines one scan.  A scan definition specifies\nthe components to be included in the scan, and for progressive JPEG it also\nspecifies the progression parameters Ss,Se,Ah,Al for the scan.  Scan\ndefinitions are separated by semicolons (';').  A semicolon after the last\nscan definition is optional.\n\nEach scan definition contains one to four component indexes, optionally\nfollowed by a colon (':') and the four progressive-JPEG parameters.  The\ncomponent indexes denote which color component(s) are to be transmitted in\nthe scan.  Components are numbered in the order in which they appear in the\nJPEG SOF marker, with the first component being numbered 0.  (Note that these\nindexes are not the \"component ID\" codes assigned to the components, just\npositional indexes.)\n\nThe progression parameters for each scan are:\n\tSs\tZigzag index of first coefficient included in scan\n\tSe\tZigzag index of last coefficient included in scan\n\tAh\tZero for first scan of a coefficient, else Al of prior scan\n\tAl\tSuccessive approximation low bit position for scan\nIf the progression parameters are omitted, the values 0,63,0,0 are used,\nproducing a sequential JPEG file.  cjpeg automatically determines whether\nthe script represents a progressive or sequential file, by observing whether\nSs and Se values other than 0 and 63 appear.  (The -progressive switch is\nnot needed to specify this; in fact, it is ignored when -scans appears.)\nThe scan script must meet the JPEG restrictions on progression sequences.\n(cjpeg checks that the spec's requirements are obeyed.)\n\nScan script files are free format, in that arbitrary whitespace can appear\nbetween numbers and around punctuation.  Also, comments can be included: a\ncomment starts with '#' and extends to the end of the line.  For additional\nlegibility, commas or dashes can be placed between values.  (Actually, any\nsingle punctuation character other than ':' or ';' can be inserted.)  For\nexample, the following two scan definitions are equivalent:\n\t0 1 2: 0 63 0 0;\n\t0,1,2 : 0-63, 0,0 ;\n\nHere is an example of a scan script that generates a partially interleaved\nsequential JPEG file:\n\n\t0;\t\t\t# Y only in first scan\n\t1 2;\t\t\t# Cb and Cr in second scan\n\nHere is an example of a progressive scan script using only spectral selection\n(no successive approximation):\n\n\t# Interleaved DC scan for Y,Cb,Cr:\n\t0,1,2: 0-0,   0, 0 ;\n\t# AC scans:\n\t0:     1-2,   0, 0 ;\t# First two Y AC coefficients\n\t0:     3-5,   0, 0 ;\t# Three more\n\t1:     1-63,  0, 0 ;\t# All AC coefficients for Cb\n\t2:     1-63,  0, 0 ;\t# All AC coefficients for Cr\n\t0:     6-9,   0, 0 ;\t# More Y coefficients\n\t0:     10-63, 0, 0 ;\t# Remaining Y coefficients\n\nHere is an example of a successive-approximation script.  This is equivalent\nto the default script used by \"cjpeg -progressive\" for YCbCr images:\n\n\t# Initial DC scan for Y,Cb,Cr (lowest bit not sent)\n\t0,1,2: 0-0,   0, 1 ;\n\t# First AC scan: send first 5 Y AC coefficients, minus 2 lowest bits:\n\t0:     1-5,   0, 2 ;\n\t# Send all Cr,Cb AC coefficients, minus lowest bit:\n\t# (chroma data is usually too small to be worth subdividing further;\n\t#  but note we send Cr first since eye is least sensitive to Cb)\n\t2:     1-63,  0, 1 ;\n\t1:     1-63,  0, 1 ;\n\t# Send remaining Y AC coefficients, minus 2 lowest bits:\n\t0:     6-63,  0, 2 ;\n\t# Send next-to-lowest bit of all Y AC coefficients:\n\t0:     1-63,  2, 1 ;\n\t# At this point we've sent all but the lowest bit of all coefficients.\n\t# Send lowest bit of DC coefficients\n\t0,1,2: 0-0,   1, 0 ;\n\t# Send lowest bit of AC coefficients\n\t2:     1-63,  1, 0 ;\n\t1:     1-63,  1, 0 ;\n\t# Y AC lowest bit scan is last; it's usually the largest scan\n\t0:     1-63,  1, 0 ;\n\nIt may be worth pointing out that this script is tuned for quality settings\nof around 50 to 75.  For lower quality settings, you'd probably want to use\na script with fewer stages of successive approximation (otherwise the\ninitial scans will be really bad).  For higher quality settings, you might\nwant to use more stages of successive approximation (so that the initial\nscans are not too large).\n"
  },
  {
    "path": "wrbmp.c",
    "content": "/*\n * wrbmp.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to write output images in Microsoft \"BMP\"\n * format (MS Windows 3.x and OS/2 1.x flavors).\n * Either 8-bit colormapped or 24-bit full-color format can be written.\n * No compression is supported.\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n *\n * This code contributed by James Arthur Boucher.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef BMP_SUPPORTED\n\n\n/*\n * To support 12-bit JPEG data, we'd have to scale output down to 8 bits.\n * This is not yet implemented.\n */\n\n#if BITS_IN_JSAMPLE != 8\n  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */\n#endif\n\n/*\n * Since BMP stores scanlines bottom-to-top, we have to invert the image\n * from JPEG's top-to-bottom order.  To do this, we save the outgoing data\n * in a virtual array during put_pixel_row calls, then actually emit the\n * BMP file during finish_output.  The virtual array contains one JSAMPLE per\n * pixel if the output is grayscale or colormapped, three if it is full color.\n */\n\n/* Private version of data destination object */\n\ntypedef struct {\n  struct djpeg_dest_struct pub;\t/* public fields */\n\n  boolean is_os2;\t\t/* saves the OS2 format request flag */\n\n  jvirt_sarray_ptr whole_image;\t/* needed to reverse row order */\n  JDIMENSION data_width;\t/* JSAMPLEs per row */\n  JDIMENSION row_width;\t\t/* physical width of one row in the BMP file */\n  int pad_bytes;\t\t/* number of padding bytes needed per row */\n  JDIMENSION cur_output_row;\t/* next row# to write to virtual array */\n} bmp_dest_struct;\n\ntypedef bmp_dest_struct * bmp_dest_ptr;\n\n\n/* Forward declarations */\nLOCAL(void) write_colormap\n\tJPP((j_decompress_ptr cinfo, bmp_dest_ptr dest,\n\t     int map_colors, int map_entry_size));\n\n\n/*\n * Write some pixel data.\n * In this module rows_supplied will always be 1.\n */\n\nMETHODDEF(void)\nput_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\tJDIMENSION rows_supplied)\n/* This version is for writing 24-bit pixels */\n{\n  bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n  int pad;\n\n  /* Access next row in virtual array */\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, dest->whole_image,\n     dest->cur_output_row, (JDIMENSION) 1, TRUE);\n  dest->cur_output_row++;\n\n  /* Transfer data.  Note destination values must be in BGR order\n   * (even though Microsoft's own documents say the opposite).\n   */\n  inptr = dest->pub.buffer[0];\n  outptr = image_ptr[0];\n  for (col = cinfo->output_width; col > 0; col--) {\n    outptr[2] = *inptr++;\t/* can omit GETJSAMPLE() safely */\n    outptr[1] = *inptr++;\n    outptr[0] = *inptr++;\n    outptr += 3;\n  }\n\n  /* Zero out the pad bytes. */\n  pad = dest->pad_bytes;\n  while (--pad >= 0)\n    *outptr++ = 0;\n}\n\nMETHODDEF(void)\nput_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t       JDIMENSION rows_supplied)\n/* This version is for grayscale OR quantized color output */\n{\n  bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n  int pad;\n\n  /* Access next row in virtual array */\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, dest->whole_image,\n     dest->cur_output_row, (JDIMENSION) 1, TRUE);\n  dest->cur_output_row++;\n\n  /* Transfer data. */\n  inptr = dest->pub.buffer[0];\n  outptr = image_ptr[0];\n  for (col = cinfo->output_width; col > 0; col--) {\n    *outptr++ = *inptr++;\t/* can omit GETJSAMPLE() safely */\n  }\n\n  /* Zero out the pad bytes. */\n  pad = dest->pad_bytes;\n  while (--pad >= 0)\n    *outptr++ = 0;\n}\n\n\n/*\n * Startup: normally writes the file header.\n * In this module we may as well postpone everything until finish_output.\n */\n\nMETHODDEF(void)\nstart_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  /* no work here */\n}\n\n\n/*\n * Finish up at the end of the file.\n *\n * Here is where we really output the BMP file.\n *\n * First, routines to write the Windows and OS/2 variants of the file header.\n */\n\nLOCAL(void)\nwrite_bmp_header (j_decompress_ptr cinfo, bmp_dest_ptr dest)\n/* Write a Windows-style BMP file header, including colormap if needed */\n{\n  char bmpfileheader[14];\n  char bmpinfoheader[40];\n#define PUT_2B(array,offset,value)  \\\n\t(array[offset] = (char) ((value) & 0xFF), \\\n\t array[offset+1] = (char) (((value) >> 8) & 0xFF))\n#define PUT_4B(array,offset,value)  \\\n\t(array[offset] = (char) ((value) & 0xFF), \\\n\t array[offset+1] = (char) (((value) >> 8) & 0xFF), \\\n\t array[offset+2] = (char) (((value) >> 16) & 0xFF), \\\n\t array[offset+3] = (char) (((value) >> 24) & 0xFF))\n  INT32 headersize, bfSize;\n  int bits_per_pixel, cmap_entries;\n\n  /* Compute colormap size and total file size */\n  if (cinfo->out_color_space == JCS_RGB) {\n    if (cinfo->quantize_colors) {\n      /* Colormapped RGB */\n      bits_per_pixel = 8;\n      cmap_entries = 256;\n    } else {\n      /* Unquantized, full color RGB */\n      bits_per_pixel = 24;\n      cmap_entries = 0;\n    }\n  } else {\n    /* Grayscale output.  We need to fake a 256-entry colormap. */\n    bits_per_pixel = 8;\n    cmap_entries = 256;\n  }\n  /* File size */\n  headersize = 14 + 40 + cmap_entries * 4; /* Header and colormap */\n  bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height;\n  \n  /* Set unused fields of header to 0 */\n  MEMZERO(bmpfileheader, SIZEOF(bmpfileheader));\n  MEMZERO(bmpinfoheader, SIZEOF(bmpinfoheader));\n\n  /* Fill the file header */\n  bmpfileheader[0] = 0x42;\t/* first 2 bytes are ASCII 'B', 'M' */\n  bmpfileheader[1] = 0x4D;\n  PUT_4B(bmpfileheader, 2, bfSize); /* bfSize */\n  /* we leave bfReserved1 & bfReserved2 = 0 */\n  PUT_4B(bmpfileheader, 10, headersize); /* bfOffBits */\n\n  /* Fill the info header (Microsoft calls this a BITMAPINFOHEADER) */\n  PUT_2B(bmpinfoheader, 0, 40);\t/* biSize */\n  PUT_4B(bmpinfoheader, 4, cinfo->output_width); /* biWidth */\n  PUT_4B(bmpinfoheader, 8, cinfo->output_height); /* biHeight */\n  PUT_2B(bmpinfoheader, 12, 1);\t/* biPlanes - must be 1 */\n  PUT_2B(bmpinfoheader, 14, bits_per_pixel); /* biBitCount */\n  /* we leave biCompression = 0, for none */\n  /* we leave biSizeImage = 0; this is correct for uncompressed data */\n  if (cinfo->density_unit == 2) { /* if have density in dots/cm, then */\n    PUT_4B(bmpinfoheader, 24, (INT32) (cinfo->X_density*100)); /* XPels/M */\n    PUT_4B(bmpinfoheader, 28, (INT32) (cinfo->Y_density*100)); /* XPels/M */\n  }\n  PUT_2B(bmpinfoheader, 32, cmap_entries); /* biClrUsed */\n  /* we leave biClrImportant = 0 */\n\n  if (JFWRITE(dest->pub.output_file, bmpfileheader, 14) != (size_t) 14)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n  if (JFWRITE(dest->pub.output_file, bmpinfoheader, 40) != (size_t) 40)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n\n  if (cmap_entries > 0)\n    write_colormap(cinfo, dest, cmap_entries, 4);\n}\n\n\nLOCAL(void)\nwrite_os2_header (j_decompress_ptr cinfo, bmp_dest_ptr dest)\n/* Write an OS2-style BMP file header, including colormap if needed */\n{\n  char bmpfileheader[14];\n  char bmpcoreheader[12];\n  INT32 headersize, bfSize;\n  int bits_per_pixel, cmap_entries;\n\n  /* Compute colormap size and total file size */\n  if (cinfo->out_color_space == JCS_RGB) {\n    if (cinfo->quantize_colors) {\n      /* Colormapped RGB */\n      bits_per_pixel = 8;\n      cmap_entries = 256;\n    } else {\n      /* Unquantized, full color RGB */\n      bits_per_pixel = 24;\n      cmap_entries = 0;\n    }\n  } else {\n    /* Grayscale output.  We need to fake a 256-entry colormap. */\n    bits_per_pixel = 8;\n    cmap_entries = 256;\n  }\n  /* File size */\n  headersize = 14 + 12 + cmap_entries * 3; /* Header and colormap */\n  bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height;\n  \n  /* Set unused fields of header to 0 */\n  MEMZERO(bmpfileheader, SIZEOF(bmpfileheader));\n  MEMZERO(bmpcoreheader, SIZEOF(bmpcoreheader));\n\n  /* Fill the file header */\n  bmpfileheader[0] = 0x42;\t/* first 2 bytes are ASCII 'B', 'M' */\n  bmpfileheader[1] = 0x4D;\n  PUT_4B(bmpfileheader, 2, bfSize); /* bfSize */\n  /* we leave bfReserved1 & bfReserved2 = 0 */\n  PUT_4B(bmpfileheader, 10, headersize); /* bfOffBits */\n\n  /* Fill the info header (Microsoft calls this a BITMAPCOREHEADER) */\n  PUT_2B(bmpcoreheader, 0, 12);\t/* bcSize */\n  PUT_2B(bmpcoreheader, 4, cinfo->output_width); /* bcWidth */\n  PUT_2B(bmpcoreheader, 6, cinfo->output_height); /* bcHeight */\n  PUT_2B(bmpcoreheader, 8, 1);\t/* bcPlanes - must be 1 */\n  PUT_2B(bmpcoreheader, 10, bits_per_pixel); /* bcBitCount */\n\n  if (JFWRITE(dest->pub.output_file, bmpfileheader, 14) != (size_t) 14)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n  if (JFWRITE(dest->pub.output_file, bmpcoreheader, 12) != (size_t) 12)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n\n  if (cmap_entries > 0)\n    write_colormap(cinfo, dest, cmap_entries, 3);\n}\n\n\n/*\n * Write the colormap.\n * Windows uses BGR0 map entries; OS/2 uses BGR entries.\n */\n\nLOCAL(void)\nwrite_colormap (j_decompress_ptr cinfo, bmp_dest_ptr dest,\n\t\tint map_colors, int map_entry_size)\n{\n  JSAMPARRAY colormap = cinfo->colormap;\n  int num_colors = cinfo->actual_number_of_colors;\n  FILE * outfile = dest->pub.output_file;\n  int i;\n\n  if (colormap != NULL) {\n    if (cinfo->out_color_components == 3) {\n      /* Normal case with RGB colormap */\n      for (i = 0; i < num_colors; i++) {\n\tputc(GETJSAMPLE(colormap[2][i]), outfile);\n\tputc(GETJSAMPLE(colormap[1][i]), outfile);\n\tputc(GETJSAMPLE(colormap[0][i]), outfile);\n\tif (map_entry_size == 4)\n\t  putc(0, outfile);\n      }\n    } else {\n      /* Grayscale colormap (only happens with grayscale quantization) */\n      for (i = 0; i < num_colors; i++) {\n\tputc(GETJSAMPLE(colormap[0][i]), outfile);\n\tputc(GETJSAMPLE(colormap[0][i]), outfile);\n\tputc(GETJSAMPLE(colormap[0][i]), outfile);\n\tif (map_entry_size == 4)\n\t  putc(0, outfile);\n      }\n    }\n  } else {\n    /* If no colormap, must be grayscale data.  Generate a linear \"map\". */\n    for (i = 0; i < 256; i++) {\n      putc(i, outfile);\n      putc(i, outfile);\n      putc(i, outfile);\n      if (map_entry_size == 4)\n\tputc(0, outfile);\n    }\n  }\n  /* Pad colormap with zeros to ensure specified number of colormap entries */ \n  if (i > map_colors)\n    ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, i);\n  for (; i < map_colors; i++) {\n    putc(0, outfile);\n    putc(0, outfile);\n    putc(0, outfile);\n    if (map_entry_size == 4)\n      putc(0, outfile);\n  }\n}\n\n\nMETHODDEF(void)\nfinish_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;\n  register FILE * outfile = dest->pub.output_file;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW data_ptr;\n  JDIMENSION row;\n  register JDIMENSION col;\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n\n  /* Write the header and colormap */\n  if (dest->is_os2)\n    write_os2_header(cinfo, dest);\n  else\n    write_bmp_header(cinfo, dest);\n\n  /* Write the file body from our virtual array */\n  for (row = cinfo->output_height; row > 0; row--) {\n    if (progress != NULL) {\n      progress->pub.pass_counter = (long) (cinfo->output_height - row);\n      progress->pub.pass_limit = (long) cinfo->output_height;\n      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n    }\n    image_ptr = (*cinfo->mem->access_virt_sarray)\n      ((j_common_ptr) cinfo, dest->whole_image, row-1, (JDIMENSION) 1, FALSE);\n    data_ptr = image_ptr[0];\n    for (col = dest->row_width; col > 0; col--) {\n      putc(GETJSAMPLE(*data_ptr), outfile);\n      data_ptr++;\n    }\n  }\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n\n  /* Make sure we wrote the output file OK */\n  fflush(outfile);\n  if (ferror(outfile))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for BMP format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_bmp (j_decompress_ptr cinfo, boolean is_os2)\n{\n  bmp_dest_ptr dest;\n  JDIMENSION row_width;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (bmp_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(bmp_dest_struct));\n  dest->pub.start_output = start_output_bmp;\n  dest->pub.finish_output = finish_output_bmp;\n  dest->is_os2 = is_os2;\n\n  if (cinfo->out_color_space == JCS_GRAYSCALE) {\n    dest->pub.put_pixel_rows = put_gray_rows;\n  } else if (cinfo->out_color_space == JCS_RGB) {\n    if (cinfo->quantize_colors)\n      dest->pub.put_pixel_rows = put_gray_rows;\n    else\n      dest->pub.put_pixel_rows = put_pixel_rows;\n  } else {\n    ERREXIT(cinfo, JERR_BMP_COLORSPACE);\n  }\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  /* Determine width of rows in the BMP file (padded to 4-byte boundary). */\n  row_width = cinfo->output_width * cinfo->output_components;\n  dest->data_width = row_width;\n  while ((row_width & 3) != 0) row_width++;\n  dest->row_width = row_width;\n  dest->pad_bytes = (int) (row_width - dest->data_width);\n\n  /* Allocate space for inversion array, prepare for write pass */\n  dest->whole_image = (*cinfo->mem->request_virt_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n     row_width, cinfo->output_height, (JDIMENSION) 1);\n  dest->cur_output_row = 0;\n  if (cinfo->progress != NULL) {\n    cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n    progress->total_extra_passes++; /* count file input as separate pass */\n  }\n\n  /* Create decompressor output buffer. */\n  dest->pub.buffer = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, row_width, (JDIMENSION) 1);\n  dest->pub.buffer_height = 1;\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* BMP_SUPPORTED */\n"
  },
  {
    "path": "wrgif.c",
    "content": "/*\n * wrgif.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to write output images in GIF format.\n *\n **************************************************************************\n * NOTE: to avoid entanglements with Unisys' patent on LZW compression,   *\n * this code has been modified to output \"uncompressed GIF\" files.        *\n * There is no trace of the LZW algorithm in this file.                   *\n **************************************************************************\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n */\n\n/*\n * This code is loosely based on ppmtogif from the PBMPLUS distribution\n * of Feb. 1991.  That file contains the following copyright notice:\n *    Based on GIFENCODE by David Rowley <mgardi@watdscu.waterloo.edu>.\n *    Lempel-Ziv compression based on \"compress\" by Spencer W. Thomas et al.\n *    Copyright (C) 1989 by Jef Poskanzer.\n *    Permission to use, copy, modify, and distribute this software and its\n *    documentation for any purpose and without fee is hereby granted, provided\n *    that the above copyright notice appear in all copies and that both that\n *    copyright notice and this permission notice appear in supporting\n *    documentation.  This software is provided \"as is\" without express or\n *    implied warranty.\n *\n * We are also required to state that\n *    \"The Graphics Interchange Format(c) is the Copyright property of\n *    CompuServe Incorporated. GIF(sm) is a Service Mark property of\n *    CompuServe Incorporated.\"\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef GIF_SUPPORTED\n\n\n/* Private version of data destination object */\n\ntypedef struct {\n  struct djpeg_dest_struct pub;\t/* public fields */\n\n  j_decompress_ptr cinfo;\t/* back link saves passing separate parm */\n\n  /* State for packing variable-width codes into a bitstream */\n  int n_bits;\t\t\t/* current number of bits/code */\n  int maxcode;\t\t\t/* maximum code, given n_bits */\n  INT32 cur_accum;\t\t/* holds bits not yet output */\n  int cur_bits;\t\t\t/* # of bits in cur_accum */\n\n  /* State for GIF code assignment */\n  int ClearCode;\t\t/* clear code (doesn't change) */\n  int EOFCode;\t\t\t/* EOF code (ditto) */\n  int code_counter;\t\t/* counts output symbols */\n\n  /* GIF data packet construction buffer */\n  int bytesinpkt;\t\t/* # of bytes in current packet */\n  char packetbuf[256];\t\t/* workspace for accumulating packet */\n\n} gif_dest_struct;\n\ntypedef gif_dest_struct * gif_dest_ptr;\n\n/* Largest value that will fit in N bits */\n#define MAXCODE(n_bits)\t((1 << (n_bits)) - 1)\n\n\n/*\n * Routines to package finished data bytes into GIF data blocks.\n * A data block consists of a count byte (1..255) and that many data bytes.\n */\n\nLOCAL(void)\nflush_packet (gif_dest_ptr dinfo)\n/* flush any accumulated data */\n{\n  if (dinfo->bytesinpkt > 0) {\t/* never write zero-length packet */\n    dinfo->packetbuf[0] = (char) dinfo->bytesinpkt++;\n    if (JFWRITE(dinfo->pub.output_file, dinfo->packetbuf, dinfo->bytesinpkt)\n\t!= (size_t) dinfo->bytesinpkt)\n      ERREXIT(dinfo->cinfo, JERR_FILE_WRITE);\n    dinfo->bytesinpkt = 0;\n  }\n}\n\n\n/* Add a character to current packet; flush to disk if necessary */\n#define CHAR_OUT(dinfo,c)  \\\n\t{ (dinfo)->packetbuf[++(dinfo)->bytesinpkt] = (char) (c);  \\\n\t    if ((dinfo)->bytesinpkt >= 255)  \\\n\t      flush_packet(dinfo);  \\\n\t}\n\n\n/* Routine to convert variable-width codes into a byte stream */\n\nLOCAL(void)\noutput (gif_dest_ptr dinfo, int code)\n/* Emit a code of n_bits bits */\n/* Uses cur_accum and cur_bits to reblock into 8-bit bytes */\n{\n  dinfo->cur_accum |= ((INT32) code) << dinfo->cur_bits;\n  dinfo->cur_bits += dinfo->n_bits;\n\n  while (dinfo->cur_bits >= 8) {\n    CHAR_OUT(dinfo, dinfo->cur_accum & 0xFF);\n    dinfo->cur_accum >>= 8;\n    dinfo->cur_bits -= 8;\n  }\n}\n\n\n/* The pseudo-compression algorithm.\n *\n * In this module we simply output each pixel value as a separate symbol;\n * thus, no compression occurs.  In fact, there is expansion of one bit per\n * pixel, because we use a symbol width one bit wider than the pixel width.\n *\n * GIF ordinarily uses variable-width symbols, and the decoder will expect\n * to ratchet up the symbol width after a fixed number of symbols.\n * To simplify the logic and keep the expansion penalty down, we emit a\n * GIF Clear code to reset the decoder just before the width would ratchet up.\n * Thus, all the symbols in the output file will have the same bit width.\n * Note that emitting the Clear codes at the right times is a mere matter of\n * counting output symbols and is in no way dependent on the LZW patent.\n *\n * With a small basic pixel width (low color count), Clear codes will be\n * needed very frequently, causing the file to expand even more.  So this\n * simplistic approach wouldn't work too well on bilevel images, for example.\n * But for output of JPEG conversions the pixel width will usually be 8 bits\n * (129 to 256 colors), so the overhead added by Clear symbols is only about\n * one symbol in every 256.\n */\n\nLOCAL(void)\ncompress_init (gif_dest_ptr dinfo, int i_bits)\n/* Initialize pseudo-compressor */\n{\n  /* init all the state variables */\n  dinfo->n_bits = i_bits;\n  dinfo->maxcode = MAXCODE(dinfo->n_bits);\n  dinfo->ClearCode = (1 << (i_bits - 1));\n  dinfo->EOFCode = dinfo->ClearCode + 1;\n  dinfo->code_counter = dinfo->ClearCode + 2;\n  /* init output buffering vars */\n  dinfo->bytesinpkt = 0;\n  dinfo->cur_accum = 0;\n  dinfo->cur_bits = 0;\n  /* GIF specifies an initial Clear code */\n  output(dinfo, dinfo->ClearCode);\n}\n\n\nLOCAL(void)\ncompress_pixel (gif_dest_ptr dinfo, int c)\n/* Accept and \"compress\" one pixel value.\n * The given value must be less than n_bits wide.\n */\n{\n  /* Output the given pixel value as a symbol. */\n  output(dinfo, c);\n  /* Issue Clear codes often enough to keep the reader from ratcheting up\n   * its symbol size.\n   */\n  if (dinfo->code_counter < dinfo->maxcode) {\n    dinfo->code_counter++;\n  } else {\n    output(dinfo, dinfo->ClearCode);\n    dinfo->code_counter = dinfo->ClearCode + 2;\t/* reset the counter */\n  }\n}\n\n\nLOCAL(void)\ncompress_term (gif_dest_ptr dinfo)\n/* Clean up at end */\n{\n  /* Send an EOF code */\n  output(dinfo, dinfo->EOFCode);\n  /* Flush the bit-packing buffer */\n  if (dinfo->cur_bits > 0) {\n    CHAR_OUT(dinfo, dinfo->cur_accum & 0xFF);\n  }\n  /* Flush the packet buffer */\n  flush_packet(dinfo);\n}\n\n\n/* GIF header construction */\n\n\nLOCAL(void)\nput_word (gif_dest_ptr dinfo, unsigned int w)\n/* Emit a 16-bit word, LSB first */\n{\n  putc(w & 0xFF, dinfo->pub.output_file);\n  putc((w >> 8) & 0xFF, dinfo->pub.output_file);\n}\n\n\nLOCAL(void)\nput_3bytes (gif_dest_ptr dinfo, int val)\n/* Emit 3 copies of same byte value --- handy subr for colormap construction */\n{\n  putc(val, dinfo->pub.output_file);\n  putc(val, dinfo->pub.output_file);\n  putc(val, dinfo->pub.output_file);\n}\n\n\nLOCAL(void)\nemit_header (gif_dest_ptr dinfo, int num_colors, JSAMPARRAY colormap)\n/* Output the GIF file header, including color map */\n/* If colormap==NULL, synthesize a gray-scale colormap */\n{\n  int BitsPerPixel, ColorMapSize, InitCodeSize, FlagByte;\n  int cshift = dinfo->cinfo->data_precision - 8;\n  int i;\n\n  if (num_colors > 256)\n    ERREXIT1(dinfo->cinfo, JERR_TOO_MANY_COLORS, num_colors);\n  /* Compute bits/pixel and related values */\n  BitsPerPixel = 1;\n  while (num_colors > (1 << BitsPerPixel))\n    BitsPerPixel++;\n  ColorMapSize = 1 << BitsPerPixel;\n  if (BitsPerPixel <= 1)\n    InitCodeSize = 2;\n  else\n    InitCodeSize = BitsPerPixel;\n  /*\n   * Write the GIF header.\n   * Note that we generate a plain GIF87 header for maximum compatibility.\n   */\n  putc('G', dinfo->pub.output_file);\n  putc('I', dinfo->pub.output_file);\n  putc('F', dinfo->pub.output_file);\n  putc('8', dinfo->pub.output_file);\n  putc('7', dinfo->pub.output_file);\n  putc('a', dinfo->pub.output_file);\n  /* Write the Logical Screen Descriptor */\n  put_word(dinfo, (unsigned int) dinfo->cinfo->output_width);\n  put_word(dinfo, (unsigned int) dinfo->cinfo->output_height);\n  FlagByte = 0x80;\t\t/* Yes, there is a global color table */\n  FlagByte |= (BitsPerPixel-1) << 4; /* color resolution */\n  FlagByte |= (BitsPerPixel-1);\t/* size of global color table */\n  putc(FlagByte, dinfo->pub.output_file);\n  putc(0, dinfo->pub.output_file); /* Background color index */\n  putc(0, dinfo->pub.output_file); /* Reserved (aspect ratio in GIF89) */\n  /* Write the Global Color Map */\n  /* If the color map is more than 8 bits precision, */\n  /* we reduce it to 8 bits by shifting */\n  for (i=0; i < ColorMapSize; i++) {\n    if (i < num_colors) {\n      if (colormap != NULL) {\n\tif (dinfo->cinfo->out_color_space == JCS_RGB) {\n\t  /* Normal case: RGB color map */\n\t  putc(GETJSAMPLE(colormap[0][i]) >> cshift, dinfo->pub.output_file);\n\t  putc(GETJSAMPLE(colormap[1][i]) >> cshift, dinfo->pub.output_file);\n\t  putc(GETJSAMPLE(colormap[2][i]) >> cshift, dinfo->pub.output_file);\n\t} else {\n\t  /* Grayscale \"color map\": possible if quantizing grayscale image */\n\t  put_3bytes(dinfo, GETJSAMPLE(colormap[0][i]) >> cshift);\n\t}\n      } else {\n\t/* Create a gray-scale map of num_colors values, range 0..255 */\n\tput_3bytes(dinfo, (i * 255 + (num_colors-1)/2) / (num_colors-1));\n      }\n    } else {\n      /* fill out the map to a power of 2 */\n      put_3bytes(dinfo, 0);\n    }\n  }\n  /* Write image separator and Image Descriptor */\n  putc(',', dinfo->pub.output_file); /* separator */\n  put_word(dinfo, 0);\t\t/* left/top offset */\n  put_word(dinfo, 0);\n  put_word(dinfo, (unsigned int) dinfo->cinfo->output_width); /* image size */\n  put_word(dinfo, (unsigned int) dinfo->cinfo->output_height);\n  /* flag byte: not interlaced, no local color map */\n  putc(0x00, dinfo->pub.output_file);\n  /* Write Initial Code Size byte */\n  putc(InitCodeSize, dinfo->pub.output_file);\n\n  /* Initialize for \"compression\" of image data */\n  compress_init(dinfo, InitCodeSize+1);\n}\n\n\n/*\n * Startup: write the file header.\n */\n\nMETHODDEF(void)\nstart_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  gif_dest_ptr dest = (gif_dest_ptr) dinfo;\n\n  if (cinfo->quantize_colors)\n    emit_header(dest, cinfo->actual_number_of_colors, cinfo->colormap);\n  else\n    emit_header(dest, 256, (JSAMPARRAY) NULL);\n}\n\n\n/*\n * Write some pixel data.\n * In this module rows_supplied will always be 1.\n */\n\nMETHODDEF(void)\nput_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\tJDIMENSION rows_supplied)\n{\n  gif_dest_ptr dest = (gif_dest_ptr) dinfo;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n\n  ptr = dest->pub.buffer[0];\n  for (col = cinfo->output_width; col > 0; col--) {\n    compress_pixel(dest, GETJSAMPLE(*ptr++));\n  }\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  gif_dest_ptr dest = (gif_dest_ptr) dinfo;\n\n  /* Flush \"compression\" mechanism */\n  compress_term(dest);\n  /* Write a zero-length data block to end the series */\n  putc(0, dest->pub.output_file);\n  /* Write the GIF terminator mark */\n  putc(';', dest->pub.output_file);\n  /* Make sure we wrote the output file OK */\n  fflush(dest->pub.output_file);\n  if (ferror(dest->pub.output_file))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for GIF format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_gif (j_decompress_ptr cinfo)\n{\n  gif_dest_ptr dest;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (gif_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(gif_dest_struct));\n  dest->cinfo = cinfo;\t\t/* make back link for subroutines */\n  dest->pub.start_output = start_output_gif;\n  dest->pub.put_pixel_rows = put_pixel_rows;\n  dest->pub.finish_output = finish_output_gif;\n\n  if (cinfo->out_color_space != JCS_GRAYSCALE &&\n      cinfo->out_color_space != JCS_RGB)\n    ERREXIT(cinfo, JERR_GIF_COLORSPACE);\n\n  /* Force quantization if color or if > 8 bits input */\n  if (cinfo->out_color_space != JCS_GRAYSCALE || cinfo->data_precision > 8) {\n    /* Force quantization to at most 256 colors */\n    cinfo->quantize_colors = TRUE;\n    if (cinfo->desired_number_of_colors > 256)\n      cinfo->desired_number_of_colors = 256;\n  }\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  if (cinfo->output_components != 1) /* safety check: just one component? */\n    ERREXIT(cinfo, JERR_GIF_BUG);\n\n  /* Create decompressor output buffer. */\n  dest->pub.buffer = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->output_width, (JDIMENSION) 1);\n  dest->pub.buffer_height = 1;\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* GIF_SUPPORTED */\n"
  },
  {
    "path": "wrjpgcom.1",
    "content": ".TH WRJPGCOM 1 \"15 June 1995\"\n.SH NAME\nwrjpgcom \\- insert text comments into a JPEG file\n.SH SYNOPSIS\n.B wrjpgcom\n[\n.B \\-replace\n]\n[\n.BI \\-comment \" text\"\n]\n[\n.BI \\-cfile \" name\"\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B wrjpgcom\nreads the named JPEG/JFIF file, or the standard input if no file is named,\nand generates a new JPEG/JFIF file on standard output.  A comment block is\nadded to the file.\n.PP\nThe JPEG standard allows \"comment\" (COM) blocks to occur within a JPEG file.\nAlthough the standard doesn't actually define what COM blocks are for, they\nare widely used to hold user-supplied text strings.  This lets you add\nannotations, titles, index terms, etc to your JPEG files, and later retrieve\nthem as text.  COM blocks do not interfere with the image stored in the JPEG\nfile.  The maximum size of a COM block is 64K, but you can have as many of\nthem as you like in one JPEG file.\n.PP\n.B wrjpgcom\nadds a COM block, containing text you provide, to a JPEG file.\nOrdinarily, the COM block is added after any existing COM blocks; but you\ncan delete the old COM blocks if you wish.\n.SH OPTIONS\nSwitch names may be abbreviated, and are not case sensitive.\n.TP\n.B \\-replace\nDelete any existing COM blocks from the file.\n.TP\n.BI \\-comment \" text\"\nSupply text for new COM block on command line.\n.TP\n.BI \\-cfile \" name\"\nRead text for new COM block from named file.\n.PP\nIf you have only one line of comment text to add, you can provide it on the\ncommand line with\n.BR \\-comment .\nThe comment text must be surrounded with quotes so that it is treated as a\nsingle argument.  Longer comments can be read from a text file.\n.PP\nIf you give neither\n.B \\-comment\nnor\n.BR \\-cfile ,\nthen\n.B wrjpgcom\nwill read the comment text from standard input.  (In this case an input image\nfile name MUST be supplied, so that the source JPEG file comes from somewhere\nelse.)  You can enter multiple lines, up to 64KB worth.  Type an end-of-file\nindicator (usually control-D) to terminate the comment text entry.\n.PP\n.B wrjpgcom\nwill not add a COM block if the provided comment string is empty.  Therefore\n\\fB\\-replace \\-comment \"\"\\fR can be used to delete all COM blocks from a file.\n.SH EXAMPLES\n.LP\nAdd a short comment to in.jpg, producing out.jpg:\n.IP\n.B wrjpgcom \\-c\n\\fI\"View of my back yard\" in.jpg\n.B >\n.I out.jpg\n.PP\nAttach a long comment previously stored in comment.txt:\n.IP\n.B wrjpgcom\n.I in.jpg\n.B <\n.I comment.txt\n.B >\n.I out.jpg\n.PP\nor equivalently\n.IP\n.B wrjpgcom\n.B -cfile\n.I comment.txt\n.B <\n.I in.jpg\n.B >\n.I out.jpg\n.SH SEE ALSO\n.BR cjpeg (1),\n.BR djpeg (1),\n.BR jpegtran (1),\n.BR rdjpgcom (1)\n.SH AUTHOR\nIndependent JPEG Group\n"
  },
  {
    "path": "wrjpgcom.c",
    "content": "/*\n * wrjpgcom.c\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a very simple stand-alone application that inserts\n * user-supplied text as a COM (comment) marker in a JFIF file.\n * This may be useful as an example of the minimum logic needed to parse\n * JPEG markers.\n */\n\n#define JPEG_CJPEG_DJPEG\t/* to get the command-line config symbols */\n#include \"jinclude.h\"\t\t/* get auto-config symbols, <stdio.h> */\n\n#ifndef HAVE_STDLIB_H\t\t/* <stdlib.h> should declare malloc() */\nextern void * malloc ();\n#endif\n#include <ctype.h>\t\t/* to declare isupper(), tolower() */\n#ifdef USE_SETMODE\n#include <fcntl.h>\t\t/* to declare setmode()'s parameter macros */\n/* If you have setmode() but not <io.h>, just delete this line: */\n#include <io.h>\t\t\t/* to declare setmode() */\n#endif\n\n#ifdef USE_CCOMMAND\t\t/* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>\t\t/* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>\t\t/* Think declares it here */\n#endif\n#endif\n\n#ifdef DONT_USE_B_MODE\t\t/* define mode parameters for fopen() */\n#define READ_BINARY\t\"r\"\n#define WRITE_BINARY\t\"w\"\n#else\n#ifdef VMS\t\t\t/* VMS is very nonstandard */\n#define READ_BINARY\t\"rb\", \"ctx=stm\"\n#define WRITE_BINARY\t\"wb\", \"ctx=stm\"\n#else\t\t\t\t/* standard ANSI-compliant case */\n#define READ_BINARY\t\"rb\"\n#define WRITE_BINARY\t\"wb\"\n#endif\n#endif\n\n#ifndef EXIT_FAILURE\t\t/* define exit() codes if not provided */\n#define EXIT_FAILURE  1\n#endif\n#ifndef EXIT_SUCCESS\n#ifdef VMS\n#define EXIT_SUCCESS  1\t\t/* VMS is very nonstandard */\n#else\n#define EXIT_SUCCESS  0\n#endif\n#endif\n\n/* Reduce this value if your malloc() can't allocate blocks up to 64K.\n * On DOS, compiling in large model is usually a better solution.\n */\n\n#ifndef MAX_COM_LENGTH\n#define MAX_COM_LENGTH 65000L\t/* must be <= 65533 in any case */\n#endif\n\n\n/*\n * These macros are used to read the input file and write the output file.\n * To reuse this code in another application, you might need to change these.\n */\n\nstatic FILE * infile;\t\t/* input JPEG file */\n\n/* Return next input byte, or EOF if no more */\n#define NEXTBYTE()  getc(infile)\n\nstatic FILE * outfile;\t\t/* output JPEG file */\n\n/* Emit an output byte */\n#define PUTBYTE(x)  putc((x), outfile)\n\n\n/* Error exit handler */\n#define ERREXIT(msg)  (fprintf(stderr, \"%s\\n\", msg), exit(EXIT_FAILURE))\n\n\n/* Read one byte, testing for EOF */\nstatic int\nread_1_byte (void)\n{\n  int c;\n\n  c = NEXTBYTE();\n  if (c == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  return c;\n}\n\n/* Read 2 bytes, convert to unsigned int */\n/* All 2-byte quantities in JPEG markers are MSB first */\nstatic unsigned int\nread_2_bytes (void)\n{\n  int c1, c2;\n\n  c1 = NEXTBYTE();\n  if (c1 == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  c2 = NEXTBYTE();\n  if (c2 == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  return (((unsigned int) c1) << 8) + ((unsigned int) c2);\n}\n\n\n/* Routines to write data to output file */\n\nstatic void\nwrite_1_byte (int c)\n{\n  PUTBYTE(c);\n}\n\nstatic void\nwrite_2_bytes (unsigned int val)\n{\n  PUTBYTE((val >> 8) & 0xFF);\n  PUTBYTE(val & 0xFF);\n}\n\nstatic void\nwrite_marker (int marker)\n{\n  PUTBYTE(0xFF);\n  PUTBYTE(marker);\n}\n\nstatic void\ncopy_rest_of_file (void)\n{\n  int c;\n\n  while ((c = NEXTBYTE()) != EOF)\n    PUTBYTE(c);\n}\n\n\n/*\n * JPEG markers consist of one or more 0xFF bytes, followed by a marker\n * code byte (which is not an FF).  Here are the marker codes of interest\n * in this program.  (See jdmarker.c for a more complete list.)\n */\n\n#define M_SOF0  0xC0\t\t/* Start Of Frame N */\n#define M_SOF1  0xC1\t\t/* N indicates which compression process */\n#define M_SOF2  0xC2\t\t/* Only SOF0-SOF2 are now in common use */\n#define M_SOF3  0xC3\n#define M_SOF5  0xC5\t\t/* NB: codes C4 and CC are NOT SOF markers */\n#define M_SOF6  0xC6\n#define M_SOF7  0xC7\n#define M_SOF9  0xC9\n#define M_SOF10 0xCA\n#define M_SOF11 0xCB\n#define M_SOF13 0xCD\n#define M_SOF14 0xCE\n#define M_SOF15 0xCF\n#define M_SOI   0xD8\t\t/* Start Of Image (beginning of datastream) */\n#define M_EOI   0xD9\t\t/* End Of Image (end of datastream) */\n#define M_SOS   0xDA\t\t/* Start Of Scan (begins compressed data) */\n#define M_COM   0xFE\t\t/* COMment */\n\n\n/*\n * Find the next JPEG marker and return its marker code.\n * We expect at least one FF byte, possibly more if the compressor used FFs\n * to pad the file.  (Padding FFs will NOT be replicated in the output file.)\n * There could also be non-FF garbage between markers.  The treatment of such\n * garbage is unspecified; we choose to skip over it but emit a warning msg.\n * NB: this routine must not be used after seeing SOS marker, since it will\n * not deal correctly with FF/00 sequences in the compressed image data...\n */\n\nstatic int\nnext_marker (void)\n{\n  int c;\n  int discarded_bytes = 0;\n\n  /* Find 0xFF byte; count and skip any non-FFs. */\n  c = read_1_byte();\n  while (c != 0xFF) {\n    discarded_bytes++;\n    c = read_1_byte();\n  }\n  /* Get marker code byte, swallowing any duplicate FF bytes.  Extra FFs\n   * are legal as pad bytes, so don't count them in discarded_bytes.\n   */\n  do {\n    c = read_1_byte();\n  } while (c == 0xFF);\n\n  if (discarded_bytes != 0) {\n    fprintf(stderr, \"Warning: garbage data found in JPEG file\\n\");\n  }\n\n  return c;\n}\n\n\n/*\n * Read the initial marker, which should be SOI.\n * For a JFIF file, the first two bytes of the file should be literally\n * 0xFF M_SOI.  To be more general, we could use next_marker, but if the\n * input file weren't actually JPEG at all, next_marker might read the whole\n * file and then return a misleading error message...\n */\n\nstatic int\nfirst_marker (void)\n{\n  int c1, c2;\n\n  c1 = NEXTBYTE();\n  c2 = NEXTBYTE();\n  if (c1 != 0xFF || c2 != M_SOI)\n    ERREXIT(\"Not a JPEG file\");\n  return c2;\n}\n\n\n/*\n * Most types of marker are followed by a variable-length parameter segment.\n * This routine skips over the parameters for any marker we don't otherwise\n * want to process.\n * Note that we MUST skip the parameter segment explicitly in order not to\n * be fooled by 0xFF bytes that might appear within the parameter segment;\n * such bytes do NOT introduce new markers.\n */\n\nstatic void\ncopy_variable (void)\n/* Copy an unknown or uninteresting variable-length marker */\n{\n  unsigned int length;\n\n  /* Get the marker parameter length count */\n  length = read_2_bytes();\n  write_2_bytes(length);\n  /* Length includes itself, so must be at least 2 */\n  if (length < 2)\n    ERREXIT(\"Erroneous JPEG marker length\");\n  length -= 2;\n  /* Skip over the remaining bytes */\n  while (length > 0) {\n    write_1_byte(read_1_byte());\n    length--;\n  }\n}\n\nstatic void\nskip_variable (void)\n/* Skip over an unknown or uninteresting variable-length marker */\n{\n  unsigned int length;\n\n  /* Get the marker parameter length count */\n  length = read_2_bytes();\n  /* Length includes itself, so must be at least 2 */\n  if (length < 2)\n    ERREXIT(\"Erroneous JPEG marker length\");\n  length -= 2;\n  /* Skip over the remaining bytes */\n  while (length > 0) {\n    (void) read_1_byte();\n    length--;\n  }\n}\n\n\n/*\n * Parse the marker stream until SOFn or EOI is seen;\n * copy data to output, but discard COM markers unless keep_COM is true.\n */\n\nstatic int\nscan_JPEG_header (int keep_COM)\n{\n  int marker;\n\n  /* Expect SOI at start of file */\n  if (first_marker() != M_SOI)\n    ERREXIT(\"Expected SOI marker first\");\n  write_marker(M_SOI);\n\n  /* Scan miscellaneous markers until we reach SOFn. */\n  for (;;) {\n    marker = next_marker();\n    switch (marker) {\n      /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be,\n       * treated as SOFn.  C4 in particular is actually DHT.\n       */\n    case M_SOF0:\t\t/* Baseline */\n    case M_SOF1:\t\t/* Extended sequential, Huffman */\n    case M_SOF2:\t\t/* Progressive, Huffman */\n    case M_SOF3:\t\t/* Lossless, Huffman */\n    case M_SOF5:\t\t/* Differential sequential, Huffman */\n    case M_SOF6:\t\t/* Differential progressive, Huffman */\n    case M_SOF7:\t\t/* Differential lossless, Huffman */\n    case M_SOF9:\t\t/* Extended sequential, arithmetic */\n    case M_SOF10:\t\t/* Progressive, arithmetic */\n    case M_SOF11:\t\t/* Lossless, arithmetic */\n    case M_SOF13:\t\t/* Differential sequential, arithmetic */\n    case M_SOF14:\t\t/* Differential progressive, arithmetic */\n    case M_SOF15:\t\t/* Differential lossless, arithmetic */\n      return marker;\n\n    case M_SOS:\t\t\t/* should not see compressed data before SOF */\n      ERREXIT(\"SOS without prior SOFn\");\n      break;\n\n    case M_EOI:\t\t\t/* in case it's a tables-only JPEG stream */\n      return marker;\n\n    case M_COM:\t\t\t/* Existing COM: conditionally discard */\n      if (keep_COM) {\n\twrite_marker(marker);\n\tcopy_variable();\n      } else {\n\tskip_variable();\n      }\n      break;\n\n    default:\t\t\t/* Anything else just gets copied */\n      write_marker(marker);\n      copy_variable();\t\t/* we assume it has a parameter count... */\n      break;\n    }\n  } /* end loop */\n}\n\n\n/* Command line parsing code */\n\nstatic const char * progname;\t/* program name for error messages */\n\n\nstatic void\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"wrjpgcom inserts a textual comment in a JPEG file.\\n\");\n  fprintf(stderr, \"You can add to or replace any existing comment(s).\\n\");\n\n  fprintf(stderr, \"Usage: %s [switches] \", progname);\n#ifdef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"inputfile outputfile\\n\");\n#else\n  fprintf(stderr, \"[inputfile]\\n\");\n#endif\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -replace         Delete any existing comments\\n\");\n  fprintf(stderr, \"  -comment \\\"text\\\"  Insert comment with given text\\n\");\n  fprintf(stderr, \"  -cfile name      Read comment from named file\\n\");\n  fprintf(stderr, \"Notice that you must put quotes around the comment text\\n\");\n  fprintf(stderr, \"when you use -comment.\\n\");\n  fprintf(stderr, \"If you do not give either -comment or -cfile on the command line,\\n\");\n  fprintf(stderr, \"then the comment text is read from standard input.\\n\");\n  fprintf(stderr, \"It can be multiple lines, up to %u characters total.\\n\",\n\t  (unsigned int) MAX_COM_LENGTH);\n#ifndef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"You must specify an input JPEG file name when supplying\\n\");\n  fprintf(stderr, \"comment text from standard input.\\n\");\n#endif\n\n  exit(EXIT_FAILURE);\n}\n\n\nstatic int\nkeymatch (char * arg, const char * keyword, int minchars)\n/* Case-insensitive matching of (possibly abbreviated) keyword switches. */\n/* keyword is the constant keyword (must be lower case already), */\n/* minchars is length of minimum legal abbreviation. */\n{\n  register int ca, ck;\n  register int nmatched = 0;\n\n  while ((ca = *arg++) != '\\0') {\n    if ((ck = *keyword++) == '\\0')\n      return 0;\t\t\t/* arg longer than keyword, no good */\n    if (isupper(ca))\t\t/* force arg to lcase (assume ck is already) */\n      ca = tolower(ca);\n    if (ca != ck)\n      return 0;\t\t\t/* no good */\n    nmatched++;\t\t\t/* count matched characters */\n  }\n  /* reached end of argument; fail if it's too short for unique abbrev */\n  if (nmatched < minchars)\n    return 0;\n  return 1;\t\t\t/* A-OK */\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  int argn;\n  char * arg;\n  int keep_COM = 1;\n  char * comment_arg = NULL;\n  FILE * comment_file = NULL;\n  unsigned int comment_length = 0;\n  int marker;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"wrjpgcom\";\t/* in case C library doesn't provide it */\n\n  /* Parse switches, if any */\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (arg[0] != '-')\n      break;\t\t\t/* not switch, must be file name */\n    arg++;\t\t\t/* advance over '-' */\n    if (keymatch(arg, \"replace\", 1)) {\n      keep_COM = 0;\n    } else if (keymatch(arg, \"cfile\", 2)) {\n      if (++argn >= argc) usage();\n      if ((comment_file = fopen(argv[argn], \"r\")) == NULL) {\n\tfprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn]);\n\texit(EXIT_FAILURE);\n      }\n    } else if (keymatch(arg, \"comment\", 1)) {\n      if (++argn >= argc) usage();\n      comment_arg = argv[argn];\n      /* If the comment text starts with '\"', then we are probably running\n       * under MS-DOG and must parse out the quoted string ourselves.  Sigh.\n       */\n      if (comment_arg[0] == '\"') {\n\tcomment_arg = (char *) malloc((size_t) MAX_COM_LENGTH);\n\tif (comment_arg == NULL)\n\t  ERREXIT(\"Insufficient memory\");\n\tstrcpy(comment_arg, argv[argn]+1);\n\tfor (;;) {\n\t  comment_length = (unsigned int) strlen(comment_arg);\n\t  if (comment_length > 0 && comment_arg[comment_length-1] == '\"') {\n\t    comment_arg[comment_length-1] = '\\0'; /* zap terminating quote */\n\t    break;\n\t  }\n\t  if (++argn >= argc)\n\t    ERREXIT(\"Missing ending quote mark\");\n\t  strcat(comment_arg, \" \");\n\t  strcat(comment_arg, argv[argn]);\n\t}\n      }\n      comment_length = (unsigned int) strlen(comment_arg);\n    } else\n      usage();\n  }\n\n  /* Cannot use both -comment and -cfile. */\n  if (comment_arg != NULL && comment_file != NULL)\n    usage();\n  /* If there is neither -comment nor -cfile, we will read the comment text\n   * from stdin; in this case there MUST be an input JPEG file name.\n   */\n  if (comment_arg == NULL && comment_file == NULL && argn >= argc)\n    usage();\n\n  /* Open the input file. */\n  if (argn < argc) {\n    if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n#ifdef USE_SETMODE\t\t/* need to hack file mode? */\n    setmode(fileno(stdin), O_BINARY);\n#endif\n#ifdef USE_FDOPEN\t\t/* need to re-open in binary mode? */\n    if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open stdin\\n\", progname);\n      exit(EXIT_FAILURE);\n    }\n#else\n    infile = stdin;\n#endif\n  }\n\n  /* Open the output file. */\n#ifdef TWO_FILE_COMMANDLINE\n  /* Must have explicit output file name */\n  if (argn != argc-2) {\n    fprintf(stderr, \"%s: must name one input and one output file\\n\",\n\t    progname);\n    usage();\n  }\n  if ((outfile = fopen(argv[argn+1], WRITE_BINARY)) == NULL) {\n    fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn+1]);\n    exit(EXIT_FAILURE);\n  }\n#else\n  /* Unix style: expect zero or one file name */\n  if (argn < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n  /* default output file is stdout */\n#ifdef USE_SETMODE\t\t/* need to hack file mode? */\n  setmode(fileno(stdout), O_BINARY);\n#endif\n#ifdef USE_FDOPEN\t\t/* need to re-open in binary mode? */\n  if ((outfile = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {\n    fprintf(stderr, \"%s: can't open stdout\\n\", progname);\n    exit(EXIT_FAILURE);\n  }\n#else\n  outfile = stdout;\n#endif\n#endif /* TWO_FILE_COMMANDLINE */\n\n  /* Collect comment text from comment_file or stdin, if necessary */\n  if (comment_arg == NULL) {\n    FILE * src_file;\n    int c;\n\n    comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH);\n    if (comment_arg == NULL)\n      ERREXIT(\"Insufficient memory\");\n    comment_length = 0;\n    src_file = (comment_file != NULL ? comment_file : stdin);\n    while ((c = getc(src_file)) != EOF) {\n      if (comment_length >= (unsigned int) MAX_COM_LENGTH) {\n\tfprintf(stderr, \"Comment text may not exceed %u bytes\\n\",\n\t\t(unsigned int) MAX_COM_LENGTH);\n\texit(EXIT_FAILURE);\n      }\n      comment_arg[comment_length++] = (char) c;\n    }\n    if (comment_file != NULL)\n      fclose(comment_file);\n  }\n\n  /* Copy JPEG headers until SOFn marker;\n   * we will insert the new comment marker just before SOFn.\n   * This (a) causes the new comment to appear after, rather than before,\n   * existing comments; and (b) ensures that comments come after any JFIF\n   * or JFXX markers, as required by the JFIF specification.\n   */\n  marker = scan_JPEG_header(keep_COM);\n  /* Insert the new COM marker, but only if nonempty text has been supplied */\n  if (comment_length > 0) {\n    write_marker(M_COM);\n    write_2_bytes(comment_length + 2);\n    while (comment_length > 0) {\n      write_1_byte(*comment_arg++);\n      comment_length--;\n    }\n  }\n  /* Duplicate the remainder of the source file.\n   * Note that any COM markers occuring after SOF will not be touched.\n   */\n  write_marker(marker);\n  copy_rest_of_file();\n\n  /* All done. */\n  exit(EXIT_SUCCESS);\n  return 0;\t\t\t/* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "wrppm.c",
    "content": "/*\n * wrppm.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * Modified 2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to write output images in PPM/PGM format.\n * The extended 2-byte-per-sample raw PPM/PGM formats are supported.\n * The PBMPLUS library is NOT required to compile this software\n * (but it is highly useful as a set of PPM image manipulation programs).\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef PPM_SUPPORTED\n\n\n/*\n * For 12-bit JPEG data, we either downscale the values to 8 bits\n * (to write standard byte-per-sample PPM/PGM files), or output\n * nonstandard word-per-sample PPM/PGM files.  Downscaling is done\n * if PPM_NORAWWORD is defined (this can be done in the Makefile\n * or in jconfig.h).\n * (When the core library supports data precision reduction, a cleaner\n * implementation will be to ask for that instead.)\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define PUTPPMSAMPLE(ptr,v)  *ptr++ = (char) (v)\n#define BYTESPERSAMPLE 1\n#define PPM_MAXVAL 255\n#else\n#ifdef PPM_NORAWWORD\n#define PUTPPMSAMPLE(ptr,v)  *ptr++ = (char) ((v) >> (BITS_IN_JSAMPLE-8))\n#define BYTESPERSAMPLE 1\n#define PPM_MAXVAL 255\n#else\n/* The word-per-sample format always puts the MSB first. */\n#define PUTPPMSAMPLE(ptr,v)\t\t\t\\\n\t{ register int val_ = v;\t\t\\\n\t  *ptr++ = (char) ((val_ >> 8) & 0xFF);\t\\\n\t  *ptr++ = (char) (val_ & 0xFF);\t\\\n\t}\n#define BYTESPERSAMPLE 2\n#define PPM_MAXVAL ((1<<BITS_IN_JSAMPLE)-1)\n#endif\n#endif\n\n\n/*\n * When JSAMPLE is the same size as char, we can just fwrite() the\n * decompressed data to the PPM or PGM file.  On PCs, in order to make this\n * work the output buffer must be allocated in near data space, because we are\n * assuming small-data memory model wherein fwrite() can't reach far memory.\n * If you need to process very wide images on a PC, you might have to compile\n * in large-memory model, or else replace fwrite() with a putc() loop ---\n * which will be much slower.\n */\n\n\n/* Private version of data destination object */\n\ntypedef struct {\n  struct djpeg_dest_struct pub;\t/* public fields */\n\n  /* Usually these two pointers point to the same place: */\n  char *iobuffer;\t\t/* fwrite's I/O buffer */\n  JSAMPROW pixrow;\t\t/* decompressor output buffer */\n  size_t buffer_width;\t\t/* width of I/O buffer */\n  JDIMENSION samples_per_row;\t/* JSAMPLEs per output row */\n} ppm_dest_struct;\n\ntypedef ppm_dest_struct * ppm_dest_ptr;\n\n\n/*\n * Write some pixel data.\n * In this module rows_supplied will always be 1.\n *\n * put_pixel_rows handles the \"normal\" 8-bit case where the decompressor\n * output buffer is physically the same as the fwrite buffer.\n */\n\nMETHODDEF(void)\nput_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\tJDIMENSION rows_supplied)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * This code is used when we have to copy the data and apply a pixel\n * format translation.  Typically this only happens in 12-bit mode.\n */\n\nMETHODDEF(void)\ncopy_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\t JDIMENSION rows_supplied)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n  register char * bufferptr;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n\n  ptr = dest->pub.buffer[0];\n  bufferptr = dest->iobuffer;\n  for (col = dest->samples_per_row; col > 0; col--) {\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(*ptr++));\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * Write some pixel data when color quantization is in effect.\n * We have to demap the color index values to straight data.\n */\n\nMETHODDEF(void)\nput_demapped_rgb (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\t  JDIMENSION rows_supplied)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n  register char * bufferptr;\n  register int pixval;\n  register JSAMPROW ptr;\n  register JSAMPROW color_map0 = cinfo->colormap[0];\n  register JSAMPROW color_map1 = cinfo->colormap[1];\n  register JSAMPROW color_map2 = cinfo->colormap[2];\n  register JDIMENSION col;\n\n  ptr = dest->pub.buffer[0];\n  bufferptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    pixval = GETJSAMPLE(*ptr++);\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map0[pixval]));\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map1[pixval]));\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map2[pixval]));\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\nMETHODDEF(void)\nput_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\t   JDIMENSION rows_supplied)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n  register char * bufferptr;\n  register JSAMPROW ptr;\n  register JSAMPROW color_map = cinfo->colormap[0];\n  register JDIMENSION col;\n\n  ptr = dest->pub.buffer[0];\n  bufferptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map[GETJSAMPLE(*ptr++)]));\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * Startup: write the file header.\n */\n\nMETHODDEF(void)\nstart_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n\n  /* Emit file header */\n  switch (cinfo->out_color_space) {\n  case JCS_GRAYSCALE:\n    /* emit header for raw PGM format */\n    fprintf(dest->pub.output_file, \"P5\\n%ld %ld\\n%d\\n\",\n\t    (long) cinfo->output_width, (long) cinfo->output_height,\n\t    PPM_MAXVAL);\n    break;\n  case JCS_RGB:\n    /* emit header for raw PPM format */\n    fprintf(dest->pub.output_file, \"P6\\n%ld %ld\\n%d\\n\",\n\t    (long) cinfo->output_width, (long) cinfo->output_height,\n\t    PPM_MAXVAL);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_PPM_COLORSPACE);\n  }\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  /* Make sure we wrote the output file OK */\n  fflush(dinfo->output_file);\n  if (ferror(dinfo->output_file))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for PPM format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_ppm (j_decompress_ptr cinfo)\n{\n  ppm_dest_ptr dest;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (ppm_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(ppm_dest_struct));\n  dest->pub.start_output = start_output_ppm;\n  dest->pub.finish_output = finish_output_ppm;\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  /* Create physical I/O buffer.  Note we make this near on a PC. */\n  dest->samples_per_row = cinfo->output_width * cinfo->out_color_components;\n  dest->buffer_width = dest->samples_per_row * (BYTESPERSAMPLE * SIZEOF(char));\n  dest->iobuffer = (char *) (*cinfo->mem->alloc_small)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width);\n\n  if (cinfo->quantize_colors || BITS_IN_JSAMPLE != 8 ||\n      SIZEOF(JSAMPLE) != SIZEOF(char)) {\n    /* When quantizing, we need an output buffer for colormap indexes\n     * that's separate from the physical I/O buffer.  We also need a\n     * separate buffer if pixel format translation must take place.\n     */\n    dest->pub.buffer = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       cinfo->output_width * cinfo->output_components, (JDIMENSION) 1);\n    dest->pub.buffer_height = 1;\n    if (! cinfo->quantize_colors)\n      dest->pub.put_pixel_rows = copy_pixel_rows;\n    else if (cinfo->out_color_space == JCS_GRAYSCALE)\n      dest->pub.put_pixel_rows = put_demapped_gray;\n    else\n      dest->pub.put_pixel_rows = put_demapped_rgb;\n  } else {\n    /* We will fwrite() directly from decompressor output buffer. */\n    /* Synthesize a JSAMPARRAY pointer structure */\n    /* Cast here implies near->far pointer conversion on PCs */\n    dest->pixrow = (JSAMPROW) dest->iobuffer;\n    dest->pub.buffer = & dest->pixrow;\n    dest->pub.buffer_height = 1;\n    dest->pub.put_pixel_rows = put_pixel_rows;\n  }\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* PPM_SUPPORTED */\n"
  },
  {
    "path": "wrrle.c",
    "content": "/*\n * wrrle.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to write output images in RLE format.\n * The Utah Raster Toolkit library is required (version 3.1 or later).\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n *\n * Based on code contributed by Mike Lijewski,\n * with updates from Robert Hutchinson.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef RLE_SUPPORTED\n\n/* rle.h is provided by the Utah Raster Toolkit. */\n\n#include <rle.h>\n\n/*\n * We assume that JSAMPLE has the same representation as rle_pixel,\n * to wit, \"unsigned char\".  Hence we can't cope with 12- or 16-bit samples.\n */\n\n#if BITS_IN_JSAMPLE != 8\n  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */\n#endif\n\n\n/*\n * Since RLE stores scanlines bottom-to-top, we have to invert the image\n * from JPEG's top-to-bottom order.  To do this, we save the outgoing data\n * in a virtual array during put_pixel_row calls, then actually emit the\n * RLE file during finish_output.\n */\n\n\n/*\n * For now, if we emit an RLE color map then it is always 256 entries long,\n * though not all of the entries need be used.\n */\n\n#define CMAPBITS\t8\n#define CMAPLENGTH\t(1<<(CMAPBITS))\n\ntypedef struct {\n  struct djpeg_dest_struct pub; /* public fields */\n\n  jvirt_sarray_ptr image;\t/* virtual array to store the output image */\n  rle_map *colormap;\t \t/* RLE-style color map, or NULL if none */\n  rle_pixel **rle_row;\t\t/* To pass rows to rle_putrow() */\n\n} rle_dest_struct;\n\ntypedef rle_dest_struct * rle_dest_ptr;\n\n/* Forward declarations */\nMETHODDEF(void) rle_put_pixel_rows\n    JPP((j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t JDIMENSION rows_supplied));\n\n\n/*\n * Write the file header.\n *\n * In this module it's easier to wait till finish_output to write anything.\n */\n\nMETHODDEF(void)\nstart_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  rle_dest_ptr dest = (rle_dest_ptr) dinfo;\n  size_t cmapsize;\n  int i, ci;\n#ifdef PROGRESS_REPORT\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n#endif\n\n  /*\n   * Make sure the image can be stored in RLE format.\n   *\n   * - RLE stores image dimensions as *signed* 16 bit integers.  JPEG\n   *   uses unsigned, so we have to check the width.\n   *\n   * - Colorspace is expected to be grayscale or RGB.\n   *\n   * - The number of channels (components) is expected to be 1 (grayscale/\n   *   pseudocolor) or 3 (truecolor/directcolor).\n   *   (could be 2 or 4 if using an alpha channel, but we aren't)\n   */\n\n  if (cinfo->output_width > 32767 || cinfo->output_height > 32767)\n    ERREXIT2(cinfo, JERR_RLE_DIMENSIONS, cinfo->output_width, \n\t     cinfo->output_height);\n\n  if (cinfo->out_color_space != JCS_GRAYSCALE &&\n      cinfo->out_color_space != JCS_RGB)\n    ERREXIT(cinfo, JERR_RLE_COLORSPACE);\n\n  if (cinfo->output_components != 1 && cinfo->output_components != 3)\n    ERREXIT1(cinfo, JERR_RLE_TOOMANYCHANNELS, cinfo->num_components);\n\n  /* Convert colormap, if any, to RLE format. */\n\n  dest->colormap = NULL;\n\n  if (cinfo->quantize_colors) {\n    /* Allocate storage for RLE-style cmap, zero any extra entries */\n    cmapsize = cinfo->out_color_components * CMAPLENGTH * SIZEOF(rle_map);\n    dest->colormap = (rle_map *) (*cinfo->mem->alloc_small)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE, cmapsize);\n    MEMZERO(dest->colormap, cmapsize);\n\n    /* Save away data in RLE format --- note 8-bit left shift! */\n    /* Shifting would need adjustment for JSAMPLEs wider than 8 bits. */\n    for (ci = 0; ci < cinfo->out_color_components; ci++) {\n      for (i = 0; i < cinfo->actual_number_of_colors; i++) {\n        dest->colormap[ci * CMAPLENGTH + i] =\n          GETJSAMPLE(cinfo->colormap[ci][i]) << 8;\n      }\n    }\n  }\n\n  /* Set the output buffer to the first row */\n  dest->pub.buffer = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, dest->image, (JDIMENSION) 0, (JDIMENSION) 1, TRUE);\n  dest->pub.buffer_height = 1;\n\n  dest->pub.put_pixel_rows = rle_put_pixel_rows;\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL) {\n    progress->total_extra_passes++;  /* count file writing as separate pass */\n  }\n#endif\n}\n\n\n/*\n * Write some pixel data.\n *\n * This routine just saves the data away in a virtual array.\n */\n\nMETHODDEF(void)\nrle_put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\t    JDIMENSION rows_supplied)\n{\n  rle_dest_ptr dest = (rle_dest_ptr) dinfo;\n\n  if (cinfo->output_scanline < cinfo->output_height) {\n    dest->pub.buffer = (*cinfo->mem->access_virt_sarray)\n      ((j_common_ptr) cinfo, dest->image,\n       cinfo->output_scanline, (JDIMENSION) 1, TRUE);\n  }\n}\n\n/*\n * Finish up at the end of the file.\n *\n * Here is where we really output the RLE file.\n */\n\nMETHODDEF(void)\nfinish_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  rle_dest_ptr dest = (rle_dest_ptr) dinfo;\n  rle_hdr header;\t\t/* Output file information */\n  rle_pixel **rle_row, *red, *green, *blue;\n  JSAMPROW output_row;\n  char cmapcomment[80];\n  int row, col;\n  int ci;\n#ifdef PROGRESS_REPORT\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n#endif\n\n  /* Initialize the header info */\n  header = *rle_hdr_init(NULL);\n  header.rle_file = dest->pub.output_file;\n  header.xmin     = 0;\n  header.xmax     = cinfo->output_width  - 1;\n  header.ymin     = 0;\n  header.ymax     = cinfo->output_height - 1;\n  header.alpha    = 0;\n  header.ncolors  = cinfo->output_components;\n  for (ci = 0; ci < cinfo->output_components; ci++) {\n    RLE_SET_BIT(header, ci);\n  }\n  if (cinfo->quantize_colors) {\n    header.ncmap   = cinfo->out_color_components;\n    header.cmaplen = CMAPBITS;\n    header.cmap    = dest->colormap;\n    /* Add a comment to the output image with the true colormap length. */\n    sprintf(cmapcomment, \"color_map_length=%d\", cinfo->actual_number_of_colors);\n    rle_putcom(cmapcomment, &header);\n  }\n\n  /* Emit the RLE header and color map (if any) */\n  rle_put_setup(&header);\n\n  /* Now output the RLE data from our virtual array.\n   * We assume here that (a) rle_pixel is represented the same as JSAMPLE,\n   * and (b) we are not on a machine where FAR pointers differ from regular.\n   */\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL) {\n    progress->pub.pass_limit = cinfo->output_height;\n    progress->pub.pass_counter = 0;\n    (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n  }\n#endif\n\n  if (cinfo->output_components == 1) {\n    for (row = cinfo->output_height-1; row >= 0; row--) {\n      rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, dest->image,\n\t (JDIMENSION) row, (JDIMENSION) 1, FALSE);\n      rle_putrow(rle_row, (int) cinfo->output_width, &header);\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n  } else {\n    for (row = cinfo->output_height-1; row >= 0; row--) {\n      rle_row = (rle_pixel **) dest->rle_row;\n      output_row = * (*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, dest->image,\n\t (JDIMENSION) row, (JDIMENSION) 1, FALSE);\n      red = rle_row[0];\n      green = rle_row[1];\n      blue = rle_row[2];\n      for (col = cinfo->output_width; col > 0; col--) {\n        *red++ = GETJSAMPLE(*output_row++);\n        *green++ = GETJSAMPLE(*output_row++);\n        *blue++ = GETJSAMPLE(*output_row++);\n      }\n      rle_putrow(rle_row, (int) cinfo->output_width, &header);\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n  }\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n#endif\n\n  /* Emit file trailer */\n  rle_puteof(&header);\n  fflush(dest->pub.output_file);\n  if (ferror(dest->pub.output_file))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for RLE format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_rle (j_decompress_ptr cinfo)\n{\n  rle_dest_ptr dest;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (rle_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  SIZEOF(rle_dest_struct));\n  dest->pub.start_output = start_output_rle;\n  dest->pub.finish_output = finish_output_rle;\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  /* Allocate a work array for output to the RLE library. */\n  dest->rle_row = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     cinfo->output_width, (JDIMENSION) cinfo->output_components);\n\n  /* Allocate a virtual array to hold the image. */\n  dest->image = (*cinfo->mem->request_virt_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n     (JDIMENSION) (cinfo->output_width * cinfo->output_components),\n     cinfo->output_height, (JDIMENSION) 1);\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* RLE_SUPPORTED */\n"
  },
  {
    "path": "wrtarga.c",
    "content": "/*\n * wrtarga.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to write output images in Targa format.\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n *\n * Based on code contributed by Lee Daniel Crocker.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef TARGA_SUPPORTED\n\n\n/*\n * To support 12-bit JPEG data, we'd have to scale output down to 8 bits.\n * This is not yet implemented.\n */\n\n#if BITS_IN_JSAMPLE != 8\n  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */\n#endif\n\n/*\n * The output buffer needs to be writable by fwrite().  On PCs, we must\n * allocate the buffer in near data space, because we are assuming small-data\n * memory model, wherein fwrite() can't reach far memory.  If you need to\n * process very wide images on a PC, you might have to compile in large-memory\n * model, or else replace fwrite() with a putc() loop --- which will be much\n * slower.\n */\n\n\n/* Private version of data destination object */\n\ntypedef struct {\n  struct djpeg_dest_struct pub;\t/* public fields */\n\n  char *iobuffer;\t\t/* physical I/O buffer */\n  JDIMENSION buffer_width;\t/* width of one row */\n} tga_dest_struct;\n\ntypedef tga_dest_struct * tga_dest_ptr;\n\n\nLOCAL(void)\nwrite_header (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, int num_colors)\n/* Create and write a Targa header */\n{\n  char targaheader[18];\n\n  /* Set unused fields of header to 0 */\n  MEMZERO(targaheader, SIZEOF(targaheader));\n\n  if (num_colors > 0) {\n    targaheader[1] = 1;\t\t/* color map type 1 */\n    targaheader[5] = (char) (num_colors & 0xFF);\n    targaheader[6] = (char) (num_colors >> 8);\n    targaheader[7] = 24;\t/* 24 bits per cmap entry */\n  }\n\n  targaheader[12] = (char) (cinfo->output_width & 0xFF);\n  targaheader[13] = (char) (cinfo->output_width >> 8);\n  targaheader[14] = (char) (cinfo->output_height & 0xFF);\n  targaheader[15] = (char) (cinfo->output_height >> 8);\n  targaheader[17] = 0x20;\t/* Top-down, non-interlaced */\n\n  if (cinfo->out_color_space == JCS_GRAYSCALE) {\n    targaheader[2] = 3;\t\t/* image type = uncompressed gray-scale */\n    targaheader[16] = 8;\t/* bits per pixel */\n  } else {\t\t\t/* must be RGB */\n    if (num_colors > 0) {\n      targaheader[2] = 1;\t/* image type = colormapped RGB */\n      targaheader[16] = 8;\n    } else {\n      targaheader[2] = 2;\t/* image type = uncompressed RGB */\n      targaheader[16] = 24;\n    }\n  }\n\n  if (JFWRITE(dinfo->output_file, targaheader, 18) != (size_t) 18)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * Write some pixel data.\n * In this module rows_supplied will always be 1.\n */\n\nMETHODDEF(void)\nput_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\tJDIMENSION rows_supplied)\n/* used for unquantized full-color output */\n{\n  tga_dest_ptr dest = (tga_dest_ptr) dinfo;\n  register JSAMPROW inptr;\n  register char * outptr;\n  register JDIMENSION col;\n\n  inptr = dest->pub.buffer[0];\n  outptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    outptr[0] = (char) GETJSAMPLE(inptr[2]); /* RGB to BGR order */\n    outptr[1] = (char) GETJSAMPLE(inptr[1]);\n    outptr[2] = (char) GETJSAMPLE(inptr[0]);\n    inptr += 3, outptr += 3;\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\nMETHODDEF(void)\nput_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t       JDIMENSION rows_supplied)\n/* used for grayscale OR quantized color output */\n{\n  tga_dest_ptr dest = (tga_dest_ptr) dinfo;\n  register JSAMPROW inptr;\n  register char * outptr;\n  register JDIMENSION col;\n\n  inptr = dest->pub.buffer[0];\n  outptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    *outptr++ = (char) GETJSAMPLE(*inptr++);\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * Write some demapped pixel data when color quantization is in effect.\n * For Targa, this is only applied to grayscale data.\n */\n\nMETHODDEF(void)\nput_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\t   JDIMENSION rows_supplied)\n{\n  tga_dest_ptr dest = (tga_dest_ptr) dinfo;\n  register JSAMPROW inptr;\n  register char * outptr;\n  register JSAMPROW color_map0 = cinfo->colormap[0];\n  register JDIMENSION col;\n\n  inptr = dest->pub.buffer[0];\n  outptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    *outptr++ = (char) GETJSAMPLE(color_map0[GETJSAMPLE(*inptr++)]);\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * Startup: write the file header.\n */\n\nMETHODDEF(void)\nstart_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  tga_dest_ptr dest = (tga_dest_ptr) dinfo;\n  int num_colors, i;\n  FILE *outfile;\n\n  if (cinfo->out_color_space == JCS_GRAYSCALE) {\n    /* Targa doesn't have a mapped grayscale format, so we will */\n    /* demap quantized gray output.  Never emit a colormap. */\n    write_header(cinfo, dinfo, 0);\n    if (cinfo->quantize_colors)\n      dest->pub.put_pixel_rows = put_demapped_gray;\n    else\n      dest->pub.put_pixel_rows = put_gray_rows;\n  } else if (cinfo->out_color_space == JCS_RGB) {\n    if (cinfo->quantize_colors) {\n      /* We only support 8-bit colormap indexes, so only 256 colors */\n      num_colors = cinfo->actual_number_of_colors;\n      if (num_colors > 256)\n\tERREXIT1(cinfo, JERR_TOO_MANY_COLORS, num_colors);\n      write_header(cinfo, dinfo, num_colors);\n      /* Write the colormap.  Note Targa uses BGR byte order */\n      outfile = dest->pub.output_file;\n      for (i = 0; i < num_colors; i++) {\n\tputc(GETJSAMPLE(cinfo->colormap[2][i]), outfile);\n\tputc(GETJSAMPLE(cinfo->colormap[1][i]), outfile);\n\tputc(GETJSAMPLE(cinfo->colormap[0][i]), outfile);\n      }\n      dest->pub.put_pixel_rows = put_gray_rows;\n    } else {\n      write_header(cinfo, dinfo, 0);\n      dest->pub.put_pixel_rows = put_pixel_rows;\n    }\n  } else {\n    ERREXIT(cinfo, JERR_TGA_COLORSPACE);\n  }\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  /* Make sure we wrote the output file OK */\n  fflush(dinfo->output_file);\n  if (ferror(dinfo->output_file))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for Targa format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_targa (j_decompress_ptr cinfo)\n{\n  tga_dest_ptr dest;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (tga_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(tga_dest_struct));\n  dest->pub.start_output = start_output_tga;\n  dest->pub.finish_output = finish_output_tga;\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  /* Create I/O buffer.  Note we make this near on a PC. */\n  dest->buffer_width = cinfo->output_width * cinfo->output_components;\n  dest->iobuffer = (char *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(size_t) (dest->buffer_width * SIZEOF(char)));\n\n  /* Create decompressor output buffer. */\n  dest->pub.buffer = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width, (JDIMENSION) 1);\n  dest->pub.buffer_height = 1;\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* TARGA_SUPPORTED */\n"
  }
]