We store the raw RGB samples decoded from JPEG, and avoid precision loss.
Note that this may increase the encoding time reported by
cwebp -v, since RGB->YUV now occur during WebPEncode call
(in case of lossy), instead of ReadJPEG().
This also increases the memory use, since we're carying the
source ARGB samples around.
Change-Id: Ic2180206cfc9f5574f391e91c3b89b9d81695d01
this defines WORDS_BIGENDIAN, replacing uses of
__BIG_ENDIAN__/__BYTE_ORDER__ with it
+ fixes lossless BGRA output with big-endian toolchains
that do not define __BIG_ENDIAN__ (codesourcery mips gcc)
Change-Id: Ieaccd623292d235343b5e34b7a720fc251c432d7
previously, the final canvas size was adjusted tightly from the
animation frames. Now, it can be specified separately (to be larger, in particular).
calling WebPMuxSetCanvasSize(mux, 0, 0) triggers the 'adjust tightly' behaviour.
This can be useful after calling WebPMuxCreate() if further image addition
is expected.
-> Fixed gif2webp accordingly.
also: made WebPMuxAssemble() more robust by systematically zero-ing WebPData.
Change-Id: Ib4f7eac372cf9dbf6e25cd686a77960e386a0b7f
Similarly to Chrome, we then use the first sub-rectangle
to set the canvas size.
Also: add check for too-large GIF dimensions (>MAX_CANVAS_SIZE)
Change-Id: Idce55f1e6f6982a8f0e082aac540e16b530e023e
We align with Blink/Chromium code by:
- checking for ANIMEXTS1.0 signature too
- using ByteCount >= 3 instead of requiring ByteCount==3
Change-Id: Idc484ca62878517df3dccb1fdb3bb45104a5e066
see: http://odur.let.rug.nl/kleiweg/gif/netscape.html
new options:
dwebp -alpha_dither
vwebp -noalphadither
When the source was marked as quantized, we use a threshold-averaging
filter to smooth the decoded alpha plane.
Note: this option forces the decoding of alpha data in one pass, and
might slow the decoding a bit.
The new field in WebPDecoderOptions struct is 'alpha_dithering_strength'
(0 by default, means: off). Max strength value is '100'.
Change-Id: I218e21af96360d4781587fede95f8ea4e2b7287a
User-hook can fail but error was not propagated back.
Change-Id: Ic79f9543bf767634a127eccfef90af855ff15c34
Also: some ad-hoc clean-up and API dusting. More to come later...
this change has the side-effect of using directory names in the
include, silencing a lint warning.
Change-Id: Ib91cf63a90534e32fadfa5c2372bfdb29f854d02
Needed to add 'volatile' and some casts.
Relevant excerpt from the 'man longjmp':
===============
The values of automatic variables are unspecified after a call to longjmp() if they meet all the following criteria:
· they are local to the function that made the corresponding setjmp(3) call;
· their values are changed between the calls to setjmp(3) and longjmp(); and
· they are not declared as volatile.
===============
Change-Id: Ic72dc92669513a820369ca52a038afa9ec88091f
on ExUtilLoadWebP() failure no allocated memory will be returned, so
it's safe to exit immediately. additionally, any webp specific problems
will already have been reported as part of the call to
WebPGetFeatures().
broken since:
4a0e739 dwebp: move webp decoding to example_util
Change-Id: Ibc632015a1f52bae7f96d063252624123fa7c2da
doing so is not part of ISO C; removes some pedantic warnings.
use webp/decode.h to pickup VP8StatusCode instead.
Change-Id: I19b35e0f8a36fb7c45944ae9ca86838e08b90548
there's still some malloc/free in the external example
This is an encoder API change because of the introduction
of WebPMemoryWriterClear() for symmetry reasons.
The MemoryWriter object should probably go in examples/ instead
of being in the main lib, though.
mux_types.h stil contain some inlined free()/malloc() that are
harder to remove (we need to put them in the libwebputils lib
and make sure link is ok). Left as a TODO for now.
Also: WebPDecodeRGB*() function are still returning a pointer
that needs to be free()'d. We should call WebPSafeFree() on
these, but it means exposing the whole mechanism. TODO(later).
Change-Id: Iad2c9060f7fa6040e3ba489c8b07f4caadfab77b
* allow reading from stdin for dwebp / vwebp
* allow writing to stdout for gif2webp
by introducing a new function ExUtilReadFromStdin()
Example use: cat in.webp | dwebp -o - -- - > out.png
Note that the '-- -' option must appear *last*
(as per general fashion for '--' option parsing)
Change-Id: I8df0f3a246cc325925d6b6f668ba060f7dd81d68
These are presets for lossless coding, similar to zlib.
The shortcut for lossless coding is now, e.g.:
cwebp -z 5 in.png -o out_lossless.webp
There are 10 possible values for -z parameter:
0 (fastest, lowest compression)
to 9 (slowest, best compression)
A reasonable tradeoff is -z 6, e.g.
-z 9 can be quite slow, so use with care.
This -z option is just a shortcut for some pre-defined
'-lossless -m xx -q yy' combinations.
Change-Id: I6ae716456456aea065469c916c2d5ca4d6c6cf04
New API options: WebPDecoderOptions.flip and 'dwebp -flip ...'
it uses negative stride trick.
Also changed the decoder code to support user-supplied
buffers with negative stride, independently of the
WebPDecoderOptions.flip value.
Change-Id: I4dc0d06f0c87e51a3f3428be4fee2d6b5ad76053
- 12/19/13: version 0.4.0
* improved gif2webp tool
* numerous fixes, compression improvement and speed-up
* dither option added to decoder (dwebp -dither 50 ...)
* improved multi-threaded modes (-mt option)
* improved filtering strength determination
* New function: WebPMuxGetCanvasSize
* BMP and TIFF format output added to 'dwebp'
* Significant memory reduction for decoding lossy images with alpha.
* Intertwined decoding of RGB and alpha for a shorter
time-to-first-decoded-pixel.
* WebPIterator has a new member 'has_alpha' denoting whether the frame
contains transparency.
* Container spec amended with new 'blending method' for animation.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAABAgAGBQJSwa+nAAoJEPnD1r24IytdJeQQAI7JT/lyhcVdFw9yGsb8SaXr
kzz0OR+4WYIIuHVJSYJ5scun6kXYkj3AXBfBi/ctmKzLSPkAPumX/HTdZgD4e9Hx
qyLK9GlISr3BvQu3PLQWOrebxHNmm+MwZAWSiVm2mwFTx6KQiJBfgNRUy+BKyS4m
KQxkpMY1p9An73+e1OBrtJae1hdgBX8ClRqju56v8xqYbOEjbrTD0CTV0Cu1h3mz
xp7mQx8EPfo77k5HCEdYf2xRPRbCfQ4jy8SO8AW/zNPRLJVXFnpLb6jpinNlABFU
Al38om5BIRgX4amndSpLFH6ysaCEeqWIR/2OHDlLmiNeeukTuqZdg0ewLy5JpbFU
ByD5tG9BA3vXGf+sGH7RAiVdLjArAZb3Npp2hSCuzJj9UI9r+9ofjoXSd8BcMct3
xb+vXmGSjKt3rpdUiREeXBYUd/Yhr5S4sMsFlx99XBeHvc1nxKsJBua5P3ixv4v9
p6hJ3Ngri38Zo83aOBZkS+p1VETbaTwxC6q8oJ5pk4w8IcM03ViBizTMNshohF1k
d1uVHd4ZwM3HYS2L21JZW0KCN6iwGmgcfNFm8RvHoAkxw27vRd6eRmz+SU97n/VD
Ne5oZlHiKrqTnobSfY2c3tK5gpVewwPo4dpgLJbvij86IRwnNHfoSYhsOPTVi3O1
pup4AUMY8kAUwmUUceoL
=K/1E
-----END PGP SIGNATURE-----
Merge tag 'v0.4.0'
libwebp 0.4.0
- 12/19/13: version 0.4.0
* improved gif2webp tool
* numerous fixes, compression improvement and speed-up
* dither option added to decoder (dwebp -dither 50 ...)
* improved multi-threaded modes (-mt option)
* improved filtering strength determination
* New function: WebPMuxGetCanvasSize
* BMP and TIFF format output added to 'dwebp'
* Significant memory reduction for decoding lossy images with alpha.
* Intertwined decoding of RGB and alpha for a shorter
time-to-first-decoded-pixel.
* WebPIterator has a new member 'has_alpha' denoting whether the frame
contains transparency.
* Container spec amended with new 'blending method' for animation.
* tag 'v0.4.0':
update ChangeLog
update NEWS description with new general features
gif2webp: don't use C99 %zu
cwebp: fix metadata output w/lossy+alpha
makefile.unix: clean up libgif2webp_util.a
update Changelog
bump version to 0.4.0
update AUTHORS & .mailmap
update NEWS for 0.4.0
Change-Id: I6df1b512fe0b697192f1f9b29431cd59aa6063d1
this would require a PRIuS or similar macro for proper platform
compatibility (Visual Studio for instance would be variants of %lu)
Change-Id: I2b9fcb1639db024775fb47dbcf79a2240f3d98f2
this enables webpmux to accept input files starting with '-' when using
-get/-set/-strip; -info & -frame expect an input file as one of their
parameters so no changes are necessary there.
Change-Id: I154eb6dc388258a7fb743ec76ba869bf9589be1b