Commit Graph

63 Commits

Author SHA1 Message Date
Pascal Massimino
8dcae8b3cf fix rescaling-with-alpha inaccuracy
(still missing YUVA decoding case for now)

https://code.google.com/p/webp/issues/detail?id=160

Change-Id: If723b4a5c0a303d0853ec9d839f995adce056095
2013-07-26 12:10:26 -07:00
James Zern
3eeedae1bc Makefile.vc: fix libwebpdemux dll variable typo
Fixes issue #149

Patch by: Jason Stevens  (cypher497 at gmail dot com)

Change-Id: I65cceaad37d22b96e5e92cb78f859fc0b7c38b67
2013-05-09 23:49:39 -07:00
James Zern
69d0f92658 Makefile.vc: have 'all' target build everything
default is still the core examples as makefile.unix

Change-Id: Ica3fe6123f4359aefa130b39d2b0739b65e34c0b
2013-04-05 19:21:01 -07:00
James Zern
52967498b3 Makefile.vc: flags cleanup
- drop some unnecessary link flags
- use lib.exe directly for creating libraries
- factorize /nologo and use it consistently

Change-Id: Ie76119bc051e9bc53e4d6bba1a0a3f124f9062fc
2013-04-05 18:47:18 -07:00
James Zern
c61baf0c10 Makefile.vc: drop /FD flag
breaks under wine; from MSDN:
/FD is only used by the development environment, and it should not be
used from the command line or a build script.

Change-Id: I180c9813e721b163cc645b9b7f14fe36556019d3
2013-04-05 14:54:05 -07:00
James Zern
81a50695de Makefile.vc: fix dynamic builds
broken since:
e2feefa Makefile.vc: split mux into separate lib

broken even more since:
b65c4b7 Makefile.vc: add libwebpdecoder target

Change-Id: Ibb7a7f2c71ae63434a60d988ce15f0a4ed8fcaee
2013-03-21 19:30:34 -07:00
James Zern
19a8dd0154 Merge "Makefile.vc: add vwebp.exe target" into 0.3.0 2013-03-15 16:38:40 -07:00
James Zern
b65c4b7cbc Makefile.vc: add libwebpdecoder target
Change-Id: I43e5974dd4ec7280ee49d3dd258db227db757064
2013-03-15 16:32:58 -07:00
James Zern
d99aa56fbf Makefile.vc: add vwebp.exe target
Change-Id: I4de63628fef66fe2b1000cbc62c7db28f68c2cb8
2013-03-15 12:18:25 -07:00
skal
5cf7792e40 split quant_levels.c into decoder and encoder version
-> split libraries further into decoder / encoder
-> add libwebpdecoder.a in Makefile.unix
-> make dwebp link against libwebpdecoder.a in Makefile.unix

also: in makefile.unix, pass EXTRA_FLAGS to LDFLAGS too
(otherwise, -m32 wouldn't work, e.g.)

Change-Id: Ief3da02a729dd86bbaf949ed048836716941657f
2013-02-24 21:40:39 +01:00
James Zern
dd7a49b21b Makefile.vc: normalize path separator
/ -> \

Change-Id: I691c03683650b8b97a365281e9384f4a3f3fe1ca
2013-01-23 12:46:18 -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
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
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
skal
657f5c91b1 move token buffer to its own file (token.c)
Change-Id: Ib9791c52f48d98fad5ed3830f36894ef5ac362fa
2012-12-03 13:50:14 +01: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
Pascal Massimino
9b261bf521 remove the last NOT_HAVE_LOG2 instances
Change-Id: I193ecf82316cd1d5d7ddeebebf8fc98afccf0ede
2012-08-02 06:42:41 -07:00
Pascal Massimino
80cc7303ab WebPCheckMalloc() and WebPCheckCalloc():
safe size-checking versions of malloc() and calloc()

Change-Id: Iffa3138c48b9b254b3d7eaad913e1f852d9dafba
2012-07-31 16:56:39 -07:00
James Zern
ff9fd1bac6 Makefile.vc: fix webpmux.exe *-dynamic builds
the libwebpmux objects depend on the generated webp_dll.[hc] files as
well

Change-Id: I26177b56f415d69e4bc34b24d32c70a13c6c053c
2012-07-19 17:55:50 -07:00
James Zern
e41a759615 build: remove libwebpmux from default targets/config
the extended file format is still under development and related
libs/binaries are not fit for release

configure:
--enable/disable-libwebpmux; default is disabled.

makefile.unix:
src/mux/libwebpmux.a and examples/webpmux must be explicitly specified

Makefile.vc:
$(DIRLIB)\libwebpmux.lib and $(DIRBIN)\webpmux.exe must be explicitly
specified

Change-Id: I8246746b256010dd2a2e4de58291222d7eaf0457
2012-07-11 14:25:41 -07:00
James Zern
e2feefa9b8 Makefile.vc: split mux into separate lib
similar to other builds, reusing some variable naming from
makefile.unix.
also change the main output file names to libwebp{,mux}.{lib,dll} with
the import lib retaining the _dll suffix.

Change-Id: I6bbc4fb39ab37957f153e9f31954387b24094581
2012-07-02 12:37:57 -07:00
James Zern
e5f467420d add demux.c to the makefiles
Change-Id: If98c0ea859c845261218196df35e905589f09e76
2012-06-21 23:21:41 -07:00
Pascal Massimino
3e863dda61 remove tcoder, switch alpha-plane compression to lossless
* Method #1 is now calling the lossless encoder on the alpha plane.
Format is not final, it's just a first draft. We need ad-hoc functions.
* removed now useless utils/alpha.*
* added utils/quant_levels.h instead
* removed the TCoder code altogether

Change-Id: I636840b6129a43171b74860e0a0fc5bb1bcffc6a
2012-05-21 06:24:48 -07:00
James Zern
061263a787 add example_util.[hc]
moves ReadFile to a common location

Change-Id: Ia81230671f16d7d4d218b9954a5be55577a85413
2012-05-15 13:42:57 -07:00
James Zern
2924a5aee6 Makefile.vc: split object lists based on directory
Change-Id: I4e189193817f26117e6459da078e2a72c9f3ef5f
2012-05-11 18:29:33 -07:00
James Zern
0df04b9e19 Android.mk & Makefile.vc: add new files
from the lossless additions, fixes the build.

Change-Id: I3243c48f21cfb4e2244614bb5ab12ff94dd684e5
2012-04-11 15:47:04 -07:00
Pascal Massimino
61c2d51fd7 move the rescaling code into its own file and make enc/ and dec/ use it.
(cherry picked from commit 8e92d9e380a89b7443a2e2c3d16ce5a222e8c1e8)

Conflicts:

	Android.mk
	makefile.unix
	src/dec/vp8l.c
	src/utils/Makefile.am
2012-03-30 12:16:25 -07:00
James Zern
0ee2aeb904 Makefile.vc: use batch mode rules
speeds up the build

Change-Id: I2471fb6b42bb5d51f8dd1634f65d5f8114355a22
2012-02-22 11:36:28 -08:00
James Zern
d9acddc010 msvc: move {i,p}db creation to object directory
avoids cluttering the source tree.

Change-Id: I2885b36dd7152e294536584fa5cfe3ae8b04c7fa
2012-02-22 11:19:16 -08:00
James Zern
45feb55dec expose WebPFree function for DLL builds
This allows managed code (e.g., C#) to free buffers returned by the API
instead of relying on free().
Based on suggestion from Steven (grokys at googlemail dot com).
Fixes issue #109.

Change-Id: I94826a77f6f4cb6e331c454f994c964e2e448cae
2012-02-21 13:48:06 -08:00
pascal massimino
d8a47e66f7 Merge "Add predictive filtering option for Alpha." 2012-01-05 00:33:32 -08:00
Vikas Arora
252028aaac Add predictive filtering option for Alpha.
Add predictive filtering option for Alpha plane.
Valid range for filter option is [0, 5] corresponding to prediction
methods none, horizontal, vertical, gradient & paeth filter.
The prediction method 5 will try all the prediction methods (0 to 4)
and pick the prediction method that gives best compression.

Change-Id: I9244d4a9c5017501a9696c7cec5045f04c16d49b
2012-01-05 13:55:35 +05:30
pascal massimino
9b69be1cdc Merge "Simplify mux library code" 2012-01-05 00:15:48 -08:00
Urvang Joshi
a056170eca Simplify mux library code
Refactor mux code into Read APIs, Set/Delete APIs and internal
objects/utils.

Change-Id: Ia4ce32ec18cf0c1c75de9084fbb28840d46892b4
2012-01-05 12:23:08 +05:30
James Zern
992187a380 improve log2 test
- add check for native log2 to configure
- use a common define (NOT_HAVE_LOG2) to enable use of local library
  version for non-autoconf platforms without their own version,
  currently msvc and android

This uses a negative (NOT_HAVE_) to simplify the ifdef

Change-Id: Id0610eed507f8bb9c5da338918112853d5c8127a
2012-01-04 18:49:37 -08:00
Vikas Arora
e1947a9299 Add Alpha encode/decode code.
Add code for Alpha encoding & decoding. The alpha compression is done
via backward reference counts encoded with Arithmetic encoder (TCoder).
Also provided is lossy Alpha pre-processing option via level-quantizations
using kNN heuristic.

Change-Id: Ib6b13530c1a4ab6493edcb586ad29fe242bc1766
2011-11-30 17:53:09 +05:30
James Zern
a82a788ba0 Makefile.vc: cosmetics
- break long lines
- detab variable assignments
- sort object names

Change-Id: I33a210e617552a97c36ac3b1e255af4c7f2b0e35
2011-10-04 13:46:09 -07:00
James Zern
c8f41ce54e Makefile.vc: condense directory creation rules
Change-Id: I39fb8278f17498998f8a9cf022a548e0735b1d11
2011-10-04 13:39:39 -07:00
Mikolaj Zalewski
2b877cd0c8 Some fixes to Makefile.vc to support the src\mux directory.
Change-Id: I5a4a3087032dc1d5f75750b2db2a3092d39f8fc0
2011-10-01 23:47:58 +02:00
Vikas Arora
e78e971e98 Add Makefile.vc for Mux library & binary.
Add Makefile.vc for Windows platform to build Mux library and example
command line tool.

Change-Id: Ic9e2290feda0ae3e2f2fb3c5f8d46e79eada71a3
2011-09-30 16:05:33 +05:30
Pascal Massimino
b112e83647 create a libwebputils under src/utils
with bit_reader bit_writer and thread for now.

Change-Id: If961933fcfc43e60220913fe4d527230ba8f46bb
2011-09-13 15:34:15 -07:00
Pascal Massimino
e06ac0887f create a separate libwebpdsp under src/dsp
Gathers all DSP-related function (and SSE2 implementations).
Clean-up some unwanted symbolic dependencies so that webp_encode,
webp_decode and webp_dsp are truly independent libraries.

+ opportunistic clean-up:
  * remove unneeded VP8DspInitTables(), now integrated in VP8DspInit()
  * make consistent use of VP8GetCPUInfo() in the various DspInit() funcs
  * change OUT macro to DST
2011-09-13 12:29:44 -07:00
James Zern
fccca4202f windows: add decode threading support
Change-Id: Iad923550569ceec1ff469852ec68e66de3f6062b
2011-08-05 12:28:40 -07:00
James Zern
565a2cab22 Makefile.vc: rule maintenance
Remove the bulk of xcopys from the TARGET rule as things are built to
the correct location.
Allow the clean rule to be appended and only delete DLLINC for dll
builds to avoid prompting by erase when it's undefined.

Change-Id: If88b2c68090099777b8be9f3a5fbde2c25ed66a6
2011-07-22 18:56:36 -07:00
Pascal Massimino
fc7815d692 multi-thread decoding: ~25-30% faster
To be enabled with the flag WEBP_USE_THREAD.
For now it's only available on unix (pthread), when using Makefile.unix
Will be switched on more generally later.

In-loop filtering and output (=rescaling/yuv->rgb conversion)
is done in parallel to bitstream decoding, lagging 1 row behind.

Example:
examples/dwebp bryce.webp -v
Time to decode picture: 0.680s

examples/dwebp bryce.webp -v -mt
Time to decode picture: 0.515s

Change-Id: Ic30a897423137a3bdace9c4e30465ef758fe53f2
2011-07-22 15:14:18 -07:00
James Zern
b4d0ef8f58 Makefile.vc: add DLL configs
(release|debug)-dynamic
These configurations will produce a dll in bin/ and an import lib under
lib/.
Currently the -noasm switch in the examples will be disabled for these
builds due to a dependency on VP8EncGetCPUInfo.

Change-Id: I2cbac0064f0e500698d14ffc03200791ca837090
2011-07-15 15:25:02 -07:00
Pascal Massimino
e291fae0fc SSE2 functions for the fancy upsampler.
~5-10% faster.
Heavy 8bit arithmetic trickery!
Patch by Somnath Banerjee (somnath at google dot com)

Change-Id: I9fd2c511d9f631e9cf4b008c46127b49fb527b47
2011-07-07 18:12:53 -07:00
Pascal Massimino
d260310511 add Advanced Decoding Interface
You can now use WebPDecBuffer, WebPBitstreamFeatures and WebPDecoderOptions
to have better control over the decoding process (and the speed/quality tradeoff).

WebPDecoderOptions allow to:
 - turn fancy upsampler on/off
 - turn in-loop filter on/off
 - perform on-the-fly cropping
 - perform on the-fly rescale
(and more to come. Not all features are implemented yet).

On-the-fly cropping and scaling allow to save quite some memory
(as the decoding operation will now scale with the output's size, not
the input's one). It saves some CPU too (since for instance,
in-loop filtering is partially turned off where it doesn't matter,
and some YUV->RGB conversion operations are ommitted too).

The scaler uses summed area, so is mainly meant to be used for
downscaling (like: for generating thumbnails or previews).

Incremental decoding works with these new options.
More doc to come soon.

dwebp is now using the new decoding interface, with the new flags:
  -nofancy
  -nofilter
  -crop top left width height
  -scale width height

Change-Id: I08baf2fa291941686f4ef70a9cc2e4137874e85e
2011-06-20 15:30:52 -07:00