Commit Graph

4407 Commits

Author SHA1 Message Date
James Zern
a2093acc4b webp-lossless-bitstream-spec: add amendment note
for recent changes to color transform, simple code length code, image
structure and details of decoding prefix codes

Bug: webp:551
Change-Id: I36a4d1ee3e25b8a56f5d926f4770374ace99bc2f
2022-05-13 18:50:55 -07:00
James Zern
86c669303a webp-lossless-bitstream-spec: fix BNF
color cache info precedes the meta huffman info

Bug: webp:551
Change-Id: Ibb69b4ffad6bff5693015be3fe6c600c53fd06c0
2022-05-13 18:41:30 -07:00
James Zern
232f22da5a webp-lossless-bitstream-spec: fix 'simple code' snippet
based on https://crbug.com/webp/551#c3 & https://crbug.com/webp/551#c4

Bug: webp:551
Change-Id: I4bcc19643b0bdda999247e9c3457d6954a49e35f
2022-05-13 18:41:20 -07:00
James Zern
44dd765def webp-lossless-bitstream-spec: fix ColorTransform impl
and the corresponding InverseTransform(); the operations were swapped.
The forward transform subtracts the deltas, the inverse adds them.

Bug: webp:551
Change-Id: Ieb90a24f843cee7cdfe46cbb15ec7d716ca9d269
2022-05-13 18:33:16 -07:00
James Zern
7a7e33e977 webp-lossless-bitstream-spec: fix TR-pixel right border note
the value of the TR-pixel on the right border is the leftmost pixel on
the current row, not the previous one

Bug: webp:551
Change-Id: I157e8c16ce43a9f52c36aa880be1be3bef19c063
2022-05-13 16:48:23 -07:00
vrabaud@google.com
86f94ee010 Update lossless spec with Huffman codes.
Bug: webp:551
Change-Id: I28b57c8e87a8023b727fe8359c2e2809cf92752d
2022-05-13 16:42:00 -07:00
James Zern
a3927cc800 sharpyuv.c,cosmetics: fix indent
+ a few typos in sharpyuv_csp.c

Change-Id: I34b208d10d7808b42afb39b0618fb2e5d76633eb
2022-05-11 11:53:25 -07:00
Vincent Rabaud
6c45cef7ff Make sure the stride has a minimum value in the importer.
Bug: webp:569
Change-Id: Ia48d064dbb10e7179ae3da04ca8d769d1c447276
2022-05-10 10:18:46 +02:00
Maryla
0c8b0e67a4 sharpyuv: cleanup/cosmetic changes
Remove unused constants.
Use ALL_CAPS for defines and kCamelCase for static const values.
Change some defines into static constants if they are not used in array sizes.

Change-Id: I036b0f99215fd0414a33f099bd6b809ff8ee4541
2022-05-09 15:10:14 +02:00
James Zern
dc3841e077 {histogram,predictor}_enc: quiet int -> float warnings
after:
a19a25bb Replace doubles by floats in lossless misc cost estimations.

Change-Id: Idc5888b40ce5b591b72c6e51a188a9ab8c5d9823
2022-04-20 10:10:27 -07:00
Vincent Rabaud
a19a25bb03 Replace doubles by floats in lossless misc cost estimations.
Doubles are slower and use more RAM for no benefit.

Change-Id: I05b313576f9b33388c7c39d7fed8de84170c3753
2022-04-17 21:07:54 +02:00
Vincent Rabaud
42888f6c7c Add an option to enable static builds.
The build is not fully static but enough for certain usage.

Change-Id: I269fa40f332365873634b12ac54fd3c36beefd66
2022-04-12 17:50:19 +02:00
James Zern
7efcf3cc26 Merge "Fix typo in color constants: Marix -> Matrix" into main 2022-04-12 05:08:08 +00:00
Frank Barchard
8f4b5c62b7 Fix typo in color constants: Marix -> Matrix
Change-Id: Ia5dc8b37ea7ddbb3dba923e24ef07633edb822eb
2022-04-11 14:54:43 -07:00
James Zern
90084d84f9 Merge "demux,IsValidExtendedFormat: remove unused variable" into main 2022-04-11 20:29:24 +00:00
James Zern
ed643f619d Merge changes I452d2485,Ic6d75475 into main
* changes:
  SharpYuvComputeConversionMatrix: quiet int->float warnings
  Makefile.vc: add sharpyuv_csp.obj to SHARPYUV_OBJS
2022-04-11 18:54:25 +00:00
Maryla
8fa053d134 Rename SharpYUV to SharpYuv for consistency.
Change-Id: I21df96b4c8f8fa97bfd2ac9c806c7e5119b55691
2022-04-11 11:55:10 +02:00
James Zern
99a8756201 SharpYuvComputeConversionMatrix: quiet int->float warnings
under some versions of visual studio:
sharpyuv\sharpyuv_csp.c(43): warning C4244: '=': conversion from 'int' to
'float', possible loss of data
sharpyuv\sharpyuv_csp.c(35): warning C4244: 'initializing': conversion from
'int' to 'float', possible loss of data

Change-Id: I452d24857b43b8a80fae0f339163b4b3965f2d9f
2022-04-09 11:07:09 -07:00
James Zern
deb426becc Makefile.vc: add sharpyuv_csp.obj to SHARPYUV_OBJS
missed in:
01a05de1a libsharpyuv: add colorspace utilities

Change-Id: Ic6d754757a54dc098d5c761f03480a3766d60db6
2022-04-09 11:06:17 -07:00
brianpl@google.com
779597d443 demux,IsValidExtendedFormat: remove unused variable
quiets -Wunused-but-set-variable

frame_count has been unused in this function since:
ab714b8a demux, Frame: remove is_fragment_ field

Change-Id: Ie6afda915c6b82736e05e7490eba0165c3dd37e4
2022-04-08 15:28:05 -07:00
Maryla Ustarroz-Calonge
40e8aa57f8 Merge "libsharpyuv: add colorspace utilities" into main 2022-04-08 09:06:23 +00:00
Maryla
01a05de1a7 libsharpyuv: add colorspace utilities
Change-Id: I620c8593dc81f39e747de5ed354332adb7278bed
2022-04-08 10:07:22 +02:00
James Zern
2de4b05a56 Merge changes Id9890a60,I376d81e6,I1c958838 into main
* changes:
  GetBackwardReferences: fail on alloc error
  BackwardReferencesHashChainDistanceOnly: fix segfault on OOM
  VP8LEncodeStream: fix segfault on OOM
2022-04-06 20:04:25 +00:00
James Zern
b8bca81fb6 Merge "configure.ac: use LT_INIT if available" into main 2022-04-05 16:47:37 +00:00
Pascal Massimino
e8e77b9c47 Merge changes I479bc487,I39864691,I5d486c2c,I186d13be into main
* changes:
  mux{edit,internal}: fix leaks on error
  ExUtilInitCommandLineArguments: fix leak on error
  anim_util: fix leaks on error
  gif2webp: fix segfault on OOM
2022-04-05 05:51:53 +00:00
James Zern
7e7d5d503a Merge ".gitignore: add Android Studio & VS code dirs" into main 2022-04-04 22:27:07 +00:00
James Zern
10c5084842 normalize label indent
1 space is most common in the source; this fixes some mixed cases within
lossless files, likely from clang-format

Change-Id: I504206d5bf418781d4131ee73570ecee4e0a69a1
2022-04-04 12:47:41 -07:00
James Zern
89f774e61d mux{edit,internal}: fix leaks on error
several calls to ChunkSetHead() were unchecked, causing the chunk to
leak should the call fail due to OOM

Tested:
for i in `seq 1 1125`; do
  export MALLOC_FAIL_AT=$i
  ./examples/gif2webp gif_file
  ./examples/gif2webp -mixed gif_file
done
for i in `seq 1 171`; do
  export MALLOC_FAIL_AT=$i
  ./examples/img2webp jpeg_file -o /dev/null
  ./examples/img2webp -mixed jpeg_file -o /dev/null
done

Change-Id: I479bc487f61b493e5ce033872d353007055c172a
2022-04-04 11:26:25 -07:00
James Zern
2d3293ad76 ExUtilInitCommandLineArguments: fix leak on error
argv_data would leak if the argv_ allocation failed or the MAX_ARGC cap
was hit

Tested:
for i in `seq 1 171`; do
  export MALLOC_FAIL_AT=$i
  ./examples/img2webp jpeg_file -o /dev/null
  ./examples/img2webp -mixed jpeg_file -o /dev/null
done

Change-Id: I39864691e96d5456f324d95a3653bba0f6d6a7be
2022-04-04 11:26:25 -07:00
James Zern
ec34fd7023 anim_util: fix leaks on error
in ReadAnimatedWebP() & ReadAnimatedGIF() when AllocateFrames() fails
due to OOM

Tested:
for i in `seq 1 278`; do
  export MALLOC_FAIL_AT=$i
  ./examples/anim_diff webp1 webp2
  ./examples/anim_diff gif1 gif2
done

Change-Id: I5d486c2c2982ae088e34a25d8e3e0188df1a9b51
2022-04-04 11:26:25 -07:00
James Zern
e471728754 gif2webp: fix segfault on OOM
previously calls to WebPPictureCopy() weren't checked, causing a crash
when the canvas copies were accessed later in the loop

Tested:
for i in `seq 1 1125`; do
  export MALLOC_FAIL_AT=$i
  ./examples/gif2webp gif_file
  ./examples/gif2webp -mixed gif_file
done

Change-Id: I186d13be0ec8f3b72b7d247a8482590c1b1be541
2022-04-04 11:26:12 -07:00
James Zern
e3cfafaf71 GetBackwardReferences: fail on alloc error
previously failures in the call to
VP8LBackwardReferencesTraceBackwards() would be ignored which, though it
wouldn't result in a crash, would produce non-deterministic output

Change-Id: Id9890a60883c3270ec75e968506d46eea32b76d4
2022-04-04 11:24:06 -07:00
James Zern
a828a59b49 BackwardReferencesHashChainDistanceOnly: fix segfault on OOM
change CostManager to calloc to avoid frees on undefined pointer
values in CostManagerClear() should the cost_model allocation succeed,
but the cost_manager allocation fail

since:
v0.5.0-93-g3e023c17 Speed-up BackwardReferencesHashChainDistanceOnly.

Tested:
for i in `seq 1 639`; do
  export MALLOC_FAIL_AT=$i
  ./examples/cwebp -m 6 -q 100 -lossless jpeg_file
done

Bug: webp:565
Change-Id: I376d81e6f41eb73529053e9e30c142b4b4f6b45b
2022-04-04 11:23:39 -07:00
James Zern
fe153fae98 VP8LEncodeStream: fix segfault on OOM
initialize bw_side before calling EncoderAnalyze() & EncoderInit() which
may fail; previously this would cause a free of an invalid pointer in
VP8LBitWriterWipeOut().

since at least:
v0.6.0-120-gf8c2ac15 Multi-thread the lossless cruncher.

Tested:
for i in `seq 1 639`; do
  export MALLOC_FAIL_AT=$i
  ./examples/cwebp -m 6 -q 100 -lossless jpeg_file
done

Bug: webp:565
Change-Id: I1c95883834b6e4b13aee890568ce3bad0f4266f0
2022-04-04 11:21:30 -07:00
James Zern
919acc0ef5 .gitignore: add Android Studio & VS code dirs
Change-Id: I0a8b8124f568df1a4e6bbf96e5a1144b2e7606a1
2022-04-04 10:28:06 -07:00
James Zern
efa0731b9d configure.ac: use LT_INIT if available
AC_PROG_LIBTOOL is deprecated. quiets a warning from autoconf 2.71:
configure.ac:12: warning: The macro `AC_PROG_LIBTOOL' is obsolete.

Change-Id: I3b131f5ee636a8df48057862e600759f25ad7289
2022-04-04 10:25:26 -07:00
James Zern
0957fd69ee tiffdec: add grayscale support
the file is always decoded to RGBA, so just the samples_per_px needed an
update

Bug: webp:563
Change-Id: I95d95c3b9e45dc8ecb2223f89f4ba791f0b21e8b
2022-03-31 21:43:29 -07:00
Maryla Ustarroz-Calonge
e685feef0c Merge "Make libsharpyuv self-contained by removing dependency on cpu.c" into main 2022-03-31 09:04:06 +00:00
Maryla
841960b670 Make libsharpyuv self-contained by removing dependency on cpu.c
Change-Id: I2edac1afa38bfddf2a91e7829e38425bd3519feb
2022-03-30 15:04:35 +02:00
James Zern
617cf03656 image_dec: add WebPGetEnabledInputFileFormats()
and use it to output the types supported in the examples

Change-Id: Ia6b8624a2146cf72c679129065a72f215644e1e9
2022-03-26 15:37:25 -07:00
Maryla
7a68afaac5 Let SharpArgbToYuv caller pass in an RGB>YUV conversion matrix.
Change-Id: I4ed2dfc00ce63361abd49c693f31f307e0b0262f
2022-03-24 16:37:47 +01:00
James Zern
34bb332ca1 man/cwebp.1: add note about crop/resize order
+ normalize help text in [cd]webp

Bug: webp:561
Change-Id: Id92ec4228d4933cd033b2bf68a43192532cef483
2022-03-17 16:08:34 -07:00
James Zern
f0e9351cce webp-lossless-bitstream-spec,cosmetics: fix some typos
Bug: webp:551
Change-Id: I9ff90601b77deb9034ed7bef9cfd421d1f6e2e2b
2022-03-15 17:57:31 -07:00
James Zern
5ccbd6ed8c vp8l_dec.c,cosmetics: fix a few typos
Change-Id: Ia2906883e7d19bd96f355b4ade98d29ac2efe8cc
2022-03-14 10:15:31 -07:00
James Zern
c3d0c2d7d8 fix ios build scripts after sharpyuv dep added
in:
d55d447c Make libwebp depend on libsharpyuv.

Change-Id: I8efa679686b792da4cedf23f580152fecfe42275
2022-03-08 19:52:45 -08:00
Maryla Ustarroz-Calonge
d0d2292e1a Merge "Make libwebp depend on libsharpyuv." into main 2022-03-07 09:34:37 +00:00
James Zern
03d1219055 alpha_processing_neon.c: fix 0x01... typo
one instance was overlong leading to a int64->uint32 conversion warning

Change-Id: I56d5ab75d89960c79293f62cd489d7ab519bbc34
2022-03-04 15:26:21 -08:00
Maryla
d55d447c9a Make libwebp depend on libsharpyuv.
Change-Id: I6d8ebfe1f855024fc0694b1aa584f71fa27b83ae
2022-03-04 11:35:03 +01:00
Vincent Rabaud
e4cbcdd2b5 Fix lossless encoding for MIPS.
Bug: webp:558
Change-Id: I3d3ddb64ed26a8d8ff5664664c5f20f6eadfeb4f
2022-03-01 14:01:49 +01:00
James Zern
924e7ca654 alpha_processing_neon.c: fix Dispatch/ExtractAlpha_NEON
the trailing width % 8 bytes would clear the upper bytes of
alpha_mask as they're done one at a time

since:
49d0280d NEON: implement several alpha-processing functions

Change-Id: Iff76c0af3094597285a6aa6ed032b345f9856aae
2022-02-28 13:57:23 -08:00