a WebP encoder

converts PNG & JPEG to WebP

This is an experimental early version, with lot of room
of later optimizations in both speed and quality.

Compile with the usual `./configure && make`
Command line example is examples/cwebp

Usage:

   cwebp [options] -q quality input.png -o output.webp

where 'quality' is between 0 (poor) to 100 (very good).
Typical value is around 80.

More encoding options with 'cwebp -longhelp'

Change-Id: I577a94f6f622a0c44bdfa9daf1086ace89d45539
This commit is contained in:
Pascal Massimino
2011-02-18 23:33:46 -08:00
parent 81c966215b
commit f61d14aabf
36 changed files with 9050 additions and 284 deletions

116
configure vendored
View File

@ -743,6 +743,8 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
JPEG_INCLUDES
JPEG_LIBS
PNG_INCLUDES
PNG_LIBS
LIBPNG_CONFIG
@ -863,6 +865,8 @@ with_gnu_ld
enable_libtool_lock
with_pngincludedir
with_pnglibdir
with_jpegincludedir
with_jpeglibdir
'
ac_precious_vars='build_alias
host_alias
@ -1508,6 +1512,8 @@ Optional Packages:
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-pngincludedir=DIR use PNG includes from DIR
--with-pnglibdir=DIR use PNG libraries from DIR
--with-jpegincludedir=DIR use JPEG includes from DIR
--with-jpeglibdir=DIR use JPEG libraries from DIR
Some influential environment variables:
CC C compiler command
@ -4458,13 +4464,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:4461: $ac_compile\"" >&5)
(eval echo "\"\$as_me:4467: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
(eval echo "\"\$as_me:4464: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval echo "\"\$as_me:4470: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
(eval echo "\"\$as_me:4467: output\"" >&5)
(eval echo "\"\$as_me:4473: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@ -5670,7 +5676,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 5673 "configure"' > conftest.$ac_ext
echo '#line 5679 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@ -7196,11 +7202,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7199: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7205: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7203: \$? = $ac_status" >&5
echo "$as_me:7209: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -7535,11 +7541,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7538: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7544: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7542: \$? = $ac_status" >&5
echo "$as_me:7548: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -7640,11 +7646,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7643: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7649: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7647: \$? = $ac_status" >&5
echo "$as_me:7653: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -7695,11 +7701,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7698: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7704: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7702: \$? = $ac_status" >&5
echo "$as_me:7708: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -10079,7 +10085,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10082 "configure"
#line 10088 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -10175,7 +10181,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10178 "configure"
#line 10184 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -10648,9 +10654,87 @@ fi
JPEG_INCLUDES=""
JPEG_LIBS=""
# Check whether --with-jpegincludedir was given.
if test "${with_jpegincludedir+set}" = set; then :
withval=$with_jpegincludedir; JPEG_INCLUDES="-I$withval"
fi
# Check whether --with-jpeglibdir was given.
if test "${with_jpeglibdir+set}" = set; then :
withval=$with_jpeglibdir; JPEG_LIBS="-L$withval"
fi
ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default"
if test "x$ac_cv_header_jpeglib_h" = x""yes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_set_defaults in -ljpeg" >&5
$as_echo_n "checking for jpeg_set_defaults in -ljpeg... " >&6; }
if test "${ac_cv_lib_jpeg_jpeg_set_defaults+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ljpeg $MATH_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char jpeg_set_defaults ();
int
main ()
{
return jpeg_set_defaults ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_jpeg_jpeg_set_defaults=yes
else
ac_cv_lib_jpeg_jpeg_set_defaults=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_set_defaults" >&5
$as_echo "$ac_cv_lib_jpeg_jpeg_set_defaults" >&6; }
if test "x$ac_cv_lib_jpeg_jpeg_set_defaults" = x""yes; then :
JPEG_LIBS="$JPEG_LIBS -ljpeg"
JPEG_INCLUDES="$JPEG_INCLUDES -DWEBP_HAVE_JPEG"
$as_echo "#define WEBP_HAVE_JPEG 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Optional jpeg library not found" >&5
$as_echo "$as_me: WARNING: Optional jpeg library not found" >&2;}
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: jpeg library not available - no jpeglib.h" >&5
$as_echo "$as_me: WARNING: jpeg library not available - no jpeglib.h" >&2;}
fi
ac_config_headers="$ac_config_headers config.h"
ac_config_files="$ac_config_files Makefile examples/Makefile src/dec/Makefile"
ac_config_files="$ac_config_files Makefile src/Makefile examples/Makefile src/dec/Makefile src/enc/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -11621,8 +11705,10 @@ do
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
"src/dec/Makefile") CONFIG_FILES="$CONFIG_FILES src/dec/Makefile" ;;
"src/enc/Makefile") CONFIG_FILES="$CONFIG_FILES src/enc/Makefile" ;;
*) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac