mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 07:22:52 +01:00
gif2webp: Different kmin/kmax defaults for lossy and lossless
These were the best values found considering the compression gain and decoding speed. Change-Id: Iddae4c5b78c6aa42b1f8a034d1c1b93843071a81
This commit is contained in:
parent
92d47e4ca9
commit
fb887f7fe6
@ -307,8 +307,11 @@ int main(int argc, const char *argv[]) {
|
||||
WebPData webp_data = { NULL, 0 };
|
||||
int stored_icc = 0; // Whether we have already stored an ICC profile.
|
||||
int stored_xmp = 0;
|
||||
size_t kmin = 9;
|
||||
size_t kmax = 17;
|
||||
|
||||
int default_kmin = 1; // Whether to use default kmin value.
|
||||
int default_kmax = 1;
|
||||
size_t kmin = 0;
|
||||
size_t kmax = 0;
|
||||
|
||||
memset(&frame, 0, sizeof(frame));
|
||||
frame.id = WEBP_CHUNK_ANMF;
|
||||
@ -341,8 +344,10 @@ int main(int argc, const char *argv[]) {
|
||||
config.method = strtol(argv[++c], NULL, 0);
|
||||
} else if (!strcmp(argv[c], "-kmax") && c < argc - 1) {
|
||||
kmax = strtoul(argv[++c], NULL, 0);
|
||||
default_kmax = 0;
|
||||
} else if (!strcmp(argv[c], "-kmin") && c < argc - 1) {
|
||||
kmin = strtoul(argv[++c], NULL, 0);
|
||||
default_kmin = 0;
|
||||
} else if (!strcmp(argv[c], "-f") && c < argc - 1) {
|
||||
config.filter_strength = strtol(argv[++c], NULL, 0);
|
||||
} else if (!strcmp(argv[c], "-version")) {
|
||||
@ -366,6 +371,13 @@ int main(int argc, const char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
// Appropriate default kmin, kmax values for lossy and lossless.
|
||||
if (default_kmin) {
|
||||
kmin = config.lossless ? 9 : 3;
|
||||
}
|
||||
if (default_kmax) {
|
||||
kmax = config.lossless ? 17 : 5;
|
||||
}
|
||||
SanitizeKeyFrameIntervals(&kmin, &kmax);
|
||||
|
||||
cache = WebPFrameCacheNew(kmin, kmax);
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.TH GIF2WEBP 1 "February 01, 2013"
|
||||
.TH GIF2WEBP 1 "September 30, 2013"
|
||||
.SH NAME
|
||||
gif2webp \- Convert a GIF image to WebP
|
||||
.SH SYNOPSIS
|
||||
@ -58,8 +58,8 @@ some key frames into the output animation as needed so that this criteria is
|
||||
satisfied.
|
||||
.br
|
||||
A 'kmin' value of 0 will turn off insertion of key frames.
|
||||
Typical values are in the range 5 to 30. Default values are kmin = 9 and
|
||||
kmax = 17.
|
||||
Typical values are in the range 3 to 30. Default values are kmin = 9,
|
||||
kmax = 17 for lossless compression and kmin = 3, kmax = 5 for lossy compression.
|
||||
.br
|
||||
These two options are relevant only for animated images with large number of
|
||||
frames (>50).
|
||||
|
Loading…
x
Reference in New Issue
Block a user