From bc3bc9925bac8831b519bf551f870964ae737fe6 Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Fri, 18 Feb 2011 21:54:22 +0000 Subject: [PATCH] added a configure option to enable CHUNKY_STRIP_READ support (--enable-chunky-strip-read) --- ChangeLog | 6 +++++- configure | 45 ++++++++++++++++++++++++++++++++++++----- configure.ac | 16 +++++++++++++++ libtiff/tif_config.h.in | 3 +++ 4 files changed, 64 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3436fd9..33050ac8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2011-02-18 Frank Warmerdam + * configure.ac, configure: Added support for --enable-chunky-strip-read + configure option to enable the experimental feature from a couple + months ago for reading big strips in chunks. + * configure.ac, tif_read.c, tif_readdir.c, tif_dir.h, tiffiop.h, tif_write.c, tif_print.c, tif_jpeg.c, tif_dirwrite.c, tif_write.c: Implement optional support for deferring the load of strip/tile @@ -38,7 +42,7 @@ * libtiff/tif_jpeg.c: ensure that rawcc and rawcp are maintained during JPEGPreDecode and JPEGDecode calls. - * libtiff/tif_read.c: arger read ahead for CHUNKY_STRIP_READ_SUPPORT, + * libtiff/tif_read.c: larger read ahead for CHUNKY_STRIP_READ_SUPPORT, as compression formats like JPEG keep 16 lines interleaved in a sense and might need to touch quite a bit of data. diff --git a/configure b/configure index 6d91023b..2b589c82 100755 --- a/configure +++ b/configure @@ -784,7 +784,6 @@ enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock -with_gnu_ld enable_silent_rules enable_rpath enable_largefile @@ -817,6 +816,8 @@ enable_cxx with_x enable_strip_chopping with_default_strip_size +enable_defer_strile_load +enable_chunky_strip_read enable_extrasample_as_alpha enable_check_ycbcr_subsampling ' @@ -829,12 +830,8 @@ LDFLAGS LIBS CPPFLAGS CPP -CPPFLAGS CXX CXXFLAGS -LDFLAGS -LIBS -CPPFLAGS CCC CXXCPP XMKMF' @@ -1504,6 +1501,12 @@ Optional Features: to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage) + --enable-defer-strile-load + enable deferred strip/tile offset/size loading + (experimental) + --enable-chunky-strip-read + enable reading large strips in chunks for + TIFFReadScanline() (experimental) --disable-extrasample-as-alpha the RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many @@ -19683,6 +19686,38 @@ _ACEOF fi +# Check whether --enable-defer-strile-load was given. +if test "${enable_defer_strile_load+set}" = set; then : + enableval=$enable_defer_strile_load; HAVE_DEFER_STRILE_LOAD=$enableval +else + HAVE_DEFER_STRILE_LOAD=no +fi + + +if test "$HAVE_DEFER_STRILE_LOAD" = "yes" ; then + +$as_echo "#define DEFER_STRILE_LOAD 1" >>confdefs.h + + +fi + + +# Check whether --enable-chunky-strip-read was given. +if test "${enable_chunky_strip_read+set}" = set; then : + enableval=$enable_chunky_strip_read; HAVE_CHUNKY_STRIP_READ=$enableval +else + HAVE_CHUNKY_STRIP_READ=no +fi + + +if test "$HAVE_CHUNKY_STRIP_READ" = "yes" ; then + +$as_echo "#define CHUNKY_STRIP_READ 1" >>confdefs.h + + +fi + + $as_echo "#define SUBIFD_SUPPORT 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index ed398a56..d39aa377 100644 --- a/configure.ac +++ b/configure.ac @@ -854,6 +854,22 @@ if test "$HAVE_DEFER_STRILE_LOAD" = "yes" ; then fi +dnl --------------------------------------------------------------------------- +dnl Check for support of CHUNKY_STRIP_READ_SUPPORT, a mechanism to allowing +dnl reading large strips (usually one strip files) in chunks when using +dnl TIFFReadScanline(). This is an experimental feature in libtiff 4.0. +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(chunky-strip-read, + AS_HELP_STRING([--enable-chunky-strip-read], + [enable reading large strips in chunks for TIFFReadScanline() (experimental)]), + [HAVE_CHUNKY_STRIP_READ=$enableval], [HAVE_CHUNKY_STRIP_READ=no]) + +if test "$HAVE_CHUNKY_STRIP_READ" = "yes" ; then + AC_DEFINE(CHUNKY_STRIP_READ,1,[enable partial strip reading for large strips (experimental)]) + +fi + dnl --------------------------------------------------------------------------- dnl Default subifd support. dnl --------------------------------------------------------------------------- diff --git a/libtiff/tif_config.h.in b/libtiff/tif_config.h.in index 09a427cb..d13ece67 100644 --- a/libtiff/tif_config.h.in +++ b/libtiff/tif_config.h.in @@ -10,6 +10,9 @@ lacking the tag (default enabled). */ #undef CHECK_JPEG_YCBCR_SUBSAMPLING +/* enable partial strip reading for large strips (experimental) */ +#undef CHUNKY_STRIP_READ + /* Support C++ stream API (requires C++ compiler) */ #undef CXX_SUPPORT