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
Define macros in examples/unicode.h to use Unicode argv
on Windows. Keep char everywhere on Unix since it handles
UTF-8 without any change.
Impact:
- All fopen () and SHCreateStreamOnFile(),
- All fprintf() printing file paths,
- All strcmp() used with "-",
- File path parsing,
- Gif reading.
Concerned executables from examples/ and extras/:
anim_diff, anim_dump, vwebp, vwebp_sdl,
cwebp, dwebp, gif2webp, img2webp,
webpmux, webpinfo, webp_quality, get_disto
When compiled on Windows with Unicode enabled, webpmux and
img2webp will not work when used with an argument file and
will print "Reading arguments from a file is a feature
unavailable with Unicode binaries."
BUG=webp:398
Change-Id: Ic55d222a3ce1a715f9c4cce57ecbe2705d5ce317
GIFDisplayError() is already defined exactly the same way
in gifdec. Remove it from anim_util.c and add dependency.
Change-Id: Iec01b41c44d0b61b3a279b8cd754d9917d64f804
Fix issue where color data is discarded in fully transparent
areas when -resize -exact.
BUG=webp:397
Change-Id: I58ce8d5ae172d5d0f0138e07c7df3a3c6cbd0019
The graphical bug happens when there is a frame disposed to background
color, followed by another frame that does not blend, and their areas
don't fully overlap. Only the previous frame clears its part of the
viewport. The fix consists in clearing the screen for the previous and
the current frame if needed.
Change-Id: I3425cf7297f0c7b2cf13a3a61b517cc0b1c031d8
Option -usebgcolor may be used to display ANIM background color (or white if no ANIM chunk), blended on top of checkerboard. By default this is disabled (old behavior) to easily see transparent areas. Spec says that "background color MAY be used", so it's an option.
Key b may be pressed to toggle ANIM background color display. There are visual artifacts (leftovers) when toggling during an animation. This is already the case for rescaling, toggling info etc. (fixing it implies storing viewport render or rendering whole animation from start till current frame).
BUG=webp:394
Change-Id: If9ab898b2eac77226f30f062d522f9861789ef8f
Container spec indicates that background color is written
in BGRA byte order, but glClearColor() parameters are RGBA.
Anyway the checkerboard is displayed right after glClear()
calls so it replaces background color.
In response to webp-discuss/TkLHALGaHaM
Change-Id: Ief5435fadfd6a422b881a9dc240b5e8dc6546e19
with loop_compatibility disabled (the default), non-zero loop counts
will be incremented by 1 for browser rendering compatibility. the max,
65535, is a special case as the muxer will fail if it is exceeded; avoid
increasing the limit in this case. this isn't 100% correct, but should
be close enough given the high number of iterations.
BUG=webp:382
Change-Id: Icde3e98a58e9ee89604a72fafda30ab71060dec5
This is to harmonize the -h/-version options on all our examples.
+ added GetAnimatedImageVersions() method to anim_util.*
Change-Id: I2304a1c29e310682e97f236d3867274a192a7a09
this is consistent with web browser behavior as well as various
transcoding tools (ffmpeg, gif2apng, etc).
also: update anim_diff to account for this new behaviour.
BUG=webp:379
Change-Id: I70cc72a6b401ef32b73cd182a3f12d993d495bf4