Commit Graph

89 Commits

Author SHA1 Message Date
James Zern
e83ff7decd wicdec: add ICC profile extraction
Change-Id: I4522cdd5a529f802f1eb566b6d94539612e0976b
2013-02-02 10:40:49 -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
James Zern
a452a5554a cwebp: extract WIC decoding to its own module
Change-Id: I8e3e20787f6c3cc0616bd33beb2a6ccdda1e04f7
2013-01-22 18:31:28 -08: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
7c8111e4a8 Merge "cwebp/tiffdec: add TIFF metadata extraction" 2013-01-10 15:52:05 -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
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
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
pascal massimino
4828bb931d Merge "cwebp (windows): fix alpha image import on XP" 2012-10-23 00:57:21 -07:00
James Zern
eda8ee4b3b cwebp (windows): fix alpha image import on XP
Query the converter to ensure the format is supported; add BGR formats
as RGBA was failing for PNG on XP

Fixes issue 129

Change-Id: I02e0d74b3b21337bc5fffd6a5dc158b7809b9aa9
2012-10-19 18:48:47 -07:00
Pascal Massimino
f86e6abe1f add LSIM metric to WebPPictureDistortion()
LSIM stands for "local similarity": before matching
a compressed pixel to the source, we search around in the source
and minimise the squared error. So, this is close to PSNR calculation,
but mitigates some of its limitations (pure translation and noise for instance).

There's a new -print_lsim option to cwebp too.

Change-Id: Ia38561034c7a90e71d2ea0f55bb1de527eda245b
2012-10-19 06:48:11 -07:00
pascal massimino
cf1e90dec7 Merge "cwebp: fix jpg encodes on XP" 2012-10-09 00:04:19 -07:00
James Zern
f2b5d19b30 [cd]webp: always output windows errors
don't hide failures with -v.

Change-Id: I46485a66f266fd9e9e8c640d1051cd22cfa40658
2012-10-08 18:36:10 -07:00
James Zern
ecd66f774d cwebp: fix jpg encodes on XP
correct has_alpha check; previously it was controlled by keep_alpha,
which overrode the source format check.
fixes issue #127

Change-Id: I949be90419b03610c64900be0fd37f83b70cbe73
2012-10-08 18:26:21 -07:00
James Zern
292ec5cc7d quiet a few 'uninitialized' warnings
spurious in this case, but addresses e.g.,
... potentially uninitialized local variable 'weighted_average' used

Change-Id: Ib99998bf49e4af7a82ee66f13fb850ca5b17dc71
2012-08-02 14:03:30 -07:00
pascal massimino
5e7963000a Merge "WebPEncode: clear stats at the start of encode" into 0.2.0 2012-08-01 12:00:09 -07:00
Vikas Arora
dd1c3873fe Add image-hint for low-color images.
For low-color images, it may be better to not use color-palettes.
Users should treat this as one another hint (as with Photo &
Picture) and another parameter for tuning the compression density.
The optimum compression can still be obtained by running (outer loop)
compression with all possible tunable parameters.

Change-Id: Icb1a4face2a84774e16e801aee4a8ae97e232e8a
2012-07-31 23:11:19 -07:00
James Zern
256afefa50 cwebp: exit immediately on version mismatch
{Picture,Config}Init don't do allocations and attempting to free any of
their contents on version mismatch will likely cause a crash

Change-Id: I2a5aece235f9680fb406aec4799adceea7f62cfc
2012-07-27 19:58:58 -07:00
James Zern
475d87d767 WebPEncode: clear stats at the start of encode
also relocate user_data from WebPAuxStats to the WebPPicture struct to
make clearing easier while placing it closer to the progress hook with
which it's used.
prior to this change some spurious lossless data could be reported in
the lossy (sans alpha) encoding case. additionally user_data could be
lost during lossless encoding.

Change-Id: I929fae3dfde4d445ff81bbaad51445ea586dd80b
2012-07-27 19:57:18 -07:00
Pascal Massimino
7d853d79dc add stats for lossless
* Extend AuxStats with new fields
  it's slightly ABI-incompatible, but i guess it's ok for 0.1.99+
  I expect to add more stats later, possibly (predictor stats, etc.)
* Have cwebp report the features used by lossless
  compression (either for alpha or full lossless coding)
* Print the PSNR for alpha (useful in case of -alpha_q)
* clean-up alpha.c signatures
+ misc cleanup (added const '* const ptr', etc.)

Change-Id: I157a21581f1793cb0c6cc0882e7b0a2dde68a970
2012-07-24 16:17:13 -07:00
James Zern
3e5bbe1c2e Merge "rename 'use_argb_input' to 'use_argb'" into 0.2.0 2012-07-18 23:26:42 -07:00
Pascal Massimino
0275159143 add a very crude progress report for lossless
better than nothing. Removed the warning in cwebp.c
(and silenced the warning in quiet mode too)

Change-Id: I85bbeaf77e0f60ead798886043dc053e6b44def5
2012-07-18 22:54:50 -07:00
Pascal Massimino
dd1081763c rename 'use_argb_input' to 'use_argb'
long name, and there's not really an 'output' equivalent

Change-Id: I9133ff734ae8d6572cb2f607211361f011fc0bc1
2012-07-18 22:47:16 -07:00
James Zern
12f9aede7e README: update cwebp help output
Change-Id: Ifc2fafca8131e53a894056e37bb22d25fedfa150
2012-07-13 14:55:39 -07:00
pascal massimino
0e09732c5e Merge "cwebp: fix crash with yuv input + lossless" 2012-07-02 14:40:00 -07:00
James Zern
7bda392b50 cwebp: fix crash with yuv input + lossless
Change-Id: Ia27c925f532a4243369288e954abdc063b9f94f9
2012-07-02 14:33:25 -07:00
James Zern
d8921dd4e6 cwebp: name InputFileFormat members consistently
append an '_'. TIFF introduced TIFF_ to avoid a name clash.

Change-Id: Iebe484d43aeb8e1912cd5bd10d36e1c5e66a4b42
2012-07-02 11:24:23 -07:00
James Zern
6f76d246ba cwebp: add basic TIFF support
Change-Id: I29f354e1ef9cf8f23002cf2e15814a53a94b4ed5
2012-07-02 11:22:52 -07:00
Vikas Arora
d373076a53 Added image characteristic hint for the codec.
This image type hint is used by codec to apply appropriate set of
transform filters to the image.

Change-Id: Ibb24e47ba14c40fa7f9f2c50ae86e03f2b29e9a6
2012-06-22 14:03:46 +05:30
Pascal Massimino
31b68fe639 cleanup WebPPicture struct and API
* add a real proper pointer for holding memory chunk pointer
  (instead of using y and argb fields)
* polish the doc with details
* add a WebPPictureView() that extract a view from a picture
  without any copy (kind of a fast-crop).
* properly snap the top-left corner for Crop/View. Previously,
  the luma position was not snapped, and was off compared to the chroma.

Change-Id: I8a3620c7f5fc6f7d1f8dd89d9da167c91e237439
2012-06-21 00:30:43 -07:00
Vikas Arora
b7fb0ed567 Log warning for unsupported options for lossless.
Change-Id: I30d4e775959c7a4a8f5b649c8c90a4edb8cced47
2012-06-20 10:51:50 +05:30
Pascal Massimino
78f3e34504 Enable lossless encoder code
Remove USE_LOSSLESS_ENCODER compile flag
Update Makefile.am and makefile.unix

Change-Id: If7080c4d8f37994c7c784730c5e547bb0a851455
2012-06-13 00:26:58 -07:00
James Zern
c71ff9e359 cwebp: fix alpha reporting in stats output
Since
 437999f introduce a generic WebPPictureHasTransparency() function
lossy encodes will not encode alpha if the alpha channel is completely
opaque.

Change-Id: I1826669c3932483650d7f8ce806cfebd4e5225fc
2012-06-07 17:32:29 -07:00
Pascal Massimino
437999fb77 introduce a generic WebPPictureHasTransparency() function
VP8-lossy will now avoid writing an ALPH chunk if the
alpha values are trivial.

+ changed DumpPicture() accordingly in cwebp
+ prevented the -d option to be active with lossless
 (DumpPicture wouldn't work).

Change-Id: I34fdb108a2b6207e93fa6cd00b1d2509a8e1dc4b
2012-06-04 16:17:55 -07:00
James Zern
00b29e282f normalize example header includes
headers from examples/ aren't installed so prefix with './' to be
explicit.

Change-Id: Ie6c1544a026a9859b7fc0cf238b21e031ef0013f
2012-05-15 13:48:11 -07:00
James Zern
1d38b258b8 cwebp/windows: use MAKE_REFGUID where appropriate
Change-Id: If595c75a833d37df86c16bf926da5f032015c68e
2012-05-09 11:52:01 -07:00
James Zern
817ef6e9af Merge "cwebp: fix WIC/Microsoft SDK compatibility issue" 2012-05-09 11:50:05 -07:00
James Zern
902d3e3b5f cwebp: fix WIC/Microsoft SDK compatibility issue
Fixes issue #115.
Define local copies of GUID_WICPixelFormat24bppRGB &
GUID_WICPixelFormat32bppRGBA (and GUID_WICPixelFormat32bppBGRA for
symmetry) to avoid link issues when building against older versions of
the SDK.

Change-Id: I2a26be1b7fe6d970feb3211cf0059e5898e3028d
2012-05-09 11:47:15 -07:00
Pascal Massimino
4abe04a204 fix the return value and handle missing input file case.
Change-Id: I42a64fcf7587ff3a487115808e2cfa51cec0031d
2012-05-09 00:34:30 -07:00
Vikas Arora
c4ccab6463 Print relevant lossless encoding stats in cwebp.
Change-Id: Ib8dfab498b1a05e49734bba2d3e72810343e8b0a
2012-05-09 11:31:41 +05:30
Pascal Massimino
72920caa61 introduce -lossless option, protected by USE_LOSSLESS_ENCODER
Change-Id: Ic5707082fefd964b9bcab0c9f9aa276992c22b06
2012-05-07 14:25:02 -07:00
James Zern
a0b2736d79 cosmetics & warnings
- remove some unused functions
- move global arrays from data to read only section
- explicitly cast malloc returns; not specifically necessary, but helps
  show intent
- miscellaneous formatting

Change-Id: Ib15fe5b37fe6c29c369ad928bdc3a7290cd13c84
2012-01-30 17:19:53 -08:00