Merge tag 'v1.0.0'

libwebp-1.0.0

- 4/2/2018: version 1.0.0
  This is a binary compatible release.
  * lossy encoder improvements to avoid chroma shifts in various circumstances
    (issues #308, #340)
  * big-endian fixes for decode, RGBA import and WebPPictureDistortion
  Tool updates:
    gifwebp, anim_diff - default duration behavior (<= 10ms) changed to match
                         web browsers, transcoding tools (issue #379)
    img2webp, webpmux - allow options to be passed in via a file (issue #355)

* tag 'v1.0.0': (23 commits)
  update ChangeLog
  webp-container-spec: correct frame duration=0 note
  vwebp: Copy Chrome's behavior w/frame duration == 0
  update ChangeLog
  add WEBP_DSP_INIT / WEBP_DSP_INIT_FUNC
  fix 16b overflow in SSE2
  makefile.unix: add DEBUG flag for compiling w/ debug-symbol
  cwebp,get_disto: fix bpp output
  cmake: Make sure we use near-lossless by default.
  fix bug in WebPImport565: alpha value was not set
  update ChangeLog
  Revert "Use proper targets for CMake."
  Use proper targets for CMake.
  Remove some very hard TODOs.
  {de,}mux/Makefile.am: add missing headers
  makefile.unix,dist: use ascii for text output
  add -version option to anim_dump,anim_diff and img2webp
  webp_js: fix webp_js demo html
  update ChangeLog
  update AUTHORS
  ...

Change-Id: I5659406c022a0964f728ce2eb35338fd9c195466
diff --git a/AUTHORS b/AUTHORS
index b6e9cfb..83c7b9c 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -35,4 +35,5 @@
 - Urvang Joshi (urvang at google dot com)
 - Vikas Arora (vikasa at google dot com)
 - Vincent Rabaud (vrabaud at google dot com)
+- Vlad Tsyrklevich (vtsyrklevich at chromium dot org)
 - Yang Zhang (yang dot zhang at arm dot com)
diff --git a/ChangeLog b/ChangeLog
index b17feb2..9fd9acf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,92 @@
+8d510751 webp-container-spec: correct frame duration=0 note
+e6b2164e vwebp: Copy Chrome's behavior w/frame duration == 0
+d20b7707 update ChangeLog (tag: v1.0.0-rc3)
+0d5fad46 add WEBP_DSP_INIT / WEBP_DSP_INIT_FUNC
+c1cb86af fix 16b overflow in SSE2
+e577feb7 makefile.unix: add DEBUG flag for compiling w/ debug-symbol
+99be34b3 cwebp,get_disto: fix bpp output
+f5565ca8 cmake: Make sure we use near-lossless by default.
+d898dc14 fix bug in WebPImport565: alpha value was not set
+882784b0 update ChangeLog (tag: v1.0.0-rc2)
+2f930e08 Revert "Use proper targets for CMake."
+8165e8fb Use proper targets for CMake.
+3f157dd5 Remove some very hard TODOs.
+cd758a17 {de,}mux/Makefile.am: add missing headers
+b892b8ba makefile.unix,dist: use ascii for text output
+64a57d05 add -version option to anim_dump,anim_diff and img2webp
+fc1b8e3a webp_js: fix webp_js demo html
+15aa48d9 update ChangeLog (tag: v1.0.0-rc1)
+e607dabc update AUTHORS
+38410c08 [CFI] Remove function pointer casts
+c57b2736 bump version to 1.0.0
+cba28853 update NEWS
+c909d531 Merge "remove some deprecation warning on MacOSX"
+217443c7 remove some deprecation warning on MacOSX
+b672bdfa configure: quiet glut deprecation warnings on OS X
+daa9fcaf configure: use sdl-config if available
+dd174cae Merge "imagedec: support metadata reading for WebP image decoding"
+641cedcc imagedec: support metadata reading for WebP image decoding
+065b2ce1 anim_diff: add a couple missing newlines in Help()
+c4cc1147 Merge "gif2webp: force low duration frames to 100ms"
+09333097 gif2webp: force low duration frames to 100ms
+e03f0ec3 sharp_yuv: use 14b fixed-point precision for gamma
+b2db361c image_enc,WebPWritePNG: move locals after setjmp
+74e82ec6 Merge "WebPPictureDistortion: fix big-endian results order"
+645d04ca Merge "cwebp,get_disto: report bpp"
+120f58c3 Merge "lossless*sse2: improve non-const 16-bit vector creation"
+a7fe9412 WebPPictureDistortion: fix big-endian results order
+e26fe066 cwebp,get_disto: report bpp
+9df64e28 Merge changes Id5b4a1a4,Ia20ce844
+8043504f lossless*sse2: improve non-const 16-bit vector creation
+1e3dfc48 Import: extract condition from loop
+3b07d327 Import,RGBA: fix for BigEndian import
+551948e4 Remove unused argument in VP8LBitsEntropy.
+3005237a ReadWebP: fix for big-endian
+499c395a Merge "anim_diff: expose the -max_diff option"
+f69dcd69 Merge "remove WEBP_EXPERIMENTAL_FEATURES"
+07d884d5 anim_diff: expose the -max_diff option
+f4dd9256 remove WEBP_EXPERIMENTAL_FEATURES
+94a8377b extract the command-line parsing helpers to example_util
+fc09e6e2 PNM decoder: prevent unsupported depth=2 PAM case.
+6de58603 MIPS64: Fix defined-but-not-used errors with WEBP_REDUCE_CSP
+cbde5728 gif2webp: add support for reading from stdin
+cf1c5054 Add an SSE4 version of some lossless color transforms.
+45a8b5eb Fix lint error with man page.
+cff38e8f Merge "PNG decoder: handle gAMA chunk"
+59cb1a48 Merge "enable dc error-diffusion always"
+78318b30 PNG decoder: handle gAMA chunk
+664c21dd Merge "remove some TODOs"
+815652de enable dc error-diffusion always
+aec45cec remove some TODOs
+5715dfce fix block-count[] increment in case of large image
+c2d04f3e enable DC error-diffusion always for multi-pass
+96bf07c5 use DC error diffusion for U/V at low-quality
+1c59020b fix missing sse41 targets in makefile.unix
+7a8e814b cosmetics: s/color_space/colorspace/
+05f6fe24 upsampling: rm asserts w/REDUCE_CSP+OMIT_C_CODE
+b4cf5597 Merge "Upsampling SSE2/SSE4 speedup."
+ccbeb32c Makefile.vc: add missing sse41 files
+55403a9a Upsampling SSE2/SSE4 speedup.
+807b53c4 Implement the upsampling/yuv functions in SSE41
+84101a81 Fix wasm WebP compilation
+8bebd2a3 fix warning on MSVC
+a7f93fe3 webpmux: allow reading argument from a file
+b69f18a7 gif2webp.1: fix -loop_compatibility layout
+72d530c0 Merge "fix lossless decoding w/WEBP_REDUCE_SIZE"
+296c7dc4 fix lossless decoding w/WEBP_REDUCE_SIZE
+0d5d029c Merge "ImgIoUtilReadFile: fix file leak upon error"
+ae568ce7 ImgIoUtilReadFile: fix file leak upon error
+796b5a8a Merge tag 'v0.6.1'
+6b7a95fd update ChangeLog (tag: v0.6.1)
 f66955de WEBP_REDUCE_CSP: restrict colorspace support
+1af0df76 Merge "WEBP_REDUCE_CSP: restrict colorspace support"
+6de20df0 WEBP_REDUCE_CSP: restrict colorspace support
 a289d8e7 update ChangeLog (tag: v0.6.1-rc2)
 c10a493c vwebp: disable double buffering on windows & mac
 0d4466c2 webp_to_sdl.c: fix file mode
 1b27bf8b WEBP_REDUCE_SIZE: disable all rescaler code
 126be109 webpinfo: add -version option
+0df22b9e WEBP_REDUCE_SIZE: disable all rescaler code
 9add62b5 bump version to 0.6.1
 d3e26144 update NEWS
 2edda639 README: add webpinfo section
diff --git a/NEWS b/NEWS
index 85d273e..480cb7d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,13 @@
+- 4/2/2018: version 1.0.0
+  This is a binary compatible release.
+  * lossy encoder improvements to avoid chroma shifts in various circumstances
+    (issues #308, #340)
+  * big-endian fixes for decode, RGBA import and WebPPictureDistortion
+  Tool updates:
+    gifwebp, anim_diff - default duration behavior (<= 10ms) changed to match
+                         web browsers, transcoding tools (issue #379)
+    img2webp, webpmux - allow options to be passed in via a file (issue #355)
+
 - 11/24/2017: version 0.6.1
   This is a binary compatible release.
   * lossless performance and compression improvements + a new 'cruncher' mode
diff --git a/README b/README
index e9817bf..a76b378 100644
--- a/README
+++ b/README
@@ -4,7 +4,7 @@
           \__\__/\____/\_____/__/ ____  ___
                 / _/ /    \    \ /  _ \/ _/
                /  \_/   / /   \ \   __/  \__
-               \____/____/\_____/_____/____/v0.6.1
+               \____/____/\_____/_____/____/v1.0.0
 
 Description:
 ============
@@ -458,6 +458,7 @@
  -mixed ............... use mixed lossy/lossless automatic mode
  -v ................... verbose mode
  -h ................... this help
+ -version ............. print version number and exit
 
 Per-frame options (only used for subsequent images input):
  -d <int> ............. frame duration in ms (default: 100)
@@ -524,6 +525,11 @@
   -min_psnr <float> ... minimum per-frame PSNR
   -raw_comparison ..... if this flag is not used, RGB is
                         premultiplied before comparison
+  -max_diff <int> ..... maximum allowed difference per channel
+                        between corresponding pixels in subsequent
+                        frames
+  -h .................. this help
+  -version ............ print version number and exit
 
 Building:
 ---------
diff --git a/README.mux b/README.mux
index d09ac17..bd4f92f 100644
--- a/README.mux
+++ b/README.mux
@@ -1,7 +1,7 @@
           __   __  ____  ____  ____  __ __  _     __ __
          /  \\/  \/  _ \/  _ \/  _ \/  \  \/ \___/_ / _\
          \       /   __/  _  \   __/      /  /  (_/  /__
-          \__\__/\_____/_____/__/  \__//_/\_____/__/___/v0.4.1
+          \__\__/\_____/_____/__/  \__//_/\_____/__/___/v1.0.0
 
 
 Description:
diff --git a/configure.ac b/configure.ac
index dff7d07..896e5ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([libwebp], [0.6.1],
+AC_INIT([libwebp], [1.0.0],
         [https://bugs.chromium.org/p/webp],,
         [http://developers.google.com/speed/webp])
 AC_CANONICAL_HOST
diff --git a/examples/anim_diff.c b/examples/anim_diff.c
index 7ac5689..e74a915 100644
--- a/examples/anim_diff.c
+++ b/examples/anim_diff.c
@@ -190,6 +190,8 @@
   printf("  -max_diff <int> ..... maximum allowed difference per channel\n"
          "                        between corresponding pixels in subsequent\n"
          "                        frames\n");
+  printf("  -h .................. this help\n");
+  printf("  -version ............ print version number and exit\n");
 }
 
 int main(int argc, const char* argv[]) {
@@ -205,11 +207,6 @@
   const char* files[2] = { NULL, NULL };
   AnimatedImage images[2];
 
-  if (argc < 3) {
-    Help();
-    return -1;
-  }
-
   for (c = 1; c < argc; ++c) {
     int parse_error = 0;
     if (!strcmp(argv[c], "-dump_frames")) {
@@ -247,6 +244,18 @@
       } else {
         parse_error = 1;
       }
+    } else if (!strcmp(argv[c], "-h") || !strcmp(argv[c], "-help")) {
+      Help();
+      return 0;
+    } else if (!strcmp(argv[c], "-version")) {
+      int dec_version, demux_version;
+      GetAnimatedImageVersions(&dec_version, &demux_version);
+      printf("WebP Decoder version: %d.%d.%d\nWebP Demux version: %d.%d.%d\n",
+             (dec_version >> 16) & 0xff, (dec_version >> 8) & 0xff,
+             (dec_version >> 0) & 0xff,
+             (demux_version >> 16) & 0xff, (demux_version >> 8) & 0xff,
+             (demux_version >> 0) & 0xff);
+      return 0;
     } else {
       if (!got_input1) {
         files[0] = argv[c];
@@ -263,6 +272,12 @@
       return -1;
     }
   }
+  if (argc < 3) {
+    Help();
+    return -1;
+  }
+
+
   if (!got_input2) {
     Help();
     return -1;
diff --git a/examples/anim_dump.c b/examples/anim_dump.c
index b955b54..7b96cfe 100644
--- a/examples/anim_dump.c
+++ b/examples/anim_dump.c
@@ -30,6 +30,8 @@
                                   "(default: 'dump_')\n");
   printf("  -tiff ............... save frames as TIFF\n");
   printf("  -pam ................ save frames as PAM\n");
+  printf("  -h .................. this help\n");
+  printf("  -version ............ print version number and exit\n");
 }
 
 int main(int argc, const char* argv[]) {
@@ -66,6 +68,18 @@
     } else if (!strcmp(argv[c], "-pam")) {
       format = PAM;
       suffix = "pam";
+    } else if (!strcmp(argv[c], "-h") || !strcmp(argv[c], "-help")) {
+      Help();
+      return 0;
+    } else if (!strcmp(argv[c], "-version")) {
+      int dec_version, demux_version;
+      GetAnimatedImageVersions(&dec_version, &demux_version);
+      printf("WebP Decoder version: %d.%d.%d\nWebP Demux version: %d.%d.%d\n",
+             (dec_version >> 16) & 0xff, (dec_version >> 8) & 0xff,
+             (dec_version >> 0) & 0xff,
+             (demux_version >> 16) & 0xff, (demux_version >> 8) & 0xff,
+             (demux_version >> 0) & 0xff);
+      return 0;
     } else {
       uint32_t i;
       AnimatedImage image;
diff --git a/examples/anim_util.c b/examples/anim_util.c
index 800ea76..c7a05c7 100644
--- a/examples/anim_util.c
+++ b/examples/anim_util.c
@@ -786,3 +786,9 @@
     *psnr = 4.3429448 * log(255. * 255. / sse);
   }
 }
+
+void GetAnimatedImageVersions(int* const decoder_version,
+                              int* const demux_version) {
+  *decoder_version = WebPGetDecoderVersion();
+  *demux_version = WebPGetDemuxVersion();
+}
diff --git a/examples/anim_util.h b/examples/anim_util.h
index dbc9792..8063121 100644
--- a/examples/anim_util.h
+++ b/examples/anim_util.h
@@ -56,6 +56,10 @@
                     uint32_t width, uint32_t height, int premultiply,
                     int* const max_diff, double* const psnr);
 
+// Return library versions used by anim_util.
+void GetAnimatedImageVersions(int* const decoder_version,
+                              int* const demux_version);
+
 #ifdef __cplusplus
 }    // extern "C"
 #endif
diff --git a/examples/img2webp.c b/examples/img2webp.c
index 052aa87..2f750c5 100644
--- a/examples/img2webp.c
+++ b/examples/img2webp.c
@@ -48,6 +48,7 @@
   printf(" -mixed ............... use mixed lossy/lossless automatic mode\n");
   printf(" -v ................... verbose mode\n");
   printf(" -h ................... this help\n");
+  printf(" -version ............. print version number and exit\n");
   printf("\n");
 
   printf("Per-frame options (only used for subsequent images input):\n");
@@ -177,6 +178,14 @@
       } else if (!strcmp(argv[c], "-h") || !strcmp(argv[c], "-help")) {
         Help();
         goto End;
+      } else if (!strcmp(argv[c], "-version")) {
+        const int enc_version = WebPGetEncoderVersion();
+        const int mux_version = WebPGetMuxVersion();
+        printf("WebP Encoder version: %d.%d.%d\nWebP Mux version: %d.%d.%d\n",
+               (enc_version >> 16) & 0xff, (enc_version >> 8) & 0xff,
+               enc_version & 0xff, (mux_version >> 16) & 0xff,
+               (mux_version >> 8) & 0xff, mux_version & 0xff);
+        goto End;
       } else {
         continue;
       }
diff --git a/extras/extras.c b/extras/extras.c
index d01aadb..2feb595 100644
--- a/extras/extras.c
+++ b/extras/extras.c
@@ -16,9 +16,9 @@
 #include <assert.h>
 #include <string.h>
 
-#define XTRA_MAJ_VERSION 0
-#define XTRA_MIN_VERSION 1
-#define XTRA_REV_VERSION 1
+#define XTRA_MAJ_VERSION 1
+#define XTRA_MIN_VERSION 0
+#define XTRA_REV_VERSION 0
 
 //------------------------------------------------------------------------------
 
@@ -48,13 +48,14 @@
 
 int WebPImportRGB565(const uint8_t* rgb565, WebPPicture* pic) {
   int x, y;
+  uint32_t* dst;
   if (pic == NULL || rgb565 == NULL) return 0;
   pic->colorspace = WEBP_YUV420;
   pic->use_argb = 1;
   if (!WebPPictureAlloc(pic)) return 0;
+  dst = pic->argb;
   for (y = 0; y < pic->height; ++y) {
     const int width = pic->width;
-    uint32_t* dst = pic->argb + y * pic->argb_stride;
     for (x = 0; x < width; ++x) {
 #ifdef WEBP_SWAP_16BIT_CSP
       const uint32_t rg = rgb565[2 * x + 1];
@@ -70,22 +71,24 @@
       r = r | (r >> 5);
       g = g | (g >> 6);
       b = b | (b >> 5);
-      dst[x] = (r << 16) | (g << 8) | b;
+      dst[x] = (0xffu << 24) | (r << 16) | (g << 8) | b;
     }
     rgb565 += 2 * width;
+    dst += pic->argb_stride;
   }
   return 1;
 }
 
 int WebPImportRGB4444(const uint8_t* rgb4444, WebPPicture* pic) {
   int x, y;
+  uint32_t* dst;
   if (pic == NULL || rgb4444 == NULL) return 0;
   pic->colorspace = WEBP_YUV420;
   pic->use_argb = 1;
   if (!WebPPictureAlloc(pic)) return 0;
+  dst = pic->argb;
   for (y = 0; y < pic->height; ++y) {
     const int width = pic->width;
-    uint32_t* dst = pic->argb + y * pic->argb_stride;
     for (x = 0; x < width; ++x) {
 #ifdef WEBP_SWAP_16BIT_CSP
       const uint32_t rg = rgb4444[2 * x + 1];
@@ -106,6 +109,7 @@
       dst[x] = (a << 24) | (r << 16) | (g << 8) | b;
     }
     rgb4444 += 2 * width;
+    dst += pic->argb_stride;
   }
   return 1;
 }
diff --git a/makefile.unix b/makefile.unix
index 826b956..cc0035d 100644
--- a/makefile.unix
+++ b/makefile.unix
@@ -112,7 +112,12 @@
 AR = ar
 ARFLAGS = r
 CPPFLAGS = -I. -Isrc/ -Wall
-CFLAGS = -O3 -DNDEBUG $(EXTRA_FLAGS)
+ifeq ($(DEBUG), 1)
+  CFLAGS = -g
+else
+  CFLAGS = -O3 -DNDEBUG
+endif
+CFLAGS += $(EXTRA_FLAGS)
 CC = gcc
 INSTALL = install
 GROFF = /usr/bin/groff
@@ -474,7 +479,7 @@
 	for m in man/[cdv]webp.1 man/gif2webp.1 man/webpmux.1 \
                  man/img2webp.1 man/webpinfo.1; do \
 	  basenam=$$(basename $$m .1); \
-	  $(GROFF) -t -e -man -T utf8 $$m \
+	  $(GROFF) -t -e -man -T ascii $$m \
 	    | $(COL) -bx >$(DESTDIR)/doc/$${basenam}.txt; \
 	  $(GROFF) -t -e -man -T html $$m \
 	    | $(COL) -bx >$(DESTDIR)/doc/$${basenam}.html; \
diff --git a/man/img2webp.1 b/man/img2webp.1
index 910c794..da1d91d 100644
--- a/man/img2webp.1
+++ b/man/img2webp.1
@@ -1,5 +1,5 @@
 .\"                                      Hey, EMACS: -*- nroff -*-
-.TH IMG2WEBP 1 "February 7, 2018"
+.TH IMG2WEBP 1 "April 3, 2018"
 .SH NAME
 img2webp \- create animated WebP file from a sequence of input images.
 .SH SYNOPSIS
@@ -53,6 +53,9 @@
 .TP
 .B \-h, \-help
 A short usage summary.
+.TP
+.B \-version
+Print the version numbers of the relevant libraries used.
 
 .SH PER-FRAME OPTIONS
 The per-frame options are applied for the images following as arguments in the
diff --git a/src/Makefile.am b/src/Makefile.am
index 7b5f26d..32cfa38 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,7 +36,7 @@
 # other than the ones listed on the command line, i.e., after linking, it will
 # not have unresolved symbols. Some platforms (Windows among them) require all
 # symbols in shared libraries to be resolved at library creation.
-libwebp_la_LDFLAGS = -no-undefined -version-info 7:1:0
+libwebp_la_LDFLAGS = -no-undefined -version-info 7:2:0
 libwebpincludedir = $(includedir)/webp
 pkgconfig_DATA = libwebp.pc
 
@@ -48,7 +48,7 @@
   libwebpdecoder_la_LIBADD += dsp/libwebpdspdecode.la
   libwebpdecoder_la_LIBADD += utils/libwebputilsdecode.la
 
-  libwebpdecoder_la_LDFLAGS = -no-undefined -version-info 3:1:0
+  libwebpdecoder_la_LDFLAGS = -no-undefined -version-info 3:2:0
   pkgconfig_DATA += libwebpdecoder.pc
 endif
 
diff --git a/src/dec/vp8i_dec.h b/src/dec/vp8i_dec.h
index 28244d9..c929933 100644
--- a/src/dec/vp8i_dec.h
+++ b/src/dec/vp8i_dec.h
@@ -30,9 +30,9 @@
 // Various defines and enums
 
 // version numbers
-#define DEC_MAJ_VERSION 0
-#define DEC_MIN_VERSION 6
-#define DEC_REV_VERSION 1
+#define DEC_MAJ_VERSION 1
+#define DEC_MIN_VERSION 0
+#define DEC_REV_VERSION 0
 
 // YUV-cache parameters. Cache is 32-bytes wide (= one cacheline).
 // Constraints are: We need to store one 16x16 block of luma samples (y),
diff --git a/src/demux/Makefile.am b/src/demux/Makefile.am
index 362c2af..7e80bdc 100644
--- a/src/demux/Makefile.am
+++ b/src/demux/Makefile.am
@@ -5,11 +5,14 @@
 libwebpdemux_la_SOURCES += anim_decode.c demux.c
 
 libwebpdemuxinclude_HEADERS =
+libwebpdemuxinclude_HEADERS += ../webp/decode.h
 libwebpdemuxinclude_HEADERS += ../webp/demux.h
 libwebpdemuxinclude_HEADERS += ../webp/mux_types.h
 libwebpdemuxinclude_HEADERS += ../webp/types.h
+noinst_HEADERS =
+noinst_HEADERS += ../webp/format_constants.h
 
 libwebpdemux_la_LIBADD = ../libwebp.la
-libwebpdemux_la_LDFLAGS = -no-undefined -version-info 2:3:0
+libwebpdemux_la_LDFLAGS = -no-undefined -version-info 2:4:0
 libwebpdemuxincludedir = $(includedir)/webp
 pkgconfig_DATA = libwebpdemux.pc
diff --git a/src/demux/demux.c b/src/demux/demux.c
index 79c24a5..684215e 100644
--- a/src/demux/demux.c
+++ b/src/demux/demux.c
@@ -23,9 +23,9 @@
 #include "src/webp/demux.h"
 #include "src/webp/format_constants.h"
 
-#define DMUX_MAJ_VERSION 0
-#define DMUX_MIN_VERSION 3
-#define DMUX_REV_VERSION 3
+#define DMUX_MAJ_VERSION 1
+#define DMUX_MIN_VERSION 0
+#define DMUX_REV_VERSION 0
 
 typedef struct {
   size_t start_;        // start location of the data
diff --git a/src/demux/libwebpdemux.rc b/src/demux/libwebpdemux.rc
index 5a6994d..544a8b2 100644
--- a/src/demux/libwebpdemux.rc
+++ b/src/demux/libwebpdemux.rc
@@ -6,8 +6,8 @@
 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,3,0,3
- PRODUCTVERSION 0,3,0,3
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -24,12 +24,12 @@
         BEGIN
             VALUE "CompanyName", "Google, Inc."
             VALUE "FileDescription", "libwebpdemux DLL"
-            VALUE "FileVersion", "0.3.3"
+            VALUE "FileVersion", "1.0.0"
             VALUE "InternalName", "libwebpdemux.dll"
-            VALUE "LegalCopyright", "Copyright (C) 2017"
+            VALUE "LegalCopyright", "Copyright (C) 2018"
             VALUE "OriginalFilename", "libwebpdemux.dll"
             VALUE "ProductName", "WebP Image Demuxer"
-            VALUE "ProductVersion", "0.3.3"
+            VALUE "ProductVersion", "1.0.0"
         END
     END
     BLOCK "VarFileInfo"
diff --git a/src/dsp/rescaler_sse2.c b/src/dsp/rescaler_sse2.c
index f93b204..64c50de 100644
--- a/src/dsp/rescaler_sse2.c
+++ b/src/dsp/rescaler_sse2.c
@@ -36,7 +36,7 @@
 }
 
 // input: 8 bytes ABCDEFGH -> output: A0B0C0D0E0F0G0H0
-static void LoadHeightPixels_SSE2(const uint8_t* const src, __m128i* out) {
+static void LoadEightPixels_SSE2(const uint8_t* const src, __m128i* out) {
   const __m128i zero = _mm_setzero_si128();
   const __m128i A = _mm_loadl_epi64((const __m128i*)(src));  // ABCDEFGH
   *out = _mm_unpacklo_epi8(A, zero);
@@ -50,13 +50,15 @@
   int accum = x_add;
   __m128i cur_pixels;
 
+  // SSE2 implementation only works with 16b signed arithmetic at max.
+  if (wrk->src_width < 8 || accum >= (1 << 15)) {
+    WebPRescalerImportRowExpand_C(wrk, src);
+    return;
+  }
+
   assert(!WebPRescalerInputDone(wrk));
   assert(wrk->x_expand);
   if (wrk->num_channels == 4) {
-    if (wrk->src_width < 2) {
-      WebPRescalerImportRowExpand_C(wrk, src);
-      return;
-    }
     LoadTwoPixels_SSE2(src, &cur_pixels);
     src += 4;
     while (1) {
@@ -75,11 +77,7 @@
   } else {
     int left;
     const uint8_t* const src_limit = src + wrk->src_width - 8;
-    if (wrk->src_width < 8) {
-      WebPRescalerImportRowExpand_C(wrk, src);
-      return;
-    }
-    LoadHeightPixels_SSE2(src, &cur_pixels);
+    LoadEightPixels_SSE2(src, &cur_pixels);
     src += 7;
     left = 7;
     while (1) {
@@ -94,7 +92,7 @@
         if (--left) {
           cur_pixels = _mm_srli_si128(cur_pixels, 2);
         } else if (src <= src_limit) {
-          LoadHeightPixels_SSE2(src, &cur_pixels);
+          LoadEightPixels_SSE2(src, &cur_pixels);
           src += 7;
           left = 7;
         } else {   // tail
diff --git a/src/enc/vp8i_enc.h b/src/enc/vp8i_enc.h
index 11ff3f1..624e8f8 100644
--- a/src/enc/vp8i_enc.h
+++ b/src/enc/vp8i_enc.h
@@ -30,9 +30,9 @@
 // Various defines and enums
 
 // version numbers
-#define ENC_MAJ_VERSION 0
-#define ENC_MIN_VERSION 6
-#define ENC_REV_VERSION 1
+#define ENC_MAJ_VERSION 1
+#define ENC_MIN_VERSION 0
+#define ENC_REV_VERSION 0
 
 enum { MAX_LF_LEVELS = 64,       // Maximum loop filter level
        MAX_VARIABLE_LEVEL = 67,  // last (inclusive) level with variable cost
diff --git a/src/libwebp.rc b/src/libwebp.rc
index 3a47fce..d554124 100644
--- a/src/libwebp.rc
+++ b/src/libwebp.rc
@@ -6,8 +6,8 @@
 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,6,0,1
- PRODUCTVERSION 0,6,0,1
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -24,12 +24,12 @@
         BEGIN
             VALUE "CompanyName", "Google, Inc."
             VALUE "FileDescription", "libwebp DLL"
-            VALUE "FileVersion", "0.6.1"
+            VALUE "FileVersion", "1.0.0"
             VALUE "InternalName", "libwebp.dll"
-            VALUE "LegalCopyright", "Copyright (C) 2017"
+            VALUE "LegalCopyright", "Copyright (C) 2018"
             VALUE "OriginalFilename", "libwebp.dll"
             VALUE "ProductName", "WebP Image Codec"
-            VALUE "ProductVersion", "0.6.1"
+            VALUE "ProductVersion", "1.0.0"
         END
     END
     BLOCK "VarFileInfo"
diff --git a/src/libwebpdecoder.rc b/src/libwebpdecoder.rc
index 9fb0b44..8a2def4 100644
--- a/src/libwebpdecoder.rc
+++ b/src/libwebpdecoder.rc
@@ -6,8 +6,8 @@
 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,6,0,1
- PRODUCTVERSION 0,6,0,1
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -24,12 +24,12 @@
         BEGIN
             VALUE "CompanyName", "Google, Inc."
             VALUE "FileDescription", "libwebpdecoder DLL"
-            VALUE "FileVersion", "0.6.1"
+            VALUE "FileVersion", "1.0.0"
             VALUE "InternalName", "libwebpdecoder.dll"
-            VALUE "LegalCopyright", "Copyright (C) 2017"
+            VALUE "LegalCopyright", "Copyright (C) 2018"
             VALUE "OriginalFilename", "libwebpdecoder.dll"
             VALUE "ProductName", "WebP Image Decoder"
-            VALUE "ProductVersion", "0.6.1"
+            VALUE "ProductVersion", "1.0.0"
         END
     END
     BLOCK "VarFileInfo"
diff --git a/src/mux/Makefile.am b/src/mux/Makefile.am
index 374c1e7..447bcce 100644
--- a/src/mux/Makefile.am
+++ b/src/mux/Makefile.am
@@ -13,8 +13,10 @@
 libwebpmuxinclude_HEADERS += ../webp/mux.h
 libwebpmuxinclude_HEADERS += ../webp/mux_types.h
 libwebpmuxinclude_HEADERS += ../webp/types.h
+noinst_HEADERS =
+noinst_HEADERS += ../webp/format_constants.h
 
 libwebpmux_la_LIBADD = ../libwebp.la
-libwebpmux_la_LDFLAGS = -no-undefined -version-info 3:1:0 -lm
+libwebpmux_la_LDFLAGS = -no-undefined -version-info 3:2:0 -lm
 libwebpmuxincludedir = $(includedir)/webp
 pkgconfig_DATA = libwebpmux.pc
diff --git a/src/mux/libwebpmux.rc b/src/mux/libwebpmux.rc
index a9d07e4..8c7d5f6 100644
--- a/src/mux/libwebpmux.rc
+++ b/src/mux/libwebpmux.rc
@@ -6,8 +6,8 @@
 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,4,0,1
- PRODUCTVERSION 0,4,0,1
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -24,12 +24,12 @@
         BEGIN
             VALUE "CompanyName", "Google, Inc."
             VALUE "FileDescription", "libwebpmux DLL"
-            VALUE "FileVersion", "0.4.1"
+            VALUE "FileVersion", "1.0.0"
             VALUE "InternalName", "libwebpmux.dll"
-            VALUE "LegalCopyright", "Copyright (C) 2017"
+            VALUE "LegalCopyright", "Copyright (C) 2018"
             VALUE "OriginalFilename", "libwebpmux.dll"
             VALUE "ProductName", "WebP Image Muxer"
-            VALUE "ProductVersion", "0.4.1"
+            VALUE "ProductVersion", "1.0.0"
         END
     END
     BLOCK "VarFileInfo"
diff --git a/src/mux/muxi.h b/src/mux/muxi.h
index b73e3fb..6b57eea 100644
--- a/src/mux/muxi.h
+++ b/src/mux/muxi.h
@@ -26,9 +26,9 @@
 //------------------------------------------------------------------------------
 // Defines and constants.
 
-#define MUX_MAJ_VERSION 0
-#define MUX_MIN_VERSION 4
-#define MUX_REV_VERSION 1
+#define MUX_MAJ_VERSION 1
+#define MUX_MIN_VERSION 0
+#define MUX_REV_VERSION 0
 
 // Chunk object.
 typedef struct WebPChunk WebPChunk;