mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 14:34:33 +02:00
gif2webp: Add a mixed compression mode
When '-mixed' option is given, each frame would be heuristically chosen to be encoded using lossy or lossless compression. The heuristic is based on the number of colors in the image: - If num_colors <= 31, pick lossless compression - If num_colors >= 194, pick lossy compression - Otherwise, try both and pick the one that compresses better. Change-Id: I908c73493ddc38e8db35b7b1959300569e6d3a97
This commit is contained in:
@ -44,9 +44,11 @@ typedef struct WebPFrameCache WebPFrameCache;
|
||||
|
||||
// Given the minimum distance between key frames 'kmin' and maximum distance
|
||||
// between key frames 'kmax', returns an appropriately allocated cache object.
|
||||
// If 'allow_mixed' is true, the subsequent calls to WebPFrameCacheAddFrame()
|
||||
// will heuristically pick lossy or lossless compression for each frame.
|
||||
// Use WebPFrameCacheDelete() to deallocate the 'cache'.
|
||||
WebPFrameCache* WebPFrameCacheNew(int width, int height,
|
||||
size_t kmin, size_t kmax);
|
||||
size_t kmin, size_t kmax, int allow_mixed);
|
||||
|
||||
// Release all the frame data from 'cache' and free 'cache'.
|
||||
void WebPFrameCacheDelete(WebPFrameCache* const cache);
|
||||
|
Reference in New Issue
Block a user