This may help prevent confusion when placing frame options after the
target frame.
Note for compatibility this isn't fatal, but the behavior may change in
the future.
Bug: webp:381372617
Change-Id: I9f3b51e60ff650ccc6fd29b8f5f607c3771a8a55
cwebp, gif2webp, img2webp, vwebp and webpinfo are modified in this
change to align with the other examples. When given no arguments, the
examples print their help output and exit with failure.
Bug: webp:42340557, webp:381372617
Change-Id: Ifed4eb79e98233f7aa780c42e489636d0cf4a035
This change is the same as the one that introduced the options to
img2webp:
0825faa4 img2webp: add -sharp_yuv/-near_lossless
Change-Id: Id380d159299c38dd6440f833d487e00c0976afec
Use EXIT_SUCCESS / EXIT_FAILURE in most cases as more granularity isn't
useful. For anim_diff, use 0 (success), 1 (image difference) and 2
(error) to align it with other diff utilities (diff, etc.).
Bug: webp:637
Change-Id: I52925de8622a5a4d2141883279d69a1d95ef9b12
Options can precede the file name. This still won't be correct for
Unicode file names, but an approximation will be displayed (with '?'s)
rather than the first character if kParams.file_name were used.
glutCreateWindow() looks like it will prohibit correcting this as it
expects an ASCII string.
Change-Id: I96986a178a0bbce6971d2ac415222d4a456ce1a3
This is available with clang. Clears warnings of the form:
warning: empty expression statement has no effect; remove unnecessary
';' to silence this warning [-Wextra-semi-stmt]
As a side-effect it also clear a few -Wpedantic warnings with gcc:
warning: ISO C does not allow extra ';' outside of a function
[-Wpedantic]
Change-Id: I9295c767aad475c68b1fbbdff855b0d6650a25f5
this makes the output from img2webp and the ordering in doc/tools.md and
man/img2webp.1 consistent
Change-Id: Ic389aaa29c20128f2b87f231be383094602f125b
Both are global settings. Modifying them at the frame level is left as a
follow up based on need.
Bug: b/272739498
Change-Id: If15256c052f73fe3df56be5e0095e76d9870cc0f
This simplifies integration with the Android platform and avoids the
files from being used when a non-NDK build is performed. In that case
Android.bp is preferred.
Change-Id: I6e334cf8b05a19da8452405f5f448f9e4b6e4a40
when near_lossless is < 100; previously the zeroed 'picture' would be
passed in the check rather than the original picture. this would result
in alpha never been kept in the decode.
Change-Id: I6af3aef7de2d672e044025d975d8180b12d5fa40
This fixes incorrect character display in the file name
in e.g., stats output from cwebp.exe in visual studio builds.
In mingw further changes will be needed as using %s in wfprintf() for
wchar_t pointers is a Microsoft extension that doesn't seem to be
supported with gcc -fms-extensions. %ls works, but will require updating
format strings and wrapping concatenations with TO_W_CHAR() as visual
studio will reject merging string constants of different width.
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setmode
Change-Id: I57d24c3815f7b5aa3971ac315c65c4458258d706
when building for windows with _UNICODE defined
unicode_gif.h|49 col 3| warning: ISO C90 forbids mixed declarations and
code [-Wdeclaration-after-statement]
Change-Id: Ib9f0cc0eba036d6cd4221a4f70a078770dde01d0
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
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
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
store the recognized fourccs in little-endian order to match how the
fourcc is being read from the file
Bug: webp:548
Change-Id: I9de77db92208709d5e711846908a51e563102fa5
Similarly to "-set loop <>", this is useful to set
the parameter at global level and not just while assembling
the frames separately.
Change-Id: I79bcbe37f8ff50b9904e78d14011ccbac72f17a1
replace with more inclusive terms or remove the comment entirely if the
meaning was already clear.
Bug: webp:507
Change-Id: Ica3bbf751ebf79f6668df6e6209af770248ff4ca
The output was always 99dB because the lossless pipeline is not
modifying the 'picture'. Changing that is not that simple because
near_lossless impacts both VP8ApplyNearLossless() and
ApplyPredictFilter(); the latter cannot be applied as is to the input
and thus the final modified 'picture' cannot be easily retrieved
without decoding the encoded bitstream. Hence ReadWebP() is called in
cwebp.c on the encoded bitstream kept in memory to get the correct
distortion.
However -get_psnr returns a different distortion than get_disto for
lossy encoding configurations because cwebp loads the source as YUV
while get_disto directly reads it as RGB without conversion loss.
Change-Id: I5c32cf8f89eb137973dc7eebda747682d921b8e2
This is particularly useful for multi-pass search (but not only),
to prevent the search from going over or below a reasonable threshold.
E.g.: 'cwebp -qrange 50 80 ...' will prevent any unreasonable degradation.
new cwebp option: -qrange min max
Change-Id: I59f394533535fc20b6996bc0895f4301476d5eff
This is to make the initial window be rescaled in case the image
dimension is too large to fit the display.
BUG=webp:433
Change-Id: Ib04c12962bc8c26e74c8a6193829214da636ebde
CommandLineToArgvW() returns a LPWSTR*, storing to const LPWSTR* is
incorrect without a cast; fixes gcc -Wincompatible-pointer-types
and clang(-cl) -Wincompatible-pointer-types-discads-qualifiers warnings
Change-Id: Iad5b49c4862c7be68251272e50d3c751099559bc