Commit Graph

854 Commits

Author SHA1 Message Date
pascal massimino
ad2aad3c21 Merge "WebP Decoding error handling:" 2012-06-29 05:15:55 -07:00
Urvang Joshi
97649c8f6b Mux: Allow only some frames/tiles to have alpha.
And related const fixes.

Change-Id: I79f6f1b9f8c6faac8cc4ef24b58edff6d90de045
2012-06-29 17:17:19 +05:30
Vikas Arora
f864be3b2c Lower the quality settings for Alpha encoding.
Evaluated the impact of this change over 1000 image corpus.
The compression density is up (on average) by 1.2% and encoding time has
gone down considerably from 716 ms (per file) to 146 ms (per file)
(4.9X improvement in encoding time).

Change-Id: Ida562cc0bfe18c9d6f5f00873c95f8396b480eab
2012-06-29 16:19:42 +05:30
Urvang Joshi
3ba81bbe8b WebP Decoding error handling:
- Don't allow any extended chunks (except ALPH) without RIFF & VP8X
chunks.
- Also, don't allow VP8X without RIFF.

Change-Id: I1beba43e617ec637901aeeb93f2f484ec086a75d
2012-06-29 14:32:21 +05:30
Pascal Massimino
fcc69923b9 add automatic YUVA/ARGB conversion during WebPEncode()
Adds new methods WebPPictureARGBToYUVA() and WebPPictureYUVAToARGB()
Depending on the value of picture->use_argb_input,
the main call WebPEncode() will convert appropriately.
Note that both conversions are lossy, so it's recommended to:
* use YUVA input for lossy compression (picture->use_argb_input=0)
* use ARGB input for lossless compression (picture->use_argb_input=1)

Change-Id: I8269d607723ee8a1136b9f4999f7ff4e657bbb04
2012-06-28 00:34:23 -07:00
Pascal Massimino
802e012a18 fix compilation in non-FANCY_UPSAMPLING mode
Change-Id: Id0b1fad3a4888b6e9563a227412b2e6a656d9a2a
2012-06-28 00:26:35 -07:00
Pascal Massimino
e012dfd90f make width/height coding match the spec
* width/height in VP8X chunk is 24bit now
* Added some more constants #defines

Change-Id: I2f8ca7f965a247bccd341dd079ed2abf549c39d7
2012-06-28 00:20:28 -07:00
James Zern
228d96a538 mark VP8{,L}{GetInfo,CheckSignature} as WEBP_EXTERN
these functions are used by libwebpmux

Change-Id: Ifcb79e685f3a6b53007c0dc5f220737daba97d47
2012-06-27 16:07:33 -07:00
Pascal Massimino
637a314f97 remove the now unused *KeepA variants
Change-Id: I65217f3075e30bc9a7f38a49d09f01c9d7271d6a
2012-06-27 10:00:48 -07:00
Urvang Joshi
d11f6fcc82 webpmux returns error strings rather than numbers
Change-Id: Ifc8d8aaf0f6c03ecb1508ec7fbc34c918bf69c61
2012-06-27 16:55:57 +05:30
James Zern
fcec059322 makefile.unix: cwebp: fix OSX link
this is more a workaround than a fix. this change forces the tables
from yuv.h into the data section rather than generating them as common
blocks. prior to this the linkage would fail with e.g.,

Undefined symbols:
...
  "_VP8kClip4Bits", referenced from:
      _Yuv444ToRgba4444 in libwebp.a(libwebpdsp_la-upsampling.o)

broken since:
 48f8275 add colorspace for premultiplied alpha

Change-Id: I69c36758c31cd3a4b3ea5c412674d1a47b45447e
2012-06-26 18:09:55 -07:00
pascal massimino
6b811f1b06 Merge "doc: remove lossless pdf" 2012-06-22 15:43:20 -07:00
James Zern
c963482124 doc: remove lossless pdf
superseded by webp-lossless-bitstream-spec.txt

Change-Id: I5f233d4c3c2fa048a180db950ad4319ffdb9bced
2012-06-22 15:25:03 -07:00
James Zern
b9ae4f0d88 cosmetics after mux changes b74ed6e, b494ad5
Change-Id: I8f693b1ba2537de89bda1dfbcf3b95abd17e420a
2012-06-22 14:30:01 -07:00
Urvang Joshi
b494ad5096 Mux: only allow adding frame/tiles at the end.
Change-Id: I5d685628da8c8ac85144cee2e5808b30ec79fef9
2012-06-22 11:18:18 -07:00
pascal massimino
2c341b0eed Merge "Added image characteristic hint for the codec." 2012-06-22 02:54:51 -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
2ed2adb5ba Merge "msvc: add intrinsic based BitsLog2Floor" 2012-06-22 00:13:47 -07:00
James Zern
e595e7c552 Merge "add demux.c to the makefiles" 2012-06-21 23:44:44 -07:00
James Zern
da47b5bda7 Merge "demux: add {Next,Prev}Chunk" 2012-06-21 23:43:03 -07:00
James Zern
e5f467420d add demux.c to the makefiles
Change-Id: If98c0ea859c845261218196df35e905589f09e76
2012-06-21 23:21:41 -07:00
James Zern
4708393c3b demux: add {Next,Prev}Chunk
replaces WebPDemuxSetChunk(). makes this consistent with the Frame
interface.

Change-Id: Ia2b1b98cc290f35b41fd14ee35a2a17cecac7ba8
2012-06-21 23:18:39 -07:00
James Zern
e8a0a821d2 demux: quiet msvc warnings
min_size is safe to be a uint32_t so avoid the size_t -> uint32_t
conversion

Change-Id: Ib53fe58d313b55dfcf3bee35d0cad48f210d07bf
2012-06-21 23:09:38 -07:00
Urvang Joshi
7f8472a610 Update the WebP Container Spec.
- Add details about the VP8L chunk support.
- Also add new example bitsteams containing VP8L chunk.
- Add back a section describing the VP8 chunk.
- Restrict some fields to 16 or 24 bits instead of 32 bits.
- Fields whose values are always positive are stored 1-based
instead of 0-based.
- Unknown chunks can only occur at certain places in the file.
- Remove the restriction for some fields to be divisible by 32 or 16.
  Instead they are restricted to be even.
- Add a restriction for (canvas_width * canvas_height) product.
- Add 3 bits for rotation & symmetry in VP8X flags.
- Add some new example layouts.
- Add/clarify some nitty-gritties throughout the doc.
- Use the terms frame/tile more consistently and logically.
- Update related TODOs.

Change-Id: I611c1f58ecc3ee87546ca31bad1609376fad251e
2012-06-21 16:04:58 -07:00
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
Pascal Massimino
9144a18643 add overflow check before calling malloc()
It's preferable to be over-strict and paranoid here.

Change-Id: Ia928b279b753fa8f836d17decb17a35e6dc441b3
2012-06-20 23:58:43 -07:00
Pascal Massimino
81720c9139 consistency cosmetics
Change-Id: Ie8e372ddcdd6e48527478f70bf716953ed18292a
2012-06-20 23:56:11 -07:00
James Zern
2ebe8394f8 Merge "Add kramdown version information to README" 2012-06-20 16:02:03 -07:00
James Zern
7144308402 enc/vp8l.c: fix build
broken since:
233a589 take picture->argb_stride into account for lossless coding

Change-Id: I9ecbbf65f3048be3077d28c3a20dfc0e1afa10be
2012-06-20 14:44:39 -07:00
Lou Quillio
b7ac19fec9 Add kramdown version information to README
Example kramdown command line to apply syntax highlighting requires
kramdown latest. Command is slightly different for earlier versions.

modified:   doc/README

Change-Id: Icda1197436b5c5ed936ceff53c1dc51aa4ce409b
2012-06-20 14:17:36 -07:00
James Zern
efdcb6670c Merge "Edit for consistency, usage and grammar." 2012-06-20 14:01:13 -07:00
Urvang Joshi
08220102d1 Enable alpha in vvwebp
Change-Id: I9499b6d4ea64b7eab18cb377f0bb09b6b494c534
2012-06-20 11:20:48 -07:00
pascal massimino
8de9a0847b Merge "Mux API change:" 2012-06-20 11:11:49 -07:00
Urvang Joshi
b74ed6e766 Mux API change:
'Set' and 'Get' methods for images take/return a bitstream as input,
instead of separate 'image' and 'alpha' arguments.

Also,
- Make WebPDataCopy() a public API
- Use WebPData for storing data in WebPChunk.
- Fix a potential memleak.

Change-Id: I4bf5ee6b39971384cb124b5b43921c27e9aabf3e
2012-06-20 11:00:42 -07:00
Pascal Massimino
233a589ea9 take picture->argb_stride into account for lossless coding
analysis phase was assuming flat layout...

Change-Id: I96681f6d76aa3faabc51dd2ee3dffbe77ff90d36
2012-06-20 10:13:04 -07:00
Lou Quillio
04e33f17de Edit for consistency, usage and grammar.
Substantial edit, though less than 100% thorough.  This
makes changes that are clearly safe, but avoids others
where my domain knowledge is incomplete and accuracy
might be compromised.

modified:   doc/webp-lossless-bitstream-spec.txt

Change-Id: I89361a2e1157b8d2e44a8b4f4603f65833f0c1e6
2012-06-20 10:08:53 -07:00
pascal massimino
a575b4bc15 Merge "cosmetics: add missing const" 2012-06-19 22:34:28 -07:00
pascal massimino
8d99b0f4bd Merge "cosmetics: remove unimplemented function proto" 2012-06-19 22:33:54 -07:00
James Zern
69d022176d cosmetics: add missing const
Change-Id: I0c0e89bbe826961b02a40ada5a6f89e02abee378
2012-06-19 22:28:34 -07:00
James Zern
5b08318b57 cosmetics: remove unimplemented function proto
Change-Id: I580fcc756d161cebbabf753ee68c09d189628d7f
2012-06-19 22:27:56 -07:00
Vikas Arora
b7fb0ed567 Log warning for unsupported options for lossless.
Change-Id: I30d4e775959c7a4a8f5b649c8c90a4edb8cced47
2012-06-20 10:51:50 +05:30
James Zern
e1f769fe1c msvc: add intrinsic based BitsLog2Floor
Change-Id: Ic0c7d2f03e300c6699e130916a759403e672f9d8
2012-06-19 16:14:54 -07:00
Vikas Arora
8a69c7d8af Bug-fix: Clamp backward dist to 1.
Check for valid bounds on the 'dist' in backward reference case.
Clamp it to 1 in case of zero and negative values.

Change-Id: I78e956d4595955efa02b1f9628b475093f6ee001
2012-06-19 16:44:03 +05:30
James Zern
b5b6ac979f Merge "Bring the special writer 'WebPMemoryWriter' to public API" 2012-06-18 16:22:17 -07:00
pascal massimino
a6a1909fff Merge "Fix floating point exception with cwebp -progress" 2012-06-18 16:11:53 -07:00
James Zern
f2cee06708 Fix floating point exception with cwebp -progress
Adds a test of enc->mb_h_ to VP8IteratorProgress() to avoid a division
by zero. Fixes issue #121.

Original patch from even rouault (even dot rouault at gmail dot com).

Change-Id: Ie5fcc1821860c0a9366d5aa11f3aded4f5b98ed7
2012-06-18 15:43:28 -07:00
Pascal Massimino
91b7a8c754 Bring the special writer 'WebPMemoryWriter' to public API
=> WebPMemoryWriter, WebPMemoryWriterInit(), WebPMemoryWrite()

Change-Id: I142fb22b0290ece7a6f6d74f00964a2e9e58ec9b
2012-06-18 15:42:56 -07:00
Pascal Massimino
310e297205 support resize and crop for RGBA input
Change-Id: I19eac3fb4f8ecb973ff5872ac3a921f8947054bf
2012-06-18 15:20:46 -07:00
James Zern
a89835d33a Merge changes Ice662960,Ie8d7aa90,I2d996d5e,I01c04772
* changes:
  Manually number "chapters," as chapter numbers are used in the narrative.
  Re-wrap at <= 72 columns
  Apply inline emphasis and monospacing, per gdoc / PDF
  Incorporate gdoc changes through 2012-06-08
2012-06-18 14:19:58 -07:00
pascal massimino
ce614c0caf Merge "dec/vp8: avoid setting decoder status twice" 2012-06-18 14:12:21 -07:00