Huffman on compress.c

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Huffman on compress.c

Post by broucaries »

Hi,

It seems that we could remove your custom code about huffman coding if you use the HUFFMAN_ONLY strategy in
ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
int level,
int method,
int windowBits,
int memLevel,
int strategy));

It need a testsuite but it will improve the speed.

Bastien
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Huffman on compress.c

Post by magick »

Thanks, we'll take a look at using ZLIB for Huffman encoding.
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Re: Huffman on compress.c

Post by broucaries »

Note that you may need Z_FIXED if the huffman table are not dynamic in the sense of the RFC
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Re: Huffman on compress.c

Post by broucaries »

BTW libtiff #define at the beginning of the file could be dropped....
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Huffman on compress.c

Post by magick »

Done. Thanks.
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Re: Huffman on compress.c

Post by broucaries »

I think you could now remove libjpeg and libtiff from the depends_libs of libmagickcore...

They are not referenced in the module case (not even included)

Thanks
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Huffman on compress.c

Post by magick »

I think you could now remove libjpeg and libtiff from the depends_libs of libmagickcore...
We don't see either as a dependency of MagickCore anymore. Which file includes these dependencies?
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Re: Huffman on compress.c

Post by broucaries »

something like this

Code: Select all

--- a/configure.ac
+++ b/configure.ac
@@ -3713,7 +3713,7 @@ AC_SUBST(MAGICK_LIBLTDL)
 AC_SUBST(MAGICK_LTDLDEPS)
 
 if test "$with_modules" != 'no'; then
-    MAGICK_DEP_LIBS="$LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JPEG_LIBS $LQR_LIBS $FFTW_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $CCMALLOC_LIBS $EFENCE_LIBS $UMEM_LIBS $GOMP_LIBS $CL_LIBS $THREAD_LIBS"
+    MAGICK_DEP_LIBS="$LCMS_LIBS $FREETYPE_LIBS $LQR_LIBS $FFTW_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $CCMALLOC_LIBS $EFENCE_LIBS $UMEM_LIBS $GOMP_LIBS $CL_LIBS $THREAD_LIBS"
 else
     MAGICK_DEP_LIBS="$JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JP2_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $CCMALLOC_LIBS $EFENCE_LIBS $UMEM_LIBS $GOMP_LIBS $CL_LIBS $THREAD_LIBS"
 fi
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Huffman on compress.c

Post by magick »

Got it. Thanks.
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Re: Huffman on compress.c

Post by broucaries »

magick wrote:Thanks, we'll take a look at using ZLIB for Huffman encoding.
Any news ?

Care to add to TODO list ?

BTW could you publish on the source tree the TODOS list ? It will help other (particularly distrib to help you)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Huffman on compress.c

Post by magick »

See http://www.imagemagick.org/Usage/bugs/ for a bug list and our ambitions for the future.

ZLib Huffman compression may have not made it to the TODO list just yet due to a standard open-source problem-- too much to do, too little time, not enough developers.

In the mean-time, thank you for your many recent contributions to the ImageMagick project. All were needed and all are appreciated.
Post Reply