Compare commits
10 Commits
v0.6.0-rc2
...
sandbox/jz
Author | SHA1 | Date | |
---|---|---|---|
![]() |
86c756929c | ||
![]() |
50d1a848bc | ||
![]() |
20a7fea064 | ||
![]() |
415f3ffe3d | ||
![]() |
3c6d1224b4 | ||
![]() |
ee4a4141f5 | ||
![]() |
32ed856f60 | ||
![]() |
f4dc56fd77 | ||
![]() |
0d8e05880c | ||
![]() |
b045013970 |
1
AUTHORS
1
AUTHORS
@@ -5,6 +5,7 @@ Contributors:
|
||||
- Hui Su (huisu at google dot com)
|
||||
- James Zern (jzern at google dot com)
|
||||
- Jan Engelhardt (jengelh at medozas dot de)
|
||||
- Jehan (jehan at girinstud dot io)
|
||||
- Johann (johann dot koenig at duck dot com)
|
||||
- Jovan Zelincevic (jovan dot zelincevic at imgtec dot com)
|
||||
- Jyrki Alakuijala (jyrki at google dot com)
|
||||
|
@@ -1,3 +1,12 @@
|
||||
20a7fea0 extras/Makefile.am: fix libwebpextras.la reference
|
||||
415f3ffe update ChangeLog (tag: v0.6.0-rc3)
|
||||
3c6d1224 update NEWS
|
||||
ee4a4141 update AUTHORS
|
||||
32ed856f Fix "all|no frames are keyframes" settings.
|
||||
f4dc56fd disable GradientUnfilter_NEON
|
||||
0d8e0588 img2webp: treat -loop as a no-op w/single images
|
||||
b0450139 ReadImage(): restore size reporting
|
||||
0ad3b4ef update ChangeLog (tag: v0.6.0-rc2)
|
||||
6451709e img2webp,get_disto: fix image decode w/WIC builds
|
||||
92504d21 get_disto: make ReadPicture() return a bool
|
||||
c3e4b3a9 update NEWS
|
||||
|
6
NEWS
6
NEWS
@@ -1,4 +1,4 @@
|
||||
- 1/23/2017: version 0.6.0
|
||||
- 1/26/2017: version 0.6.0
|
||||
* lossless performance and compression improvements
|
||||
* miscellaneous performance improvements (SSE2, NEON, MSA)
|
||||
* webpmux gained a -duration option allowing for frame timing modification
|
||||
@@ -8,6 +8,10 @@
|
||||
- libwebp:
|
||||
WebPPictureSharpARGBToYUVA
|
||||
WebPPlaneDistortion
|
||||
- libwebpmux / gif2webp:
|
||||
WebPAnimEncoderOptions: kmax <= 0 now disables keyframes, kmax == 1
|
||||
forces all keyframes. See mux.h and the gif2webp
|
||||
manpage for details.
|
||||
|
||||
- 12/13/2016: version 0.5.2
|
||||
This is a binary compatible release.
|
||||
|
@@ -85,10 +85,15 @@ static int ReadImage(const char filename[], WebPPicture* const pic) {
|
||||
static int SetLoopCount(int loop_count, WebPData* const webp_data) {
|
||||
int ok = 1;
|
||||
WebPMuxError err;
|
||||
uint32_t features;
|
||||
WebPMuxAnimParams new_params;
|
||||
WebPMux* const mux = WebPMuxCreate(webp_data, 1);
|
||||
if (mux == NULL) return 0;
|
||||
|
||||
err = WebPMuxGetFeatures(mux, &features);
|
||||
ok = (err == WEBP_MUX_OK);
|
||||
if (!ok || !(features & ANIMATION_FLAG)) goto End;
|
||||
|
||||
err = WebPMuxGetAnimationParams(mux, &new_params);
|
||||
ok = (err == WEBP_MUX_OK);
|
||||
if (ok) {
|
||||
@@ -101,6 +106,8 @@ static int SetLoopCount(int loop_count, WebPData* const webp_data) {
|
||||
err = WebPMuxAssemble(mux, webp_data);
|
||||
ok = (err == WEBP_MUX_OK);
|
||||
}
|
||||
|
||||
End:
|
||||
WebPMuxDelete(mux);
|
||||
if (!ok) {
|
||||
fprintf(stderr, "Error during loop-count setting\n");
|
||||
|
@@ -22,5 +22,5 @@ get_disto_LDADD += $(PNG_LIBS) $(JPEG_LIBS) $(TIFF_LIBS)
|
||||
webp_quality_SOURCES = webp_quality.c
|
||||
webp_quality_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE)
|
||||
webp_quality_LDADD = ../imageio/libimageio_util.la
|
||||
webp_quality_LDADD += ./libwebpextras.la
|
||||
webp_quality_LDADD += libwebpextras.la
|
||||
webp_quality_LDADD += ../src/libwebp.la
|
||||
|
@@ -27,12 +27,13 @@
|
||||
#include "../imageio/image_dec.h"
|
||||
#include "../imageio/imageio_util.h"
|
||||
|
||||
static int ReadPicture(const char* const filename, WebPPicture* const pic,
|
||||
int keep_alpha) {
|
||||
static size_t ReadPicture(const char* const filename, WebPPicture* const pic,
|
||||
int keep_alpha) {
|
||||
const uint8_t* data = NULL;
|
||||
size_t data_size = 0;
|
||||
WebPImageReader reader = NULL;
|
||||
int ok;
|
||||
int ok = ImgIoUtilReadFile(filename, &data, &data_size);
|
||||
if (!ok) goto End;
|
||||
|
||||
pic->use_argb = 1; // force ARGB
|
||||
|
||||
@@ -40,20 +41,17 @@ static int ReadPicture(const char* const filename, WebPPicture* const pic,
|
||||
// Try to decode the file using WIC falling back to the other readers for
|
||||
// e.g., WebP.
|
||||
ok = ReadPictureWithWIC(filename, pic, keep_alpha, NULL);
|
||||
if (ok) return 1;
|
||||
if (ok) goto End;
|
||||
#endif
|
||||
ok = ImgIoUtilReadFile(filename, &data, &data_size);
|
||||
if (!ok) goto Error;
|
||||
|
||||
reader = WebPGuessImageReader(data, data_size);
|
||||
ok = reader(data, data_size, pic, keep_alpha, NULL);
|
||||
|
||||
Error:
|
||||
End:
|
||||
if (!ok) {
|
||||
fprintf(stderr, "Error! Could not process file %s\n", filename);
|
||||
}
|
||||
free((void*)data);
|
||||
return ok;
|
||||
return ok ? data_size : 0;
|
||||
}
|
||||
|
||||
static void RescalePlane(uint8_t* plane, int width, int height,
|
||||
@@ -228,6 +226,7 @@ static void Help(void) {
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
WebPPicture pic1, pic2;
|
||||
size_t size1 = 0, size2 = 0;
|
||||
int ret = 1;
|
||||
float disto[5];
|
||||
int type = 0;
|
||||
@@ -278,12 +277,10 @@ int main(int argc, const char *argv[]) {
|
||||
Help();
|
||||
goto End;
|
||||
}
|
||||
if (!ReadPicture(name1, &pic1, 1)) {
|
||||
goto End;
|
||||
}
|
||||
if (!ReadPicture(name2, &pic2, 1)) {
|
||||
goto End;
|
||||
}
|
||||
size1 = ReadPicture(name1, &pic1, 1);
|
||||
size2 = ReadPicture(name1, &pic2, 1);
|
||||
if (size1 == 0 || size2 == 0) goto End;
|
||||
|
||||
if (!keep_alpha) {
|
||||
WebPBlendAlpha(&pic1, 0x00000000);
|
||||
WebPBlendAlpha(&pic2, 0x00000000);
|
||||
@@ -293,7 +290,8 @@ int main(int argc, const char *argv[]) {
|
||||
fprintf(stderr, "Error while computing the distortion.\n");
|
||||
goto End;
|
||||
}
|
||||
printf("%.2f %.2f %.2f %.2f %.2f\n",
|
||||
printf("%u %.2f %.2f %.2f %.2f %.2f\n",
|
||||
(unsigned int)size1,
|
||||
disto[4], disto[0], disto[1], disto[2], disto[3]);
|
||||
|
||||
if (output != NULL) {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.TH GIF2WEBP 1 "June 23, 2016"
|
||||
.TH GIF2WEBP 1 "January 25, 2017"
|
||||
.SH NAME
|
||||
gif2webp \- Convert a GIF image to WebP
|
||||
.SH SYNOPSIS
|
||||
@@ -68,8 +68,9 @@ Specify the minimum and maximum distance between consecutive key frames
|
||||
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. A 'kmax' value of 0
|
||||
will result in all frames being key frames.
|
||||
A 'kmax' value of 0 will turn off insertion of key frames. A 'kmax' value of 1
|
||||
will result in all frames being key frames. 'kmin' value is not taken into
|
||||
account in both these special cases.
|
||||
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
|
||||
|
@@ -248,6 +248,12 @@ static void VerticalUnfilter_NEON(const uint8_t* prev, const uint8_t* in,
|
||||
}
|
||||
}
|
||||
|
||||
// GradientUnfilter_NEON is correct but slower than the C-version,
|
||||
// at least on ARM64. For armv7, it's a wash.
|
||||
// So best is to disable it for now, but keep the idea around...
|
||||
// #define USE_GRADIENT_UNFILTER
|
||||
|
||||
#if defined(USE_GRADIENT_UNFILTER)
|
||||
#define GRAD_PROCESS_LANE(L) do { \
|
||||
const uint8x8_t tmp1 = ROTATE_RIGHT_N(pred, 1); /* rotate predictor in */ \
|
||||
const int16x8_t tmp2 = vaddq_s16(BC, U8_TO_S16(tmp1)); \
|
||||
@@ -295,6 +301,8 @@ static void GradientUnfilter_NEON(const uint8_t* prev, const uint8_t* in,
|
||||
}
|
||||
}
|
||||
|
||||
#endif // USE_GRADIENT_UNFILTER
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Entry point
|
||||
|
||||
@@ -303,7 +311,9 @@ extern void VP8FiltersInitNEON(void);
|
||||
WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitNEON(void) {
|
||||
WebPUnfilters[WEBP_FILTER_HORIZONTAL] = HorizontalUnfilter_NEON;
|
||||
WebPUnfilters[WEBP_FILTER_VERTICAL] = VerticalUnfilter_NEON;
|
||||
#if defined(USE_GRADIENT_UNFILTER)
|
||||
WebPUnfilters[WEBP_FILTER_GRADIENT] = GradientUnfilter_NEON;
|
||||
#endif
|
||||
|
||||
WebPFilters[WEBP_FILTER_HORIZONTAL] = HorizontalFilter_NEON;
|
||||
WebPFilters[WEBP_FILTER_VERTICAL] = VerticalFilter_NEON;
|
||||
|
@@ -279,7 +279,8 @@ extern void WebPRescalerDspInitMIPS32(void);
|
||||
|
||||
WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInitMIPS32(void) {
|
||||
WebPRescalerImportRowExpand = ImportRowExpand;
|
||||
WebPRescalerImportRowShrink = ImportRowShrink;
|
||||
// WebPRescalerImportRowShrink = ImportRowShrink;
|
||||
(void)ImportRowShrink;
|
||||
WebPRescalerExportRowExpand = ExportRowExpand;
|
||||
WebPRescalerExportRowShrink = ExportRowShrink;
|
||||
}
|
||||
|
@@ -129,14 +129,13 @@ static void SanitizeEncoderOptions(WebPAnimEncoderOptions* const enc_options) {
|
||||
DisableKeyframes(enc_options);
|
||||
}
|
||||
|
||||
if (enc_options->kmin <= 0) {
|
||||
DisableKeyframes(enc_options);
|
||||
print_warning = 0;
|
||||
}
|
||||
if (enc_options->kmax <= 0) { // All frames will be key-frames.
|
||||
if (enc_options->kmax == 1) { // All frames will be key-frames.
|
||||
enc_options->kmin = 0;
|
||||
enc_options->kmax = 0;
|
||||
return;
|
||||
} else if (enc_options->kmax <= 0) {
|
||||
DisableKeyframes(enc_options);
|
||||
print_warning = 0;
|
||||
}
|
||||
|
||||
if (enc_options->kmin >= enc_options->kmax) {
|
||||
|
@@ -21,7 +21,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define WEBP_MUX_ABI_VERSION 0x0107 // MAJOR(8b) + MINOR(8b)
|
||||
#define WEBP_MUX_ABI_VERSION 0x0108 // MAJOR(8b) + MINOR(8b)
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Mux API
|
||||
@@ -430,9 +430,10 @@ struct WebPAnimEncoderOptions {
|
||||
// frames in the output. The library may insert some key
|
||||
// frames as needed to satisfy this criteria.
|
||||
// Note that these conditions should hold: kmax > kmin
|
||||
// and kmin >= kmax / 2 + 1. Also, if kmin == 0, then
|
||||
// key-frame insertion is disabled; and if kmax == 0,
|
||||
// then all frames will be key-frames.
|
||||
// and kmin >= kmax / 2 + 1. Also, if kmax <= 0, then
|
||||
// key-frame insertion is disabled; and if kmax == 1,
|
||||
// then all frames will be key-frames (kmin value does
|
||||
// not matter for these special cases).
|
||||
int allow_mixed; // If true, use mixed compression mode; may choose
|
||||
// either lossy and lossless for each frame.
|
||||
int verbose; // If true, print info and warning messages to stderr.
|
||||
|
Reference in New Issue
Block a user