Commit Graph

109 Commits

Author SHA1 Message Date
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
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
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
28a9d9b41a speed-up GetResidualCost()
+ misc cosmetics and code polishing

Change-Id: I5830cd2f268d64c072b1cbccc0a4674833875055
2012-01-23 02:36:38 -08:00
Pascal Massimino
378086bd0a misc cosmetics
Change-Id: Iafc73f9fece13b5ca900a8b9c1039268872a181b
2012-01-22 23:20:53 -08:00
Pascal Massimino
f0d2c7a76f pass of cosmetics
Change-Id: Id031221b7499e8cfc460c873d0f8124c9bef3aa3
2012-01-17 18:32:27 -08:00
Vikas Arora
221a06bb16 Fix bug for Alpha in RGBA_4444 color-mode.
Fix bug for Alpha data in RGBA_4444 color-mode.
The Alpha data is required to be clipped [0, 15] while
converting from 8 bits to 4 bits.

Change-Id: I80705d575c35121beb9633a05ec8823435c79586
2012-01-09 14:07:30 +05:30
James Zern
ad1e163a0d cosmetics: normalize copyright headers
Change-Id: I5e2462b101e0447a4f15a1455c07131bc97a52dd
2012-01-06 14:49:06 -08:00
James Zern
b1662b0530 fix some more type conversion warnings w/MSVC
API & memory related warnings will be dealt with separately

Change-Id: I8a7893baa4d5035c963fb3c16e0bb4eee742e968
2011-12-21 16:07:16 -08:00
Pascal Massimino
223d8c60aa fix some uint64_t -> int conversion warnings with MSC
Change-Id: I5dc314c9d1a3cbda095be3c90886983500104867
2011-12-21 14:43:52 -08:00
James Zern
421eb99db3 Merge "Remove assigned-but-not-used variable "br"" 2011-12-08 10:41:18 -08:00
Martin Olsson
a5d7ed5c4b Remove assigned-but-not-used variable "br"
Fixes gcc 4.6.x -Wunused-but-set-variable compiler warning:

	libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -Wextra -Wall -Wunused-but-set-variable -MT libwebpdecode_la-idec.lo -MD -MP -MF .deps/libwebpdecode_la-idec.Tpo -c idec.c  -fPIC -DPIC -o .libs/libwebpdecode_la-idec.o
	idec.c: In function 'DecodeRemaining':
	idec.c:371:17: warning: variable 'br' set but not used [-Wunused-but-set-variable]

Change-Id: Ib037be9634b5b802ba9f1e2ef156a8fdf9630752
2011-12-08 15:42:01 +01:00
Pascal Massimino
f62d2c9497 remove unused 'has_alpha' from VP8GetInfo() signature
alpha information is not to be found at RIFF chunks level, not
in the VP8 bitstream (that was a tmp hack)

Change-Id: Idd1629c696b03c26f6f30650d7216f627f1761df
2011-12-08 06:41:40 -08:00
Urvang Joshi
8666a93aae Some bug-fixes for images with alpha.
- Fix the off-by-one diff when cropping with simple-filter.
- Fix a bug in incremental decoding in case of alpha.
- In VP8FinishRow(), do not decode alpha when y_start > y_end.
- Correct output of alpha channel for MODE_ARGB.
- Correct output of alpha channel for MODE_RGBA_4444.

Change-Id: I785763a2a704b973cc742ad93ffbb53699d1fc0a
2011-12-07 15:12:50 +05:30
Pascal Massimino
273a12a013 fix off-by-1 diff in case cropping and simple filtering
Change-Id: I6dea172d0cf129f9986b8a3e1eea85fa97a70402
2011-12-05 08:37:55 -08:00
James Zern
721f3f48e7 fix alpha decode
- remove left-over WEBP_EXPERIMENTAL_FEATURES #ifdef

Change-Id: I2b91ccd2e2b3ebea63d5f698f90206feec30a4db
2011-12-02 11:00:27 -08:00
Pascal Massimino
60942c8cea fix the has_alpha_ order
Change-Id: I26211732584f6181bf763497818b45515e394c21
2011-12-02 10:26:42 -08:00
Vikas Arora
885f25bc83 Updated the includes to relative paths.
Change-Id: I0ea1a59dd0f6cb1df9f41e048e0c5a13e7fb8335
2011-12-01 15:30:41 +05:30
Vikas Arora
d117a94046 Add Alpha Decode support from WebPDecode.
Extend WebP decode functionality to extract Alpha data (support ALPH
chunk) and decode the Alpha plane using Alpha (utils/alpha) core-lib.

Change-Id: I6f0ee1b189c13caba3c1dd9b681383bfd00aa212
2011-12-01 11:24:50 +05:30
pascal massimino
059f03ef99 Merge "dec: validate colorspace before using as array index" 2011-11-17 10:24:59 -08:00
James Zern
469d6eb974 Merge "Makefile.am: remove redundant noinst_HEADERS" 2011-11-16 18:41:55 -08:00
James Zern
9fe3372f19 dec: validate colorspace before using as array index
Change-Id: I5bcf01769d58d39a5f8d50f54cf0cd83a2309602
2011-11-16 18:21:56 -08:00
James Zern
ced3e3f4e0 Makefile.am: remove redundant noinst_HEADERS
When they appear in _SOURCES they won't be installed [1].

[1]: http://www.gnu.org/software/automake/manual/automake.html#Headers

Change-Id: I14fd816294682e7bd0fccefd6428e1526c9470d8
2011-11-11 16:29:32 -08:00
James Zern
964387ed19 use WEBP_INLINE for inline function declarations
removes a #define inline, objectionable in certain projects

Change-Id: Iebe0ce0b25a030756304d402679ef769e5f854d1
2011-11-11 10:53:58 -08:00
Vikas Arora
f07b2138cd Rectify the Chunk parsing logic.
For odd-sized chunk-payload, there's one Byte padding at the end to make the
next chunk start at even-address. The chunk-skip logic needs to be updated to
handle such cases.

Change-Id: I8939ed07584a6195092fbe703eb0ea711fa5f153
2011-10-31 18:47:33 -07:00
Pascal Massimino
42c2e682e0 Fix missing coma (on uncompiled code)
Spotted by Jakub, Thanks!

Change-Id: Ic2509acc683690748089b831ee3d109ad2162dc2
2011-10-27 06:37:36 -07:00
James Zern
563e52d62e cosmetics after '76036f5 Refactor decoder library'
reference 'VP8X' consistently / spelling
sort header size defines alphabetically on their logical boundaries
drop useless cast
const updates

Change-Id: I9409814c5b89773ae8910dc74887f91435e6ac82
2011-09-16 12:32:03 -07:00
Urvang Joshi
76036f547e Refactor decoder library
- Move common defines to dec/webpi.h
 - Regularize naming and parameters of various "CheckAndSkip" functions.
   Also they return VP8StatusCode for clarity.
 - Move WebP header/chunk parsing functions to webpi.h
 - Fix a bug in static function GetFeatures()

Change-Id: Ibc3da4ba210d860551724dc40741959750d66b89
2011-09-16 10:55:24 -07:00
James Zern
0ee683b593 update libtool version-info
consistent with:
  http://www.gnu.org/software/libtool/manual/libtool.html#Versioning

current=2 matches the ABI version for both encode & decode

Change-Id: Ie175b2bdb8f5e14690f4cf6357fc0e0c6c78fe7d
2011-09-13 15:49:13 -07:00
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
ee697d9fc9 harmonize the include guards and #endif comments 2011-09-13 15:31:52 -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
Pascal Massimino
812dfa1ae1 bump up versions in preparations for 0.1.3
Change-Id: Icbadada515a5be7810473ff530565c2cb4fb904d
2011-08-29 22:52:47 -07:00
James Zern
7c43663036 Silence some (more) Visual Studio warnings.
Change-Id: Idac44feac894ab13630e032222c4744d6fa785df
2011-08-29 18:08:26 -07:00
James Zern
c7e86abab6 cosmetics: fix comment line lengths
add additional '-' to //----... style comments globally instead of
polluting further commits

Change-Id: I951acc68b7b5384b4d6e235349b0067d1aa6fa8b
2011-08-26 12:19:33 -07:00
Pascal Massimino
dfcc2136e1 reorganize chunk-parsing code
make room for future VP8X extensions

Change-Id: Ic78217c26f142403b733740b17980aa81602f83d
2011-08-18 11:07:13 -07:00
Pascal Massimino
3cf2030653 initialize pointers to function within VP8DspInit()
makes testing easier, allowing a reset to C-version

Change-Id: I707d8338fedff4ae993e52eefe730c236ca3dcb5
2011-08-18 10:03:19 -07:00
James Zern
d21b479581 Merge "windows: add decode threading support" 2011-08-05 16:31:50 -07:00
James Zern
473ae95324 fix hang on thread creation failure
with assertions enabled the code would abort in
WebPWorkerChangeState with:
Assertion `worker->status_ >= OK'

without them the code would hang in the _cond_wait.

this change makes WebPWorkerChangeState a no-op in this case.

Change-Id: Iea855568bbdef2865ae61ab54473b3a7c230e91a
2011-08-05 15:01:16 -07:00
James Zern
fccca4202f windows: add decode threading support
Change-Id: Iad923550569ceec1ff469852ec68e66de3f6062b
2011-08-05 12:28:40 -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
Pascal Massimino
acd8ba4229 io->teardown() was not always called upon error
Change-Id: I8317139b583124fc20754b9b19aa4dba51cd05af
2011-07-20 07:49:57 -07:00