Commit Graph

3147 Commits

Author SHA1 Message Date
Vincent Rabaud
696eb2b03a fix C and SIMD flags completion.
CMAKE_C_FLAGS is handled as a string and not a list by CMake.

Change-Id: Ia0cfb38817edef2f212a04b26601f6aea76a5684
2016-02-17 09:10:04 +01:00
Pascal Massimino
2b4fe33e00 Merge "fix multiple allocation for transform buffer" 2016-02-17 07:27:23 +00:00
Pascal Massimino
2f5e8986cf fix multiple allocation for transform buffer
We were not updating the current_width_, which is usually
not a problem, unless we use Delta Palette with small number
of colors
-> Addressed this re-entrancy problem by checking we have
enough capacity for transform buffer.

The problem is not currently visible, until we restrict
the number of gradient used in delta-palette to less than 16.
Then the buffers have different current_width_ and the problem
surfaces.

Change-Id: Icd84b919905d7789014bb6668bfb6813c93fb36e
2016-02-17 06:14:39 +01:00
Vincent Rabaud
bf2b4f114f Regroup common SSE code + optimization.
The transpose refactoring will help removing a transpose in a
later CL.

The horizontal add function helps removing a _mm_sad_epu8 in DC8uv
=> the latency/throughput went from 29/25 to 23/19

Change-Id: I5f3dfd4aad614eb079b1e83631e6a7cef49a3766
2016-02-16 18:34:34 +01:00
Pascal Massimino
4ed650a13d force "-pass 6" if -psnr or -size is used but -pass isn't.
This is to prevent users shooting in the foot using -psnr or
-size alone and not getting the expected result.

Change-Id: I67a3289e4ec0a2a813c98807f2ec5e600f52dc63
2016-02-13 10:22:32 +01:00
Nico Weber
3ef1ce98b9 yuv_sse2: fix -Wconstant-conversion warning
'implicit conversion from 'int' to 'short' changes value from 33050 to
-32486'

original patch:

https://codereview.chromium.org/1657313003/

Make libwebp build with -Wconstant-conversion from newer clangs.

After http://llvm.org/viewvc/llvm-project?rev=259271&view=rev, clang
points out that _mm_set1_epi16(33050) causes an overflow in the short
argument to _mm_set1_epi16().  Since there's no version that takes an
unsigned short, add an explicit cast to tell the compiler that this is
intentional.

No behavior change.

Change-Id: I6b4e3401b15cfbcc895f9e81b5c2dc59d43ffb9b
2016-02-02 14:52:11 -08:00
James Zern
a7a03e9f96 Merge changes I4852d18f,I51ccb85d
* changes:
  gif2webp: set enc_options.verbose = 0 w/-quiet
  anim_encode,DefaultEncoderOptions: init verbose
2016-02-02 01:49:12 +00:00
James Zern
5e122bd6d6 gif2webp: set enc_options.verbose = 0 w/-quiet
Change-Id: I4852d18f7c04f1f48684459f0ac5b002a8c2f27b
2016-02-01 17:00:51 -08:00
James Zern
ab3c2583aa anim_encode,DefaultEncoderOptions: init verbose
default to disabled

broken since:
c13245c AnimEncoder: Add a GetError() method.

Change-Id: I51ccb85d5df338570512ec1d7430ad3229f93a9f
2016-02-01 17:00:19 -08:00
James Zern
8f0dee773a Merge "configure: fix builtin detection w/-Werror" 2016-01-30 05:11:19 +00:00
James Zern
4a7b85a967 cmake: fix builtin detection w/-Werror
and other warnings enabled (-Wunused-value)

Change-Id: Ie3605628b4cbfb5bfd1e847cc504cb96f2825388
2016-01-28 23:47:11 -08:00
James Zern
b74657fb2e configure: fix builtin detection w/-Werror
and other warnings enabled (-Wunused-value)

Change-Id: Ic0080d559366a5254d0fa3ba939150445157087f
2016-01-28 23:45:35 -08:00
Vincent Rabaud
3661b98069 Add a CMakeLists.txt
The goal is not to replace our autotools configuration, but to
provide a minimal CMake file that can build the lib, cwebp and
dwebp.

Change-Id: I3be343bd698d118c5f00172449d232d87e868f23
2016-01-28 01:30:59 +01:00
Pascal Massimino
75f4af4d54 remove useless #include
Change-Id: Id34f12ec94d8be6853fabd67609a6006ac99f152
2016-01-25 09:34:10 -08:00
Pascal Massimino
6c1d763119 avoid Yoda style for comparison
Change-Id: I8ff9f96951e5e8a619f7132455dd281cbf91aa4d
2016-01-15 23:52:29 -08:00
Vincent Rabaud
8ce975ac82 SSE optimization for vector mismatch.
Change-Id: I564b822033b59d86635230f29ed6197e306a2c4f
2016-01-07 18:23:45 +01:00
James Zern
7db53831a9 libwebp-0.5.0
- 12/17/2015: version 0.5.0
   * miscellaneous bug & build fixes (issues #234, #258, #274, #275, #278)
   * encoder & decoder speed-ups on x86/ARM/MIPS for lossy & lossless
     - note! YUV->RGB conversion was sped-up, but the results will be slightly
       different from previous releases
   * various lossless encoder improvements
   * gif2webp improvements, -min_size option added
   * tools fully support input from stdin and output to stdout (issue #168)
   * New WebPAnimEncoder API for creating animations
   * New WebPAnimDecoder API for decoding animations
   * other API changes:
     - libwebp:
       WebPPictureSmartARGBToYUVA() (-pre 4 in cwebp)
       WebPConfig::exact (-exact in cwebp; -alpha_cleanup is now the default)
       WebPConfig::near_lossless (-near_lossless in cwebp)
       WebPFree() (free'ing webp allocated memory in other languages)
       WebPConfigLosslessPreset()
       WebPMemoryWriterClear()
     - libwebpdemux: removed experimental fragment related fields and functions
     - libwebpmux: WebPMuxSetCanvasSize()
   * new libwebpextras library with some uncommon import functions:
     WebPImportGray/WebPImportRGB565/WebPImportRGB4444
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWes+OAAoJEPnD1r24IytdE5UP/1SiiepxgmDB2zV1gvPOzFM6
 r+ezjDwTsJE7wQxjPjOEP/tOSCmMqs4CgA5B1nhu5df6sewOTq4OMALnoER2zTIq
 qdb70auok4OyrHw33TINApRWJ2jUUJIJUsG4s82+Nsl7Sn6Xt8eLKRcJziZGNuSQ
 y1TUuGYJujkSc1ZKYhEYXqxFK2V9UDPY+4lsNfmMloX5fKoPKhRNhvadOiWYat7R
 SDyV0taIofjRl0WBCp3yhUn7aIkp6W5Ipdeitb1TTc4OpPKKRwib8kafQfZ/w9OV
 KxBngZoaUtwtCs4XT+lJmulEWDX12FbfHcL8Fz74uA/0qF3HvvWCPxrkz8TpvwfV
 zvT3p/C0Hiz0/J+EdW4qr1/Y0qVZ7OHfsRR6TbUZkEhnbnn4O8orm9CHKw48IvuP
 70MaAaAlIFR9XBu+vo7r5+6FuT9d/XhkaWhcxROR63xWpzL1glHcGJWB92OsdOlF
 rcdN7epqdfFhXcKCWXaluRGdpBgk7AtymaWEthdmPKQ9CMUaLPQQra0IRUMbRih2
 e7zJafhSg1TM7v2VEFqOjSkkyYr/Zcp4uc5lVj7nWeiP+R4VlsGCcz61LDNDsMoD
 MS0A1EdPE92B1F55se5WL8uBdk6DLJwjFm+QDQN26Flpr9kKYocFrsuNu8Xp1b3l
 6q1+Cw6I+YtO+8SAuFrk
 =5v3s
 -----END PGP SIGNATURE-----

Merge tag 'v0.5.0'

libwebp-0.5.0
- 12/17/2015: version 0.5.0
  * miscellaneous bug & build fixes (issues #234, #258, #274, #275, #278)
  * encoder & decoder speed-ups on x86/ARM/MIPS for lossy & lossless
    - note! YUV->RGB conversion was sped-up, but the results will be slightly
      different from previous releases
  * various lossless encoder improvements
  * gif2webp improvements, -min_size option added
  * tools fully support input from stdin and output to stdout (issue #168)
  * New WebPAnimEncoder API for creating animations
  * New WebPAnimDecoder API for decoding animations
  * other API changes:
    - libwebp:
      WebPPictureSmartARGBToYUVA() (-pre 4 in cwebp)
      WebPConfig::exact (-exact in cwebp; -alpha_cleanup is now the default)
      WebPConfig::near_lossless (-near_lossless in cwebp)
      WebPFree() (free'ing webp allocated memory in other languages)
      WebPConfigLosslessPreset()
      WebPMemoryWriterClear()
    - libwebpdemux: removed experimental fragment related fields and functions
    - libwebpmux: WebPMuxSetCanvasSize()
  * new libwebpextras library with some uncommon import functions:
    WebPImportGray/WebPImportRGB565/WebPImportRGB4444

* tag 'v0.5.0':
  update ChangeLog
  faster rgb565/rgb4444/argb output
  update NEWS
  update AUTHORS
  update mailmap
  bump version to 0.5.0
  README: update help text, repo link

Change-Id: I21dc611cfd2a3cb6ed6ba5c455a5049fe615f7a1
2015-12-23 11:20:42 -08:00
James Zern
37f049490d update ChangeLog
Change-Id: I1df7a610c466eb1cfc675e030c12fcff21f57c1b
2015-12-18 00:04:24 -08:00
Pascal Massimino
7e7b6ccc7f faster rgb565/rgb4444/argb output
SSE2 and NEON implementation.

Change-Id: I342a1c3d84937b8497f0aaecb7ce9bdb7f50296b
2015-12-17 23:38:58 -08:00
James Zern
4c7f565ff0 update NEWS
Change-Id: I2000d5e7331cba4cb76648df5f16043f48ec622a
2015-12-17 23:25:23 -08:00
James Zern
1f62b6b2e6 update AUTHORS
Change-Id: Ieb8e8b98c82be3d5084915ca0cbd9997117d05ab
2015-12-17 19:45:14 -08:00
James Zern
e224fdc80b update mailmap
Change-Id: I32af2b1bcdc818d3664ef36f548951d07c35c035
2015-12-17 19:45:14 -08:00
James Zern
71100500a8 bump version to 0.5.0
libwebp{,decoder} - 0.5.0
libwebp libtool - 6.0.0
libwebpdecoder libtool - 2.0.0

mux/demux - 0.3.0
libtool - 2.0.0

Change-Id: I5346d13eb827fb5890efbb63ff3f28cea9d0c55f
2015-12-17 19:45:14 -08:00
James Zern
230a685ea7 README: update help text, repo link
Change-Id: Iebcd05932572908abe4fcd0bb39a04dde9325199
2015-12-17 19:45:14 -08:00
James Zern
d48e427b1d Merge "demux: accept raw bitstreams" 2015-12-17 22:52:10 +00:00
James Zern
99a01f4f8b Merge "Unify some entropy functions." 2015-12-17 22:35:29 +00:00
James Zern
4b025f10f7 Merge "configure: disable asserts by default" 2015-12-17 22:28:37 +00:00
James Zern
92cbddf89c Merge "fix PrintBlockInfo()" 2015-12-17 21:00:57 +00:00
Vincent Rabaud
ca509a3362 Unify some entropy functions.
The code and logic is unified when computing bit entropy + Huffman cost.

Speed-wise, we gain 8% for lossless encoding.
Logic-wise, the beginning/end of the distributions are handled properly
and the compression ratio does not change much.

Change-Id: Ifa91d7d3e667c9a9a421faec4e845ecb6479a633
2015-12-17 17:00:08 +01:00
Pascal Massimino
367bf903b3 fix PrintBlockInfo()
... which has gone out of sync since the last block-cache layout change.

Change-Id: Ic441ec07b0198b508ce3fd34ab582cb60b1daabc
2015-12-17 15:47:25 +01:00
Pascal Massimino
b0547ff0b4 move back common constants for lossless_enc*.c into the .h
Change-Id: I11bc979db691f6518d85e2e1c3ac7f05d69681b0
2015-12-17 15:11:56 +01:00
Lode Vandevenne
fb4c7832f1 lossless: simpler alpha cleanup preprocessing
setting all transparent pixels to black rather than the "flatten" method.

0.3% smaller filesize on the 1000 PNGs if alpha cleanup is used (before: 18685774, after: 18622472)

Change-Id: Ib0db9e7ccde55b36e82de07855f2dbb630fe62b1
2015-12-17 15:04:50 +01:00
Pascal Massimino
ba7f4b68c9 Merge "anim_diff: add brief description of options" 2015-12-17 10:03:15 +00:00
Vincent Rabaud
47ddd5a4cc Move some codec logic out of ./dsp .
The functions containing magic constants are moved out of ./dsp .
VP8LPopulationCost got put back in ./enc
VP8LGetCombinedEntropy is now unrefined (refinement happening in ./enc)
VP8LBitsEntropy is now unrefined (refinement happening in ./enc)
VP8LHistogramEstimateBits got put back in ./enc
VP8LHistogramEstimateBitsBulk got deleted.

Change-Id: I09c4101eebbc6f174403157026fe4a23a5316beb
2015-12-17 07:03:25 +00:00
James Zern
b4106c44b0 anim_diff: add brief description of options
Change-Id: I193d3d94704c008edea7ae40349a8fbff2b5ede6
2015-12-16 20:36:15 -08:00
James Zern
357f455dec yuv_sse2: fix 32-bit visual studio build
src\dsp\yuv_sse2.c : C2719: 'in': formal parameter with
  __declspec(align('16')) won't be aligned
src\dsp\yuv_sse2.c : C2719: 'out': formal parameter with
  __declspec(align('16')) won't be aligned

Change-Id: Ifd79e33b35c70748faff19cd64eba4a8ffce5a5a
2015-12-16 15:04:36 -08:00
James Zern
b9d80fa4e8 configure: disable asserts by default
--enable-asserts can be used to avoid defining NDEBUG

Change-Id: I6216668e3f79f69bd8c453f0b36cecb3b585688e
2015-12-16 13:15:53 -08:00
Pascal Massimino
7badd3da4a cosmetic fix: sizeof(type) -> sizeof(*var)
Change-Id: I1a39fccfdcb9f0a4b9b025d3c9b522e8edfe7fd6
2015-12-16 18:29:14 +01:00
Vincent Rabaud
80ce27d34e Speed up 24-bit packing / unpacking in YUV / RGB conversions.
This implementation brings:
- an SSE implementation of packing / unpacking
- bigger buffers processed at the same time
The speedup is of 4% on lossy decoding (YUV to RGB), 0.5% on
lossy encoding (RGB to YUV was already optimized).

Change-Id: Iec677ee17f91c08614d1adab67c6df551925767f
2015-12-16 11:06:42 +01:00
Pascal Massimino
68eebcb0ff remove a TODO about rotation
(won't happen yet)

Change-Id: Ibb4ceccd1d7af0f76594e71062983dc311ba9aa2
2015-12-15 23:36:12 -08:00
Pascal Massimino
2dee2966df remove few obsolete TODO about aligned loads in SSE2
Change-Id: I3628602942ea2ce34dbcb85975d15afc1041f76c
2015-12-15 23:00:41 -08:00
Pascal Massimino
e0c0bb3480 remove TODO about unused ref_lf_delta[]
Change-Id: I54983c0dfc6927564143bad56bd2e4c4cdfefc0e
2015-12-15 22:57:53 -08:00
Pascal Massimino
9cf1cc2bd6 remove few TODO:
* 256 -> RD_DISTO_MULT
  * don't use TDisto for UV mode picking

Change-Id: I243148c716fe688b5c1b1fb9b7a6e58d0b5e6835
2015-12-15 22:52:12 -08:00
James Zern
791896455a Merge changes from topic 'demux-fragment-cleanup'
* changes:
  demux: remove GetFragment()
  demux: remove dead fragment related TODO
  demux, Frame: remove is_fragment_ field
  demux,WebPIterator: remove fragment_num/num_fragments
  demux: remove WebPDemuxSelectFragment
2015-12-16 06:45:00 +00:00
James Zern
47399f92b0 demux: remove GetFragment()
Change-Id: Ibea117b64ca91ccafde80411c10e0035dc3247f3
2015-12-15 19:26:13 -08:00
James Zern
d3cfb79ad6 demux: remove dead fragment related TODO
Change-Id: Iea6bf4742f803af46cd18f5d26843548e1b5cf00
2015-12-15 17:44:17 -08:00
James Zern
ab714b8ac4 demux, Frame: remove is_fragment_ field
this hasn't been set since parsing of the experimental chunk was
removed.
+ cleanup IsValidExtendedFormat(). is_fragmented has caused immediate
  failure since:
  4e2589f demux: restore strict fragment flag check

Change-Id: If9ecfc19556297100a6d5de1ba2cffdcbdc6c8fd
2015-12-15 17:43:23 -08:00
James Zern
b105921c7d yuv_sse2, cosmetics: fix indent
+ remove unneeded header

Change-Id: I3247378fd3315d95bb3345625d3575aa9e05c1b8
2015-12-15 17:29:04 -08:00
James Zern
466c92e829 demux,WebPIterator: remove fragment_num/num_fragments
these are remnants of an unused experiment

Change-Id: Ia08f9e6a895d5afff41a49f6e680fd76f024a5ee
2015-12-15 14:06:34 -08:00
James Zern
11714ff158 demux: remove WebPDemuxSelectFragment
this never had any affect, fragments were an abandoned experiment

Change-Id: Ifef15486a04cdb58f89f7faf56c31fd0a06e44ab
2015-12-15 13:02:32 -08:00