Commit Graph

213 Commits

Author SHA1 Message Date
James Zern
5efd6300dc mv SharpYuvEstimate420Risk to extras/
There's no need for this in libsharpyuv currently. This avoids an ABI
bump and library size increase.

Change-Id: I3e4c79052fdb4d628a2d36491547233dd0b6dc34
2024-01-12 15:25:27 -08:00
Maryla
d7a0506dcc Add YUV420 riskiness metric.
Basic version for 8 bit only and C only (no simd).

Hidden behind a compile flag because the precompiled table is
fairly large (114kiB) and more than triples the size of the library.

Change-Id: I165c78e863df6a17b32f578bdbffe3adda9ac1d0
2023-12-05 10:17:15 +01:00
Vincent Rabaud
24d7f9cb6e Switch code to SDL2.
Also simplify wasm html (now that it is suppported by all browsers).

Change-Id: I352b08594b93d3dd7d44832d4328b3546ccc1b90
2023-10-28 23:36:35 +02:00
Vincent Rabaud
eac3bd5c53 Have the palette code be in its own file.
Change-Id: I099a342effedd9f451c94d00a14aead27079e6cc
2023-07-06 22:09:24 +02:00
James Zern
979c0ebbcd sharpyuv: add SharpYuvGetCPUInfo
This gives a similar structure to libwebp and fixes a bug where passing
NULL to SharpYuvInit() would unconditionally set optimized function
pointers. SharpYuvInit() is left as an undocumented public function and
SharpYuvGetCPUInfo is kept private to serialize updates to the pointer.

Change-Id: Id72fbf3ba5b396367510e3bcd1ee2e4e11b95b8c
2022-10-26 13:07:01 -07:00
Maryla
9d7ff74a55 Create libsharpyuv.a in makefile.unix.
Add libsharpyuv dependency to fuzzer makefile.

Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49778

Change-Id: Ib03219de33a97c3d7b13d0daffbee2035f2a3bde
2022-08-08 09:40:34 +02:00
James Zern
8278825aac makefile.unix: add sharpyuv objects to clean target
Change-Id: Iad9ac2530bd892681c055e5ae1bf82eb8782d2a2
2022-07-05 10:41:14 -07:00
Maryla
2d607ee646 sharpyuv: increase precision of gamma<->linear conversion
Change-Id: I261bae3628315bda4ec0dafb8798c7512dd03a36
2022-06-01 15:38:44 +02:00
Maryla
01a05de1a7 libsharpyuv: add colorspace utilities
Change-Id: I620c8593dc81f39e747de5ed354332adb7278bed
2022-04-08 10:07:22 +02:00
Maryla
d55d447c9a Make libwebp depend on libsharpyuv.
Change-Id: I6d8ebfe1f855024fc0694b1aa584f71fa27b83ae
2022-03-04 11:35:03 +01:00
Maryla
29cc95ce4c Basic version of libsharpyuv in libwebp, in C.
It's self contained apart from a dependency on src/webp/types.h and src/dsp/cpu.h
For now it's only set up as an internal library, not an installable one.
Webp doesn't depend on it yet, the code is only duplicated.

Change-Id: I752799894f9d4105d0d296ddebd9f9641181a1ec
2022-02-18 14:52:44 +00:00
James Zern
b6f756e82b update http links
- prefer https

- metadataworkinggroup.org/com seem to be offline; the web archive link
  was obtained from exiftool: https://exiftool.org/TagNames/MWG.html

- fix kramdown link, rubyforge has been gone a long time

- fix png/zlib links

Bug: webp:544
Bug: b/202302177
Change-Id: Id69de4553e7baf00393f12a2c1acb262443a1a93
2021-11-23 10:13:40 -08:00
Ilya Kurdyukov
a09a647241 SSE4.1 version of TransformColorInverse
Change-Id: I6ba5cb35917eef7a52152c4924eca205b4af7220
2021-02-18 12:42:39 +01:00
James Zern
312f74d010 makefile.unix: allow *_LIBS to be overridden w/EXTRA_LIBS
previously setting EXTRA_LIBS on the command line would skip any
per-target updates. this allows both EXTRA_LIBS and [CD]WEBP_LIBS,
GL_LIBS to be set together avoiding the need to add unnecessary
dependencies to EXTRA_LIBS which affects all targets.

Change-Id: I63bbc14f0ac0cd04aa50c5d5047060ac57d0c9dc
2019-07-01 19:49:18 -07:00
Pascal Massimino
fcfd9c71b4 BitTrace: if BITTRACE is > 0, record and print syntax bits used
* Bittrace decoding is ~3x slower.
* Binary is the same byte-wise if BITTRACE=0
* Example output:
=== Bit traces ===
global-header    :    174 bytes   	[ 0.69%] [count:    1850]
segments         :    246 bytes   	[ 0.98%] [count:    3072]
block-size       :    170 bytes   	[ 0.68%] [count:    1536]
pred-modes       :   3829 bytes   	[15.27%] [count:   51458]
pred-modes-uv    :    279 bytes   	[ 1.11%] [count:    2329]
coeffs           :  20370 bytes   	[81.27%] [count:  212914]
Total: 25065 bytes

Change-Id: Ie32569c4e54a7ec13264e68d2dae2ce45c8536cb
2019-03-15 07:23:50 +01:00
Johann
0fd7514b55 neon: SetResidualCoeffs
Much faster with aarch64. Still somewhat faster without vmaxv.

C: 3.700s
ArmV7: 3.675
aarch64: 3.600

BUG=b/118740850

Change-Id: I3be852da89633eca4bddce443c87f5e4a2f55868
2018-11-14 11:46:40 -08:00
Vincent Rabaud
cbf82cc04d Remove AVX2 files.
There is only enc_avx2.c and we never managed to get
something fast enough.

Change-Id: I7465b5d8ccf47d9aa612173b8f80f96060cdb366
2018-10-16 14:12:03 +02:00
Yannis Guyon
b911fbc980 libwebp: Remove duplicate GIFDisplayError in anim_util
GIFDisplayError() is already defined exactly the same way
in gifdec. Remove it from anim_util.c and add dependency.

Change-Id: Iec01b41c44d0b61b3a279b8cd754d9917d64f804
2018-10-09 17:29:54 +02:00
Pascal Massimino
e577feb7c2 makefile.unix: add DEBUG flag for compiling w/ debug-symbol
usage example: make -f makefile.unix DEBUG=

Change-Id: I5aefe026a3364e5db5e0220b9fa506687cb98a8d
2018-04-11 20:51:04 +00:00
James Zern
b892b8ba8b makefile.unix,dist: use ascii for text output
this prevents unknown escapes containing '-'s getting stripped on OS X
when a tty targeted font is used

Change-Id: I11d77f2984d9fd67a8b22948fb21e4c11396aec4
2018-04-03 12:55:01 -07:00
Pascal Massimino
217443c71a remove some deprecation warning on MacOSX
Change-Id: I3e6de5ae6d84aa7906049eb55b6373c5123b0158
2018-03-31 09:30:00 +02:00
Pascal Massimino
641cedccd3 imagedec: support metadata reading for WebP image decoding
Needs to link imagedec.a to demux/libwebpdemux.a

Change-Id: Id8f4068718b0e4a1e84607bccd5af5419120c231
2018-03-28 16:36:37 -07:00
James Zern
f4dd92565e remove WEBP_EXPERIMENTAL_FEATURES
the webp bitstream is considered stable at this point

Change-Id: I4b13f9ed4c45f63785474b097e96cb7bf651be7b
2018-02-09 10:25:11 -08:00
Pascal Massimino
1c59020b93 fix missing sse41 targets in makefile.unix
Change-Id: I8c7a39746594caea160c40e25ea22d756ca44e11
2017-12-11 00:00:19 -08:00
James Zern
a439972175 WIP: list includes as descendants of the project dir
#include "(.|..)/..." -> #include "src/..."

Change-Id: I772880aa097a770722043c8a4393552ba38a89b6
2017-10-10 23:04:05 -07:00
Pascal Massimino
8635973dc3 use sdl-config (if available) to determine the link flags
this fixes the compilation of vwebp_sdl on MacOS.

BUG=webp:355

Change-Id: I48c5607f31965b220db6bf707cff22b7157e0bb6
2017-09-06 20:35:48 +00:00
Pascal Massimino
e9459382b0 use CPPFLAGS before CFLAGS
this way, -Isrc/ is used *before* system-wide -I locations
like /opt/local/include/ for instance.

Change-Id: I83c97775aff87695720a0ff3fca5c3cf2bb62a09
2017-09-03 21:13:33 -07:00
Pascal Massimino
f66f94ef36 anim_dump: small tool to dump frames from animated WebP
dumps frames to PNG, PAM or TIFF files.


Change-Id: I86a4d7e235cb7040cf5bbcae28270cb5a84be087
2017-08-30 06:12:03 +00:00
skal
663a6d9d2e unify the ALTERNATE_CODE flag usage
Pattern is now:
 #if !defined(FLAG)
 #define FLAG 0   // ALTERNATE_CODE
 #endif
...
 #if (FLAG == 1)
 ...
 #else
  ...
 #endif    // FLAG
...

Removed some unused code / flags:
  WEBP_YUV_USE_TABLE, WEBP_REFERENCE_IMPLEMENTATION,
  experimental code,  VP8YUVInit(), ...

BUG=webp:355

Change-Id: I98deb9189446a4cfd665c13ea8aa1ce6a308c63f
2017-08-01 20:49:29 -07:00
Vincent Rabaud
8acb4942f7 Remove the argb* files.
Half of the functionality was duplicated.
The rest is about the alpha channel handling so we
might as well put it in the appropriate file.

Change-Id: I8d5ef0afce82cc4842ab7132fd97995c42e6140a
2017-06-25 14:44:33 +02:00
Vincent Rabaud
b903b80c30 Split cost-based backward references in its own file.
Change-Id: I4d8281e69b0e41f7c90337e5be70a6c65b044086
2017-06-01 16:22:31 +02:00
hui su
d63e6f4b23 Add a man page for webpinfo
BUG=webp:330

Change-Id: I7b02274401c935affa173a49a883a39272b6dcc3
2017-05-09 16:14:44 -07:00
Pascal Massimino
52245424b0 NEON implementation of some Sharp-YUV420 functions
Change-Id: I449ef9c76b06f971f6e2ad7f9db96bf906d8fe1f
new-file: dsp/yuv_neon.c
2017-04-18 19:22:37 +02:00
Pascal Massimino
274daf5415 Add webpinfo tool.
A command line tool to print out the chunk level structure of
WebP files along with basic integrity checks.

BUG=webp:330

Change-Id: Ic69f646f649abb655b1854621d99afedeed158d7
2017-03-14 11:41:17 +01:00
Pascal Massimino
ec5036e475 add explicit reference to /usr/local/{lib,inc}
Change-Id: Idf0450bc715c476950f23b2f9db383a5b9936890
2017-03-08 09:14:15 +01:00
Pascal Massimino
39cf6f4f36 vwebp_sdl: fix the makefile.unix
The FLAGS_LIBS was dropped at some point.
There is still an SDL_Main / main problem though, but it's a
separate topic.

Change-Id: Ief4d79624e94e7904134df8d84a4ac7c77c48ce7
2017-02-27 08:46:44 -08:00
Pascal Massimino
693bf74ec0 move the SSIM calculation code in ssim.c / ssim_sse2.c
Change-Id: I63a63fa7f44f257f2e17e45358b206c23069c448
2017-02-21 12:53:35 +01:00
Pascal Massimino
57d8de8a79 Merge "vwebp_sdl: simple viewer based on SDL" 2017-02-03 09:43:57 +00:00
Pascal Massimino
dcf9d82a95 imageio: add limited PNM support for reading
see: http://netpbm.sourceforge.net/

Only reads P5 and P6 pnm files for now.

Change-Id: I2332a623f803df67455047f570f1cff9f464480a
2017-02-01 07:41:56 +00:00
Pascal Massimino
6524fcd614 vwebp_sdl: simple viewer based on SDL
Uses WebPToSDL() generic function defined in vwebp_sdl.[ch].
This function is not included in the libextras library, because it
would bring in an SDL dependency. Probably too heavy for now.

WebPToSDL() is separate, because it will be called used by the javascript
version of libwebp (through emscripten build rules)

Change-Id: Ic85b36f8ce4784f46023656278f6480be6802834
2017-01-31 10:23:03 +01:00
James Zern
668e1dd44f src/{dec,enc,utils}: give filenames a unique suffix
this avoids duplicates between these trees and dsp/, e.g., enc/tree.c,
dec/tree.c, making pulling the whole library source tree into one target
possible

BUG=webp:279

Change-Id: I060a614833c7c24ddd37bf641702ae6a5eef1775
2017-01-19 19:09:48 -08:00
James Zern
ea4824097e makefiles: prune get_disto & webp_quality deps
remove libimagedec from webp_quality, only the webp headers are
inspected. libwebpextras isn't needed by get_disto.

Change-Id: Ib85f97e2c4a9edd97392fd20ef294d1ccc76dda5
2017-01-18 18:10:58 -08:00
Pascal Massimino
1de931c669 NEON: implement alpha-filters (horizontal/vertical/gradient)
gradient-filter code is not much faster, but maybe improvable in the future.

Change-Id: Ia16070e409fe8703b02276166f19526917df6b35
2017-01-17 15:44:46 +01:00
Pascal Massimino
49d0280df1 NEON: implement several alpha-processing functions
- ApplyAlphaMultiply
 - DispatchAlpha
 - DispatchAlphaToGreen
 - ExtractAlpha

Decoding to Argb / rgbA / ... is 10-15% faster (measured on N4)

new file: alpha_processing_neon.c

Change-Id: I40f1a809e9885d1031ff0bc886d8d001efa66bca
2017-01-11 17:39:29 +01:00
Pascal Massimino
03f40955a3 img2webp: convert a sequence of images to an animated webp
Usage:

  img2webp [file-level options] [image files...] [per-frame options...]

File-level options (only used at the start of compression):
 -min_size ............ minimize size
 -loop <int> .......... loop count (default: 0, = infinite loop)
 -kmax <int> .......... maximum number of frame between key-frames
                        (0=only keyframes)
 -kmin <int> .......... minimum number of frame between key-frames
                        (0=disable key-frames altogether)
 -mixed ............... use mixed lossy/lossless automatic mode
 -v ................... verbose mode
 -h ................... this help

Per-frame options (only used for subsequent images input):
 -d <int> ............. frame duration in ms (default: 100)
 -lossless  ........... use lossless mode (default)
 -lossy ... ........... use lossy mode
 -q <float> ........... quality
 -m <int> ............. method to use

example: img2webp -loop 2 in0.png -lossy in1.jpg
                  -d 80 in2.tiff -o out.webp

Change-Id: I23771b90eaf0660f420d7ffd304e704155386286
2016-12-02 11:44:17 +01:00
hui su
68ae5b671f Add libwebp/src/mux/animi.h
Change-Id: I80ca2070d419acf6e8355a295ee965d2df5a4d8f
2016-10-05 10:33:29 -07:00
Vincent Rabaud
6cc48b1728 Move some lossless logic out of dsp.
Change-Id: I4cfd60cd5497666a2e1c188ceada2e71b05f1505
2016-09-13 15:37:32 +02:00
Vincent Rabaud
c9b45863e2 Split off common lossless dsp inline functions.
Change-Id: I64f96897b11d1c21f033c7e47b21edccb5c68738
2016-09-12 17:35:08 +02:00
Pascal Massimino
af1ad3e2dd libimageenc.a: extract image-saving code from dwebp
BUG=webp:277
Change-Id: I2c0e1df7b13b1f77474b5478048fef022e90f77a
2016-09-08 19:11:26 -07:00
Pascal Massimino
485cac1a88 switch libimagedec.a and libimageio_util.a to avoid undefined symbol
gcc-4.8.3 was giving the undefined reference to ImgIoUtilReadFile and
ImgIoUtilCopyPlane when linking libimagedec.a

Change-Id: I8b85ab3a860602535629d0bb541a39754413728e
2016-08-17 19:48:08 -07:00