Commit Graph

2130 Commits

Author SHA1 Message Date
Urvang Joshi
4af1858a10 Fix a crash due to max symbol in a tree >= alphabet size
(cherry picked from commit 15253f91567ce7a2a4a3de8d70e54ba4b0641af3)

Change-Id: I4fbeaea4c712dae3bef078aef9d302b44bc39ffb
2012-04-10 23:07:13 -07:00
Pascal Massimino
6f01b830e2 split the VP8 and VP8L decoding properly
* each with their own decoder instances.
* Refactor the incremental buffer-update code a lot.
* remove br_offset_ for VP8LDecoder along the way
* make VP8GetHeaders() be used only for VP8, not VP8L bitstream
* remove VP8LInitDecoder()
* rename VP8LBitReaderResize() to VP8LBitReaderSetBuffer()
(cherry picked from commit 5529a2e6d47212a721ca4ab003215f97bd88ebb4)

Change-Id: I58f0b8abe1ef31c8b0e1a6175d2d86b863793ead
2012-04-10 23:06:58 -07:00
James Zern
f2623dbe58 enable lossless decoder
import changes from experimental 5529a2e^
and enable build in autoconf and makefile.unix; windows will be treated
separately.

Change-Id: Ie2e177a99db63190b4cd647b3edee3b4e13719e9
2012-04-10 23:06:36 -07:00
James Zern
b96efd7d50 add dec/vp8i.h changes from experimental
Pulled from 5529a2e^.

Change-Id: I51fe7a9c3acf1be4c43af834fd525ab3be5d7e65
2012-04-10 23:05:57 -07:00
James Zern
19f6398ed7 add dec/vp8l{i.h,.c} from experimental
Pulled from 5529a2e^.
The history of this and related files is a bit entangled so rather
trying to split the changes and introduce some noise in master's history
we'll start with a fresh snapshot.
The file progression is still available in the experimental branch.

Change-Id: I490a49cb0084d556a29d7c5257c986ea695ce60c
2012-04-10 23:05:14 -07:00
James Zern
c4ae53c8b3 add utils/bit_reader.[hc] changes from experimental
Pulled from the parent of the current version (5529a2e^).
The history of this and related files is a bit entangled so rather
trying to split the changes and introduce some noise in master's history
we'll start with a fresh snapshot.
The file progression is still available in the experimental branch.

Change-Id: I6dae97fc381cd6c1d1640c4c565b2084a41ec955
2012-04-10 17:48:49 -07:00
James Zern
514d008921 add dsp/lossless.[hc] from experimental
Pulled from the current HEAD (218c32e).
The history of this and related files is a bit entangled so rather
trying to split the changes and introduce some noise in master's history
we'll start with a fresh snapshot.
The file progression is still available in the experimental branch.

Change-Id: I40538799dbf999abb9408ac83f55b897d8e22498
2012-04-10 17:37:44 -07:00
James Zern
9c67291d67 add utils/huffman.[hc] from experimental
Pulled from the current HEAD (218c32e).
The history of this and related files is a bit entangled so rather
trying to split the changes and introduce some noise in master's history
we'll start with a fresh snapshot.
The file progression is still available in the experimental branch.

Change-Id: Ie57be21bf50ad83808c72aeb5fc706d9954d01d8
2012-04-10 17:31:54 -07:00
James Zern
337914a036 add utils/color_cache.[hc] from experimental
Pulled from the current HEAD (218c32e).
The history of this and related files is a bit entangled so rather
trying to split the changes and introduce some noise in master's history
we'll start with a fresh snapshot.
The file progression is still available in the experimental branch.

Change-Id: Id879be453a94d9f44ec8d47747823ca7297ae008
2012-04-10 17:23:38 -07:00
Pascal Massimino
b3bf8fe7a1 the read-overflow code-path wasn't reporting as an error
(since 'ok' was '1' by default)
(cherry picked from commit fe5eb4ffae74ff493e92fb5cd9a7a1625a113a7b)
2012-03-30 18:58:30 -07:00
Pascal Massimino
1db888ba40 take colorspace into account when cropping
(cherry picked from commit 4e33653b52637c74ae30adde7990265d1d43994b)

Conflicts:

	src/dec/vp8l.c
2012-03-30 12:48:24 -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
Urvang Joshi
efc2016a31 Make rescaler methods generic
to be used in rescaling of lossless bitstreams.
(cherry picked from commit 2e12a3045498b6faf13b93bc25391e8226119f0a)
2012-03-30 11:57:07 -07:00
Urvang Joshi
3eacee8158 Move rescaler methods out of io.c.
(cherry picked from commit b5e9db1824f6efbe0bfb87e94b8d6e88a7973ef7)
2012-03-30 11:56:51 -07:00
James Zern
a69b893dda automake: replace 'silent-rules' w/AM_SILENT_RULES
silent-rules is a new option with automake-1.11; older versions will
fatally exit with it. Using AM_SILENT_RULES will only result in a
warning at least through automake-1.9.

Change-Id: Ieae6a09780efd85f08f0c6442172634a1ce5ff33
2012-03-28 22:46:12 -07:00
Pascal Massimino
6f7bf645b4 issue 111: fix little-endian problem in bit-reader
patch by naideflan

Change-Id: I874dbd5588d5cd2559c54ca9ad5582fa3a589b1b
2012-03-27 05:55:20 -07:00
Scott LaVarnway
ed278e2279 Removed unnecessary lookup
The lookup value is the same as the index.  The index in this
case is either a 0 or 1.

Change-Id: I0432dfcbea9e7bb20bca7574e25fb1fd8a51c8e9
2012-03-26 11:44:04 -04:00
Pascal Massimino
cd8c3ba78f fix some warnings: down-cast and possibly-uninitialized variable
Change-Id: I5baf59bbcd5dcff69316b0601483ff5abe8e1454
2012-03-16 20:20:33 -07:00
Pascal Massimino
0a7102ba60 ~1% improvement of alpha compression
by packing the symbol map more efficiently.

This is mainly useful in making it harder to generate invalid bitstream:
before this change, one could code the same symbol twice. Now, it's
impossible, since we code the position using empty symbol slots, instead
of total position.

* Fix the HasOnlyLeftChild() naming while at it.

Change-Id: I63c56c80a4f04a86ac83eded1e3306329815b6c9
2012-02-24 19:59:40 -08:00
James Zern
3bc1b14191 Merge "Reformat container doc" 2012-02-24 19:30:40 -08:00
James Zern
dc17abdcb6 mux: cosmetics
add a few missing consts and remove an unnecessary cast

Change-Id: I396571090ce379bbc7a173cbc90714a6b7b52a2a
2012-02-23 13:21:43 -08:00
pascal massimino
cb5810dfbe Merge "WebPMuxGetImage: allow image param to be NULL" 2012-02-22 21:58:48 -08:00
James Zern
506a4af2fa mux: cosmetics
group like parameters together in prototypes, comments, move variable
declarations closer to first use.

Change-Id: Idd6bd87d0366d783fed83f4dd21bd7968cbe6948
2012-02-22 16:14:32 -08:00
James Zern
135e8b1942 WebPMuxGetImage: allow image param to be NULL
but not both alpha & image

Change-Id: I6822a740de7577eedcbe7529382aa2c020d1e8e4
2012-02-22 16:09:06 -08:00
pascal massimino
de556b6866 Merge "README.mux: reword some descriptions" 2012-02-22 15:02:50 -08: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
237c9aa727 Merge "expose WebPFree function for DLL builds" 2012-02-22 10:55:52 -08:00
James Zern
b3e4054f14 silence msvc debug build warning
_byteswap_ulong is defined in stdlib.h, release builds seem to pull it
in through a different path.

Change-Id: I510d2624150f89a4a77734bf3dc5b4db60a4ba95
2012-02-21 13:57:48 -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
James Zern
11316d84b4 README.mux: reword some descriptions
Change-Id: I334caaa908c9a50baf8e35125dd0062d764f2949
2012-02-17 14:39:31 -08:00
James Zern
4be52f4a65 factorize WebPMuxValidate
move count extraction, count and feature flag validation to
ValidateChunk.

Change-Id: I4bd81bbc8a5a48e1263d11992ab3f285c45417b8
2012-02-15 11:54:10 -08:00
James Zern
14f6b9f606 mux: light cleanup
- const / move declarations closer to first use
- remove unnecessary ()s
- don't return int unnecessarily with internal Init/Release
- compact some lines

Change-Id: If7ab505e417221debc356f21f075506939110a84
2012-02-14 13:51:41 -08:00
Pascal Massimino
5e96a5dbef add more param checks to WebPPictureDistortion()
and use the proper alpha flag too.

Change-Id: I664c6c9dbcc747495bf20b3da95d00e1120b5baf
2012-02-10 02:52:48 -08:00
pascal massimino
8abaf82083 Merge "silence some type size related warnings" 2012-02-09 19:21:39 -08:00
James Zern
1601a39b09 silence some type size related warnings
size_t/ptrdiff_t -> uint32_t

Change-Id: Ic4d889b9239752311b9ed906c83076829d850874
2012-02-09 13:00:09 -08:00
pascal massimino
f3abe520ac Merge "idec: simplify buffer size calculation" 2012-02-09 01:25:00 -08:00
James Zern
a9c5cd4c97 idec: simplify buffer size calculation
Change-Id: Id0e20c44704ef9b0e14dcf5e71a05cea488fd95a
2012-02-08 14:29:25 -08:00
pascal massimino
7b06bd7fcb Merge "configure/automake: add silent-rules option" 2012-02-08 14:04:12 -08:00
James Zern
e9a7d145e7 Reformat container doc
- split the doc into sections for simple and extended format and move
  example layouts to the end.
- use ASCII tables to describe chunk formats
- attempt to consistently use MUST/SHOULD, etc.
- remove bold from most terms, but add them to definition lists which
  allow for the styling to be changed.

Change-Id: I93c1cd33bde9ccf0b265b202ec4182ce98fd6b48
2012-02-08 11:32:42 -08:00
James Zern
d4e5c7f327 configure/automake: add silent-rules option
Enables --(enable|disable)-silent-rules and make V=[01] to control
compile output. Default is verbose as before.

Change-Id: Id9a65977ac8c719f4d9e3efe386750e520689b76
2012-02-07 18:08:08 -08:00
James Zern
5081db78be configure/automake: no -version-info for convenience libs
Silences:
libtool: link: warning: `-version-info/-version-number' is ignored for
convenience libraries

Change-Id: I5705383b58f529fb06c2bf0932976b5a202446b6
2012-02-07 18:06:20 -08:00
pascal massimino
85b6ff6897 Merge "idec: fix WebPIUpdate failure" 2012-01-31 23:39:02 -08:00
James Zern
7bb6a9ccd6 idec: fix internal state corruption
A call to Append/Update would index the parts_ array w/-1 as num_parts_
had yet to be set by DecodePartition0. This would cause corruption
within the VP8Decoder member.

Fixes issue #106.

Change-Id: Ib9f2811594ff19e948a66fda862a4e0a384bb9aa
2012-01-31 17:10:29 -08:00
James Zern
89cd1bb85b idec: fix WebPIUpdate failure
If the first call to WebPIUpdate contained all of partition 0, but not
enough to decode a macroblock the test for max macro block size could
fail (4096 bytes) due to a memory buffer offset not being updated.
This change offsets the buffer in the same manner as Append().

Fixes issue #105.

Change-Id: I90ca3d0dde92eedc076933b8349d2d297f2469e8
2012-01-31 16:55:10 -08:00
Pascal Massimino
01b6380656 4-5% faster decoding, optimized byte loads in arithmetic decoder.
Bits are loaded 32bits at a time (and often aligned).
Rather 64bit-friendly

Change-Id: If7f67dbe5e37696efbeb6d579d9d8482350b79ee
2012-01-31 02:07:15 -08:00
pascal massimino
631117ea5e Merge "cosmetics & warnings" 2012-01-30 22:04:11 -08: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
Pascal Massimino
f73947f41d use 32bit for storing dequant coeffs, instead of 16b.
is a tad faster

Change-Id: Ibef8f3b4f3f04a9a647098e5946f616e211a61cd
2012-01-29 17:38:37 -08:00
Pascal Massimino
b9600308e8 Merge "store prediction mode array as uint8_t[16], not int[16]." 2012-01-27 07:16:50 -08:00