Commit Graph

299 Commits

Author SHA1 Message Date
Pascal Massimino
5199eab516 Merge "add uncompressed TIFF output support" 2013-05-13 08:59:48 -07:00
Pascal Massimino
a3aede9739 add uncompressed TIFF output support
new option: 'dwebp -tiff ...'
This is a very simple uncompressed-tiff writing method.

Change-Id: Ie2182c8498bce570de3cde363abe1099e18596cb
2013-05-11 01:46:24 -07:00
Urvang Joshi
043e1ae4bd gif2webp: Fix signed/unsigned comparison mismatch
Change-Id: I355f0614424276550db71b24e5bb1948e5c6894c
2013-05-10 13:37:20 -07:00
pascal massimino
ed6f53086b Merge "Add GetCanvasSize() method to mux" 2013-05-08 01:53:22 -07:00
Urvang Joshi
fffefd18c3 Add GetCanvasSize() method to mux
Change-Id: If910f5024f4c301a92e6c2e8ee9c315a103c5df7
2013-05-07 12:47:48 -07:00
pascal massimino
732da8d0f0 Merge "configure: add GLUT detection; build vwebp" 2013-05-07 12:15:50 -07:00
James Zern
0e513f7ae3 configure: add GLUT detection; build vwebp
Change-Id: I7f0964db2d04c22ff9ec274e8cd1cbed7379a165
2013-05-07 11:42:15 -07:00
Pascal Massimino
a4e1cdbbe8 Remove the gcc compilation comments
They went out of sync some time ago, and are
no longer really required since we have them
buildable from makefile.unix

Change-Id: Ica2dcf5c55f44365598f832f55204d123d7aa601
2013-05-01 15:01:37 -07:00
Urvang Joshi
6393fe4b7c Cosmetic fixes
Change-Id: I7d5a337077ba1d0406769190fef9b47146ed8b24
2013-04-26 15:55:42 -07:00
pascal massimino
5369a80fd4 Merge "prevent signed int overflow in left shift ops" 2013-04-19 00:13:16 -07:00
Urvang Joshi
b26e5ad540 gif2webp: Fix ICC and XMP support
Change-Id: Ib5aafef388bd191610e4cc2f8180f35cd454f1d3
2013-04-18 14:19:25 -07:00
James Zern
f4f90880a8 prevent signed int overflow in left shift ops
force unsigned when shifting by 24.

Change-Id: Ie229d252e2e4078107cd705b09397e686a321ffd
2013-04-13 10:57:31 -07:00
Pascal Massimino
b66caee410 dwebp: add support for BMP output
Supports alpha output too.

Change-Id: I42ea0bf7b6bbb420f0e537d372a3b13fe00528a9
2013-04-09 18:52:34 -07:00
Urvang Joshi
b68912af2c pngdec: Avoid a double-free.
Earlier, at line#275, if ok == 0, it would have triggered a double free
of 'rgb'.

Change-Id: Iaee1f35824a66f6e4b488e523416f73b87c5ec30
2013-04-05 11:24:59 -07:00
Pascal Massimino
e7d9548c9b add WebPBlendAlpha() function to blend colors against background
new option: -blend_alpha 0xrrggbb
also: don't force picture.use_argb value for lossless. Instead,
delay the YUVA<->ARGB conversion till WebPEncode() is called.
This make the blending more accurate when source is ARGB
and lossy compression is used (YUVA).
This has an effect on cropping/rescaling. E.g. for PNG, these
are now done in ARGB colorspace instead of YUV when lossy compression
is used.

Change-Id: I18571f1b1179881737a8dbd23ad0aa8cddae3c6b
2013-04-02 19:14:30 -07:00
James Zern
53c77afc52 Merge "gif2webp: Bgcolor fix for a special case" into 0.3.0 2013-03-25 16:33:51 -07:00
Urvang Joshi
a5ebd143d6 gif2webp: Bgcolor fix for a special case
When transparent color index and background color index are same,
we should set background color to 0x00ffffff (transparent).

For this, we delay setting the background color until we have read the
first frame.

Change-Id: I443609b9c7697a2b94a66992460cff8465b3c127
2013-03-25 16:30:27 -07:00
James Zern
6378f23876 Merge "vwebp/animation: fix background dispose" into 0.3.0 2013-03-25 16:24:02 -07:00
James Zern
04c7a2ecf0 vwebp/animation: fix background dispose
buffer the last frame's details to perform DISPOSE_BACKGROUND on the
image's area, rather than the entire canvas.

also fixes transparent backgrounds with animated images

Change-Id: I53e4d70c441e1eeb136f1d01e7c88de4f9ecff53
2013-03-25 13:39:27 -07:00
James Zern
14d42af207 examples: don't use C99 %zu
this would require a PRIuS or similar macro for proper platform
compatibility (Visual Studio for instance would be variants of %lu)

Change-Id: I1af530c7c358c91b845acde1d8c12ef46c2ef746
2013-03-20 16:59:35 -07:00
James Zern
a788644f93 dwebp: warn when decoding animated webp's
the decode will fail; provide a bit more background info

Change-Id: Iecccb09cf0fa9f8c1c3e87636a55e1f251dee023
2013-03-20 13:59:38 -07:00
James Zern
723847d5d7 gif2webp: only write error messages to stderr
also output something if -o is not given, but the process succeeded

Change-Id: I466c377f0cbf8c9f45bb1839191b04dada9c5f0f
2013-03-18 11:13:35 -07:00
James Zern
59423a2486 gif2webp: fix crash on open failure with libgif5
output the current gif_error and use it instead of the NULL context to
retrieve an error message.

Change-Id: Ib761ebd36b3ddd6288375de46e671022d2381083
2013-03-17 18:06:39 -07:00
James Zern
9acb17dea4 gif2webp: silence a unused param warning
Change-Id: I694857fc6adb011f19d14780de4f8c71e2719707
2013-03-17 17:04:54 -07:00
James Zern
096a8e321d Merge "vwebp: add color profile support" into 0.3.0 2013-03-16 11:58:19 -07:00
James Zern
ddfee5dce5 vwebp: add color profile support
uses qcms from Mozilla / Chromium:

http://hg.mozilla.org/mozilla-central/file/0e7639e3bdfb/gfx/qcms
http://src.chromium.org/viewvc/chrome/trunk/src/third_party/qcms

Change-Id: I674e16adb6ca085719816e984acbf00721b28fb0
2013-03-16 11:55:00 -07:00
James Zern
0d6927d3cd Merge "Mark fragment options as experimental in webpmux" into 0.3.0 2013-03-16 10:45:52 -07:00
Urvang Joshi
5dbd403029 Mark fragment options as experimental in webpmux
This is to disallow any accidental creation/parsing of fragmented images
by users.

Change-Id: I970a4bd5ec5a522867b24a0c9efb45164ae67047
2013-03-16 04:07:19 -07:00
James Zern
7dd288f098 cwebp: fix build
METADATA_ICCP was renamed to METADATA_ICC in
  d8dc72a examples: normalize icc related program arguments
but was merged without rebasing after
  0bc4268 cwebp: output metadata statistics

Change-Id: Ie317208488cc851d5d21300591c91cebf5abd4a7
2013-03-15 16:42:58 -07:00
James Zern
50eeddad3d Merge "examples: normalize icc related program arguments" into 0.3.0 2013-03-15 16:37:30 -07:00
James Zern
013023e771 vwebp: replace doubles w/floats where appropriate
Change-Id: Ief1ef5213a5f357004922989e6e5d97ef3561a23
2013-03-15 12:17:45 -07:00
James Zern
7b6a26cff9 Merge "cwebp: output metadata statistics" into 0.3.0 2013-03-14 19:09:58 -07:00
James Zern
d8dc72a039 examples: normalize icc related program arguments
use 'icc' rather than 'iccp'.

Change-Id: I9667f286bfa1cfeb0ac49148ba341d268b051b98
2013-03-14 19:05:22 -07:00
James Zern
d40c98e172 Merge "webpmux binary: tiny style fix" into 0.3.0 2013-03-14 00:02:58 -07:00
James Zern
0bc42689e4 cwebp: output metadata statistics
Change-Id: Ida33555bab3c9330e82158863c355e51f90d0a76
2013-03-13 22:57:54 -07:00
Urvang Joshi
7681bb961d webpmux binary: tiny style fix
Change-Id: I195929d79940cd3d060977ef7feee9cd13f7d041
2013-03-13 18:10:56 -07:00
James Zern
a3dd3d0f9e avoid installing example_util.h
older versions of automake (1.9) it seems would install the headers
regardless of the fact that the library was marked noinst_

this change follows some of the header guidance found here:
http://www.gnu.org/software/automake/manual/automake.html#Headers

Change-Id: I80acc00935097ebf36004e9871574fb9ef09aabf
2013-03-13 15:48:34 -07:00
skal
9bfbdd144f 1.5x-2x faster encoding for method 3 and up
using token-buffer (that is: slightly more memory. O(output_size))

This change is ON by default. To return to previous behaviour, use
'cwebp -low_memory' or set config.low_memory to true.

Side-effect of this new mode: it forces 1 partition only (which was
default anyway), and makes some statistics about the bitstream
no longer available. cwebp will no longer report 'intra4-coeffs', etc.

This mode also doesn't work (yet) with multi-pass, and -low_memory
is currently forced for multi-pass.

also: reversed the flag: USE_TOKEN_BUFFER -> DISABLE_TOKEN_BUFFER
also: fixed the kAverageBytesPerMB estimate

Change-Id: I4ea80382038d6df4309663e0cb7bd88d9bca9cf1
2013-03-11 17:01:33 -07:00
pascal massimino
847b49243e Merge "vwebp: use magenta for 'i'nfo display" 2013-03-08 05:17:57 -08:00
pascal massimino
25ea46bdee Merge "vwebp: add keyboard shortcuts to help output" 2013-03-08 05:15:17 -08:00
James Zern
bea7ccaffd vwebp: use magenta for 'i'nfo display
replaces black

Change-Id: I8ca52c187c7b4b890378dec2a526e51c7819f7e1
2013-03-07 19:42:41 -08:00
James Zern
8fab161a3f webpmux: correct -frame param order in help output
params were reordered to +duration+x offset+...

Change-Id: I99e8a70c8a645552238294ab82c3f7ffe01e70bd
2013-03-07 19:15:37 -08:00
James Zern
03cc23d6f9 vwebp: add keyboard shortcuts to help output
Change-Id: Ida94b3f99115ddeb6b6eec1411918f99e964ed91
2013-03-07 19:13:00 -08:00
Urvang Joshi
fdeeb01dc6 gif2webp: Be lenient about background color index.
Change-Id: I4440cffff4e8cefb3b0327a9b4925e05a7bbfc50
2013-03-05 13:41:55 -08:00
skal
f817930a55 multi-threaded alpha encoding for lossy
new option: 'cwebp -mt ...'
new config flag: config.thread_level
(allowed thread_level are 0 or 1 for now. Maybe more later...)
If -mt is activated (and WEBP_USE_THREAD is used for compile), the alpha-compression
will be done in parallel to RGB coding for lossy. Can save quite a bit of latency...
Has no effect for lossless encoding.

Change-Id: I769d0bf90e7380cf99344ad62cd77277f4df5a46
2013-03-01 10:04:08 +01:00
Urvang Joshi
a5042a3240 GetVersion() methods for mux and demux
Also use the same in example binaries.

Change-Id: Id4bb4c4231a6b8fe9ed4370a6f46567c52a04a17
2013-02-26 14:22:06 -08:00
James Zern
3151669b15 wicdec + dwebp cosmetics: normalize formatting
- drop mixed use of Hungarian notation
- fix some line continuations

Change-Id: I9e6ec5cd6c746eb78048cf3532586fd93cef4ddb
2013-02-15 20:39:45 -08:00
Pascal Massimino
92668da6f2 change default filtering parameters:
* type is now 'strong'
  * strength is now '60'

These help with gradients and blocking

Change-Id: Ie1c8265c557306ef5e9ccefacf43e10946e55370
2013-02-15 01:09:32 -08:00
skal
5c3e381b2f Merge "add a -jpeg_like option" 2013-02-13 22:17:58 -08:00
James Zern
c9f1649012 wicdec: add alpha support for paletted formats
Fixes issue #141.

Change-Id: I5d8163329a9e363da9db9d70d25edeb29da32e9e
2013-02-06 23:29:32 -08:00
James Zern
e7ea61eb75 wicdec: silence some warnings
-Wformat, -Wmissing-field-initializers and size type related

Change-Id: I92b1c7cc485bf59f94b5c0f8bb2137d87604f831
2013-02-06 23:16:50 -08:00
skal
e895059a05 add a -jpeg_like option
This option remaps internal parameters to better match
the expected compression curve of JPEG and produce output files
of similar size, but with better quality.

Change-Id: I96a1cbb480b1f6a0c6845a23c33dfd63f197b689
2013-02-06 14:19:16 +01:00
James Zern
7c732e59f4 cwebp: centralize WebPCleanupTransparentArea()
this can be safely called whether the picture has alpha or not

Change-Id: I0047fd4c110f1072f183f3d340682502bd6623d7
2013-02-04 15:44:26 -08:00
James Zern
7381254e9a Merge "wicdec: add ICC profile extraction" 2013-02-04 15:43:39 -08:00
James Zern
e83ff7decd wicdec: add ICC profile extraction
Change-Id: I4522cdd5a529f802f1eb566b6d94539612e0976b
2013-02-02 10:40:49 -08:00
pascal massimino
146c6e3be8 Merge "cosmetics: pngdec: normalize default label location" 2013-02-02 00:18:37 -08:00
James Zern
1dfee6dbea cosmetics: pngdec: normalize default label location
Change-Id: I25dd0e61898af3fcaff3d17cddedd3d39d4930aa
2013-02-01 20:37:05 -08:00
James Zern
88d382a042 cwebp: cleanup after memory_writer
always initialize the memory_writer so it can be unconditionally freed
on exit

Change-Id: I9226addb588309446ec94abadfdde201f23195d2
2013-02-01 19:17:26 -08:00
skal
66c810bc3c add a -yuv option to dwebp (very similar to -pgm)
It will decode to raw (flat) YUV format, similar to what
cwebp can take as input. Makes the PSNR/SSIM calculation easier.

Change-Id: Iebfaedfc0bedc70c169b24ae4aabc701488d0644
2013-01-28 23:22:14 +01:00
Pascal Massimino
126c035f3f remove some more -Wshadow warnings
Change-Id: Icaba088b9a74732137bd35d82854eed858ec88f8
2013-01-25 00:44:31 -08:00
James Zern
522e9d6108 Merge "cwebp: enable '-metadata'" 2013-01-24 20:04:09 -08:00
James Zern
76ec5fa1b6 cwebp: enable '-metadata'
This copies metadata selected by -metadata from the input to the output
if present.
Currently there is no WIC support for Windows builds.

Change-Id: I34fb2443729d80ffe3a6da0979d9f6fa9b3fe536
2013-01-24 19:52:50 -08:00
Vikas Arora
a941a3463e Fixed few nits in the build files.
Fixed the nits from last change (Provide an option to build decoder
library).

Change-Id: I7d8675b8156dc63cf21ef64810722552e7fb59f6
2013-01-23 13:22:06 -08:00
James Zern
9161be863d Merge "cwebp: extract WIC decoding to its own module" 2013-01-23 12:44:22 -08:00
Vikas Arora
0aeba52852 Provide an option to build decoder library.
When the config option '--enable-libwebpdecoder' is specified, the
lean decoder library 'libwebpdecoder' will be created in addition to
libwebp. Also dwebp binary will be linked to libwebpdecoder, if this
config option is specified.

Change-Id: I9de3e149b59c9a8390fae2ba660941749640e54a
2013-01-23 11:43:36 -08:00
James Zern
a452a5554a cwebp: extract WIC decoding to its own module
Change-Id: I8e3e20787f6c3cc0616bd33beb2a6ccdda1e04f7
2013-01-22 18:31:28 -08:00
skal
0d19fbff51 remove some -Wshadow warnings
these are quite noisy, but it's not a big deal to remove
them.

Change-Id: I5deb08f10263feb77e2cc8a70be44ad4f725febd
2013-01-22 23:06:28 +01:00
James Zern
7eaee9f1ac cwebp: add -metadata option
currently has no effect except to disable metadata extraction from the
input when the value is 'none'.

Change-Id: Ic50d4c9d634cc1f6b72ae4e130e99736c85a6477
2013-01-14 17:44:54 -08:00
James Zern
36c52c2cf1 tiffdec: use toff_t for exif ifd offset
versions < 4.0.0 used uint32 interchangeably, but with 4.0.0 toff_t
became 64-bit and TIFFTAG_EXIFIFD began returning it rather than
TIFF_LONG/uint32.

Change-Id: I42492bd24613a884c7496e7bfc0c5d892758bce9
2013-01-10 21:33:24 -08:00
James Zern
7c8111e4a8 Merge "cwebp/tiffdec: add TIFF metadata extraction" 2013-01-10 15:52:05 -08:00
pascal massimino
1ab5b3a7bd Merge "configure: fix --with-gifincludedir" 2013-01-08 13:54:23 -08:00
James Zern
03c749ebb8 configure: fix --with-gifincludedir
GIF_INCLUDES were not being used by examples/Makefile.am

Change-Id: I981ad473f6efe24f095e2b9cc8b133d6ae3658b6
2013-01-08 12:39:43 -08:00
Urvang Joshi
8b650635df multiple libgif versions support for gif2webp
Make it work for libgif v5.0+, for which a couple of APIs have changed.

Change-Id: I6dd49bb5bf1b60f96f3a164d58ef2ef19281c96b
2013-01-08 11:52:24 -08:00
Urvang Joshi
476e293fe8 gif2webp: Use DGifOpenFileName()
This removes some unnecessary code.

Change-Id: Ic87baa402362f43b30d7c4a75be2f58e8f13f4a1
2013-01-08 11:07:13 -08:00
James Zern
b50f277bc7 tiffdec: correct format string
the expression using dircount will be promoted to int when tdir_t is an
unsigned short.
quiets:
warning: format specifies type 'unsigned short' but the argument has
      type 'int' [-Wformat]

Change-Id: If2e8c27454826556178b0a972aaed272d5fbfa07
2013-01-07 19:06:20 -08:00
pascal massimino
2b9048e324 Merge "tiffdec: check error returns for width/height" 2012-12-22 06:29:23 -08:00
James Zern
a1b5a9a3e0 Merge "cwebp/tiff: use the first image directory" 2012-12-21 08:37:11 -08:00
James Zern
079423f5c5 tiffdec: check error returns for width/height
Change-Id: I1399a7b75aea54044f30c6a53ac11843c1e75877
2012-12-20 22:33:52 -08:00
pascal massimino
d62824af42 Merge "cwebp/jpegdec: add JPEG metadata extraction" 2012-12-20 22:25:46 -08:00
pascal massimino
03afaca4a2 Merge "cwebp: add PNG metadata extraction" 2012-12-20 22:20:12 -08:00
James Zern
2c724968d2 cwebp/jpegdec: add JPEG metadata extraction
the values of EXIF/XMP/ICC are unused and Extended XMP for payloads >
64k is unsupported.

Change-Id: If721aa2009335ce090148b7ecd7ea8459f9b942d
2012-12-20 18:35:38 -08:00
James Zern
dba64d91bb cwebp: add PNG metadata extraction
the values of XMP/EXIF/ICC are currently unused.

Change-Id: I39d78b9a179f2d36c9c8ea12776bfdf6d8d18663
2012-12-20 18:32:09 -08:00
James Zern
2914ecfd56 cwebp/tiffdec: add TIFF metadata extraction
currently the values of XMP/ICC are unused and EXIF is ignored.

Change-Id: I1d8b73bde4db2768f117158f986aadbaaec45804
2012-12-19 18:26:05 -08:00
James Zern
bd0025579f cwebp/tiff: use the first image directory
tiffdec does not support and warns about multi-directory images.
previously, the code would read all the directories and thus attempt to
use the last rather than the first as the message suggests.

Change-Id: I3a10c778e6e924a3df75b41c26a9c03afb761044
2012-12-15 18:49:38 -08:00
James Zern
df7aa07605 Merge "Cleanup around jpegdec" 2012-12-14 19:27:49 -08:00
James Zern
6bf208748c add examples/metadata.c
relocates the static functions from metadata.h and adds MetadataCopy()
to the interface

Change-Id: I28bfa9233d3dd70dddf6b561fe0bf4be378db1ec
2012-12-11 18:10:09 -08:00
skal
1bd287a6e4 Cleanup around jpegdec
* change some (*func_ptr) construct to func_ptr simply.
  * remove one memcpy
  * group #include related to decoding together

Change-Id: If751cfbd9e78be75c57fb60fc9c937900c2c8fe0
2012-12-11 11:02:39 +01:00
James Zern
d3dace2ff0 cosmetics: jpegdec
- squash some whitespace
- remove unnecessary pointer check

Change-Id: I06208566a5621786479956ea658434f5c4d62fcc
2012-12-10 23:26:11 -08:00
James Zern
1c1c5646a5 cwebp: extract tiff decoding to its own module
Change-Id: If98d0d37de34b63ac10d826150237b5f99446532
2012-12-10 22:37:04 -08:00
James Zern
6a871d66a4 cwebp: extract jpeg decoding to its own module
Change-Id: I45e1f0fa7b34286dd98926e0485e5a8ab1964570
2012-12-07 20:12:46 -08:00
James Zern
2ee228f9a5 cwebp: extract png decoding to its own module
Change-Id: I80dd09fe1f1c6317e9d0cdd422438bda11b43ed5
2012-12-07 20:02:41 -08:00
James Zern
63aba3aef1 cwebp: add metadata framework
unused currently, but the intent is to allow each format to populate
exif/xmp/icc with cwebp then transferring it to the webp file.

Change-Id: I0514f62de52fa7f89c595ee7ef2ad7dced910a41
2012-12-06 14:29:10 -08:00
Urvang Joshi
23782f95b4 Separate out mux and demux code and libraries:
- Separate out mux.h and demux.h
- muxtypes.h: new header for data types common to mux/demux
- Move some misc read/write utilities to utils/utils.h
- Remove some duplicate methods.
- Separate out mux/demux libraries

Change-Id: If9b9569b10d55d922ad9317ef51710544315d6de
2012-11-19 11:40:18 -08:00
James Zern
540790ca6b gif2webp.c: add a note about prerequisites
Change-Id: I25a88f13b0c38c5968b5c4a3be0955e18e990723
2012-11-15 22:31:55 -08:00
Urvang Joshi
c40efca157 gif2webp build support with autoconf tools
Change-Id: I51a007e7931f05f2eb2ac062038309c2127df3fd
2012-11-15 11:04:12 -08:00
skal
41a6ced92e user GLfloat instead of float
Change-Id: I1af65f9a6046835cd4d390f37ccb0e659016ba1d
2012-11-15 09:35:01 +01:00
skal
b542611964 fix indentation
Change-Id: Ieb22b158d52b16f9782a7e747dd5edbf29099ec5
2012-11-15 09:34:34 +01:00
skal
68f282f79c * handle offset in anim viewer 'vwebp'
* fix gif2webp to handle disposal method and odd offset correctly

+ remove -scale and -crop option from vwebp, since it'll be broken
  with offsets and fragments. Needs a revisit.
+ remove a warning in gif2web

Change-Id: If04c6d085806e32540f2f15a37244c4407b719b3
2012-11-15 09:15:04 +01:00
skal
4860008483 Change the order of -frame argument to be more natural
Now, its: +duration+xoffset+yoffset+disposal
+disposal can be omitted and will default to +0 (NONE)
additionally, +xoffset+yoffset can be omitted and will default to +0+0

Change-Id: I62138c9f675d4fc4408305babbcd485cb32b73d3
2012-11-14 06:19:31 +01:00
Urvang Joshi
7caab1d8f6 Some cosmetic/comment fixes.
Change-Id: Id0613f84cc53fcbeceb913c835a262451687e27b
2012-11-09 10:46:38 -08:00