Commit Graph

51 Commits

Author SHA1 Message Date
Pascal Massimino
d5bc05a47b make the filtering process match libvpx and ffvp8
libvpx (and ffvp8) implementations are completely skipping the deblocking
step if loop_filter_level is 0, which is _not_ equivalent to performing
the loop-filtering with a 0 value for loop_filter_level. In the latter case
(which we followed), few pixels were modified here and there and you could
observe off-by-1 errors on few places.

This patch will reconcile the 3 implementations (since the difference
is minor, skipping the deblocking step will save CPU for virtually
no visible difference).

The spec will be made clearer about the expected behaviour:
* if the global loop_filter_level is 0, turn deblocking off.
* if it's not 0 but the local loop_filter_level ends up being 0 for whatever
reason (lf_delta, mode delta, ref delta, etc.) on a particular
macroblock, skip the deblocking too.

Change-Id: I157f1f8de463b8a76caddb3f347b7fbc7bd527d2
2011-03-08 18:47:08 -08:00
Pascal Massimino
dd60138d20 add man pages for cwebp(1) and dwebp(1)
Change-Id: I450717fc82fff19f16df75aca6a9a567773afd00
2011-03-01 16:07:57 -08:00
Pascal Massimino
c4fa36448b fix header
Change-Id: I982868e480434d19e2870780100b1df83df0800a
2011-02-27 21:51:10 -08:00
Pascal Massimino
5b70b378bd * add an option to bypass_filtering in VP8Io.
This will make the decoder skip the filtering process if needed,
resulting in speed-up, but also non-compliant (blocky?) output
+ Add a versioning check for VP8InitIo(), since we've adding a field to VP8Io
+ add some more error checks while at it

Change-Id: I4e9899edc24ecf8600cbb27aa4038490b7b2cef3
2011-02-27 10:55:33 -08:00
Pascal Massimino
b97a4003c0 simplify QuantizeBlock code a bit
Change-Id: I1130859756fa88e88957781f60a3701be354e2a3
2011-02-27 10:46:28 -08:00
Pascal Massimino
84b58ebba3 add more checks around picture allocation
covers overflow corner cases for 32/64bit platforms.

Change-Id: I0c9169264c33a4e9d0bbfdb026fb0d82c7e56de8
2011-02-27 10:31:20 -08:00
Pascal Massimino
b65a3e101e remove absolute_delta_ field and syntax code
we'll always encode using absolute value, not relative ones.
    Both methods use the same number of bits, so we'll go for the
    simpler and most robust one.
    + add some extra checks about pic->u/v being NULL.

Change-Id: I98ea01a1a6b133ab3c816c0fbc50e18269bd2098
2011-02-27 10:27:07 -08:00
Pascal Massimino
0744e8420e Dont' open output file until we're sure the input file is valid
fixes http://code.google.com/p/webp/issues/detail?id=48

Change-Id: I9ce2e500623380ba71ae0e2c8faf80db4568ae50
2011-02-25 12:03:27 -08:00
Pascal Massimino
d5bd54c712 fix typo and buggy line
Change-Id: I744bcfe5e611a49af9ad8a00ba764b74ee8dd727
2011-02-20 11:57:49 -08:00
Pascal Massimino
f7a9549dcb Add a simple top-level makefile.unix for quick & easy build.
Just use:
  make -f makefile.unix
instead of the autoconf system.

Change-Id: Idcedfd22e543023d1731f5753fb4958f02d0dd75
2011-02-20 11:17:44 -08:00
Pascal Massimino
5f36b94403 update the doc for the -f option
Change-Id: I0ae23bf755b516f0149539ac849e20c15fa26209
2011-02-19 09:34:48 -08:00
Pascal Massimino
f61d14aabf a WebP encoder
converts PNG & JPEG to WebP

This is an experimental early version, with lot of room
of later optimizations in both speed and quality.

Compile with the usual `./configure && make`
Command line example is examples/cwebp

Usage:

   cwebp [options] -q quality input.png -o output.webp

where 'quality' is between 0 (poor) to 100 (very good).
Typical value is around 80.

More encoding options with 'cwebp -longhelp'

Change-Id: I577a94f6f622a0c44bdfa9daf1086ace89d45539
2011-02-18 23:54:59 -08:00
Pascal Massimino
81c966215b oops: forgotten call to Initialize()
+ move the error message to a more useful place

Change-Id: Id03a992491f907f278fcaad11e94f70f1baccd5f
2011-02-18 10:26:42 -08:00
Pascal Massimino
87ffa005de typo: fix a missing 'R', was confusing.
Change-Id: I769ded6058f6c7eabc97fc7a772bc44a42cd826e
2011-02-17 09:59:34 -08:00
Pascal Massimino
b04b857a35 * add decoding measurement using stopwatch.h (use -v option)
* support PNG output through WIC on Win32

Change-Id: I1dbcc6ab1360010aca25da80f30a74781aadc76d
2011-02-16 15:01:27 -08:00
Pascal Massimino
746a4820b9 * make (*put)() hook return a bool for abort request.
* add an enum for VP8Status() to make things clearer

Change-Id: I458aeabab93f95d28e8ee10be699b677c04b4acb
2011-02-16 14:33:16 -08:00
Pascal Massimino
73c973e6da * strengthen riff/chunk size checks
* don't consider odd-sized chunks being an error

Change-Id: I2901b071232bb996680cf155e1a25a6a9388f222
2011-02-16 13:24:55 -08:00
Pascal Massimino
1dc4611a3a add support for PNG output (default)
regularize include guards

Change-Id: Ia1d0fa49c8c98e2c11f775b839d04a24e5450170
2011-01-31 22:25:44 -08:00
Pascal Massimino
860641df3f fix a typo: sizeof(kYModeProbaInter0) => sizeof(kUVModeProbaInter0)
report by mr dot gnu do jr at gmail dot org.

Change-Id: Iccd701ab1ec613a019f216e5cb37a18e5adfb4cf
2011-01-31 21:12:19 -08:00
Pascal Massimino
3254fc5259 fix some petty constness
fix the ./configure file too

Change-Id: I96cfc84e08e9bab517dec24c92f856efa5ad04ca
2011-01-23 12:59:06 -08:00
Pascal Massimino
504d33937c fix eof_ mis-initialization
For very very short partitions, the initial GetByte() could
set eof_ to 1, whereas some bits were available but unread yet.
So we set eof_ to 0 last.

Change-Id: Ic6b68271bc72efa4de4e64e1f57307d1d8fb613c
2011-01-17 00:25:18 -08:00
Pascal Massimino
2bc0778f85 leftover Makefile.* from previous commit
Change-Id: If89dde15cd3f4a27ad95401a66f27fd5e079c5da
2011-01-08 07:16:20 -08:00
Pascal Massimino
d2cf04e48e move Makefile.am one level below, to src/dec
fix typos here and there
dwebp is now an installed program

autotools = lot of fun :)

Change-Id: Idd12a944dd8d6614e393122c4378e1f7ecf0e209
2011-01-07 18:16:04 -08:00
Pascal Massimino
ade92de8e0 typo: vp8.h -> decode_vp8.h
Change-Id: I860183182b5e531d38f10b81769c3e5911880b0b
2011-01-07 11:45:29 -08:00
Pascal Massimino
d7241241d1 forgot to declare types.h to be installed
Change-Id: I5edab197829e0148cbabd4a6dfe9e56279204fc6
2011-01-06 19:44:43 -08:00
Pascal Massimino
6421a7a4fb move the decoder sourcetree to a sub-location src/dec
to make room for future libs sources

also extract the types declaration into its own types.h file

Change-Id: I8bae8a323a479a29375cf509792228ae6af51c7a
2011-01-06 08:57:14 -08:00
Pascal Massimino
a9b3eab6fd correct layout name is IMC4.
U-plane comes first, then V-plane.
see http://www.fourcc.org/yuv.php#IMC4

Change-Id: I65222176ca4d8f3b1e072783becd769dd4dd2f55
2011-01-03 11:05:13 -08:00
Pascal Massimino
2330522cff handle corner case of zero-dimensions
Change-Id: I943a335b92b5ee6c2980c2ba9d4092f0b79f9a6b
2010-12-20 12:09:07 -08:00
Pascal Massimino
280c36583f make VP8Init() handle short buffers (< 2 bytes) correctly
Change-Id: Ie354a97f0dc44d95bd5fad92851a76cfdedae3de
2010-12-20 05:50:16 -08:00
Pascal Massimino
b1c9e8b48c handle error cases more robustly
Change-Id: I252fd9596d10db26026b8c577ad7f29ffd373f4c
2010-12-20 05:28:57 -08:00
Pascal Massimino
0e94935ca9 Merge "table-less version of clip_8b()" 2010-12-17 11:10:00 -08:00
Pascal Massimino
1e0a2d25f6 table-less version of clip_8b()
added some dynamic range analysis too.

Change-Id: I76804adbfceccd83639c5821b4f0f5b9e7d6c82c
2010-12-17 05:56:37 -08:00
Pascal Massimino
e12109eefc dwebp: change -yuv option to -raw
change the layout to IMC2

This is easier visually
(cf http://www.fourcc.org/yuv.php#IMC2)

Change-Id: I8e8495908f98a392bf629d41f14eb7835ba027e1
2010-12-17 05:53:50 -08:00
Pascal Massimino
d72180a489 speed-up fancy upscaler
by processing two rows at a time.
The [9 3 3 1] weights are decomposed as
[1 1 1 1] + [0 2 2 0] + [8 0 0 0] for better
reuse of sub-expressions, too.

Change-Id: I87ab549048ed249d38add73bb3241dfa0c583328
2010-12-14 13:57:05 -08:00
Pascal Massimino
9145f3bc93 reset eof_ at construction time
not critical, but makes things sound

Change-Id: Ib013259924d38dca6f7521d7f1ab09ecc1d3b933
2010-12-02 11:39:29 -08:00
Pascal Massimino
a7ee0559f3 simplify the logic of GetCoeffs()
We only need to know _if_ there's some non-zero coeffs at all,
not the exact number of these.

+ code-style nits clean-up

Change-Id: Ice9acf00aef999d70affe4629cb56ae7709140ab
2010-11-28 23:13:33 -08:00
Pascal Massimino
f67b5939ad lot of cosmetics
just flushing the pile:
 - get rid of Put4 in dsp.c
 - move LD4 enum value
 - move more fields and code under the ONLY_KEYFRAME_CODE compile flag
 - update test_ref.ppm reference (now with FANCY_UPSCALER)
 - simplify VP8GetSignedValue()
 - use HE and VE naming for prediction mode instead of H and V
 - some missing c89 fixes
 - code style nits

all test vectors still passing
2010-11-17 20:09:47 -08:00
Pascal Massimino
ea27d7c6a8 fix endian problem on PowerPC
not super-elegant, but should work without
having to go into deeper hacking (like: creating
an endian.h file, etc.)

Change-Id: I43100ec67a22393c87e11357078efffc750060f5
2010-11-08 15:44:37 -08:00
Pascal Massimino
beb0a1badb fix signature of VP8StoreBlock
cygwin spotted that.

Change-Id: I24a0767b438b0937c5dbd85f8a6db1be8ab51e70
2010-11-03 17:52:00 -07:00
Pascal Massimino
b128c5e268 Merge "fancy chroma upscaling" 2010-11-03 16:33:13 -07:00
Pascal Massimino
6a37a2aaa9 fancy chroma upscaling
When FANCY_UPSCALING is defined, use a smoothing filter for upscaling
the U/V chroma fields. The filter used is a separable t[1 3 3 1] x [1 3 3 1]
filter. It can be easily changed in macros MIX_*.

The upscaling code reside on the thing shell between user and core
decoding (in webp.c), and not in the core decoder. As such, this smoothing
process can still be offloaded to GPU in some future and is not integral
part of the decoding process.

Coincidentaly: changed the way data is tranfered to user. For profile 2 (no
filtering), it used to be on a per-block basis. Now, for all profiles, we
emit rows of pixels (between 8 and 24 in height) when they are ready.
This makes the upscaling code much easier.

Will update the test vectors MD5 sums soon (as they'll be broken
after this change)

Change-Id: I2640ff12596cb8b843a4a376d7347447d9b9f778
2010-11-03 15:05:48 -07:00
Pascal Massimino
ff565edc25 fix two numeric typos
Change-Id: I817bb424919f26c64475795935135ee8783486dd
2010-11-03 14:17:21 -07:00
Pascal Massimino
5a936a0a21 use uintptr_t for casting pointers to ints
this is required on 32bit platforms
(and is the recommended way to do so, actually)

Change-Id: I8785be523e91a6ed2806612984b3830eab4da757
2010-11-01 15:07:12 -07:00
Pascal Massimino
e14a0301f8 for cross_compiling=yes to prevent executing any binary
this was causing problems with security softwares like Bit9

Change-Id: Id335ef3f8370cdeab77529be0559f2ee35fc14a1
2010-11-01 13:36:01 -07:00
Pierre Joye
83b545eea7 add vc9+ makefile
nmake /F Makefile.vc9 cfg=release-static
    objdir=h:\projects\webp\repo\build\libwebp ARCH=x64

given that you are in x64 mode, this command will build libwebp in
the <objdir>\release-static

Change-Id: I42e1849f5cdb7638db3b79d3658e2852d3969cc2
2010-11-01 06:48:36 -04:00
Pascal Massimino
296f691441 fix output loop for small height
the logic was broken in case of small height (1 macroblock row only).
2010-10-31 09:27:06 -07:00
Pascal Massimino
cbfbb5c3b5 convert to plain-C
there were still some dandling local variables.
2010-10-31 00:36:33 -07:00
Pascal Massimino
f09f96ee3f Fix declaration after statement warning
Change-Id: I038a3d547ada367c85d99cdae202562d644f19e0
2010-10-19 17:16:49 -04:00
Pascal Massimino
5981ee55ce Fix UV plane ac/dc quantizer transposition
Typo caused incorrect quantizer to be used for UV blocks.

Change-Id: I26faad370a16ea5b35ae49396d17b8903602499e
2010-10-14 20:38:23 -04:00
Pierre Joye
c8d15efa12 convert to ANSI-C 2010-10-06 14:37:28 -07:00