Commit Graph

2158 Commits

Author SHA1 Message Date
Pascal Massimino
45fbeba5cd Merge "Do token recording and counting in a single loop" 2016-07-20 13:07:41 +00:00
James Zern
ad497fbce3 move src/extras to the top-level
reserve src/ for the code of the main libraries: libwebp, libwebpdemux
and libwebpmux

+ demote this library to internal only; i.e., don't install the header +
lib with make install

Change-Id: I8c9844db8f494be0fa0a2549a5b75b5cebcf666d
2016-07-19 17:23:17 -07:00
hui su
0c0fb83211 Do token recording and counting in a single loop
Change-Id: I8afd3c486b210bd67888de03e91dde7f78276f89
2016-07-19 16:28:26 -07:00
Parag Salasakar
9ac74f922e Add MSA optimized rescaling functions
We add the following MSA optimized rescaling functions:
- RescalerExportRowExpand
- RescalerExportRowShrink

Change-Id: Ic1c76065423b02617db94cf0c22bb564219b36e6
2016-07-19 15:52:42 +00:00
Parag Salasakar
cb19dbc1a4 Add MSA optimized color transform functions
We add the following MSA optimized color transform functions:
- TransformColor
- SubtractGreenFromBlueAndRed

Change-Id: Ib182d2b5faa7191f503ce70f0dfde0ac89402fd3
2016-07-18 13:49:24 +00:00
Urvang Joshi
3f4042b52a WebPAnimEncoder: If 'minimize_size' and 'allow_mixed' on, try lossy + lossless.
This improves compression by ~5% at default quality.

If only 'allow_mixed' is on (but 'minimize_size' isn't), we continue to
use a heuristic to try one of the two or both.

Change-Id: Ia573a73ea26ad25f9debff759eed69d2b0449e82
2016-07-15 16:56:20 -07:00
James Zern
5e2eb89e1f cosmetics,dsp/*msa.c: associate '*' with the type
not the variable

Change-Id: If5823e9731c406655eaf1dc1aaa2e6554ca7daad
2016-07-15 15:40:41 -07:00
skal
5b60db5c9d FastMBAnalyze() for quick i16/i4 decision
The decision is based on the variance between DC values of each
sub-4x4 block. This heuristic is rather ok for predicting whether
the 2nd transform (intra-16) is going to help or not.
The decision threshold varies with quality (=quantization).

It's only used for -m 0 and -m 1, where no full RD-opt is performed.
It actually makes these modes quite faster, with RD curve much
closer to the -m 2 mode.

Change-Id: I15f972db97ba4082cbd1dfd16bee3eb2eca701a8
2016-07-15 11:21:08 -07:00
Parag Salasakar
567e697776 Add MSA optimized CollectHistogram function
We add the following MSA optimized encoder Histogram function:
- CollectHistogram

Change-Id: I28415704ec62c3ad375de06eeef468d9f514bb2d
2016-07-15 22:51:33 +05:30
Parag Salasakar
c54ab8dd1a Add MSA optimized quantization functions
We add the following MSA optimized encoder quantization functions:
- QuantizeBlock
- Quantize2Blocks

Change-Id: Ie32b442afa99eee62d2ef48942b41116a4e157d3
2016-07-15 15:33:47 +00:00
Pascal Massimino
ec6f68c51e Merge "Remove QuantizeBlockWHT() in enc.c" 2016-07-14 18:59:08 +00:00
Vincent Rabaud
2a5c417c68 Apply the RLE heuristic to LZ77.
Change-Id: I7317eed7e017ee8981f40fcf1737f97e0e3a238c
2016-07-14 20:12:48 +02:00
hui su
91b59e886b Remove QuantizeBlockWHT() in enc.c
QuantizeBlockWHT() is basically identical to QuantizeBlock(),
no need to keep two copies.

Change-Id: I970cb6948da1c750c1339971a55e3b40765cdd01
2016-07-14 10:44:18 -07:00
Parag Salasakar
fe57273736 Add MSA optimized SSE functions
We add the following MSA optimized encoder SSE functions:
- SSE16x16
- SSE16x8
- SSE8x8
- SSE4x4

Change-Id: I9ef9e903019337d9975c83264a652a7282bf5d5b
2016-07-14 15:43:23 +05:30
James Zern
6b53ca876e cosmetics,(dec|enc)_sse2.c: fix indent
Change-Id: Ic3326136ddd325e911e96c2e5a7f06b3e1d60f66
2016-07-13 16:11:29 -07:00
Pascal Massimino
b15d00d996 Merge "Add MSA optimized encoder IntraChromaPreds function" 2016-07-13 14:54:28 +00:00
Parag Salasakar
afe3cec813 Add MSA optimized encoder IntraChromaPreds function
We add the following MSA optimized intrapred chroma function:
- IntraChromaPreds

Change-Id: I051cd174f5ce675aeb94e648d52c5a340a133ed4
2016-07-13 18:13:51 +05:30
skal
fc8cad9f29 reduce the number of malloc/free cycles in huffman.c
pre-allocating a sorted[] array for most common cases of small
alphabet size cuts a lot of traffic.

Change-Id: I73ff2f6e507f81b0b0bb7d9801a344aa4bcb038a
2016-07-12 12:06:31 -07:00
Parag Salasakar
7b4b05e0dc Add MSA optimized encoder Intra16Preds function
We add the following MSA optimized intrapred 16x16 function:
- Intra16Preds

Change-Id: I89a249e041fbed377cb6a328c0b973add335b980
2016-07-12 14:30:03 +05:30
Parag Salasakar
c18787a0e9 Add MSA optimized encoder Intra4Preds function
We add the following MSA optimized intrapred 4x4 function:
- Intra4Preds

Change-Id: Icf325f3dcbf98bb6210811b666ce632cae575b22
2016-07-12 04:36:56 +00:00
Pascal Massimino
bbb6ecd9b0 Merge "Add MSA optimized distortion functions" 2016-07-07 08:59:40 +00:00
Parag Salasakar
7915396f40 Add MSA optimized distortion functions
We add the following MSA optimized distortion functions:
- Disto4x4
- Disto16x16

Change-Id: I0a545ed0182ea56a0d5f358639f6671c2c21b95c
2016-07-07 07:30:22 +00:00
James Zern
c0991a141f io,EmitRescaledAlphaYUV: factor out a common expr
+ s/src_a/dst_a/
+ remove unnecessary (void) as expected_num_lines_out is used within the
  function

Change-Id: Ic45f798ef22bd19eaabf1a0512d1cf8a201bb4b5
2016-07-06 20:38:55 -07:00
James Zern
bfef6c9f82 libwebp-0.5.1
- 6/14/2016: version 0.5.1
   This is a binary compatible release.
   * miscellaneous bug fixes (issues #280, #289)
   * reverted alpha plane encoding with color cache for compatibility with
     libwebp 0.4.0->0.4.3 (issues #291, #298)
   * lossless encoding performance improvements
   * memory reduction in both lossless encoding and decoding
   * force mux output to be in the extended format (VP8X) when undefined chunks
     are present (issue #294)
   * gradle, cmake build support
   * workaround for compiler bug causing 64-bit decode failures on android
     devices using clang-3.8 in the r11c NDK
   * various WebPAnimEncoder improvements
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXfb1vAAoJEPnD1r24IytdtbwP/iCCEEU9scepXgh9+ICUOm1D
 6ASfz6eTYIPP4s2E+kIJKrKeGUrk7U1j6BeehjKxS3vMQxQlJvkXvepk0mdJUO4C
 okttfLahLY6DOZSAETK9SI4haE2Uuz5WGfxMe8x+4uuZZTxSLHqOCFMvU2oxo6uM
 rhErJgH3jWE9vGV9OuI8YUa109qGi8PLtErrFjXqFmAvnxJS95kJHr3MHVoulH8g
 tXrSUYTq37BCfSsxudhZTCENLhYqlXHO5tydvQVAlVbXJfpOsNLQciWUrqFiPuB9
 qhUv3smRV9YBd4XuUgFWLQcbcecQVBzIqxJ7lv41R71vi17Lu4plLjNAc0Cx70qc
 cnfe/acH+9hX0EwBzpvOpN/Lzirx1tmBKPOqnSiFpFP48RZSngLMG0mwhUufyq1I
 y6T2rEcMLRbAX/85sGMRd1AwffoW6OvgPG2LdhW2bh8u9YbA/g3qGH98z2T1JKjy
 V/TNvpTjXAdZ5XQMY8zIunv83Wp/6AWmJIRWZ+mfhw29F/F80HQG2Ss7dulbe3m2
 zpBjxdsaLj+9iZpheewrGGImZ5mJQsG7nRovtQ0VARVaRSY3xpaYug2CqXlQQ2bc
 bjdmGS9u+a4fHdk+uKTMzJEbu4RbXcOeLrvpzA+PxhUQi9WRyLIucIWeVVEDiUI2
 p7OJop9JmPjkRvvqfi5y
 =Mchr
 -----END PGP SIGNATURE-----

Merge tag 'v0.5.1'

libwebp-0.5.1
- 6/14/2016: version 0.5.1
  This is a binary compatible release.
  * miscellaneous bug fixes (issues #280, #289)
  * reverted alpha plane encoding with color cache for compatibility with
    libwebp 0.4.0->0.4.3 (issues #291, #298)
  * lossless encoding performance improvements
  * memory reduction in both lossless encoding and decoding
  * force mux output to be in the extended format (VP8X) when undefined chunks
    are present (issue #294)
  * gradle, cmake build support
  * workaround for compiler bug causing 64-bit decode failures on android
    devices using clang-3.8 in the r11c NDK
  * various WebPAnimEncoder improvements

* tag 'v0.5.1': (30 commits)
  update ChangeLog
  Clarify the expected 'config' lifespan in WebPIDecode()
  update ChangeLog
  Fix corner case in CostManagerInit.
  gif2webp: normalize the number of .'s in the help message
  vwebp: normalize the number of .'s in the help message
  cwebp: normalize the number of .'s in the help message
  fix rescaling bug: alpha plane wasn't filled with 0xff
  Improve lossless compression.
  'our bug tracker' -> 'the bug tracker'
  normalize the number of .'s in the help message
  pngdec,ReadFunc: throw an error on invalid read
  decode.h,WebPGetInfo: normalize function comment
  Inline GetResidual for speed.
  Speed-up uniform-region processing.
  free -> WebPSafeFree()
  DecodeImageData(): change the incorrect assert
  Fix a boundary case in BackwardReferencesHashChainDistanceOnly.
  Make sure to consider small distances in LZ77.
  add some asserts to delimit the perimeter of CostManager's operation
  ...

Change-Id: I44cee79fddd43527062ea9d83be67da42484ebfc
2016-07-06 19:31:27 -07:00
Pascal Massimino
deb54d915a Clarify the expected 'config' lifespan in WebPIDecode()
Change-Id: I08c880adc34d651a63fa2d07cfb07b1468a6df1b
2016-07-06 17:17:15 -07:00
Parag Salasakar
435308e029 Add MSA optimized encoder transform functions
We add the following MSA optimized encoder transform functions:
- ITransform
- FTransform
- FTransformWHT

Change-Id: Ia6b17556aba5aff2d7a88208905fb45293d080a8
2016-07-05 14:35:47 +00:00
Parag Salasakar
dce64bfa1b Add MSA optimized alpha filter functions
We add the following MSA optimized alpha filter functions:
- HorizontalFilter
- VerticalFilter
- GradientFilter

Change-Id: I71e2e04050e569b8c0bf086fadf210ee16d50924
2016-07-01 19:58:25 +00:00
Parag Salasakar
429120d0af Add MSA optimized color transform functions
We add the following MSA optimized color transform functions:
- AddGreenToBlueAndRed
- TransformColorInverse

Change-Id: Iceab3813905955aa8b811253df9188512fc7de3f
2016-06-28 20:36:21 +05:30
Pascal Massimino
55b2fede7f normalize the macros' "do {...} while (0)" constructs
(so we're no longer bitten by the extra ';' problem!)

Change-Id: Icf849c97df9a7af135ba15a7906fc28590d7ce77
2016-06-27 15:30:05 -07:00
Parag Salasakar
701c772eed Add MSA optimized colorspace conversion functions
We add the following MSA optimized colorspace conversion functions:
- ConvertBGRAToRGBA
- ConvertBGRAToBGR
- ConvertBGRAToRGB

Change-Id: I76db1c829d593a06d4975d54dbafa385c82b84fb
2016-06-27 21:19:06 +00:00
Vincent Rabaud
c7eb06f737 Fix corner case in CostManagerInit.
Change-Id: I91795d05eb78816d6d9a8cadc64d3814650d2aee
2016-06-27 20:01:44 +02:00
Pascal Massimino
f918cb1013 fix rescaling bug: alpha plane wasn't filled with 0xff
(in case no alpha was present in the source .webp,
but user requested some)

Change-Id: I9011d38237907c60d6796a86bd2c72166aa80f27
(cherry picked from commit 06a38c7b1c)
2016-06-27 10:48:31 -07:00
Pascal Massimino
06a38c7b1c fix rescaling bug: alpha plane wasn't filled with 0xff
(in case no alpha was present in the source .webp,
but user requested some)

Change-Id: I9011d38237907c60d6796a86bd2c72166aa80f27
2016-06-24 17:15:31 +02:00
Vincent Rabaud
319e37be13 Improve lossless compression.
This is essentially a revert of a3611513d2
and cfbcc5ece0.
Here is what happened: there was a corruption bug that eventually
got fixed by 0174d18d8b.
But before finding the root, a3611513d2
and cfbcc5ece0 hid the bug
by not imposing length of 1 when it was actually 2 or 3 (which does help
compression as a litteral is more efficient than an offset and a length
of size 2 or 3).

Change-Id: I6f18fc1f583a51ac9d8aab2508458264047cd493
2016-06-24 16:11:25 +02:00
Parag Salasakar
6a19793777 Add MSA optimized intra pred chroma functions
We add the following MSA optimized intra pred chroma functions:
- DC8uv
- TM8uv
- VE8uv
- HE8uv
- DC8uvNoTop
- DC8uvNoLeft
- DC8uvNoTopLeft

Change-Id: I48ad2409f334371acd38f4a70626ebcf2e10f4fe
2016-06-24 08:45:29 +00:00
Parag Salasakar
293d786f31 Added MSA optimized intra prediction 16x16 functions
1. DC16
2. TM16
3. VE16
4. HE16
5. DC16NoTop
6. DC16NoLeft
7. DC16NoTopLeft

Change-Id: I53c57c27cee40973b7ee40a7b7a7fbf0df812d1a
2016-06-23 13:09:02 +00:00
Parag Salasakar
0afa0ce2ff Added MSA optimized intra prediction 4x4 functions
1. DC4
2. TM4
3. VE4
4. RD4
5. LD4

Change-Id: Ib73131f9174aac13443160d2c2add1af90a3bd45
2016-06-23 10:49:34 +00:00
Parag Salasakar
a6621bacf3 Added MSA optimized simple edge filtering functions
1. SimpleVFilter16
2. SimpleHFilter16
3. SimpleVFilter16i
4. SimpleHFilter16i

Change-Id: Ib330e01960623aeeed1bdb5bc8155cc6657556f9
2016-06-23 06:52:01 +00:00
James Zern
38063af131 decode.h,WebPGetInfo: normalize function comment
use true/false to match the documentation of other functions.

Change-Id: If059f8fb6d771a165e4682495fd8881b3dc0670f
2016-06-22 15:20:47 -07:00
Parag Salasakar
1ebf193c2c Added MSA optimized chroma edge filtering functions
1. VFilter8
2. HFilter8
3. VFilter8i
4. HFilter8i

Change-Id: Iea5f0107178809dc31f3d9ba817e2474bd73fc0a
2016-06-22 13:51:29 +00:00
Parag Salasakar
9ad2352d0d Merge "Added MSA optimized edge filtering functions" 2016-06-22 10:45:15 +00:00
Parag Salasakar
607510967f Added MSA optimized edge filtering functions
1. VFilter16
2. HFilter16
3. VFilter16i
4. HFilter16i


Change-Id: I6a302c5ab40329c9e9bd1501a611d7267a983d81
2016-06-22 09:35:49 +00:00
Vincent Rabaud
9e8e1b7b2a Inline GetResidual for speed.
Change-Id: Ib4228e87dc448866229c0795ca68dabe777ef31c
2016-06-21 16:04:53 +02:00
Vincent Rabaud
7d58d1b7b9 Speed-up uniform-region processing.
Change-Id: I9a88d0ac97c31d19323c9505ebe21f375d2e96b8
2016-06-21 15:45:46 +02:00
Pascal Massimino
8ec7032bc2 simplify HistogramCombineEntropyBin()
We only perform a single pass, and swap the final histograms
into the beginning of the array as we go. Therefore, they are
already at the correct place at the end of the pass.
-> HistogramCompactBins() is removed, we just truncate the array.

output is bitwise the same.

Change-Id: I9508c96dda0f8903c927a71b06af4e6490c3249c
2016-06-21 14:13:36 +02:00
Pascal Massimino
23e29cb1e3 Merge "Fix a boundary case in BackwardReferencesHashChainDistanceOnly." into 0.5.1 2016-06-20 16:06:39 +00:00
Pascal Massimino
472a049b4e remove bin_map[] allocation altogether
... and just re-use histogram_symbols[] instead!
It's guaranteed to work.

Change-Id: Ie3b0cd5781171ded20058e8bc143fce2f69b4c68
2016-06-20 11:19:25 +02:00
Pascal Massimino
0bb23b2cf7 free -> WebPSafeFree()
avoids unbalanced memory track at the end (w/ PRINT_MEM_INFO flag on)

Change-Id: I70da087f079198bcaacd0c81593f104058dcac69
2016-06-17 17:49:07 +02:00
Pascal Massimino
a977b4b513 Merge "rewrite the bin_map clustering to use less memory" 2016-06-17 08:25:35 +00:00
Pascal Massimino
3591ba6684 rewrite the bin_map clustering to use less memory
output should bit-write the same as before, in both
low_effort and non low_effort modes.

if anything, speed is a tad faster, probably because of the
reduced memory traffic.

Change-Id: Iaa2ddcfda2aaffefe7e5b7bc89216373d1ddb194
2016-06-17 09:52:36 +02:00